mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 06:39:01 +08:00
fs: rpmsgfs_client: add init message to unlock semaphore
Add INIT message which can be used in case ns_announcement isn't supported on the system. It unlocks the client flow by calling rpmsg_post() on the semaphore. Without this or an NS announcement, the client's semaphore will wait forever. This is practical when the server side is running from linux userspace using ioctl where controlling NS announcements is problematic. Signed-off-by: Andre Heinemans <andre.heinemans@nxp.com>
This commit is contained in:
committed by
Xiang Xiao
parent
faa4d7ff8d
commit
67f1cd288a
@@ -38,6 +38,7 @@
|
||||
|
||||
#define RPMSGFS_NAME_PREFIX "rpmsgfs-"
|
||||
|
||||
#define RPMSGFS_INIT 0 /* Only needed if NS announcements can't be used */
|
||||
#define RPMSGFS_OPEN 1
|
||||
#define RPMSGFS_CLOSE 2
|
||||
#define RPMSGFS_READ 3
|
||||
|
||||
@@ -80,6 +80,9 @@ static int rpmsgfs_statfs_handler(FAR struct rpmsg_endpoint *ept,
|
||||
static int rpmsgfs_stat_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv);
|
||||
static int rpmsgfs_init_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv);
|
||||
static void rpmsgfs_device_created(struct rpmsg_device *rdev,
|
||||
FAR void *priv_);
|
||||
static void rpmsgfs_device_destroy(struct rpmsg_device *rdev,
|
||||
@@ -98,6 +101,7 @@ static int rpmsgfs_send_recv(FAR struct rpmsgfs_s *priv,
|
||||
|
||||
static const rpmsg_ept_cb g_rpmsgfs_handler[] =
|
||||
{
|
||||
[RPMSGFS_INIT] = rpmsgfs_init_handler,
|
||||
[RPMSGFS_OPEN] = rpmsgfs_default_handler,
|
||||
[RPMSGFS_CLOSE] = rpmsgfs_default_handler,
|
||||
[RPMSGFS_READ] = rpmsgfs_read_handler,
|
||||
@@ -276,6 +280,15 @@ static int rpmsgfs_stat_handler(FAR struct rpmsg_endpoint *ept,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rpmsgfs_init_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct rpmsgfs_s *ept_priv = ept->priv;
|
||||
rpmsg_post(&ept_priv->ept, &ept_priv->wait);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static FAR void *rpmsgfs_get_tx_payload_buffer(FAR struct rpmsgfs_s *priv,
|
||||
FAR uint32_t *len)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user