You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/08/15 14:28:07 UTC

[incubator-nuttx-apps] 03/03: wapi: Make the initial scan buffer configurable through Kconfig

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit a25f640e54f5f24e76019bea1b3d1fa01112785e
Author: zhanghongyu <zh...@xiaomi.com>
AuthorDate: Sat Apr 2 15:25:45 2022 +0800

    wapi: Make the initial scan buffer configurable through Kconfig
    
    The default value is 4KB which is same as IW_SCAN_MAX_DATA
    
    Signed-off-by: zhanghongyu <zh...@xiaomi.com>
---
 wireless/wapi/Kconfig        | 4 ++++
 wireless/wapi/src/wireless.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/wireless/wapi/Kconfig b/wireless/wapi/Kconfig
index 309f3366d..eed466f3c 100644
--- a/wireless/wapi/Kconfig
+++ b/wireless/wapi/Kconfig
@@ -36,6 +36,10 @@ config WIRELESS_WAPI_PRIORITY
 	int "Command Priority"
 	default 100
 
+config WIRELESS_WAPI_SCAN_MAX_DATA
+	int "Scan Cache Buffer Size (bytes)"
+	default 4096
+
 config WIRELESS_WAPI_INITCONF
 	bool "Wireless Configure Initialization"
 	default n
diff --git a/wireless/wapi/src/wireless.c b/wireless/wapi/src/wireless.c
index ee6db4a6a..96a946584 100644
--- a/wireless/wapi/src/wireless.c
+++ b/wireless/wapi/src/wireless.c
@@ -1292,7 +1292,7 @@ int wapi_scan_coll(int sock, FAR const char *ifname,
 
   WAPI_VALIDATE_PTR(aps);
 
-  buflen = IW_SCAN_MAX_DATA;
+  buflen = CONFIG_WIRELESS_WAPI_SCAN_MAX_DATA;
   buf = malloc(buflen * sizeof(char));
   if (!buf)
     {