Lines Matching refs:cid
119 uint16_t cid; in l2cap_chan_alloc_cid() local
125 if (le_chan->rx.cid > 0) { in l2cap_chan_alloc_cid()
129 for (cid = L2CAP_LE_CID_DYN_START; cid <= L2CAP_LE_CID_DYN_END; cid++) { in l2cap_chan_alloc_cid()
130 if (!bt_l2cap_le_lookup_rx_cid(conn, cid)) { in l2cap_chan_alloc_cid()
131 le_chan->rx.cid = cid; in l2cap_chan_alloc_cid()
384 if (L2CAP_LE_CID_IS_DYN(le_chan->rx.cid)) { in l2cap_chan_add()
416 le_chan->rx.cid = fchan->cid; in bt_l2cap_connected()
417 le_chan->tx.cid = fchan->cid; in bt_l2cap_connected()
536 req->scid = sys_cpu_to_le16(ch->rx.cid); in l2cap_le_conn_req()
593 net_buf_add_le16(buf, ch->rx.cid); in l2cap_ecred_conn_req()
783 if (!L2CAP_LE_CID_IS_DYN(lechan->tx.cid)) { in chan_take_credit()
818 L2CAP_LE_CID_IS_DYN(lechan->tx.cid) ? "dynamic" : "static", in get_ready_chan()
833 uint16_t cid = POINTER_TO_UINT(user_data); in l2cap_chan_sdu_sent() local
835 LOG_DBG("conn %p CID 0x%04x err %d", conn, cid, err); in l2cap_chan_sdu_sent()
843 chan = bt_l2cap_le_lookup_tx_cid(conn, cid); in l2cap_chan_sdu_sent()
845 LOG_DBG("got SDU sent cb for disconnected chan (CID %u)", cid); in l2cap_chan_sdu_sent()
858 if (!L2CAP_LE_CID_IS_DYN(lechan->tx.cid)) { in get_pdu_len()
869 if (!L2CAP_LE_CID_IS_DYN(lechan->tx.cid)) { in chan_has_credits()
950 hdr->cid = sys_cpu_to_le16(lechan->tx.cid); in l2cap_data_pull()
972 if (last_frag && L2CAP_LE_CID_IS_DYN(lechan->tx.cid)) { in l2cap_data_pull()
979 sdu_end ? UINT_TO_POINTER(lechan->tx.cid) : NULL); in l2cap_data_pull()
1105 uint16_t cid) in bt_l2cap_le_lookup_tx_cid() argument
1110 if (BT_L2CAP_LE_CHAN(chan)->tx.cid == cid) { in bt_l2cap_le_lookup_tx_cid()
1119 uint16_t cid) in bt_l2cap_le_lookup_rx_cid() argument
1124 if (BT_L2CAP_LE_CHAN(chan)->rx.cid == cid) { in bt_l2cap_le_lookup_rx_cid()
1295 LOG_DBG("chan %p cid 0x%04x", le_chan, le_chan->rx.cid); in l2cap_chan_destroy()
1394 le_chan->tx.cid = scid; in l2cap_chan_accept()
1499 rsp->dcid = sys_cpu_to_le16(le_chan->rx.cid); in le_conn_req()
1593 dcid[i++] = sys_cpu_to_le16(ch->rx.cid); in le_ecred_conn_req()
1781 uint16_t cid) in l2cap_remove_rx_cid() argument
1787 if (!L2CAP_LE_CID_IS_DYN(cid)) { in l2cap_remove_rx_cid()
1792 if (BT_L2CAP_LE_CHAN(chan)->rx.cid == cid) { in l2cap_remove_rx_cid()
1840 rsp->dcid = sys_cpu_to_le16(chan->rx.cid); in le_disconn_req()
1841 rsp->scid = sys_cpu_to_le16(chan->tx.cid); in le_disconn_req()
1988 chan->tx.cid = dcid; in le_ecred_conn_rsp()
2067 chan->tx.cid = dcid; in le_conn_rsp()
2127 uint16_t credits, cid; in le_credits() local
2134 cid = sys_le16_to_cpu(ev->cid); in le_credits()
2137 LOG_DBG("cid 0x%04x credits %u", cid, credits); in le_credits()
2139 chan = bt_l2cap_le_lookup_tx_cid(conn, cid); in le_credits()
2311 ev->cid = sys_cpu_to_le16(chan->rx.cid); in l2cap_chan_send_credits()
2320 static int l2cap_chan_send_credits_pdu(struct bt_conn *conn, uint16_t cid, uint16_t credits) in l2cap_chan_send_credits_pdu() argument
2332 .cid = sys_cpu_to_le16(cid), in l2cap_chan_send_credits_pdu()
2390 err = l2cap_chan_send_credits_pdu(chan->conn, le_chan->rx.cid, additional_credits); in bt_l2cap_chan_give_credits()
2702 if (L2CAP_LE_CID_IS_DYN(le_chan->rx.cid)) { in l2cap_chan_recv()
2727 uint16_t cid; in bt_l2cap_recv() local
2742 cid = sys_le16_to_cpu(hdr->cid); in bt_l2cap_recv()
2744 LOG_DBG("Packet for CID %u len %u", cid, buf->len); in bt_l2cap_recv()
2746 chan = bt_l2cap_le_lookup_rx_cid(conn, cid); in bt_l2cap_recv()
2748 LOG_WRN("Ignoring data for unknown channel ID 0x%04x", cid); in bt_l2cap_recv()
2779 LOG_DBG("ch %p cid 0x%04x", BT_L2CAP_LE_CHAN(chan), BT_L2CAP_LE_CHAN(chan)->rx.cid); in l2cap_connected()
2786 LOG_DBG("ch %p cid 0x%04x", le_chan, le_chan->rx.cid); in l2cap_disconnected()
3029 net_buf_add_le16(buf, ch->rx.cid); in bt_l2cap_ecred_chan_reconfigure()
3116 net_buf_add_le16(buf, ch->rx.cid); in bt_l2cap_ecred_chan_reconfigure_explicit()
3178 LOG_DBG("chan %p scid 0x%04x dcid 0x%04x", chan, le_chan->rx.cid, le_chan->tx.cid); in bt_l2cap_chan_disconnect()
3189 req->dcid = sys_cpu_to_le16(le_chan->tx.cid); in bt_l2cap_chan_disconnect()
3190 req->scid = sys_cpu_to_le16(le_chan->rx.cid); in bt_l2cap_chan_disconnect()
3313 __ASSERT_NO_MSG(L2CAP_LE_CID_IS_DYN(le_chan->tx.cid)); in bt_l2cap_chan_send()