Home
last modified time | relevance | path

Searched full:nb (Results 1 – 25 of 104) sorted by relevance

12345

/Zephyr-Core-3.5.0/subsys/mgmt/mcumgr/grp/os_mgmt_client/src/
Dos_mgmt_client.c43 static int reset_res_fn(struct net_buf *nb, void *user_data) in reset_res_fn() argument
45 if (!nb) { in reset_res_fn()
56 struct net_buf *nb; in os_mgmt_client_reset() local
62 nb = smp_client_buf_allocation(active_client->smp_client, MGMT_GROUP_ID_OS, in os_mgmt_client_reset()
64 if (!nb) { in os_mgmt_client_reset()
69 rc = smp_client_send_cmd(active_client->smp_client, nb, reset_res_fn, in os_mgmt_client_reset()
73 smp_packet_free(nb); in os_mgmt_client_reset()
89 static int echo_res_fn(struct net_buf *nb, void *user_data) in echo_res_fn() argument
100 if (!nb) { in echo_res_fn()
107 zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data, nb->len, 1); in echo_res_fn()
[all …]
/Zephyr-Core-3.5.0/subsys/mgmt/mcumgr/smp_client/src/
Dclient.c29 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 = net_buf_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 net_buf_put(&entry->smp_client->tx_fifo, entry->nb); in smp_client_transport_work_fn()
170 smp_client_buf_free(cmd_req->nb); in smp_client_cmd_req_free()
171 cmd_req->nb = NULL; in smp_client_cmd_req_free()
193 smp_read_hdr(cmd_req->nb, &smp_header); in smp_client_response_discover()
[all …]
/Zephyr-Core-3.5.0/tests/subsys/mgmt/mcumgr/mcumgr_client/src/
Dos_gr_stub.c32 struct net_buf *nb; in os_reset_response() local
34 nb = smp_response_buf_allocation(); in os_reset_response()
35 if (nb) { in os_reset_response()
36 nb->len = 0; in os_reset_response()
42 struct net_buf *nb; in os_echo_response() local
46 nb = smp_response_buf_allocation(); in os_echo_response()
48 if (!nb) { in os_echo_response()
52 zcbor_new_encode_state(zse, ARRAY_SIZE(zse), nb->data, net_buf_tailroom(nb), 0); in os_echo_response()
68 nb->len = zse->payload - nb->data; in os_echo_response()
72 void os_echo_verify(struct net_buf *nb) in os_echo_verify() argument
[all …]
Dimg_gr_stub.c43 struct net_buf *nb; in img_upload_response() local
47 nb = smp_response_buf_allocation(); in img_upload_response()
49 if (!nb) { in img_upload_response()
53 zcbor_new_encode_state(zse, ARRAY_SIZE(zse), nb->data, net_buf_tailroom(nb), 0); in img_upload_response()
70 nb->len = zse->payload - nb->data; in img_upload_response()
76 struct net_buf *nb; in img_fail_response() local
80 nb = smp_response_buf_allocation(); in img_fail_response()
82 if (!nb) { in img_fail_response()
86 zcbor_new_encode_state(zse, ARRAY_SIZE(zse), nb->data, net_buf_tailroom(nb), 0); in img_fail_response()
94 nb->len = zse->payload - nb->data; in img_fail_response()
[all …]
Dsmp_stub.c58 void smp_transport_read_hdr(const struct net_buf *nb, struct smp_hdr *dst_hdr) in smp_transport_read_hdr() argument
60 memcpy(dst_hdr, nb->data, sizeof(*dst_hdr)); in smp_transport_read_hdr()
66 static uint16_t smp_uart_get_mtu(const struct net_buf *nb) in smp_uart_get_mtu() argument
71 static int smp_uart_tx_pkt(struct net_buf *nb) in smp_uart_tx_pkt() argument
78 memcpy(&res_hdr, nb->data, sizeof(res_hdr)); in smp_uart_tx_pkt()
85 rx_verify_cb(nb); in smp_uart_tx_pkt()
89 net_buf_unref(nb); in smp_uart_tx_pkt()
/Zephyr-Core-3.5.0/subsys/mgmt/mcumgr/grp/img_mgmt_client/src/
Dimg_mgmt_client.c47 static int image_state_res_fn(struct net_buf *nb, void *user_data) in image_state_res_fn() argument
72 if (!nb) { in image_state_res_fn()
77 zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data, nb->len, 1); in image_state_res_fn()
187 static int image_upload_res_fn(struct net_buf *nb, void *user_data) in image_upload_res_fn() argument
199 if (!nb) { in image_upload_res_fn()
204 zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data, nb->len, 1); in image_upload_res_fn()
221 static int erase_res_fn(struct net_buf *nb, void *user_data) in erase_res_fn() argument
231 if (!nb) { in erase_res_fn()
236 zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data, nb->len, 1); in erase_res_fn()
334 struct net_buf *nb; in img_mgmt_client_upload() local
[all …]
/Zephyr-Core-3.5.0/subsys/mgmt/mcumgr/transport/src/
Dsmp_dummy.c92 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()
[all …]
Dsmp.c51 void smp_packet_free(struct net_buf *nb) in smp_packet_free() argument
53 net_buf_unref(nb); in smp_packet_free()
110 smp_process_packet(struct smp_transport *smpt, struct net_buf *nb) in smp_process_packet() argument
123 rc = smp_process_request_packet(&streamer, nb); in smp_process_packet()
134 struct net_buf *nb; in smp_handle_reqs() local
139 while ((nb = net_buf_get(&smpt->fifo, K_NO_WAIT)) != NULL) { in smp_handle_reqs()
140 smp_process_packet(smpt, nb); in smp_handle_reqs()
197 * @param nb The request packet to process.
200 smp_rx_req(struct smp_transport *smpt, struct net_buf *nb) in smp_rx_req() argument
202 net_buf_put(&smpt->fifo, nb); in smp_rx_req()
[all …]
Dserial_util.c22 if (rx_ctxt->nb != NULL) { in mcumgr_serial_free_rx_ctxt()
23 smp_packet_free(rx_ctxt->nb); in mcumgr_serial_free_rx_ctxt()
24 rx_ctxt->nb = NULL; in mcumgr_serial_free_rx_ctxt()
35 if (rx_ctxt->nb->len < 2) { in mcumgr_serial_extract_len()
39 rx_ctxt->pkt_len = net_buf_pull_be16(rx_ctxt->nb); in mcumgr_serial_extract_len()
49 rc = base64_decode(rx_ctxt->nb->data + rx_ctxt->nb->len, in mcumgr_serial_decode_frag()
50 net_buf_tailroom(rx_ctxt->nb), &dec_len, in mcumgr_serial_decode_frag()
56 rx_ctxt->nb->len += dec_len; in mcumgr_serial_decode_frag()
72 struct net_buf *nb; in mcumgr_serial_process_frag() local
77 if (rx_ctxt->nb == NULL) { in mcumgr_serial_process_frag()
[all …]
Dsmp_uart.c43 struct net_buf *nb; in smp_uart_process_frag() local
48 nb = mcumgr_serial_process_frag(&smp_uart_rx_ctxt, in smp_uart_process_frag()
57 if (nb != NULL) { in smp_uart_process_frag()
58 smp_rx_req(&smp_uart_transport, nb); in smp_uart_process_frag()
81 static uint16_t smp_uart_get_mtu(const struct net_buf *nb) in smp_uart_get_mtu() argument
86 static int smp_uart_tx_pkt(struct net_buf *nb) in smp_uart_tx_pkt() argument
90 rc = uart_mcumgr_send(nb->data, nb->len); in smp_uart_tx_pkt()
91 smp_packet_free(nb); in smp_uart_tx_pkt()
Dsmp_udp.c116 static int smp_udp4_tx(struct net_buf *nb) in smp_udp4_tx() argument
119 struct sockaddr *addr = net_buf_user_data(nb); in smp_udp4_tx()
121 ret = sendto(configs.ipv4.sock, nb->data, nb->len, 0, addr, sizeof(*addr)); in smp_udp4_tx()
129 smp_packet_free(nb); in smp_udp4_tx()
136 static int smp_udp6_tx(struct net_buf *nb) in smp_udp6_tx() argument
139 struct sockaddr *addr = net_buf_user_data(nb); in smp_udp6_tx()
141 ret = sendto(configs.ipv6.sock, nb->data, nb->len, 0, addr, sizeof(*addr)); in smp_udp6_tx()
149 smp_packet_free(nb); in smp_udp6_tx()
155 static uint16_t smp_udp_get_mtu(const struct net_buf *nb) in smp_udp_get_mtu() argument
157 ARG_UNUSED(nb); in smp_udp_get_mtu()
[all …]
Dsmp_bt.c306 struct net_buf *nb; in smp_bt_chr_write() local
313 nb = smp_packet_alloc(); in smp_bt_chr_write()
314 if (!nb) { in smp_bt_chr_write()
319 if (net_buf_tailroom(nb) < len) { in smp_bt_chr_write()
321 len, net_buf_tailroom(nb)); in smp_bt_chr_write()
322 smp_packet_free(nb); in smp_bt_chr_write()
326 net_buf_add_mem(nb, buf, len); in smp_bt_chr_write()
328 ud = net_buf_user_data(nb); in smp_bt_chr_write()
336 smp_rx_req(&smp_bt_transport, nb); in smp_bt_chr_write()
388 static struct bt_conn *smp_bt_conn_from_pkt(const struct net_buf *nb) in smp_bt_conn_from_pkt() argument
[all …]
Dsmp_shell.c190 struct net_buf *nb; in smp_shell_process() local
198 nb = mcumgr_serial_process_frag(&smp_shell_rx_ctxt, in smp_shell_process()
201 if (nb != NULL) { in smp_shell_process()
202 smp_rx_req(&smp_shell_transport, nb); in smp_shell_process()
209 static uint16_t smp_shell_get_mtu(const struct net_buf *nb) in smp_shell_get_mtu() argument
230 static int smp_shell_tx_pkt(struct net_buf *nb) in smp_shell_tx_pkt() argument
234 rc = mcumgr_serial_tx_pkt(nb->data, nb->len, smp_shell_tx_raw); in smp_shell_tx_pkt()
235 smp_packet_free(nb); in smp_shell_tx_pkt()
/Zephyr-Core-3.5.0/tests/subsys/mgmt/mcumgr/smp_version/src/
Dmain.c63 static struct net_buf *nb; variable
146 nb = smp_dummy_get_outgoing(); in ZTEST()
150 zassert_equal(sizeof(response_old), nb->len, "Expected received data length mismatch"); in ZTEST()
151 zassert_mem_equal(response_old, nb->data, nb->len, "Expected received data mismatch"); in ZTEST()
154 smp_header = net_buf_pull_mem(nb, sizeof(struct smp_hdr)); in ZTEST()
158 zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1); in ZTEST()
233 nb = smp_dummy_get_outgoing(); in ZTEST()
237 zassert_equal(sizeof(response_current), nb->len, "Expected received data length mismatch"); in ZTEST()
238 zassert_mem_equal(response_current, nb->data, nb->len, "Expected received data mismatch"); in ZTEST()
241 smp_header = net_buf_pull_mem(nb, sizeof(struct smp_hdr)); in ZTEST()
[all …]
/Zephyr-Core-3.5.0/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/
Dlimited.c30 static struct net_buf *nb; variable
79 nb = smp_dummy_get_outgoing(); in ZTEST()
83 (void)net_buf_pull(nb, sizeof(struct smp_hdr)); in ZTEST()
84 zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1); in ZTEST()
145 nb = smp_dummy_get_outgoing(); in ZTEST()
149 (void)net_buf_pull(nb, sizeof(struct smp_hdr)); in ZTEST()
150 zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1); in ZTEST()
158 zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1); in ZTEST()
170 if (nb != NULL) { in cleanup_test()
171 net_buf_unref(nb); in cleanup_test()
[all …]
Dmain.c60 static struct net_buf *nb; variable
246 nb = smp_dummy_get_outgoing(); in ZTEST()
249 zassert_equal(sizeof(expected_response), nb->len, in ZTEST()
251 nb->len); in ZTEST()
253 zassert_mem_equal(expected_response, nb->data, nb->len, in ZTEST()
256 net_buf_unref(nb); in ZTEST()
284 nb = smp_dummy_get_outgoing(); in ZTEST()
287 zassert_equal(sizeof(expected_response), nb->len, in ZTEST()
289 nb->len); in ZTEST()
291 zassert_mem_equal(expected_response, nb->data, nb->len, in ZTEST()
[all …]
Dbuild_date.c30 static struct net_buf *nb; variable
119 nb = smp_dummy_get_outgoing(); in ZTEST()
123 (void)net_buf_pull(nb, sizeof(struct smp_hdr)); in ZTEST()
124 zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1); in ZTEST()
195 nb = smp_dummy_get_outgoing(); in ZTEST()
199 (void)net_buf_pull(nb, sizeof(struct smp_hdr)); in ZTEST()
200 zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1); in ZTEST()
251 if (nb != NULL) { in cleanup_test()
252 net_buf_unref(nb); in cleanup_test()
253 nb = NULL; in cleanup_test()
/Zephyr-Core-3.5.0/include/zephyr/mgmt/mcumgr/smp/
Dsmp_client.h48 * @param nb net_buf for response
54 typedef int (*smp_client_res_fn)(struct net_buf *nb, void *user_data);
59 * @param nb response net_buf
65 int smp_client_single_response(struct net_buf *nb, const struct smp_hdr *res_hdr);
85 * @param nb The net_buf to free.
87 void smp_client_buf_free(struct net_buf *nb);
93 * @param nb net_buf packet for send
102 int smp_client_send_cmd(struct smp_client_object *smp_client, struct net_buf *nb,
/Zephyr-Core-3.5.0/tests/subsys/mgmt/mcumgr/smp_client/src/
Dsmp_transport_stub.c20 void smp_transport_read_hdr(const struct net_buf *nb, struct smp_hdr *dst_hdr) in smp_transport_read_hdr() argument
22 memcpy(dst_hdr, nb->data, sizeof(*dst_hdr)); in smp_transport_read_hdr()
30 static uint16_t smp_uart_get_mtu(const struct net_buf *nb) in smp_uart_get_mtu() argument
35 static int smp_uart_tx_pkt(struct net_buf *nb) in smp_uart_tx_pkt() argument
37 smp_packet_free(nb); in smp_uart_tx_pkt()
Dmain.c28 int smp_client_res_cb(struct net_buf *nb, void *user_data) in smp_client_res_cb() argument
30 res_buf = nb; in smp_client_res_cb()
61 struct net_buf *nb; in ZTEST() local
65 nb = smp_client_buf_allocation(&smp_client, MGMT_GROUP_ID_IMAGE, 1, MGMT_OP_WRITE, in ZTEST()
67 zassert_not_null(nb, "Buffer was Null"); in ZTEST()
68 rc = smp_client_send_cmd(&smp_client, nb, smp_client_res_cb, &testing_user_data, 2); in ZTEST()
/Zephyr-Core-3.5.0/tests/subsys/mgmt/mcumgr/settings_mgmt/src/
Dmain.c38 static struct net_buf *nb; variable
79 if (nb != NULL) { in cleanup_test()
80 net_buf_unref(nb); in cleanup_test()
81 nb = NULL; in cleanup_test()
137 nb = smp_dummy_get_outgoing(); in ZTEST()
141 zassert_equal(nb->len, TEST_RESPONSE_OK_LENGTH, "SMP response mismatch"); in ZTEST()
142 header = (struct smp_hdr *)nb->data; in ZTEST()
152 zassert_mem_equal(&nb->data[(TEST_RESPONSE_OK_LENGTH - TEST_RESPONSE_OK_DATA_LENGTH)], in ZTEST()
191 nb = smp_dummy_get_outgoing(); in ZTEST()
195 zassert_equal(nb->len, TEST_RESPONSE_ERROR_LENGTH, "SMP response mismatch"); in ZTEST()
[all …]
/Zephyr-Core-3.5.0/subsys/mgmt/mcumgr/smp/src/
Dsmp.c52 static void cbor_nb_reader_init(struct cbor_nb_reader *cnr, struct net_buf *nb) in cbor_nb_reader_init() argument
54 cnr->nb = nb; in cbor_nb_reader_init()
55 zcbor_new_decode_state(cnr->zs, ARRAY_SIZE(cnr->zs), nb->data, in cbor_nb_reader_init()
56 nb->len, 1); in cbor_nb_reader_init()
59 static void cbor_nb_writer_init(struct cbor_nb_writer *cnw, struct net_buf *nb) in cbor_nb_writer_init() argument
61 net_buf_reset(nb); in cbor_nb_writer_init()
62 cnw->nb = nb; in cbor_nb_writer_init()
63 cnw->nb->len = sizeof(struct smp_hdr); in cbor_nb_writer_init()
64 zcbor_new_encode_state(cnw->zs, ARRAY_SIZE(cnw->zs), nb->data + sizeof(struct smp_hdr), in cbor_nb_writer_init()
65 net_buf_tailroom(nb), 0); in cbor_nb_writer_init()
[all …]
/Zephyr-Core-3.5.0/tests/subsys/mgmt/mcumgr/os_mgmt_echo/src/
Dmain.c39 struct net_buf *nb; in ZTEST() local
55 nb = smp_dummy_get_outgoing(); in ZTEST()
58 zassert_equal(sizeof(expected_response), nb->len, in ZTEST()
60 nb->len); in ZTEST()
62 zassert_mem_equal(expected_response, nb->data, nb->len, in ZTEST()
/Zephyr-Core-3.5.0/tests/benchmarks/sched_userspace/src/
Dapp_threads.h25 #define DEFINE_THREADS_HELPER(nb) \ argument
26 K_THREAD_STACK_DEFINE(app_##nb##_stack, APP_STACKSIZE); \
27 K_APPMEM_PARTITION_DEFINE(app_##nb##_partition); \
28 K_APP_DMEM(app_##nb##_partition) int dummy##nb; /* Need data in each partition */
/Zephyr-Core-3.5.0/dts/bindings/dma/
Dst,stm32-dma.yaml34 for 2nd dma instance, offset is the nb of dma channels of the 1st dma,
35 for 3rd dma instance, offset is the nb of dma channels of the 2nd dma
36 plus the nb of dma channels of the 1st dma instance, etc.

12345