From d7f3e41b1399e950eba9bcb5e87afe20ffa4ce98 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 18 Dec 2024 01:09:41 +0800 Subject: [PATCH] Revert "rptun/rptun_ivshmem:add restart cmd to reboot slave" This reverts commit 4fa1c460d343171ab92fad7eeb249ec033a53b7d. to reducing the complexity of rptun driver. Signed-off-by: Xiang Xiao --- drivers/rptun/rptun_ivshmem.c | 37 ----------------------------------- include/nuttx/rptun/rptun.h | 2 -- 2 files changed, 39 deletions(-) diff --git a/drivers/rptun/rptun_ivshmem.c b/drivers/rptun/rptun_ivshmem.c index 57f46177473..2e2c5a88432 100644 --- a/drivers/rptun/rptun_ivshmem.c +++ b/drivers/rptun/rptun_ivshmem.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include @@ -289,38 +288,6 @@ static int rptun_ivshmem_register_callback(FAR struct rptun_dev_s *dev, return 0; } -/**************************************************************************** - * Name: rptun_ivshmem_check_cmd - ****************************************************************************/ - -static void rptun_ivshmem_check_cmd(FAR struct rptun_ivshmem_dev_s *priv) -{ - FAR struct rptun_cmd_s *rptun_cmd = RPTUN_RSC2CMD(&priv->shmem->rsc); - uint32_t cmd; - - if (priv->master) - { - cmd = RPTUN_GET_CMD(rptun_cmd->cmd_slave); - rptun_cmd->cmd_slave = RPTUN_CMD(RPTUN_CMD_DEFAULT, 0); - } - else - { - cmd = RPTUN_GET_CMD(rptun_cmd->cmd_master); - rptun_cmd->cmd_master = RPTUN_CMD(RPTUN_CMD_DEFAULT, 0); - } - - switch (cmd) - { - case RPTUN_CMD_RESTART: -#ifdef CONFIG_BOARDCTL_RESET - board_reset(0); -#endif - break; - default: - break; - } -} - /**************************************************************************** * Name: rptun_ivshmem_interrupt ****************************************************************************/ @@ -329,8 +296,6 @@ static int rptun_ivshmem_interrupt(int irq, FAR void *context, FAR void *arg) { FAR struct rptun_ivshmem_dev_s *priv = arg; - rptun_ivshmem_check_cmd(priv); - if (priv->callback != NULL) { priv->callback(priv->arg, RPTUN_NOTIFY_ALL); @@ -349,8 +314,6 @@ static void rptun_ivshmem_wdog(wdparm_t arg) (FAR struct rptun_ivshmem_dev_s *)arg; bool should_notify = false; - rptun_ivshmem_check_cmd(priv); - if (priv->master && priv->seq != priv->shmem->seqs) { priv->seq = priv->shmem->seqs; diff --git a/include/nuttx/rptun/rptun.h b/include/nuttx/rptun/rptun.h index 626623e921f..904db963c75 100644 --- a/include/nuttx/rptun/rptun.h +++ b/include/nuttx/rptun/rptun.h @@ -50,11 +50,9 @@ #define RPTUN_NOTIFY_ALL (UINT32_MAX - 0) -#define RPTUN_CMD_DEFAULT 0x0 #define RPTUN_CMD_PANIC 0x1 #define RPTUN_CMD_STOP 0x2 #define RPTUN_CMD_READY 0x3 -#define RPTUN_CMD_RESTART 0x4 #define RPTUN_CMD_MASK 0xffff #define RPTUN_CMD_SHIFT 16