Lines Matching refs:len
114 size = (skb) ? skb->len + count : count; in cmtp_add_msgpart()
122 if (skb && (skb->len > 0)) in cmtp_add_msgpart()
123 skb_copy_from_linear_data(skb, skb_put(nskb, skb->len), skb->len); in cmtp_add_msgpart()
135 __u16 len; in cmtp_recv_frame() local
137 BT_DBG("session %p skb %p len %d", session, skb, skb->len); in cmtp_recv_frame()
139 while (skb->len > 0) { in cmtp_recv_frame()
145 len = skb->data[1]; in cmtp_recv_frame()
149 len = skb->data[1] | (skb->data[2] << 8); in cmtp_recv_frame()
153 len = 0; in cmtp_recv_frame()
159 BT_DBG("hdr 0x%02x hdrlen %d len %d id %d", hdr, hdrlen, len, id); in cmtp_recv_frame()
161 if (hdrlen + len > skb->len) { in cmtp_recv_frame()
166 if (len == 0) { in cmtp_recv_frame()
173 cmtp_add_msgpart(session, id, skb->data + hdrlen, len); in cmtp_recv_frame()
178 cmtp_add_msgpart(session, id, skb->data + hdrlen, len); in cmtp_recv_frame()
186 skb_pull(skb, hdrlen + len); in cmtp_recv_frame()
193 static int cmtp_send_frame(struct cmtp_session *session, unsigned char *data, int len) in cmtp_send_frame() argument
196 struct kvec iv = { data, len }; in cmtp_send_frame()
199 BT_DBG("session %p data %p len %d", session, data, len); in cmtp_send_frame()
201 if (!len) in cmtp_send_frame()
206 return kernel_sendmsg(sock, &msg, &iv, 1, len); in cmtp_send_frame()
226 tail = session->mtu - nskb->len; in cmtp_process_transmit()
228 cmtp_send_frame(session, nskb->data, nskb->len); in cmtp_process_transmit()
233 size = min_t(uint, ((tail < 258) ? (tail - 2) : (tail - 3)), skb->len); in cmtp_process_transmit()
247 | ((skb->len == size) ? 0x00 : 0x01); in cmtp_process_transmit()
253 | ((skb->len == size) ? 0x00 : 0x01); in cmtp_process_transmit()
261 if (skb->len > 0) { in cmtp_process_transmit()
266 cmtp_send_frame(session, nskb->data, nskb->len); in cmtp_process_transmit()
273 cmtp_send_frame(session, nskb->data, nskb->len); in cmtp_process_transmit()