Lines Matching refs:nb
92 struct net_buf *nb; in smp_dummy_process_frag() local
97 nb = mcumgr_dummy_process_frag(&smp_dummy_rx_ctxt, in smp_dummy_process_frag()
106 if (nb != NULL) { in smp_dummy_process_frag()
107 smp_rx_req(&smp_dummy_transport, nb); in smp_dummy_process_frag()
118 struct net_buf *nb; in smp_dummy_process_frag_outgoing() local
123 nb = mcumgr_dummy_process_frag_outgoing(&smp_dummy_tx_ctxt, in smp_dummy_process_frag_outgoing()
126 return nb; in smp_dummy_process_frag_outgoing()
153 static uint16_t smp_dummy_get_mtu(const struct net_buf *nb) in smp_dummy_get_mtu() argument
178 static int smp_dummy_tx_pkt_int(struct net_buf *nb) in smp_dummy_tx_pkt_int() argument
182 rc = mcumgr_dummy_tx_pkt(nb->data, nb->len, dummy_mcumgr_send_raw); in smp_dummy_tx_pkt_int()
183 smp_packet_free(nb); in smp_dummy_tx_pkt_int()
289 if (rx_ctxt->nb != NULL) { in mcumgr_dummy_free_rx_ctxt()
290 smp_packet_free(rx_ctxt->nb); in mcumgr_dummy_free_rx_ctxt()
291 rx_ctxt->nb = NULL; in mcumgr_dummy_free_rx_ctxt()
320 if (rx_ctxt->nb->len < 2) { in mcumgr_dummy_extract_len()
324 rx_ctxt->pkt_len = net_buf_pull_be16(rx_ctxt->nb); in mcumgr_dummy_extract_len()
334 rc = base64_decode(rx_ctxt->nb->data + rx_ctxt->nb->len, in mcumgr_dummy_decode_frag()
335 net_buf_tailroom(rx_ctxt->nb), &dec_len, in mcumgr_dummy_decode_frag()
341 rx_ctxt->nb->len += dec_len; in mcumgr_dummy_decode_frag()
361 struct net_buf *nb; in mcumgr_dummy_process_frag() local
366 if (rx_ctxt->nb == NULL) { in mcumgr_dummy_process_frag()
367 rx_ctxt->nb = smp_packet_alloc(); in mcumgr_dummy_process_frag()
368 if (rx_ctxt->nb == NULL) { in mcumgr_dummy_process_frag()
376 net_buf_reset(rx_ctxt->nb); in mcumgr_dummy_process_frag()
380 if (rx_ctxt->nb->len == 0U) { in mcumgr_dummy_process_frag()
406 if (rx_ctxt->nb->len < rx_ctxt->pkt_len) { in mcumgr_dummy_process_frag()
411 if (rx_ctxt->nb->len > rx_ctxt->pkt_len) { in mcumgr_dummy_process_frag()
417 crc = mcumgr_dummy_calc_crc(rx_ctxt->nb->data, rx_ctxt->nb->len); in mcumgr_dummy_process_frag()
424 rx_ctxt->nb->len -= 2U; in mcumgr_dummy_process_frag()
426 nb = rx_ctxt->nb; in mcumgr_dummy_process_frag()
427 rx_ctxt->nb = NULL; in mcumgr_dummy_process_frag()
428 return nb; in mcumgr_dummy_process_frag()
446 struct net_buf *nb; in mcumgr_dummy_process_frag_outgoing() local
451 if (tx_ctxt->nb == NULL) { in mcumgr_dummy_process_frag_outgoing()
452 tx_ctxt->nb = smp_packet_alloc(); in mcumgr_dummy_process_frag_outgoing()
453 if (tx_ctxt->nb == NULL) { in mcumgr_dummy_process_frag_outgoing()
461 net_buf_reset(tx_ctxt->nb); in mcumgr_dummy_process_frag_outgoing()
465 if (tx_ctxt->nb->len == 0U) { in mcumgr_dummy_process_frag_outgoing()
491 if (tx_ctxt->nb->len < tx_ctxt->pkt_len) { in mcumgr_dummy_process_frag_outgoing()
496 if (tx_ctxt->nb->len > tx_ctxt->pkt_len) { in mcumgr_dummy_process_frag_outgoing()
502 crc = mcumgr_dummy_calc_crc(tx_ctxt->nb->data, tx_ctxt->nb->len); in mcumgr_dummy_process_frag_outgoing()
509 tx_ctxt->nb->len -= 2U; in mcumgr_dummy_process_frag_outgoing()
511 nb = tx_ctxt->nb; in mcumgr_dummy_process_frag_outgoing()
512 tx_ctxt->nb = NULL; in mcumgr_dummy_process_frag_outgoing()
513 return nb; in mcumgr_dummy_process_frag_outgoing()