Lines Matching full:buf
44 struct net_buf *buf; member
68 struct net_buf *buf; member
181 static inline void copy_hdr(struct net_buf *buf) in copy_hdr() argument
183 net_buf_add_mem(buf, rx.hdr, rx.hdr_len); in copy_hdr()
215 struct net_buf *buf; in rx_thread() local
224 LOG_DBG("rx.buf %p", rx.buf); in rx_thread()
230 if (rx.have_hdr && !rx.buf) { in rx_thread()
231 rx.buf = get_rx(K_FOREVER); in rx_thread()
232 LOG_DBG("Got rx.buf %p", rx.buf); in rx_thread()
233 if (rx.remaining > net_buf_tailroom(rx.buf)) { in rx_thread()
238 copy_hdr(rx.buf); in rx_thread()
245 buf = net_buf_get(&rx.fifo, K_FOREVER); in rx_thread()
249 LOG_DBG("Calling bt_recv(%p)", buf); in rx_thread()
250 bt_recv(buf); in rx_thread()
259 buf = net_buf_get(&rx.fifo, K_NO_WAIT); in rx_thread()
260 } while (buf); in rx_thread()
266 uint8_t buf[33]; in h4_discard() local
269 err = uart_fifo_read(uart, buf, MIN(len, sizeof(buf))); in h4_discard()
280 struct net_buf *buf; in read_payload() local
284 if (!rx.buf) { in read_payload()
287 rx.buf = get_rx(K_NO_WAIT); in read_payload()
288 if (!rx.buf) { in read_payload()
301 LOG_DBG("Allocated rx.buf %p", rx.buf); in read_payload()
303 buf_tailroom = net_buf_tailroom(rx.buf); in read_payload()
311 copy_hdr(rx.buf); in read_payload()
314 read = uart_fifo_read(h4_dev, net_buf_tail(rx.buf), rx.remaining); in read_payload()
320 net_buf_add(rx.buf, read); in read_payload()
324 LOG_DBG("Payload (len %u): %s", rx.buf->len, bt_hex(rx.buf->data, rx.buf->len)); in read_payload()
330 buf = rx.buf; in read_payload()
331 rx.buf = NULL; in read_payload()
335 bt_buf_set_type(buf, BT_BUF_EVT); in read_payload()
338 bt_buf_set_type(buf, BT_BUF_ACL_IN); in read_payload()
345 LOG_DBG("Calling bt_recv_prio(%p)", buf); in read_payload()
346 bt_recv_prio(buf); in read_payload()
350 LOG_DBG("Putting buf %p to rx fifo", buf); in read_payload()
351 net_buf_put(&rx.fifo, buf); in read_payload()
378 if (rx.have_hdr && rx.buf) { in read_header()
379 if (rx.remaining > net_buf_tailroom(rx.buf)) { in read_header()
384 copy_hdr(rx.buf); in read_header()
393 if (!tx.buf) { in process_tx()
394 tx.buf = net_buf_get(&tx.fifo, K_NO_WAIT); in process_tx()
395 if (!tx.buf) { in process_tx()
403 switch (bt_buf_get_type(tx.buf)) { in process_tx()
429 bytes = uart_fifo_fill(h4_dev, tx.buf->data, tx.buf->len); in process_tx()
433 net_buf_pull(tx.buf, bytes); in process_tx()
436 if (tx.buf->len) { in process_tx()
442 net_buf_unref(tx.buf); in process_tx()
443 tx.buf = net_buf_get(&tx.fifo, K_NO_WAIT); in process_tx()
444 if (!tx.buf) { in process_tx()
451 LOG_DBG("remaining %u discard %u have_hdr %u rx.buf %p len %u", rx.remaining, rx.discard, in process_rx()
452 rx.have_hdr, rx.buf, rx.buf ? rx.buf->len : 0); in process_rx()
482 static int h4_send(struct net_buf *buf) in h4_send() argument
484 LOG_DBG("buf %p type %u len %u", buf, bt_buf_get_type(buf), buf->len); in h4_send()
486 net_buf_put(&tx.fifo, buf); in h4_send()