• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/netgraph/bluetooth/l2cap/

Lines Matching defs:con

73 	ng_l2cap_con_p		 con = NULL;
77 con = ng_l2cap_con_by_addr(l2cap, bdaddr, type);
78 if (con != NULL) {
82 __func__, NG_NODE_NAME(l2cap->node), con->state,
83 con->con_handle);
98 con = ng_l2cap_new_con(l2cap, bdaddr, type);
99 if (con == NULL)
106 ng_l2cap_free_con(con);
115 con->flags |= NG_L2CAP_CON_OUTGOING;
116 con->state = NG_L2CAP_W4_LP_CON_CFM;
117 ng_l2cap_lp_timeout(con);
121 if (ng_l2cap_lp_untimeout(con) == 0)
122 ng_l2cap_free_con(con);
144 ng_l2cap_con_p con = NULL;
158 con = ng_l2cap_con_by_addr(l2cap, &ep->bdaddr, ep->link_type);
159 if (con == NULL) {
168 if (con->state != NG_L2CAP_W4_LP_CON_CFM) {
172 __func__, NG_NODE_NAME(l2cap->node), con->state,
173 con->con_handle);
185 if ((error = ng_l2cap_lp_untimeout(con)) != 0)
189 con->state = NG_L2CAP_CON_OPEN;
190 con->con_handle = ep->con_handle;
191 ng_l2cap_lp_deliver(con);
193 ng_l2cap_con_fail(con, ep->status);
213 ng_l2cap_con_p con = NULL;
228 con = ng_l2cap_con_by_addr(l2cap, &ep->bdaddr, ep->link_type);
229 if (con != NULL) {
233 __func__, NG_NODE_NAME(l2cap->node), con->state,
234 con->con_handle);
249 con = ng_l2cap_new_con(l2cap, &ep->bdaddr, ep->link_type);
250 if (con == NULL)
257 ng_l2cap_free_con(con);
267 con->state = NG_L2CAP_W4_LP_CON_CFM;
268 ng_l2cap_lp_timeout(con);
272 if (ng_l2cap_lp_untimeout(con) == 0)
273 ng_l2cap_free_con(con);
294 ng_l2cap_con_p con = NULL;
309 con = ng_l2cap_con_by_handle(l2cap, ep->con_handle);
310 if (con == NULL) {
320 if (con->state != NG_L2CAP_CON_OPEN) {
324 __func__, NG_NODE_NAME(l2cap->node), con->state,
325 con->con_handle);
337 if (con->flags & NG_L2CAP_CON_AUTO_DISCON_TIMO)
338 if ((error = ng_l2cap_discon_untimeout(con)) != 0)
341 ng_l2cap_con_fail(con, ep->reason);
356 ng_l2cap_con_p con = NULL;
360 con = ng_l2cap_con_by_handle(l2cap, con_handle);
361 if (con == NULL) {
371 if (con->state != NG_L2CAP_CON_OPEN) {
375 __func__, NG_NODE_NAME(l2cap->node), con->state,
376 con->con_handle);
445 ng_l2cap_con_p con = NULL;
460 con = ng_l2cap_con_by_handle(l2cap, ep->con_handle);
461 if (con == NULL) {
471 if (con->state != NG_L2CAP_CON_OPEN) {
475 __func__, NG_NODE_NAME(l2cap->node), con->state,
476 con->con_handle);
490 ng_l2cap_con_p con = NULL;
505 con = ng_l2cap_con_by_handle(l2cap, ep->con_handle);
506 if (con == NULL) {
516 if (con->state != NG_L2CAP_CON_OPEN) {
520 __func__, NG_NODE_NAME(l2cap->node), con->state,
521 con->con_handle);
526 con->encryption = ep->status;
529 if((ch->con->con_handle == ep->con_handle) &&
530 (ch->con->linktype == ep->link_type))
544 ng_l2cap_lp_send(ng_l2cap_con_p con, u_int16_t dcid, struct mbuf *m0)
546 ng_l2cap_p l2cap = con->l2cap;
550 int len, flag = (con->linktype == NG_HCI_LINK_ACL) ? NG_HCI_PACKET_START : NG_HCI_LE_PACKET_START;
552 KASSERT((con->tx_pkt == NULL),
609 con->con_handle, flag, 0));
614 if (con->tx_pkt == NULL)
615 con->tx_pkt = m_last = m0;
623 __func__, NG_NODE_NAME(l2cap->node), con->con_handle,
636 while (con->tx_pkt != NULL) {
637 m = con->tx_pkt->m_nextpkt;
638 m_freem(con->tx_pkt);
639 con->tx_pkt = m;
664 ng_l2cap_con_p con = NULL;
696 con = ng_l2cap_con_by_handle(l2cap, con_handle);
697 if (con == NULL) {
707 if (con->state != NG_L2CAP_CON_OPEN) {
710 __func__, NG_NODE_NAME(l2cap->node), con->state);
718 if (con->rx_pkt != NULL) {
722 con->rx_pkt->m_pkthdr.len, con->rx_pkt_len);
723 NG_FREE_M(con->rx_pkt);
724 con->rx_pkt_len = 0;
749 con->rx_pkt = m;
750 con->rx_pkt_len = le16toh(l2cap_hdr->length)+sizeof(*l2cap_hdr);
752 if (con->rx_pkt == NULL) {
756 con->con_handle);
761 m_cat(con->rx_pkt, m);
762 con->rx_pkt->m_pkthdr.len += length;
771 con->rx_pkt_len -= length;
772 if (con->rx_pkt_len < 0) {
776 con->rx_pkt->m_pkthdr.len, con->rx_pkt_len);
777 NG_FREE_M(con->rx_pkt);
778 con->rx_pkt_len = 0;
779 } else if (con->rx_pkt_len == 0) {
781 error = ng_l2cap_receive(con);
782 con->rx_pkt = NULL;
783 con->rx_pkt_len = 0;
799 ng_l2cap_lp_deliver(ng_l2cap_con_p con)
801 ng_l2cap_p l2cap = con->l2cap;
806 if (con->state != NG_L2CAP_CON_OPEN)
809 if (con->tx_pkt == NULL)
810 ng_l2cap_con_wakeup(con);
812 if (con->tx_pkt == NULL)
825 while (con->pending < con->l2cap->num_pkts && con->tx_pkt != NULL) {
826 m = con->tx_pkt;
827 con->tx_pkt = con->tx_pkt->m_nextpkt;
831 ng_l2cap_lp_receive(con->l2cap, m);
836 __func__, NG_NODE_NAME(l2cap->node), con->con_handle,
844 con->con_handle, error);
849 con->pending ++;
854 __func__, NG_NODE_NAME(l2cap->node), con->pending,
855 con->con_handle);
860 while (con->tx_pkt != NULL) {
861 m = con->tx_pkt->m_nextpkt;
862 m_freem(con->tx_pkt);
863 con->tx_pkt = m;
877 ng_l2cap_con_p con = NULL;
885 con = ng_l2cap_con_by_handle(l2cap, con_handle);
887 if (con == NULL) {
894 if (!(con->flags & NG_L2CAP_CON_LP_TIMO)) {
897 __func__, NG_NODE_NAME(node), con_handle, con->state,
898 con->flags);
907 con->flags &= ~NG_L2CAP_CON_LP_TIMO;
908 ng_l2cap_con_fail(con, NG_L2CAP_TIMEOUT);
920 ng_l2cap_con_p con = NULL;
931 con = ng_l2cap_con_by_handle(l2cap, con_handle);
933 if (con == NULL) {
940 if (!(con->flags & NG_L2CAP_CON_AUTO_DISCON_TIMO)) {
943 __func__, NG_NODE_NAME(node), con_handle, con->state,
944 con->flags);
948 con->flags &= ~NG_L2CAP_CON_AUTO_DISCON_TIMO;
965 ep->con_handle = con->con_handle;