Lines Matching defs:p_tcb
92 void gatt_free_pending_ind(tGATT_TCB *p_tcb)
96 while (p_tcb->pending_ind_q.p_first)
97 GKI_freebuf (GKI_dequeue (&p_tcb->pending_ind_q));
109 void gatt_free_pending_enc_queue(tGATT_TCB *p_tcb)
113 while (p_tcb->pending_enc_clcb.p_first)
114 GKI_freebuf (GKI_dequeue (&p_tcb->pending_enc_clcb));
215 tGATT_VALUE *gatt_add_pending_ind(tGATT_TCB *p_tcb, tGATT_VALUE *p_ind)
223 GKI_enqueue (&p_tcb->pending_ind_q, p_buf);
744 BOOLEAN gatt_is_srv_chg_ind_pending (tGATT_TCB *p_tcb)
746 tGATT_VALUE *p_buf = (tGATT_VALUE *)GKI_getfirst(&p_tcb->pending_ind_q);
749 GATT_TRACE_DEBUG("gatt_is_srv_chg_ind_pending is_queue_empty=%d", GKI_queue_is_empty(&p_tcb->pending_ind_q) );
751 if (p_tcb->indicate_handle == gatt_cb.handle_of_h_r)
865 tGATT_TCB *p_tcb = NULL;
868 p_tcb = &gatt_cb.tcb[tcb_idx];
870 return p_tcb;
884 tGATT_TCB *p_tcb = NULL;
888 p_tcb = &gatt_cb.tcb[i];
890 return p_tcb;
928 tGATT_TCB *p_tcb = NULL;
940 p_tcb = &gatt_cb.tcb[i];
944 memset(p_tcb, 0, sizeof(tGATT_TCB));
945 GKI_init_q (&p_tcb->pending_enc_clcb);
946 GKI_init_q (&p_tcb->pending_ind_q);
947 p_tcb->in_use = TRUE;
948 p_tcb->tcb_idx = i;
949 p_tcb->transport = transport;
951 memcpy(p_tcb->peer_bda, bda, BD_ADDR_LEN);
953 return p_tcb;
1194 void gatt_start_conf_timer(tGATT_TCB *p_tcb)
1196 p_tcb->conf_timer_ent.param = (TIMER_PARAM_TYPE)p_tcb;
1197 btu_start_timer (&p_tcb->conf_timer_ent, BTU_TTYPE_ATT_WAIT_FOR_RSP,
1209 void gatt_start_ind_ack_timer(tGATT_TCB *p_tcb)
1211 p_tcb->ind_ack_timer_ent.param = (TIMER_PARAM_TYPE)p_tcb;
1213 btu_start_timer (&p_tcb->ind_ack_timer_ent, BTU_TTYPE_ATT_WAIT_FOR_IND_ACK,
1229 if (p_clcb == NULL || p_clcb->p_tcb == NULL)
1240 if (p_clcb != gatt_cmd_dequeue(p_clcb->p_tcb, &rsp_code))
1253 gatt_disconnect (p_clcb->p_tcb);
1267 tGATT_TCB * p_tcb = (tGATT_TCB *)p_tle->param;
1271 if (p_tcb != NULL)
1272 p_tcb->ind_count = 0;
1438 tGATT_STATUS gatt_send_error_rsp (tGATT_TCB *p_tcb, UINT8 err_code, UINT8 op_code,
1449 if ((p_buf = attp_build_sr_msg(p_tcb, GATT_RSP_ERROR, (tGATT_SR_MSG *)&error)) != NULL)
1451 status = attp_send_sr_msg (p_tcb, p_buf);
1457 gatt_dequeue_sr_cmd(p_tcb);
1619 tGATT_TCB *p_tcb = gatt_get_tcb_by_idx(tcb_idx);
1632 p_clcb->p_tcb = p_tcb;
1671 tGATT_TCB *p_tcb = NULL;
1677 p_tcb = &gatt_cb.tcb[xx];
1681 return p_tcb;
1694 UINT8 gatt_num_apps_hold_link(tGATT_TCB *p_tcb)
1700 if (p_tcb->app_hold_link[i])
1724 if (gatt_cb.clcb[i].in_use && memcmp(gatt_cb.clcb[i].p_tcb->peer_bda, bda, BD_ADDR_LEN) == 0)
1739 void gatt_sr_copy_prep_cnt_to_cback_cnt(tGATT_TCB *p_tcb )
1743 if (p_tcb)
1747 if (p_tcb->prep_cnt[i])
1749 p_tcb->sr_cmd.cback_cnt[i]=1;
1765 BOOLEAN gatt_sr_is_cback_cnt_zero(tGATT_TCB *p_tcb )
1770 if (p_tcb)
1774 if (p_tcb->sr_cmd.cback_cnt[i])
1797 BOOLEAN gatt_sr_is_prep_cnt_zero(tGATT_TCB *p_tcb)
1802 if (p_tcb)
1806 if (p_tcb->prep_cnt[i])
1830 void gatt_sr_reset_cback_cnt(tGATT_TCB *p_tcb )
1834 if (p_tcb)
1838 p_tcb->sr_cmd.cback_cnt[i]=0;
1852 void gatt_sr_reset_prep_cnt(tGATT_TCB *p_tcb )
1855 if (p_tcb)
1859 p_tcb->prep_cnt[i]=0;
1874 void gatt_sr_update_cback_cnt(tGATT_TCB *p_tcb, tGATT_IF gatt_if, BOOLEAN is_inc, BOOLEAN is_reset_first)
1879 if (p_tcb)
1883 gatt_sr_reset_cback_cnt(p_tcb);
1887 p_tcb->sr_cmd.cback_cnt[idx]++;
1891 if ( p_tcb->sr_cmd.cback_cnt[idx])
1893 p_tcb->sr_cmd.cback_cnt[idx]--;
1909 void gatt_sr_update_prep_cnt(tGATT_TCB *p_tcb, tGATT_IF gatt_if, BOOLEAN is_inc, BOOLEAN is_reset_first)
1914 p_tcb->tcb_idx, gatt_if, is_inc, is_reset_first);
1916 if (p_tcb)
1920 gatt_sr_reset_prep_cnt(p_tcb);
1924 p_tcb->prep_cnt[idx]++;
1928 if (p_tcb->prep_cnt[idx])
1930 p_tcb->prep_cnt[idx]--;
1946 tGATT_TCB *p_tcb=NULL;
1949 p_tcb = gatt_find_tcb_by_addr(bda, BT_TRANSPORT_LE);
1951 if (p_tcb)
1953 if (gatt_get_ch_state(p_tcb) == GATT_CH_OPEN)
1960 gatt_update_app_use_link_flag(gatt_if, p_tcb, FALSE, FALSE);
1961 if (!gatt_num_apps_hold_link(p_tcb))
1963 gatt_disconnect(p_tcb);
1980 BOOLEAN gatt_find_app_hold_link(tGATT_TCB *p_tcb, UINT8 start_idx, UINT8 *p_found_idx, tGATT_IF *p_gatt_if)
1987 if (p_tcb->app_hold_link[i])
2007 BOOLEAN gatt_cmd_enq(tGATT_TCB *p_tcb, UINT16 clcb_idx, BOOLEAN to_send, UINT8 op_code, BT_HDR *p_buf)
2009 tGATT_CMD_Q *p_cmd = &p_tcb->cl_cmd_q[p_tcb->next_slot_inq];
2018 p_tcb->pending_cl_req = p_tcb->next_slot_inq;
2021 p_tcb->next_slot_inq ++;
2022 p_tcb->next_slot_inq %= GATT_CL_MAX_LCB;
2036 tGATT_CLCB * gatt_cmd_dequeue(tGATT_TCB *p_tcb, UINT8 *p_op_code)
2038 tGATT_CMD_Q *p_cmd = &p_tcb->cl_cmd_q[p_tcb->pending_cl_req];
2041 if (p_tcb->pending_cl_req != p_tcb->next_slot_inq)
2047 p_tcb->pending_cl_req ++;
2048 p_tcb->pending_cl_req %= GATT_CL_MAX_LCB;
2063 UINT8 gatt_send_write_msg (tGATT_TCB *p_tcb, UINT16 clcb_idx, UINT8 op_code,
2076 return attp_send_cl_msg(p_tcb, clcb_idx, op_code, &msg);
2089 UINT8 gatt_act_send_browse(tGATT_TCB *p_tcb, UINT16 index, UINT8 op, UINT16 s_handle,
2099 return attp_send_cl_msg(p_tcb, index, op, &msg);
2154 cb_data.mtu = p_clcb->p_tcb->payload_size;
2194 tGATT_TCB *p_tcb = NULL;
2203 if ((p_tcb = gatt_find_tcb_by_addr(bda, transport)) != NULL)
2205 GATT_TRACE_DEBUG ("found p_tcb ");
2206 gatt_set_ch_state(p_tcb, GATT_CH_CLOSE);
2210 if (p_clcb->in_use && p_clcb->p_tcb == p_tcb)
2222 btu_stop_timer (&p_tcb->ind_ack_timer_ent);
2223 btu_stop_timer (&p_tcb->conf_timer_ent);
2224 gatt_free_pending_ind(p_tcb);
2225 gatt_free_pending_enc_queue(p_tcb);
2232 conn_id = GATT_CREATE_CONN_ID(p_tcb->tcb_idx, p_reg->gatt_if);
2233 GATT_TRACE_DEBUG ("found p_reg tcb_idx=%d gatt_if=%d conn_id=0x%x", p_tcb->tcb_idx, p_reg->gatt_if, conn_id);
2237 memset(p_tcb, 0, sizeof(tGATT_TCB));
2472 tGATT_TCB *p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE);
2475 if (p_tcb)
2476 gatt_update_app_use_link_flag(gatt_if, p_tcb, FALSE, FALSE);
2694 tGATT_TCB *p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE);
2708 if (ret && p_tcb != NULL)
2711 gatt_update_app_use_link_flag(gatt_if, p_tcb
2732 tGATT_PENDING_ENC_CLCB* gatt_add_pending_enc_channel_clcb(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb )
2741 GKI_enqueue (&p_tcb->pending_enc_clcb, p_buf);