Lines Matching refs:p_mcb

135   tRFC_MCB* p_mcb = NULL;  in rfc_alloc_multiplexer_channel()  local
165 p_mcb = &rfc_cb.port.rfc_mcb[j]; in rfc_alloc_multiplexer_channel()
168 alarm_free(p_mcb->mcb_timer); in rfc_alloc_multiplexer_channel()
169 fixed_queue_free(p_mcb->cmd_q, NULL); in rfc_alloc_multiplexer_channel()
170 memset(p_mcb, 0, sizeof(tRFC_MCB)); in rfc_alloc_multiplexer_channel()
171 p_mcb->bd_addr = bd_addr; in rfc_alloc_multiplexer_channel()
177 p_mcb->mcb_timer = alarm_new("rfcomm_mcb.mcb_timer"); in rfc_alloc_multiplexer_channel()
178 p_mcb->cmd_q = fixed_queue_new(SIZE_MAX); in rfc_alloc_multiplexer_channel()
180 p_mcb->is_initiator = is_initiator; in rfc_alloc_multiplexer_channel()
182 rfc_timer_start(p_mcb, RFC_MCB_INIT_INACT_TIMER); in rfc_alloc_multiplexer_channel()
185 return (p_mcb); in rfc_alloc_multiplexer_channel()
198 void rfc_release_multiplexer_channel(tRFC_MCB* p_mcb) { in rfc_release_multiplexer_channel() argument
200 rfc_save_lcid_mcb(NULL, p_mcb->lcid); in rfc_release_multiplexer_channel()
204 if (rfc_cb.port.port[i].rfc.p_mcb == p_mcb) in rfc_release_multiplexer_channel()
205 rfc_cb.port.port[i].rfc.p_mcb = NULL; in rfc_release_multiplexer_channel()
208 rfc_timer_stop(p_mcb); in rfc_release_multiplexer_channel()
209 alarm_free(p_mcb->mcb_timer); in rfc_release_multiplexer_channel()
211 fixed_queue_free(p_mcb->cmd_q, osi_free); in rfc_release_multiplexer_channel()
213 memset(p_mcb, 0, sizeof(tRFC_MCB)); in rfc_release_multiplexer_channel()
214 p_mcb->state = RFC_MX_STATE_IDLE; in rfc_release_multiplexer_channel()
224 void rfc_timer_start(tRFC_MCB* p_mcb, uint16_t timeout) { in rfc_timer_start() argument
228 alarm_set_on_mloop(p_mcb->mcb_timer, interval_ms, rfcomm_mcb_timer_timeout, in rfc_timer_start()
229 p_mcb); in rfc_timer_start()
239 void rfc_timer_stop(tRFC_MCB* p_mcb) { in rfc_timer_stop() argument
242 alarm_cancel(p_mcb->mcb_timer); in rfc_timer_stop()
283 void rfc_check_mcb_active(tRFC_MCB* p_mcb) { in rfc_check_mcb_active() argument
287 if (p_mcb->port_handles[i] != 0) { in rfc_check_mcb_active()
288 p_mcb->is_disc_initiator = false; in rfc_check_mcb_active()
294 if (p_mcb->is_disc_initiator) { in rfc_check_mcb_active()
295 p_mcb->is_disc_initiator = false; in rfc_check_mcb_active()
296 rfc_mx_sm_execute(p_mcb, RFC_MX_EVENT_CLOSE_REQ, NULL); in rfc_check_mcb_active()
298 rfc_timer_start(p_mcb, RFC_MCB_RELEASE_INACT_TIMER); in rfc_check_mcb_active()
308 tRFC_MCB* p_mcb = (tRFC_MCB*)data; in rfcomm_mcb_timer_timeout() local
310 rfc_mx_sm_execute(p_mcb, RFC_EVENT_TIMEOUT, NULL); in rfcomm_mcb_timer_timeout()
349 tRFC_MCB* p_mcb = p_port->rfc.p_mcb; in rfc_port_closed() local
354 if (p_mcb) { in rfc_port_closed()
355 p_mcb->port_handles[p_port->dlci] = 0; in rfc_port_closed()
358 rfc_check_mcb_active(p_mcb); in rfc_port_closed()
377 if (p_port->rfc.p_mcb->flow == PORT_FC_CREDIT) { in rfc_inc_credit()
382 if (p_port->tx.peer_fc) PORT_FlowInd(p_port->rfc.p_mcb, p_port->dlci, true); in rfc_inc_credit()
398 if (p_port->rfc.p_mcb->flow == PORT_FC_CREDIT) { in rfc_dec_credit()
415 void rfc_check_send_cmd(tRFC_MCB* p_mcb, BT_HDR* p_buf) { in rfc_check_send_cmd() argument
418 if (p_mcb->cmd_q == NULL) { in rfc_check_send_cmd()
421 __func__, p_mcb, p_mcb->lcid, rfc_find_lcid_mcb(p_mcb->lcid)); in rfc_check_send_cmd()
423 fixed_queue_enqueue(p_mcb->cmd_q, p_buf); in rfc_check_send_cmd()
427 while (!p_mcb->l2cap_congested) { in rfc_check_send_cmd()
428 BT_HDR* p = (BT_HDR*)fixed_queue_try_dequeue(p_mcb->cmd_q); in rfc_check_send_cmd()
430 L2CA_DataWrite(p_mcb->lcid, p); in rfc_check_send_cmd()