Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f86b46f5 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov Committed by Scott James Remnant
Browse files

GKI cleanup - Moved struct TIMER_LIST_ENT to OSI

* Moved struct TIMER_LIST_ENT to file osi/include/non_repeating_timer.h
  and renamed it to timer_entry_t
  NOTE: This is a short-term solution. timer_entry_t should be
  removed, and its usage everywhere should be replaced by
  struct non_repeating_timer_t .
* Renamed TIMER_CBACK to timer_callback_t
* Renamed TIMER_PARAM_TYPE to timer_param_t

Change-Id: I9ca830718bf900195f9c0a513a97f6995322693b
parent 169d8207
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -21,27 +21,6 @@
#include "bt_target.h"
#include "bt_types.h"

static const char GKI_MODULE[] = "gki_module";

/* Timer list entry callback type
*/
typedef void (TIMER_CBACK)(void *p_tle);
#ifndef TIMER_PARAM_TYPE
#define TIMER_PARAM_TYPE void*
#endif
/* Define a timer list entry
*/
typedef struct _tle
{
    TIMER_CBACK  *p_cback;
    INT32         ticks;
    INT32         ticks_initial;
    TIMER_PARAM_TYPE   param;
    TIMER_PARAM_TYPE   data;
    UINT16        event;
    UINT8         in_use;
} TIMER_LIST_ENT;

/***********************************************************************
** Function prototypes
*/
+3 −3
Original line number Diff line number Diff line
@@ -251,7 +251,7 @@ typedef struct
    char                clip[BTA_AG_AT_MAX_LEN+1]; /* number string used for CLIP */
    UINT16              serv_handle[BTA_AG_NUM_IDX]; /* RFCOMM server handles */
    tBTA_AG_AT_CB       at_cb;          /* AT command interpreter */
    TIMER_LIST_ENT      act_timer;     /* ring timer */
    timer_entry_t       act_timer;      /* ring timer */
    BD_ADDR             peer_addr;      /* peer bd address */
    tSDP_DISCOVERY_DB   *p_disc_db;     /* pointer to discovery database */
    tBTA_SERVICE_MASK   reg_services;   /* services specified in register API */
@@ -270,7 +270,7 @@ typedef struct
    BOOLEAN             codec_updated;  /* set to TRUE whenever the app updates codec type */
    BOOLEAN             codec_fallback; /* If sco nego fails for mSBC, fallback to CVSD */
    tBTA_AG_SCO_MSBC_SETTINGS codec_msbc_settings; /* settings to be used for the impending eSCO */
    TIMER_LIST_ENT      cn_timer;       /* codec negotiation timer */
    timer_entry_t       cn_timer;       /* codec negotiation timer */
#endif
    UINT16              sco_idx;        /* SCO handle */
    BOOLEAN             in_use;         /* scb in use */
@@ -281,7 +281,7 @@ typedef struct
    BOOLEAN             cmee_enabled;   /* set to TRUE if HF enables CME ERROR reporting */
    BOOLEAN             inband_enabled; /* set to TRUE if inband ring enabled */
    BOOLEAN             svc_conn;       /* set to TRUE when service level connection up */
    TIMER_LIST_ENT      colli_timer;    /* Collision timer */
    timer_entry_t       colli_timer;    /* Collision timer */
    BOOLEAN             colli_tmr_on;   /* TRUE if collision timer is active */
    UINT8               state;          /* state machine state */
    UINT8               conn_service;   /* connected service */
+8 −7
Original line number Diff line number Diff line
@@ -285,12 +285,12 @@ tBTA_AG_CB bta_ag_cb;
static void bta_ag_timer_cback(void *p)
{
    BT_HDR          *p_buf;
    TIMER_LIST_ENT  *p_tle = (TIMER_LIST_ENT *) p;
    timer_entry_t   *p_te = (timer_entry_t *) p;

    if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
    {
        p_buf->event = p_tle->event;
        p_buf->layer_specific = bta_ag_scb_to_idx((tBTA_AG_SCB *) p_tle->param);
        p_buf->event = p_te->event;
        p_buf->layer_specific = bta_ag_scb_to_idx((tBTA_AG_SCB *) p_te->param);
        bta_sys_sendmsg(p_buf);
    }
}
@@ -576,15 +576,15 @@ tBTA_AG_SCB *bta_ag_get_other_idle_scb (tBTA_AG_SCB *p_curr_scb)
** Returns          void
**
*******************************************************************************/
static void bta_ag_colli_timer_cback (TIMER_LIST_ENT *p_tle)
static void bta_ag_colli_timer_cback (timer_entry_t *p_te)
{
    tBTA_AG_SCB *p_scb;

    APPL_TRACE_DEBUG ("bta_ag_colli_timer_cback");

    if (p_tle)
    if (p_te)
    {
        p_scb = (tBTA_AG_SCB *)p_tle->param;
        p_scb = (tBTA_AG_SCB *)p_te->param;

        if (p_scb)
        {
@@ -649,7 +649,8 @@ void bta_ag_collision_cback (tBTA_SYS_CONN_STATUS status, UINT8 id,
            bta_ag_start_servers(p_scb, p_scb->reg_services);

        /* Start timer to han */
        p_scb->colli_timer.p_cback = (TIMER_CBACK*)&bta_ag_colli_timer_cback;
        p_scb->colli_timer.p_cback =
            (timer_callback_t *)&bta_ag_colli_timer_cback;
        p_scb->colli_timer.param = p_scb;
        bta_sys_start_timer(&p_scb->colli_timer, 0, BTA_AG_COLLISION_TIMER);
        p_scb->colli_tmr_on = TRUE;
+4 −4
Original line number Diff line number Diff line
@@ -648,13 +648,13 @@ BOOLEAN bta_ag_attempt_msbc_safe_settings(tBTA_AG_SCB *p_scb)
** Returns          void
**
*******************************************************************************/
static void bta_ag_cn_timer_cback (TIMER_LIST_ENT *p_tle)
static void bta_ag_cn_timer_cback (timer_entry_t *p_te)
{
    tBTA_AG_SCB *p_scb;

    if (p_tle)
    if (p_te)
    {
        p_scb = (tBTA_AG_SCB *)p_tle->param;
        p_scb = (tBTA_AG_SCB *)p_te->param;

        if (p_scb)
        {
@@ -692,7 +692,7 @@ void bta_ag_codec_negotiate(tBTA_AG_SCB *p_scb)
        bta_ag_send_bcs(p_scb, NULL);

        /* Start timer to handle timeout */
        p_scb->cn_timer.p_cback = (TIMER_CBACK*)&bta_ag_cn_timer_cback;
        p_scb->cn_timer.p_cback = (timer_callback_t *)&bta_ag_cn_timer_cback;
        p_scb->cn_timer.param = p_scb;
        bta_sys_start_timer(&p_scb->cn_timer, 0, BTA_AG_CODEC_NEGO_TIMEOUT);
    }
+7 −5
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@
#define BTA_AV_ACP_SIG_TIME_VAL 2000
#endif

static void bta_av_acp_sig_timer_cback (TIMER_LIST_ENT *p_tle);
static void bta_av_acp_sig_timer_cback(timer_entry_t *p_te);

/*******************************************************************************
**
@@ -1467,7 +1467,8 @@ void bta_av_sig_chg(tBTA_AV_DATA *p_data)
                        // it as a UINT8 and then reassigns it as param that
                        // way, so should this be unsigned?
                        p_cb->acp_sig_tmr.param = INT_TO_PTR(xx);
                        p_cb->acp_sig_tmr.p_cback = (TIMER_CBACK*)&bta_av_acp_sig_timer_cback;
                        p_cb->acp_sig_tmr.p_cback =
                            (timer_callback_t *)&bta_av_acp_sig_timer_cback;
                        bta_sys_start_timer(&p_cb->acp_sig_tmr, 0, BTA_AV_ACP_SIG_TIME_VAL);
                    }
                    break;
@@ -1561,9 +1562,9 @@ void bta_av_sig_timer(tBTA_AV_DATA *p_data)
** Returns          void
**
*******************************************************************************/
static void bta_av_acp_sig_timer_cback (TIMER_LIST_ENT *p_tle)
static void bta_av_acp_sig_timer_cback(timer_entry_t *p_te)
{
    UINT8   inx = PTR_TO_UINT(p_tle->param);
    UINT8   inx = PTR_TO_UINT(p_te->param);
    tBTA_AV_CB  *p_cb = &bta_av_cb;
    tBTA_AV_SCB *p_scb = NULL;
    tBTA_AV_API_OPEN  *p_buf;
@@ -1587,7 +1588,8 @@ static void bta_av_acp_sig_timer_cback (TIMER_LIST_ENT *p_tle)
                    p_scb->coll_mask |= BTA_AV_COLL_INC_TMR;

                    p_cb->acp_sig_tmr.param = UINT_TO_PTR(inx);
                    p_cb->acp_sig_tmr.p_cback = (TIMER_CBACK *)&bta_av_acp_sig_timer_cback;
                    p_cb->acp_sig_tmr.p_cback =
                        (timer_callback_t *)&bta_av_acp_sig_timer_cback;
                    bta_sys_start_timer(&p_cb->acp_sig_tmr, 0, BTA_AV_ACP_SIG_TIME_VAL);
                }
                else
Loading