Lines Matching refs:ch

335 	ng_l2cap_chan_p	ch = NULL;
337 ch = malloc(sizeof(*ch), M_NETGRAPH_L2CAP,
339 if (ch == NULL)
342 ch->scid = ch->dcid = NG_L2CAP_ATT_CID;
344 ch->scid = ch->dcid = NG_L2CAP_SMP_CID;
346 ch->scid = ng_l2cap_get_cid(l2cap,
350 ch->idtype = idtype;
351 if (ch->scid != NG_L2CAP_NULL_CID) {
353 ch->psm = psm;
354 ch->con = con;
355 ch->state = NG_L2CAP_CLOSED;
358 ch->imtu = NG_L2CAP_MTU_DEFAULT;
359 bcopy(ng_l2cap_default_flow(), &ch->iflow, sizeof(ch->iflow));
361 ch->omtu = NG_L2CAP_MTU_DEFAULT;
362 bcopy(ng_l2cap_default_flow(), &ch->oflow, sizeof(ch->oflow));
364 ch->flush_timo = NG_L2CAP_FLUSH_TIMO_DEFAULT;
365 ch->link_timo = NG_L2CAP_LINK_TIMO_DEFAULT;
367 LIST_INSERT_HEAD(&l2cap->chan_list, ch, next);
371 bzero(ch, sizeof(*ch));
372 free(ch, M_NETGRAPH_L2CAP);
373 ch = NULL;
376 return (ch);
383 ng_l2cap_chan_p ch = NULL;
390 LIST_FOREACH(ch, &l2cap->chan_list, next){
392 (ch->con->linktype == NG_HCI_LINK_ACL ))
395 (ch->con->linktype != NG_HCI_LINK_ACL ))
397 if (ch->scid == scid)
400 return (ch);
407 ng_l2cap_chan_p ch = NULL;
410 LIST_FOREACH(ch, &l2cap->chan_list, next){
411 if ((ch->scid == scid) &&
412 (ch->con->con_handle == con_handle))
415 return (ch);
423 ng_l2cap_free_chan(ng_l2cap_chan_p ch)
427 f = TAILQ_FIRST(&ch->con->cmd_list);
432 if (f->ch == ch) {
442 LIST_REMOVE(ch, next);
444 ng_l2cap_con_unref(ch->con);
446 bzero(ch, sizeof(*ch));
447 free(ch, M_NETGRAPH_L2CAP);
455 ng_l2cap_new_cmd(ng_l2cap_con_p con, ng_l2cap_chan_p ch, u_int8_t ident,
460 KASSERT((ch == NULL || ch->con == con),
470 cmd->ch = ch;