diff --git a/arch/sim/src/sim/up_head.c b/arch/sim/src/sim/up_head.c index 2b6faecb6c..6868c9af68 100644 --- a/arch/sim/src/sim/up_head.c +++ b/arch/sim/src/sim/up_head.c @@ -63,7 +63,7 @@ static char g_logbuffer[4096]; int main(int argc, char **argv, char **envp) { #ifdef CONFIG_SYSLOG_RPMSG - syslog_rpmsg_init_early("server", g_logbuffer, sizeof(g_logbuffer)); + syslog_rpmsg_init_early(g_logbuffer, sizeof(g_logbuffer)); #endif /* Start NuttX */ diff --git a/boards/sim/sim/sim/configs/rpproxy/defconfig b/boards/sim/sim/sim/configs/rpproxy/defconfig index ec2cae3732..cb151f9f83 100644 --- a/boards/sim/sim/sim/configs/rpproxy/defconfig +++ b/boards/sim/sim/sim/configs/rpproxy/defconfig @@ -59,6 +59,7 @@ CONFIG_SIM_M32=y CONFIG_SYSLOG_PREFIX=y CONFIG_SYSLOG_PREFIX_STRING="proxy: " CONFIG_SYSLOG_RPMSG=y +CONFIG_SYSLOG_RPMSG_SERVER_NAME="server" CONFIG_SYSLOG_TIMESTAMP=y CONFIG_SYSTEM_CLE=y CONFIG_SYSTEM_NSH=y diff --git a/drivers/syslog/Kconfig b/drivers/syslog/Kconfig index 2d3d129598..263e05671b 100644 --- a/drivers/syslog/Kconfig +++ b/drivers/syslog/Kconfig @@ -215,6 +215,13 @@ config SYSLOG_RPMSG ---help--- Use the rpmsg as a SYSLOG output device, send message to remote proc. +config SYSLOG_RPMSG_SERVER_NAME + string "The name of Syslog Rpmsg Server" + depends on SYSLOG_RPMSG + ---help--- + The proc name of rpmsg server. Client sends message to + specified name of remote proc. + config SYSLOG_DEFAULT bool "Default SYSLOG device" ---help--- diff --git a/drivers/syslog/syslog_rpmsg.c b/drivers/syslog/syslog_rpmsg.c index 4438e653b3..168ea1bbed 100644 --- a/drivers/syslog/syslog_rpmsg.c +++ b/drivers/syslog/syslog_rpmsg.c @@ -62,7 +62,6 @@ struct syslog_rpmsg_s struct work_s work; /* Used for deferred callback work */ struct rpmsg_endpoint ept; - FAR const char *cpuname; bool suspend; bool transfer; /* The transfer flag */ ssize_t trans_len; /* The data length when transfer */ @@ -210,7 +209,8 @@ static void syslog_rpmsg_device_created(FAR struct rpmsg_device *rdev, FAR struct syslog_rpmsg_s *priv = priv_; int ret; - if (priv->buffer && strcmp(priv->cpuname, rpmsg_get_cpuname(rdev)) == 0) + if (priv->buffer && strcmp(CONFIG_SYSLOG_RPMSG_SERVER_NAME, + rpmsg_get_cpuname(rdev)) == 0) { priv->ept.priv = priv; @@ -230,7 +230,8 @@ static void syslog_rpmsg_device_destroy(FAR struct rpmsg_device *rdev, { FAR struct syslog_rpmsg_s *priv = priv_; - if (priv->buffer && strcmp(priv->cpuname, rpmsg_get_cpuname(rdev)) == 0) + if (priv->buffer && strcmp(CONFIG_SYSLOG_RPMSG_SERVER_NAME, + rpmsg_get_cpuname(rdev)) == 0) { rpmsg_destroy_ept(&priv->ept); } @@ -343,15 +344,13 @@ ssize_t syslog_rpmsg_write(FAR struct syslog_channel_s *channel, return buflen; } -void syslog_rpmsg_init_early(FAR const char *cpuname, FAR void *buffer, - size_t size) +void syslog_rpmsg_init_early(FAR void *buffer, size_t size) { FAR struct syslog_rpmsg_s *priv = &g_syslog_rpmsg; char prev, cur; size_t i; size_t j; - priv->cpuname = cpuname; priv->buffer = buffer; priv->size = size; diff --git a/include/nuttx/syslog/syslog_rpmsg.h b/include/nuttx/syslog/syslog_rpmsg.h index e39307c678..ef16a74cca 100644 --- a/include/nuttx/syslog/syslog_rpmsg.h +++ b/include/nuttx/syslog/syslog_rpmsg.h @@ -40,8 +40,7 @@ extern "C" #endif #ifdef CONFIG_SYSLOG_RPMSG -void syslog_rpmsg_init_early(FAR const char *cpu_name, FAR void *buffer, - size_t size); +void syslog_rpmsg_init_early(FAR void *buffer, size_t size); int syslog_rpmsg_init(void); int syslog_rpmsg_putc(FAR struct syslog_channel_s *channel, int ch);