Lines Matching full:buf
72 struct net_buf *buf; in bt_rpmsg_evt_recv() local
93 buf = bt_buf_get_evt(hdr.evt, discardable, discardable ? K_NO_WAIT : K_SECONDS(10)); in bt_rpmsg_evt_recv()
94 if (!buf) { in bt_rpmsg_evt_recv()
97 return buf; in bt_rpmsg_evt_recv()
101 } while (!buf); in bt_rpmsg_evt_recv()
103 net_buf_add_mem(buf, &hdr, sizeof(hdr)); in bt_rpmsg_evt_recv()
105 buf_tailroom = net_buf_tailroom(buf); in bt_rpmsg_evt_recv()
108 net_buf_unref(buf); in bt_rpmsg_evt_recv()
112 net_buf_add_mem(buf, data, remaining); in bt_rpmsg_evt_recv()
114 return buf; in bt_rpmsg_evt_recv()
120 struct net_buf *buf; in bt_rpmsg_acl_recv() local
128 buf = bt_buf_get_rx(BT_BUF_ACL_IN, K_NO_WAIT); in bt_rpmsg_acl_recv()
129 if (buf) { in bt_rpmsg_acl_recv()
134 net_buf_add_mem(buf, &hdr, sizeof(hdr)); in bt_rpmsg_acl_recv()
142 net_buf_unref(buf); in bt_rpmsg_acl_recv()
146 buf_tailroom = net_buf_tailroom(buf); in bt_rpmsg_acl_recv()
149 net_buf_unref(buf); in bt_rpmsg_acl_recv()
154 net_buf_add_mem(buf, data, remaining); in bt_rpmsg_acl_recv()
156 return buf; in bt_rpmsg_acl_recv()
162 struct net_buf *buf; in bt_rpmsg_iso_recv() local
170 buf = bt_buf_get_rx(BT_BUF_ISO_IN, K_NO_WAIT); in bt_rpmsg_iso_recv()
171 if (buf) { in bt_rpmsg_iso_recv()
176 net_buf_add_mem(buf, &hdr, sizeof(hdr)); in bt_rpmsg_iso_recv()
184 net_buf_unref(buf); in bt_rpmsg_iso_recv()
188 buf_tailroom = net_buf_tailroom(buf); in bt_rpmsg_iso_recv()
191 net_buf_unref(buf); in bt_rpmsg_iso_recv()
196 net_buf_add_mem(buf, data, remaining); in bt_rpmsg_iso_recv()
198 return buf; in bt_rpmsg_iso_recv()
204 struct net_buf *buf = NULL; in bt_rpmsg_rx() local
214 buf = bt_rpmsg_evt_recv(data, remaining); in bt_rpmsg_rx()
218 buf = bt_rpmsg_acl_recv(data, remaining); in bt_rpmsg_rx()
222 buf = bt_rpmsg_iso_recv(data, remaining); in bt_rpmsg_rx()
230 if (buf) { in bt_rpmsg_rx()
231 LOG_DBG("Calling bt_recv(%p)", buf); in bt_rpmsg_rx()
243 bt_recv(buf); in bt_rpmsg_rx()
246 LOG_HEXDUMP_DBG(buf->data, buf->len, "RX buf payload:"); in bt_rpmsg_rx()
250 static int bt_rpmsg_send(struct net_buf *buf) in bt_rpmsg_send() argument
255 LOG_DBG("buf %p type %u len %u", buf, bt_buf_get_type(buf), buf->len); in bt_rpmsg_send()
257 switch (bt_buf_get_type(buf)) { in bt_rpmsg_send()
268 LOG_ERR("Unknown type %u", bt_buf_get_type(buf)); in bt_rpmsg_send()
271 net_buf_push_u8(buf, pkt_indicator); in bt_rpmsg_send()
273 LOG_HEXDUMP_DBG(buf->data, buf->len, "Final HCI buffer:"); in bt_rpmsg_send()
274 err = ipc_service_send(&hci_ept, buf->data, buf->len); in bt_rpmsg_send()
280 net_buf_unref(buf); in bt_rpmsg_send()