This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 347cb6074a920194d22ee561b4b2361883f53037 Author: Bowen Wang <[email protected]> AuthorDate: Wed Nov 18 23:07:31 2026 +0800 include/nuttx/rpmsg/rpmsg.h: add the rpmsg ctrldev and eptdev ioctls Add the ioctl commands and struct rpmsg_endpoint_info of the Linux <linux/rpmsg.h> interface, for the rpmsg char driver that follows: RPMSG_CREATE_EPT_IOCTL, RPMSG_CREATE_DEV_IOCTL and RPMSG_RELEASE_DEV_IOCTL on the rpmsg device, RPMSG_DESTROY_EPT_IOCTL and the flow control ioctls on an endpoint device. Signed-off-by: Bowen Wang <[email protected]> --- include/nuttx/rpmsg/rpmsg.h | 51 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/include/nuttx/rpmsg/rpmsg.h b/include/nuttx/rpmsg/rpmsg.h index 4126400611c..062983191e2 100644 --- a/include/nuttx/rpmsg/rpmsg.h +++ b/include/nuttx/rpmsg/rpmsg.h @@ -45,22 +45,34 @@ * Pre-processor Definitions ****************************************************************************/ -#define RPMSGIOC_PANIC _RPMSGIOC(1) -#define RPMSGIOC_DUMP _RPMSGIOC(2) -#define RPMSGIOC_PING _RPMSGIOC(3) -#define RPMSGIOC_TEST _RPMSGIOC(4) -#define RPMSGIOC_RUNNING _RPMSGIOC(5) -#define RPMSGIOC_ACQUIRE_WAKELOCK _RPMSGIOC(6) -#define RPMSGIOC_RELEASE_WAKELOCK _RPMSGIOC(7) +#define RPMSGIOC_PANIC _RPMSGIOC(1) +#define RPMSGIOC_DUMP _RPMSGIOC(2) +#define RPMSGIOC_PING _RPMSGIOC(3) +#define RPMSGIOC_TEST _RPMSGIOC(4) +#define RPMSGIOC_RUNNING _RPMSGIOC(5) +#define RPMSGIOC_ACQUIRE_WAKELOCK _RPMSGIOC(6) +#define RPMSGIOC_RELEASE_WAKELOCK _RPMSGIOC(7) -#define RPMSG_SIGNAL_RUNNING TIOCM_CD +/* Rpmsg IOCTL for the rpmsg ctrldev */ + +#define RPMSG_CREATE_EPT_IOCTL _RPMSGIOC(8) +#define RPMSG_CREATE_DEV_IOCTL _RPMSGIOC(9) +#define RPMSG_RELEASE_DEV_IOCTL _RPMSGIOC(10) + +/* Rpmsg IOCTL for the rpmsg eptdev */ + +#define RPMSG_DESTROY_EPT_IOCTL _RPMSGIOC(11) +#define RPMSG_GET_OUTGOING_FLOWCONTROL _RPMSGIOC(12) +#define RPMSG_SET_INCOMING_FLOWCONTROL _RPMSGIOC(13) + +#define RPMSG_SIGNAL_RUNNING TIOCM_CD #if CONFIG_RPMSG_POOL_COUNT <= 0 -# define rpmsg_pool_alloc(size) alloca(size) +# define rpmsg_pool_alloc(size) alloca(size) # define rpmsg_pool_free(addr) #endif -#define rpmsg_wait(e, s) rpmsg_tickwait(e, s, CLOCK_MAX) +#define rpmsg_wait(e, s) rpmsg_tickwait(e, s, CLOCK_MAX) /**************************************************************************** * Public Types @@ -76,6 +88,25 @@ struct rpmsg_ping_s int sleep; /* unit: ms */ }; +/* Used for ioctl RPMSG_CREATE_EPT_IOCTL, RPMSG_CREATE_DEV_IOCTL and + * RPMSG_RELEASE_DEV_IOCTL + */ + +struct rpmsg_endpoint_info +{ + /* Name of rpmsg service */ + + char name[RPMSG_NAME_SIZE]; + + /* Local address. To set to RPMSG_ADDR_ANY if not used. */ + + uint32_t src; + + /* Destination address. To set to RPMSG_ADDR_ANY if not used. */ + + uint32_t dst; +}; + struct rpmsg_timestamp_s { uint64_t tx_nsec;
