Lines Matching refs:cp
239 const struct btp_l2cap_connect_cmd *cp = cmd; in connect() local
244 uint16_t mtu = sys_le16_to_cpu(cp->mtu); in connect()
245 uint16_t psm = sys_le16_to_cpu(cp->psm); in connect()
247 bool ecfc = cp->options & BTP_L2CAP_CONNECT_OPT_ECFC; in connect()
250 if (cp->num == 0 || cp->num > CHANNELS || mtu > DATA_MTU_INITIAL) { in connect()
254 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in connect()
259 for (i = 0U; i < cp->num; i++) { in connect()
272 chan->hold_credit = cp->options & BTP_L2CAP_CONNECT_OPT_HOLD_CREDIT; in connect()
277 if (cp->num == 1 && !ecfc) { in connect()
297 rp->num = cp->num; in connect()
314 const struct btp_l2cap_disconnect_cmd *cp = cmd; in disconnect() local
318 if (cp->chan_id >= CHANNELS) { in disconnect()
322 chan = &channels[cp->chan_id]; in disconnect()
336 const struct btp_l2cap_reconfigure_cmd *cp = cmd; in reconfigure() local
343 if (cmd_len < sizeof(*cp) || in reconfigure()
344 cmd_len != sizeof(*cp) + cp->num) { in reconfigure()
348 if (cp->num > CHANNELS) { in reconfigure()
352 mtu = sys_le16_to_cpu(cp->mtu); in reconfigure()
357 for (int i = 0; i < cp->num; i++) { in reconfigure()
358 if (cp->chan_id[i] > CHANNELS) { in reconfigure()
362 reconf_channels[i] = &channels[cp->chan_id[i]].le.chan; in reconfigure()
365 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in reconfigure()
372 err = bt_l2cap_ecred_chan_reconfigure_explicit(reconf_channels, cp->num, mtu, mps); in reconfigure()
387 const struct btp_l2cap_disconnect_eatt_chans_cmd *cp = cmd; in disconnect_eatt_chans() local
391 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in disconnect_eatt_chans()
397 for (int i = 0; i < cp->count; i++) { in disconnect_eatt_chans()
414 const struct btp_l2cap_send_data_cmd *cp = cmd; in send_data() local
420 if (cmd_len < sizeof(*cp) || in send_data()
421 cmd_len != sizeof(*cp) + sys_le16_to_cpu(cp->data_len)) { in send_data()
425 if (cp->chan_id >= CHANNELS) { in send_data()
429 chan = &channels[cp->chan_id]; in send_data()
430 data_len = sys_le16_to_cpu(cp->data_len); in send_data()
446 net_buf_add_mem(buf, cp->data, data_len); in send_data()
519 const struct btp_l2cap_listen_cmd *cp = cmd; in listen() local
521 uint16_t psm = sys_le16_to_cpu(cp->psm); in listen()
537 switch (cp->response) { in listen()
568 const struct btp_l2cap_credits_cmd *cp = cmd; in credits() local
571 if (cp->chan_id >= CHANNELS) { in credits()
575 chan = &channels[cp->chan_id]; in credits()