MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ng_l2cap_free_chan

Function ng_l2cap_free_chan

freebsd/netgraph/bluetooth/l2cap/ng_l2cap_misc.c:422–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420 */
421
422void
423ng_l2cap_free_chan(ng_l2cap_chan_p ch)
424{
425 ng_l2cap_cmd_p f = NULL, n = NULL;
426
427 f = TAILQ_FIRST(&ch->con->cmd_list);
428
429 while (f != NULL) {
430 n = TAILQ_NEXT(f, next);
431
432 if (f->ch == ch) {
433 ng_l2cap_unlink_cmd(f);
434 if (f->flags & NG_L2CAP_CMD_PENDING)
435 ng_l2cap_command_untimeout(f);
436 ng_l2cap_free_cmd(f);
437 }
438
439 f = n;
440 }
441
442 LIST_REMOVE(ch, next);
443
444 ng_l2cap_con_unref(ch->con);
445
446 bzero(ch, sizeof(*ch));
447 free(ch, M_NETGRAPH_L2CAP);
448} /* ng_l2cap_free_chan */
449
450/*
451 * Create new L2CAP command descriptor. WILL NOT add command to the queue.

Callers 15

ng_l2cap_process_cmd_rejFunction · 0.85
ng_l2cap_process_con_reqFunction · 0.85
ng_l2cap_process_con_rspFunction · 0.85
ng_l2cap_process_cfg_reqFunction · 0.85
ng_l2cap_process_cfg_rspFunction · 0.85
ng_l2cap_free_conFunction · 0.85
ng_l2cap_con_wakeupFunction · 0.85
ng_l2cap_con_failFunction · 0.85

Calls 4

ng_l2cap_con_unrefFunction · 0.85
bzeroFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected