Home | History | Annotate | Download | only in hw

Lines Matching full:len

51                         const l2cap_hdr *hdr, int len);
142 static uint16_t l2cap_fcs16(const uint8_t *message, int len)
146 while (len --)
193 uint16_t len;
196 len = cpu_to_le16(L2CAP_CMD_REJ_SIZE + plen);
205 memcpy(&hdr->len, &len, sizeof(hdr->len));
238 hdr->len = cpu_to_le16(L2CAP_CONN_RSP_SIZE);
249 int dcid, int flag, const uint8_t *data, int len)
256 L2CAP_CMD_HDR_SIZE + L2CAP_CONF_REQ_SIZE(len));
266 hdr->len = cpu_to_le16(L2CAP_CONF_REQ_SIZE(len));
270 if (len)
271 memcpy(params->data, data, len);
277 int scid, int flag, int result, const uint8_t *data, int len)
284 L2CAP_CMD_HDR_SIZE + L2CAP_CONF_RSP_SIZE(len));
290 hdr->len = cpu_to_le16(L2CAP_CONF_RSP_SIZE(len));
295 if (len)
296 memcpy(params->data, data, len);
315 hdr->len = cpu_to_le16(L2CAP_DISCONN_RSP_SIZE);
324 const uint8_t *data, int len)
331 L2CAP_CMD_HDR_SIZE + len);
337 hdr->len = cpu_to_le16(len);
339 memcpy(params, data, len);
345 int result, const uint8_t *data, int len)
352 L2CAP_CMD_HDR_SIZE + L2CAP_INFO_RSP_SIZE + len);
358 hdr->len = cpu_to_le16(L2CAP_INFO_RSP_SIZE + len);
362 if (len)
363 memcpy(params->data, data, len);
368 static uint8_t *l2cap_bframe_out(struct bt_l2cap_conn_params_s *parm, int len);
371 static uint8_t *l2cap_iframe_out(struct bt_l2cap_conn_params_s *parm, int len);
375 const l2cap_hdr *hdr, int len);
377 const l2cap_hdr *hdr, int len);
501 const uint8_t *data, int len)
506 uint8_t rsp[len];
509 data = memcpy(rsp, data, len);
510 while (len) {
513 if (len < L2CAP_CONF_OPT_SIZE ||
514 len < L2CAP_CONF_OPT_SIZE + opt->len) {
518 data += L2CAP_CONF_OPT_SIZE + opt->len;
519 len -= L2CAP_CONF_OPT_SIZE + opt->len;
523 if (opt->len != 2) {
540 if (opt->len != 2) {
556 if (opt->len != L2CAP_CONF_OPT_QOS_SIZE) {
598 if (opt->len != 9) {
680 flag, result, rsp, len);
686 int flag, int cid, const uint8_t *data, int len)
704 if (l2cap_channel_config(l2cap, ch, flag, data, len))
718 int result, int flag, int cid, const uint8_t *data, int len)
761 int len = 0;
766 data[len ++] = l2cap->group_ch.mps & 0xff;
767 data[len ++] = l2cap->group_ch.mps >> 8;
772 data[len ++] = 0x03;
773 data[len ++] = 0x00;
774 data[len ++] = 0x00;
775 data[len ++] = 0x00;
782 l2cap_info_response(l2cap, type, result, data, len);
786 const uint8_t *params, int len)
810 if (unlikely(len != 2 && len != 4 && len != 6)) {
822 if (unlikely(len != L2CAP_CONN_REQ_SIZE)) {
833 if (unlikely(len != L2CAP_CONN_RSP_SIZE)) {
844 if (unlikely(len < L2CAP_CONF_REQ_SIZE(0))) {
853 len - L2CAP_CONF_REQ_SIZE(0));
857 if (unlikely(len < L2CAP_CONF_RSP_SIZE(0))) {
867 len - L2CAP_CONF_RSP_SIZE(0)))
873 if (unlikely(len != L2CAP_DISCONN_REQ_SIZE)) {
884 if (unlikely(len != L2CAP_DISCONN_RSP_SIZE)) {
895 l2cap_echo_response(l2cap, params, len);
905 if (unlikely(len != L2CAP_INFO_REQ_SIZE)) {
914 if (unlikely(len != L2CAP_INFO_RSP_SIZE)) {
941 static void l2cap_cframe_in(void *opaque, const uint8_t *data, int len)
947 while (len) {
949 if (len < L2CAP_CMD_HDR_SIZE)
952 len -= L2CAP_CMD_HDR_SIZE;
955 clen = le16_to_cpu(hdr->len);
956 if (len < clen) {
963 len -= clen;
969 static void l2cap_gframe_in(void *opaque, const uint8_t *data, int len)
980 const l2cap_hdr *hdr, int len)
983 ch->params.sdu_in(ch->params.opaque, hdr->data, len);
988 const l2cap_hdr *hdr, int len)
990 uint16_t fcs = le16_to_cpup((void *) (hdr->data + len - 2));
992 if (len < 4)
994 if (l2cap_fcs16((const uint8_t *) hdr, L2CAP_HDR_SIZE + len - 2) != fcs)
1001 if (len != 4)
1012 if (len - 4 > ch->mps)
1015 len - 4);
1018 if (ch->len_total || len < 6)
1020 if (len - 6 > ch->mps)
1024 if (len >= 6 + ch->len_total)
1027 ch->len_cur = len - 6;
1032 if (!ch->len_total || ch->len_cur + len - 4 < ch->len_total)
1034 if (len - 4 > ch->mps)
1037 memcpy(ch->sdu + ch->len_cur, hdr->data + 2, len - 4);
1041 if (!ch->len_total || ch->len_cur + len - 4 >= ch->len_total)
1043 if (len - 4 > ch->mps)
1046 memcpy(ch->sdu + ch->len_cur, hdr->data + 2, len - 4);
1047 ch->len_cur += len - 4;
1063 uint16_t len = le16_to_cpu(frame->len);
1071 l2cap->cid[cid]->frame_in(l2cap->cid[cid], cid, frame, len);
1076 const uint8_t *data, int len)
1080 if (unlikely(len + l2cap->frame_in_len > sizeof(l2cap->frame_in))) {
1092 memcpy(l2cap->frame_in + l2cap->frame_in_len, data, len);
1093 l2cap->frame_in_len += len;
1095 if (len >= L2CAP_HDR_SIZE)
1096 if (len >= L2CAP_HDR_SIZE + le16_to_cpu(hdr->len))
1103 uint16_t cid, uint16_t len)
1107 l2cap->frame_out_len = len + L2CAP_HDR_SIZE;
1110 hdr->len = cpu_to_le16(len);
1123 static uint8_t *l2cap_bframe_out(struct bt_l2cap_conn_params_s *parm, int len)
1127 if (len > chan->params.remote_mtu) {
1134 return l2cap_pdu_out(chan->l2cap, chan->remote_cid, len);
1146 static uint8_t *l2cap_iframe_out(struct bt_l2cap_conn_params_s *parm, int len)
1150 if (len > chan->params.remote_mtu) {
1291 const uint8_t *data, int start, int len)
1299 l2cap_pdu_in(&l2cap->l2cap, data, len);
1304 const uint8_t *data, int start, int len)
1313 l2cap_pdu_in(l2cap, data, len);