Lines Matching refs:nb
29 struct net_buf *nb; member
46 static void smp_read_hdr(const struct net_buf *nb, struct smp_hdr *dst_hdr);
56 struct net_buf *nb; in smp_client_handle_reqs() local
61 while ((nb = k_fifo_get(&smp_client->tx_fifo, K_NO_WAIT)) != NULL) { in smp_client_handle_reqs()
62 smpt->functions.output(nb); in smp_client_handle_reqs()
111 entry->nb = net_buf_ref(entry->nb); in smp_client_transport_work_fn()
114 k_fifo_put(&entry->smp_client->tx_fifo, entry->nb); in smp_client_transport_work_fn()
172 smp_client_buf_free(cmd_req->nb); in smp_client_cmd_req_free()
173 cmd_req->nb = NULL; in smp_client_cmd_req_free()
195 smp_read_hdr(cmd_req->nb, &smp_header); in smp_client_response_discover()
227 int smp_client_single_response(struct net_buf *nb, const struct smp_hdr *res_hdr) in smp_client_single_response() argument
244 cb(nb, user_data); in smp_client_single_response()
256 struct net_buf *nb; in smp_client_buf_allocation() local
259 nb = smp_packet_alloc(); in smp_client_buf_allocation()
261 if (nb) { in smp_client_buf_allocation()
265 memcpy(nb->data, &smp_header, sizeof(smp_header)); in smp_client_buf_allocation()
266 nb->len = sizeof(smp_header); in smp_client_buf_allocation()
268 return nb; in smp_client_buf_allocation()
271 void smp_client_buf_free(struct net_buf *nb) in smp_client_buf_free() argument
273 smp_packet_free(nb); in smp_client_buf_free()
276 static void smp_read_hdr(const struct net_buf *nb, struct smp_hdr *dst_hdr) in smp_read_hdr() argument
278 memcpy(dst_hdr, nb->data, sizeof(*dst_hdr)); in smp_read_hdr()
283 int smp_client_send_cmd(struct smp_client_object *smp_client, struct net_buf *nb, in smp_client_send_cmd() argument
298 smp_read_hdr(nb, &smp_header); in smp_client_send_cmd()
299 if (nb->len < sizeof(smp_header)) { in smp_client_send_cmd()
303 smp_header.nh_len = sys_cpu_to_be16(nb->len - sizeof(smp_header)); in smp_client_send_cmd()
305 memcpy(nb->data, &smp_header, sizeof(smp_header)); in smp_client_send_cmd()
315 cmd_req->nb = nb; in smp_client_send_cmd()
322 nb = net_buf_ref(nb); in smp_client_send_cmd()
324 k_fifo_put(&smp_client->tx_fifo, nb); in smp_client_send_cmd()