Lines Matching refs:buf

43 static void hci_rx_buf_destroy(struct net_buf *buf)  in hci_rx_buf_destroy()  argument
45 net_buf_destroy(buf); in hci_rx_buf_destroy()
82 struct net_buf *buf; in bt_buf_get_rx() local
94 buf = net_buf_alloc(&hci_rx_pool, timeout); in bt_buf_get_rx()
95 if (!buf) { in bt_buf_get_rx()
96 return buf; in bt_buf_get_rx()
99 net_buf_add_u8(buf, bt_buf_type_to_h4(type)); in bt_buf_get_rx()
101 return buf; in bt_buf_get_rx()
113 struct net_buf *buf; in bt_buf_get_tx() local
132 buf = net_buf_alloc(pool, timeout); in bt_buf_get_tx()
133 if (!buf) { in bt_buf_get_tx()
134 return buf; in bt_buf_get_tx()
137 net_buf_add_u8(buf, bt_buf_type_to_h4(type)); in bt_buf_get_tx()
140 if (net_buf_tailroom(buf) < size) { in bt_buf_get_tx()
141 net_buf_unref(buf); in bt_buf_get_tx()
145 net_buf_add_mem(buf, data, size); in bt_buf_get_tx()
148 return buf; in bt_buf_get_tx()
159 int bt_hci_recv(const struct device *dev, struct net_buf *buf) in bt_hci_recv() argument
161 uint8_t type = buf->data[0]; in bt_hci_recv()
165 LOG_DBG("buf %p len %u", buf, buf->len); in bt_hci_recv()
167 bt_monitor_send(bt_monitor_opcode(type, BT_MONITOR_RX), buf->data + 1, buf->len - 1); in bt_hci_recv()
169 k_fifo_put(raw_rx, buf); in bt_hci_recv()
174 int bt_send(struct net_buf *buf) in bt_send() argument
176 if (buf->len == 0) { in bt_send()
180 LOG_DBG("buf %p type %u len %u", buf, buf->data[0], buf->len); in bt_send()
182 bt_monitor_send(bt_monitor_opcode(buf->data[0], BT_MONITOR_TX), in bt_send()
183 buf->data + 1, buf->len - 1); in bt_send()
185 return bt_hci_send(bt_dev.hci, buf); in bt_send()