Zephyr Project API  3.1.0
A Scalable Open Source RTOS
smp.h
Go to the documentation of this file.
1/*
2 * Copyright Runtime.io 2018. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_MGMT_SMP_H_
8#define ZEPHYR_INCLUDE_MGMT_SMP_H_
9
10#include <zephyr/kernel.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
17struct net_buf;
18
30 struct net_buf *nb);
31
46
61 const struct net_buf *src);
62
72typedef void zephyr_smp_transport_ud_free_fn(void *ud);
73
78 /* Must be the first member. */
80
81 /* FIFO containing incoming requests to be processed. */
83
88
89#ifdef CONFIG_MCUMGR_SMP_REASSEMBLY
90 /* Packet reassembly internal data, API access only */
91 struct {
92 struct net_buf *current; /* net_buf used for reassembly */
93 uint16_t expected; /* expected bytes to come */
94 } __reassembly;
95#endif
96};
97
108 zephyr_smp_transport_out_fn *output_func,
111 zephyr_smp_transport_ud_free_fn *ud_free_func);
112
122void zephyr_smp_rx_req(struct zephyr_smp_transport *zst, struct net_buf *nb);
123
124#ifdef __cplusplus
125}
126#endif
127
128#endif
Public kernel APIs.
void zephyr_smp_rx_req(struct zephyr_smp_transport *zst, struct net_buf *nb)
Enqueues an incoming SMP request packet for processing.
void zephyr_smp_transport_ud_free_fn(void *ud)
SMP free buffer user_data function for Zephyr.
Definition: smp.h:72
int zephyr_smp_transport_out_fn(struct zephyr_smp_transport *zst, struct net_buf *nb)
SMP transmit function for Zephyr.
Definition: smp.h:29
int zephyr_smp_transport_ud_copy_fn(struct net_buf *dst, const struct net_buf *src)
SMP copy buffer user_data function for Zephyr.
Definition: smp.h:60
void zephyr_smp_transport_init(struct zephyr_smp_transport *zst, zephyr_smp_transport_out_fn *output_func, zephyr_smp_transport_get_mtu_fn *get_mtu_func, zephyr_smp_transport_ud_copy_fn *ud_copy_func, zephyr_smp_transport_ud_free_fn *ud_free_func)
Initializes a Zephyr SMP transport object.
uint16_t zephyr_smp_transport_get_mtu_fn(const struct net_buf *nb)
SMP MTU query function for Zephyr.
Definition: smp.h:45
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Definition: kernel.h:2186
A structure used to submit work.
Definition: kernel.h:3642
Network buffer representation.
Definition: buf.h:915
Provides Zephyr-specific functionality for sending SMP responses.
Definition: smp.h:77
struct k_work zst_work
Definition: smp.h:79
struct k_fifo zst_fifo
Definition: smp.h:82
zephyr_smp_transport_get_mtu_fn * zst_get_mtu
Definition: smp.h:85
zephyr_smp_transport_ud_copy_fn * zst_ud_copy
Definition: smp.h:86
zephyr_smp_transport_ud_free_fn * zst_ud_free
Definition: smp.h:87
zephyr_smp_transport_out_fn * zst_output
Definition: smp.h:84
static ZTEST_BMEM struct thread_data expected