From be892de35a5f9db4b4468a354aa6e43414e7e5f9 Mon Sep 17 00:00:00 2001 From: "Man, Jianting (Meco)" <920369182@qq.com> Date: Tue, 29 Mar 2022 01:39:55 -0400 Subject: [PATCH] [posix] add RT_USING_POSIX_SOCKET (#5731) --- bsp/qemu-vexpress-a9/drivers/Kconfig | 4 ++-- .../stm32f407-atk-explorer/board/Kconfig | 9 ++------- components/libc/posix/Kconfig | 6 ++++++ components/net/sal/Kconfig | 19 ++++++++----------- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/bsp/qemu-vexpress-a9/drivers/Kconfig b/bsp/qemu-vexpress-a9/drivers/Kconfig index 85fae65bb1..a4754bdab4 100644 --- a/bsp/qemu-vexpress-a9/drivers/Kconfig +++ b/bsp/qemu-vexpress-a9/drivers/Kconfig @@ -46,8 +46,8 @@ endif config BSP_DRV_EMAC bool "Enable EMAC driver" select RT_USING_LWIP - select RT_USING_SAL - select SAL_USING_POSIX + select RT_USING_POSIX_FS + select RT_USING_POSIX_SOCKET default n config BSP_DRV_AUDIO diff --git a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig index 3eddc0a442..84edfcddc7 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig +++ b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig @@ -83,13 +83,8 @@ menu "Onboard Peripheral Drivers" default n select RT_USING_LWIP select RT_LWIP_USING_HW_CHECKSUM - - config BSP_USING_ETH_SAL - bool "Enable Ethernet with SAL" - depends on BSP_USING_ETH - default y - select RT_USING_SAL - select SAL_USING_POSIX + select RT_USING_POSIX_FS + select RT_USING_POSIX_SOCKET config PHY_USING_LAN8720A bool diff --git a/components/libc/posix/Kconfig b/components/libc/posix/Kconfig index 411289baf6..ee2fd81a73 100644 --- a/components/libc/posix/Kconfig +++ b/components/libc/posix/Kconfig @@ -26,6 +26,12 @@ if RT_USING_POSIX_FS select RT_USING_POSIX_POLL default n + config RT_USING_POSIX_SOCKET + bool "Enable BSD Socket I/O " + select RT_USING_POSIX_SELECT + select RT_USING_SAL + default n + config RT_USING_POSIX_TERMIOS bool "Enable Terminal I/O " select RT_USING_POSIX_STDIO diff --git a/components/net/sal/Kconfig b/components/net/sal/Kconfig index 3836049333..8542f02a2e 100644 --- a/components/net/sal/Kconfig +++ b/components/net/sal/Kconfig @@ -35,19 +35,16 @@ if RT_USING_SAL endif config SAL_USING_POSIX - bool "Enable BSD socket operated by file system API" - default n - select RT_USING_POSIX_FS - select RT_USING_POSIX_SELECT + bool + depends on DFS_USING_POSIX + default y help + Enable BSD socket operated by file system API Let BSD socket operated by file system API, such as read/write and involveed in select/poll POSIX APIs. - if !SAL_USING_POSIX - - config SAL_SOCKETS_NUM - int "the maximum number of sockets" - default 16 - - endif + config SAL_SOCKETS_NUM + int "the maximum number of sockets" + depends on !SAL_USING_POSIX + default 16 endif