Lines Matching refs:p_mcb

137   tRFC_MCB* p_mcb = NULL;  in rfc_alloc_multiplexer_channel()  local
172 p_mcb = &rfc_cb.port.rfc_mcb[j]; in rfc_alloc_multiplexer_channel()
175 alarm_free(p_mcb->mcb_timer); in rfc_alloc_multiplexer_channel()
176 fixed_queue_free(p_mcb->cmd_q, NULL); in rfc_alloc_multiplexer_channel()
177 memset(p_mcb, 0, sizeof(tRFC_MCB)); in rfc_alloc_multiplexer_channel()
178 memcpy(p_mcb->bd_addr, bd_addr, BD_ADDR_LEN); in rfc_alloc_multiplexer_channel()
184 p_mcb->mcb_timer = alarm_new("rfcomm_mcb.mcb_timer"); in rfc_alloc_multiplexer_channel()
185 p_mcb->cmd_q = fixed_queue_new(SIZE_MAX); in rfc_alloc_multiplexer_channel()
187 p_mcb->is_initiator = is_initiator; in rfc_alloc_multiplexer_channel()
189 rfc_timer_start(p_mcb, RFC_MCB_INIT_INACT_TIMER); in rfc_alloc_multiplexer_channel()
192 return (p_mcb); in rfc_alloc_multiplexer_channel()
205 void rfc_release_multiplexer_channel(tRFC_MCB* p_mcb) { in rfc_release_multiplexer_channel() argument
207 rfc_save_lcid_mcb(NULL, p_mcb->lcid); in rfc_release_multiplexer_channel()
211 if (rfc_cb.port.port[i].rfc.p_mcb == p_mcb) in rfc_release_multiplexer_channel()
212 rfc_cb.port.port[i].rfc.p_mcb = NULL; in rfc_release_multiplexer_channel()
215 rfc_timer_stop(p_mcb); in rfc_release_multiplexer_channel()
216 alarm_free(p_mcb->mcb_timer); in rfc_release_multiplexer_channel()
218 fixed_queue_free(p_mcb->cmd_q, osi_free); in rfc_release_multiplexer_channel()
220 memset(p_mcb, 0, sizeof(tRFC_MCB)); in rfc_release_multiplexer_channel()
221 p_mcb->state = RFC_MX_STATE_IDLE; in rfc_release_multiplexer_channel()
231 void rfc_timer_start(tRFC_MCB* p_mcb, uint16_t timeout) { in rfc_timer_start() argument
235 alarm_set_on_queue(p_mcb->mcb_timer, interval_ms, rfcomm_mcb_timer_timeout, in rfc_timer_start()
236 p_mcb, btu_general_alarm_queue); in rfc_timer_start()
246 void rfc_timer_stop(tRFC_MCB* p_mcb) { in rfc_timer_stop() argument
249 alarm_cancel(p_mcb->mcb_timer); in rfc_timer_stop()
291 void rfc_check_mcb_active(tRFC_MCB* p_mcb) { in rfc_check_mcb_active() argument
295 if (p_mcb->port_inx[i] != 0) { in rfc_check_mcb_active()
296 p_mcb->is_disc_initiator = false; in rfc_check_mcb_active()
302 if (p_mcb->is_disc_initiator) { in rfc_check_mcb_active()
303 p_mcb->is_disc_initiator = false; in rfc_check_mcb_active()
304 rfc_mx_sm_execute(p_mcb, RFC_MX_EVENT_CLOSE_REQ, NULL); in rfc_check_mcb_active()
306 rfc_timer_start(p_mcb, RFC_MCB_RELEASE_INACT_TIMER); in rfc_check_mcb_active()
316 tRFC_MCB* p_mcb = (tRFC_MCB*)data; in rfcomm_mcb_timer_timeout() local
318 rfc_mx_sm_execute(p_mcb, RFC_EVENT_TIMEOUT, NULL); in rfcomm_mcb_timer_timeout()
357 tRFC_MCB* p_mcb = p_port->rfc.p_mcb; in rfc_port_closed() local
366 if (p_mcb) { in rfc_port_closed()
367 p_mcb->port_inx[p_port->dlci] = 0; in rfc_port_closed()
370 rfc_check_mcb_active(p_mcb); in rfc_port_closed()
389 if (p_port->rfc.p_mcb->flow == PORT_FC_CREDIT) { in rfc_inc_credit()
395 PORT_FlowInd(p_port->rfc.p_mcb, p_port->dlci, true); in rfc_inc_credit()
411 if (p_port->rfc.p_mcb->flow == PORT_FC_CREDIT) { in rfc_dec_credit()
428 void rfc_check_send_cmd(tRFC_MCB* p_mcb, BT_HDR* p_buf) { in rfc_check_send_cmd() argument
431 if (p_mcb->cmd_q == NULL) { in rfc_check_send_cmd()
434 __func__, p_mcb, p_mcb->lcid, rfc_find_lcid_mcb(p_mcb->lcid)); in rfc_check_send_cmd()
436 fixed_queue_enqueue(p_mcb->cmd_q, p_buf); in rfc_check_send_cmd()
440 while (p_mcb->l2cap_congested == false) { in rfc_check_send_cmd()
441 BT_HDR* p = (BT_HDR*)fixed_queue_try_dequeue(p_mcb->cmd_q); in rfc_check_send_cmd()
443 L2CA_DataWrite(p_mcb->lcid, p); in rfc_check_send_cmd()