Lines Matching refs:p_lcb
65 static bool avct_l2c_is_passive(tAVCT_LCB* p_lcb) { in avct_l2c_is_passive() argument
71 if (p_ccb->allocated && (p_ccb->p_lcb == p_lcb)) { in avct_l2c_is_passive()
94 tAVCT_LCB* p_lcb; in avct_l2c_connect_ind_cback() local
98 p_lcb = avct_lcb_by_bd(bd_addr); in avct_l2c_connect_ind_cback()
99 if (p_lcb == NULL) { in avct_l2c_connect_ind_cback()
101 p_lcb = avct_lcb_alloc(bd_addr); in avct_l2c_connect_ind_cback()
102 if (p_lcb == NULL) { in avct_l2c_connect_ind_cback()
109 if (!avct_l2c_is_passive(p_lcb) || (p_lcb->ch_state == AVCT_CH_OPEN)) { in avct_l2c_connect_ind_cback()
115 p_lcb->conflict_lcid = p_lcb->ch_lcid; in avct_l2c_connect_ind_cback()
117 p_lcb->conflict_lcid); in avct_l2c_connect_ind_cback()
121 if (p_lcb) { in avct_l2c_connect_ind_cback()
123 lcid, result, p_lcb->ch_state); in avct_l2c_connect_ind_cback()
134 p_lcb->ch_lcid = lcid; in avct_l2c_connect_ind_cback()
137 p_lcb->ch_state = AVCT_CH_CFG; in avct_l2c_connect_ind_cback()
140 if (p_lcb) AVCT_TRACE_DEBUG("ch_state cni: %d ", p_lcb->ch_state); in avct_l2c_connect_ind_cback()
144 tAVCT_LCB* p_lcb = avct_lcb_by_lcid(lcid); in avct_on_l2cap_error() local
145 if (p_lcb == nullptr) return; in avct_on_l2cap_error()
146 if (p_lcb->ch_state == AVCT_CH_CONN) { in avct_on_l2cap_error()
148 p_lcb->conflict_lcid); in avct_on_l2cap_error()
149 if (p_lcb->conflict_lcid == lcid) { in avct_on_l2cap_error()
150 p_lcb->conflict_lcid = 0; in avct_on_l2cap_error()
154 avct_lcb_event(p_lcb, AVCT_LCB_LL_CLOSE_EVT, &avct_lcb_evt); in avct_on_l2cap_error()
156 } else if (p_lcb->ch_state == AVCT_CH_CFG) { in avct_on_l2cap_error()
158 p_lcb->ch_state); in avct_on_l2cap_error()
160 p_lcb->ch_result = result; in avct_on_l2cap_error()
178 tAVCT_LCB* p_lcb; in avct_l2c_connect_cfm_cback() local
181 p_lcb = avct_lcb_by_lcid(lcid); in avct_l2c_connect_cfm_cback()
182 if (p_lcb != NULL) { in avct_l2c_connect_cfm_cback()
186 lcid, result, p_lcb->ch_state, p_lcb->conflict_lcid); in avct_l2c_connect_cfm_cback()
188 if (p_lcb->ch_state == AVCT_CH_CONN) { in avct_l2c_connect_cfm_cback()
192 p_lcb->ch_state = AVCT_CH_CFG; in avct_l2c_connect_cfm_cback()
198 } else if (p_lcb->conflict_lcid == lcid) { in avct_l2c_connect_cfm_cback()
202 p_lcb->ch_state, p_lcb->conflict_lcid); in avct_l2c_connect_cfm_cback()
208 p_lcb->conflict_lcid = 0; in avct_l2c_connect_cfm_cback()
210 AVCT_TRACE_DEBUG("ch_state cnc: %d ", p_lcb->ch_state); in avct_l2c_connect_cfm_cback()
228 tAVCT_LCB* p_lcb; in avct_l2c_config_cfm_cback() local
231 p_lcb = avct_lcb_by_lcid(lcid); in avct_l2c_config_cfm_cback()
232 if (p_lcb != NULL) { in avct_l2c_config_cfm_cback()
234 p_lcb->ch_state); in avct_l2c_config_cfm_cback()
236 if (p_lcb->ch_state == AVCT_CH_CFG) { in avct_l2c_config_cfm_cback()
237 p_lcb->ch_state = AVCT_CH_OPEN; in avct_l2c_config_cfm_cback()
238 avct_lcb_event(p_lcb, AVCT_LCB_LL_OPEN_EVT, NULL); in avct_l2c_config_cfm_cback()
240 AVCT_TRACE_DEBUG("ch_state cfc: %d ", p_lcb->ch_state); in avct_l2c_config_cfm_cback()
255 tAVCT_LCB* p_lcb; in avct_l2c_config_ind_cback() local
258 p_lcb = avct_lcb_by_lcid(lcid); in avct_l2c_config_ind_cback()
259 if (p_lcb != NULL) { in avct_l2c_config_ind_cback()
261 p_lcb->ch_state); in avct_l2c_config_ind_cback()
264 p_lcb->peer_mtu = p_cfg->mtu; in avct_l2c_config_ind_cback()
266 p_lcb->peer_mtu = L2CAP_DEFAULT_MTU; in avct_l2c_config_ind_cback()
282 tAVCT_LCB* p_lcb; in avct_l2c_disconnect_ind_cback() local
286 p_lcb = avct_lcb_by_lcid(lcid); in avct_l2c_disconnect_ind_cback()
287 if (p_lcb != NULL) { in avct_l2c_disconnect_ind_cback()
289 p_lcb->ch_state); in avct_l2c_disconnect_ind_cback()
292 avct_lcb_event(p_lcb, AVCT_LCB_LL_CLOSE_EVT, &avct_lcb_evt); in avct_l2c_disconnect_ind_cback()
293 AVCT_TRACE_DEBUG("ch_state di: %d ", p_lcb->ch_state); in avct_l2c_disconnect_ind_cback()
300 tAVCT_LCB* p_lcb; in avct_l2c_disconnect() local
304 p_lcb = avct_lcb_by_lcid(lcid); in avct_l2c_disconnect()
305 if (p_lcb != NULL) { in avct_l2c_disconnect()
308 p_lcb->ch_state, result); in avct_l2c_disconnect()
310 res = (p_lcb->ch_result != 0) ? p_lcb->ch_result : result; in avct_l2c_disconnect()
311 p_lcb->ch_result = 0; in avct_l2c_disconnect()
315 avct_lcb_event(p_lcb, AVCT_LCB_LL_CLOSE_EVT, &avct_lcb_evt); in avct_l2c_disconnect()
316 AVCT_TRACE_DEBUG("ch_state dc: %d ", p_lcb->ch_state); in avct_l2c_disconnect()
331 tAVCT_LCB* p_lcb; in avct_l2c_congestion_ind_cback() local
335 p_lcb = avct_lcb_by_lcid(lcid); in avct_l2c_congestion_ind_cback()
336 if (p_lcb != NULL) { in avct_l2c_congestion_ind_cback()
339 avct_lcb_event(p_lcb, AVCT_LCB_LL_CONG_EVT, &avct_lcb_evt); in avct_l2c_congestion_ind_cback()
354 tAVCT_LCB* p_lcb; in avct_l2c_data_ind_cback() local
358 p_lcb = avct_lcb_by_lcid(lcid); in avct_l2c_data_ind_cback()
359 if (p_lcb != NULL) { in avct_l2c_data_ind_cback()
360 avct_lcb_event(p_lcb, AVCT_LCB_LL_MSG_EVT, (tAVCT_LCB_EVT*)&p_buf); in avct_l2c_data_ind_cback()