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 2023/05/03 15:23:37 UTC

[nuttx] branch master updated (a514c0a13e -> 24ce51f137)

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

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


    from a514c0a13e mtd/nand: Implement isbad and markbad callback
     new a86a9dc09e esp32s3/wifi: fix Wi-Fi's NVS-like storage long filename error
     new 9ede7d4650 esp32s3/wifi: add support to WPA3 on Station Mode
     new 6e76229df2 esp32/wifi: remove debug features from Wi-Fi-related `defconfig`s
     new 28361a295d esp32/wifi: add support to WPA3 on Station Mode
     new 24ce51f137 documentation/esp32_esp32s3: update informations about Wi-Fi

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../xtensa/esp32/boards/esp32-audio-kit/index.rst  |  5 ++-
 .../xtensa/esp32/boards/esp32-devkitc/index.rst    | 11 ++++-
 .../esp32/boards/esp32-ethernet-kit/index.rst      |  5 ++-
 .../xtensa/esp32/boards/esp32-lyrat/index.rst      |  5 ++-
 .../xtensa/esp32/boards/esp32-wrover-kit/index.rst |  5 ++-
 Documentation/platforms/xtensa/esp32/index.rst     | 13 ++++++
 .../xtensa/esp32s3/boards/esp32s3-devkit/index.rst |  7 +++
 Documentation/platforms/xtensa/esp32s3/index.rst   |  7 +++
 arch/xtensa/src/esp32/esp32_wifi_adapter.c         | 51 +++++-----------------
 arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c     | 50 +++++----------------
 .../esp32-devkitc/configs/sta_softap/defconfig     |  7 +--
 .../esp32/esp32-devkitc/configs/wifi/defconfig     |  7 +--
 .../esp32s3-devkit/configs/sta_softap/defconfig    |  1 +
 .../esp32s3/esp32s3-devkit/configs/wifi/defconfig  |  1 +
 14 files changed, 80 insertions(+), 95 deletions(-)


[nuttx] 05/05: documentation/esp32_esp32s3: update informations about Wi-Fi

Posted by xi...@apache.org.
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/nuttx.git

commit 24ce51f137702cdcd04a91dab8bbf9df10f35191
Author: Tiago Medicci Serrano <ti...@espressif.com>
AuthorDate: Thu Apr 27 18:04:49 2023 -0300

    documentation/esp32_esp32s3: update informations about Wi-Fi
    
    Add links for `wapi` referencing and links through documentation
    pages that indicate Wi-Fi behavior on ESP32 and ESP32-S3.
---
 .../platforms/xtensa/esp32/boards/esp32-audio-kit/index.rst |  5 ++++-
 .../platforms/xtensa/esp32/boards/esp32-devkitc/index.rst   | 11 +++++++++--
 .../xtensa/esp32/boards/esp32-ethernet-kit/index.rst        |  5 ++++-
 .../platforms/xtensa/esp32/boards/esp32-lyrat/index.rst     |  5 ++++-
 .../xtensa/esp32/boards/esp32-wrover-kit/index.rst          |  5 ++++-
 Documentation/platforms/xtensa/esp32/index.rst              | 13 +++++++++++++
 .../xtensa/esp32s3/boards/esp32s3-devkit/index.rst          |  7 +++++++
 Documentation/platforms/xtensa/esp32s3/index.rst            |  7 +++++++
 8 files changed, 52 insertions(+), 6 deletions(-)

diff --git a/Documentation/platforms/xtensa/esp32/boards/esp32-audio-kit/index.rst b/Documentation/platforms/xtensa/esp32/boards/esp32-audio-kit/index.rst
index e352fb1f47..1e486dbef4 100644
--- a/Documentation/platforms/xtensa/esp32/boards/esp32-audio-kit/index.rst
+++ b/Documentation/platforms/xtensa/esp32/boards/esp32-audio-kit/index.rst
@@ -115,7 +115,7 @@ browser:
 
 After successfully built and flashed, connect the board to the Wi-Fi network::
 
-  $ nsh> wapi psk wlan0 mypasswd 1
+  $ nsh> wapi psk wlan0 mypasswd 3
   $ nsh> wapi essid wlan0 myssid 1
   $ nsh> renew wlan0
 
@@ -153,3 +153,6 @@ at runtime::
     nsh> wapi psk wlan0 mypasswd 3
     nsh> wapi essid wlan0 myssid 1
     nsh> renew wlan0
+
+.. tip:: Please refer to :ref:`ESP32 Wi-Fi Station Mode <esp32_wi-fi_sta>`
+  for more information.
diff --git a/Documentation/platforms/xtensa/esp32/boards/esp32-devkitc/index.rst b/Documentation/platforms/xtensa/esp32/boards/esp32-devkitc/index.rst
index 45c5a017af..13cb2c4b13 100644
--- a/Documentation/platforms/xtensa/esp32/boards/esp32-devkitc/index.rst
+++ b/Documentation/platforms/xtensa/esp32/boards/esp32-devkitc/index.rst
@@ -203,7 +203,7 @@ browser:
 
 After successfully built and flashed, connect the board to the Wi-Fi network::
 
-    nsh> wapi psk wlan0 mypasswd 1
+    nsh> wapi psk wlan0 mypasswd 3
     nsh> wapi essid wlan0 myssid 1
     nsh> renew wlan0
 
@@ -524,7 +524,7 @@ From the host, start the broker and subscribe to the :code:`test` topic.  Using
 
 From the NSH, connect to an access point::
 
-    nsh> wapi psk wlan0 mypasswd 1
+    nsh> wapi psk wlan0 mypasswd 3
     nsh> wapi essid wlan0 myssid 1
     nsh> renew wlan0
 
@@ -757,6 +757,10 @@ to connect your smartphone or laptop to your board::
 In this case, you are creating the access point ``nuttxapp`` in your board and to
 connect to it on your smartphone you will be required to type the password ``mypasswd``
 using WPA2.
+
+.. tip:: Please refer to :ref:`ESP32 Wi-Fi SoftAP Mode <esp32_wi-fi_softap>`
+  for more information.
+
 The ``dhcpd_start`` is necessary to let your board to associate an IP to your smartphone.
 
 tickless
@@ -833,6 +837,9 @@ at runtime::
     nsh> wapi essid wlan0 myssid 1
     nsh> renew wlan0
 
+.. tip:: Please refer to :ref:`ESP32 Wi-Fi Station Mode <esp32_wi-fi_sta>`
+  for more information.
+
 wifi_smp
 --------
 
diff --git a/Documentation/platforms/xtensa/esp32/boards/esp32-ethernet-kit/index.rst b/Documentation/platforms/xtensa/esp32/boards/esp32-ethernet-kit/index.rst
index efdb2a3779..da8cd3dada 100644
--- a/Documentation/platforms/xtensa/esp32/boards/esp32-ethernet-kit/index.rst
+++ b/Documentation/platforms/xtensa/esp32/boards/esp32-ethernet-kit/index.rst
@@ -317,4 +317,7 @@ at runtime::
 
     nsh> wapi psk wlan0 mypasswd 3
     nsh> wapi essid wlan0 myssid 1
-    nsh> renew wlan0
\ No newline at end of file
+    nsh> renew wlan0
+
+.. tip:: Please refer to :ref:`ESP32 Wi-Fi Station Mode <esp32_wi-fi_sta>`
+  for more information.
diff --git a/Documentation/platforms/xtensa/esp32/boards/esp32-lyrat/index.rst b/Documentation/platforms/xtensa/esp32/boards/esp32-lyrat/index.rst
index 4cbd1f9d29..799619df47 100644
--- a/Documentation/platforms/xtensa/esp32/boards/esp32-lyrat/index.rst
+++ b/Documentation/platforms/xtensa/esp32/boards/esp32-lyrat/index.rst
@@ -426,7 +426,7 @@ browser:
 
 After successfully built and flashed, connect the board to the Wi-Fi network::
 
-  $ nsh> wapi psk wlan0 mypasswd 1
+  $ nsh> wapi psk wlan0 mypasswd 3
   $ nsh> wapi essid wlan0 myssid 1
   $ nsh> renew wlan0
 
@@ -590,3 +590,6 @@ at runtime::
     nsh> wapi psk wlan0 mypasswd 3
     nsh> wapi essid wlan0 myssid 1
     nsh> renew wlan0
+
+.. tip:: Please refer to :ref:`ESP32 Wi-Fi Station Mode <esp32_wi-fi_sta>`
+  for more information.
diff --git a/Documentation/platforms/xtensa/esp32/boards/esp32-wrover-kit/index.rst b/Documentation/platforms/xtensa/esp32/boards/esp32-wrover-kit/index.rst
index 1b8253c587..dcd731416a 100644
--- a/Documentation/platforms/xtensa/esp32/boards/esp32-wrover-kit/index.rst
+++ b/Documentation/platforms/xtensa/esp32/boards/esp32-wrover-kit/index.rst
@@ -273,4 +273,7 @@ at runtime::
 
     nsh> wapi psk wlan0 mypasswd 3
     nsh> wapi essid wlan0 myssid 1
-    nsh> renew wlan0
\ No newline at end of file
+    nsh> renew wlan0
+
+.. tip:: Please refer to :ref:`ESP32 Wi-Fi Station Mode <esp32_wi-fi_sta>`
+  for more information.
diff --git a/Documentation/platforms/xtensa/esp32/index.rst b/Documentation/platforms/xtensa/esp32/index.rst
index 362ae750b6..3789f98307 100644
--- a/Documentation/platforms/xtensa/esp32/index.rst
+++ b/Documentation/platforms/xtensa/esp32/index.rst
@@ -290,6 +290,15 @@ the result by running ``ifconfig`` afterwards.
 
 .. tip:: Boards usually expose a ``wifi`` defconfig which enables Wi-Fi
 
+.. tip:: Please check :doc:`wapi </applications/wapi/index>` documentation for more
+   information about its commands and arguments.
+
+.. note:: The ``wapi psk`` command on Station mode sets a security threshold. That
+   is, it enables connecting only to an equally or more secure network than the set
+   threshold. ``wapi psk wlan0 mypasswd 3`` sets a WPA2-PSK-secured network and
+   enables the device to connect to networks that are equally or more secure than
+   that (WPA3-SAE, for instance, would be eligible for connecting to).
+
 .. _esp32_wi-fi_softap:
 
 Wi-Fi SoftAP
@@ -309,6 +318,10 @@ to connect your smartphone or laptop to your board::
 In this case, you are creating the access point ``nuttxapp`` in your board and to
 connect to it on your smartphone you will be required to type the password ``mypasswd``
 using WPA2.
+
+.. tip:: Please check :doc:`wapi </applications/wapi/index>` documentation for more
+   information about its commands and arguments.
+
 The ``dhcpd_start`` is necessary to let your board to associate an IP to your smartphone.
 
 Bluetooth
diff --git a/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst b/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst
index 060d5d03fb..d20a113aff 100644
--- a/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst
+++ b/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst
@@ -233,6 +233,10 @@ to connect your smartphone or laptop to your board::
 In this case, you are creating the access point ``nuttxapp`` in your board and to
 connect to it on your smartphone you will be required to type the password ``mypasswd``
 using WPA2.
+
+.. tip:: Please refer to :ref:`ESP32 Wi-Fi SoftAP Mode <esp32_wi-fi_softap>`
+  for more information.
+
 The ``dhcpd_start`` is necessary to let your board to associate an IP to your smartphone.
 
 tickless
@@ -271,6 +275,9 @@ at runtime::
     nsh> wapi essid wlan0 myssid 1
     nsh> renew wlan0
 
+.. tip:: Please refer to :ref:`ESP32 Wi-Fi Station Mode <esp32_wi-fi_sta>`
+  for more information.
+
 watchdog
 --------
 
diff --git a/Documentation/platforms/xtensa/esp32s3/index.rst b/Documentation/platforms/xtensa/esp32s3/index.rst
index fc53d34d10..d1db3e79f0 100644
--- a/Documentation/platforms/xtensa/esp32s3/index.rst
+++ b/Documentation/platforms/xtensa/esp32s3/index.rst
@@ -140,6 +140,9 @@ In this case a connection to AP with SSID ``myssid`` is done, using ``mypasswd``
 password. IP address is obtained via DHCP using ``renew`` command. You can check
 the result by running ``ifconfig`` afterwards.
 
+.. tip:: Please refer to :ref:`ESP32 Wi-Fi Station Mode <esp32_wi-fi_sta>`
+  for more information.
+
 Wi-Fi SoftAP
 ------------
 
@@ -159,6 +162,10 @@ to connect your smartphone or laptop to your board::
 In this case, you are creating the access point ``nuttxapp`` in your board and to
 connect to it on your smartphone you will be required to type the password ``mypasswd``
 using WPA2.
+
+.. tip:: Please refer to :ref:`ESP32 Wi-Fi SoftAP Mode <esp32_wi-fi_softap>`
+  for more information.
+
 The ``dhcpd_start`` is necessary to let your board to associate an IP to your smartphone.
 
 Memory Map


[nuttx] 02/05: esp32s3/wifi: add support to WPA3 on Station Mode

Posted by xi...@apache.org.
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/nuttx.git

commit 9ede7d4650318d6d8c7af8bb6cac56994b53b17b
Author: Tiago Medicci Serrano <ti...@espressif.com>
AuthorDate: Thu Apr 27 11:07:07 2023 -0300

    esp32s3/wifi: add support to WPA3 on Station Mode
    
    Add support to select WPA3-SAE while connecting to an AP. Please
    note that STA mode sets a security threshold, i.e, it was able to
    connect to a WPA3-SAE network prior to this change because it
    connects to an equally or more secure network than the set
    threshold. Considering this patch, the device is now able to
    ignore WPA2-PSK APs when WPA3 is set.
---
 arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c | 50 +++++++-------------------
 1 file changed, 12 insertions(+), 38 deletions(-)

diff --git a/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c b/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c
index dd0c3b6248..206504e7ae 100644
--- a/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c
+++ b/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c
@@ -4030,6 +4030,11 @@ static int esp_wifi_auth_trans(uint32_t wifi_auth)
         auth_mode = IW_AUTH_WPA_VERSION_WPA2;
         break;
 
+      case WIFI_AUTH_WPA3_PSK:
+      case WIFI_AUTH_WPA2_WPA3_PSK:
+        auth_mode = IW_AUTH_WPA_VERSION_WPA3;
+        break;
+
       default:
         wlerr("Failed to transfer wireless authmode: %d", wifi_auth);
         break;
@@ -5408,6 +5413,10 @@ int esp_wifi_sta_auth(struct iwreq *iwr, bool set)
                     wifi_cfg.sta.threshold.authmode = WIFI_AUTH_WPA2_PSK;
                     break;
 
+                  case IW_AUTH_WPA_VERSION_WPA3:
+                    wifi_cfg.sta.threshold.authmode = WIFI_AUTH_WPA3_PSK;
+                    break;
+
                   default:
                     wlerr("Invalid wpa version %" PRId32 "\n",
                           iwr->u.param.value);
@@ -5431,12 +5440,8 @@ int esp_wifi_sta_auth(struct iwreq *iwr, bool set)
                     break;
 
                   case IW_AUTH_CIPHER_TKIP:
-                    wifi_cfg.sta.threshold.authmode = WIFI_AUTH_WPA_PSK;
-                    break;
-
                   case IW_AUTH_CIPHER_CCMP:
                   case IW_AUTH_CIPHER_AES_CMAC:
-                    wifi_cfg.sta.threshold.authmode = WIFI_AUTH_WPA2_PSK;
                     break;
 
                   default:
@@ -6194,37 +6199,10 @@ int esp_wifi_softap_password(struct iwreq *iwr, bool set)
       /* Clear the password field and copy the user password to it */
 
       memset(wifi_cfg.ap.password, 0x0, PWD_MAX_LEN);
-      if (len)
-        {
-          memcpy(wifi_cfg.ap.password, pdata, len);
-          switch (ext->alg)
-            {
-              case IW_ENCODE_ALG_NONE:
-                wifi_cfg.ap.authmode = WIFI_AUTH_OPEN;
-                break;
-
-              case IW_ENCODE_ALG_WEP:
-                wifi_cfg.ap.authmode = WIFI_AUTH_WEP;
-                break;
-
-              case IW_ENCODE_ALG_TKIP:
-                wifi_cfg.ap.authmode = WIFI_AUTH_WPA_PSK;
-                break;
 
-              case IW_ENCODE_ALG_CCMP:
-                wifi_cfg.ap.authmode = WIFI_AUTH_WPA2_PSK;
-                break;
-
-              case IW_ENCODE_ALG_PMK:
-              case IW_ENCODE_ALG_AES_CMAC:
-                wifi_cfg.ap.authmode = WIFI_AUTH_WPA_WPA2_PSK;
-                break;
-
-              default:
-                wlerr("Failed to transfer wireless authmode: %d",
-                      ext->alg);
-                return -EINVAL;
-            }
+      if (ext->alg != IW_ENCODE_ALG_NONE)
+        {
+          memcpy(wifi_cfg.sta.password, pdata, len);
         }
 
       if (g_softap_started)
@@ -6505,12 +6483,8 @@ int esp_wifi_softap_auth(struct iwreq *iwr, bool set)
                     break;
 
                   case IW_AUTH_CIPHER_TKIP:
-                    wifi_cfg.ap.authmode = WIFI_AUTH_WPA_PSK;
-                    break;
-
                   case IW_AUTH_CIPHER_CCMP:
                   case IW_AUTH_CIPHER_AES_CMAC:
-                    wifi_cfg.ap.authmode = WIFI_AUTH_WPA2_PSK;
                     break;
 
                   default:


[nuttx] 03/05: esp32/wifi: remove debug features from Wi-Fi-related `defconfig`s

Posted by xi...@apache.org.
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/nuttx.git

commit 6e76229df2e6547c033e5d5d1966cdad50615ded
Author: Tiago Medicci Serrano <ti...@espressif.com>
AuthorDate: Thu Apr 27 11:10:40 2023 -0300

    esp32/wifi: remove debug features from Wi-Fi-related `defconfig`s
---
 boards/xtensa/esp32/esp32-devkitc/configs/sta_softap/defconfig | 7 +------
 boards/xtensa/esp32/esp32-devkitc/configs/wifi/defconfig       | 7 +------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/sta_softap/defconfig b/boards/xtensa/esp32/esp32-devkitc/configs/sta_softap/defconfig
index 099f9df52e..604693626c 100644
--- a/boards/xtensa/esp32/esp32-devkitc/configs/sta_softap/defconfig
+++ b/boards/xtensa/esp32/esp32-devkitc/configs/sta_softap/defconfig
@@ -6,6 +6,7 @@
 # modifications.
 #
 # CONFIG_ARCH_LEDS is not set
+# CONFIG_NDEBUG is not set
 # CONFIG_NSH_ARGCAT is not set
 # CONFIG_NSH_CMDOPT_HEXDUMP is not set
 # CONFIG_NSH_NETINIT is not set
@@ -21,12 +22,6 @@ CONFIG_ARCH_STACKDUMP=y
 CONFIG_ARCH_XTENSA=y
 CONFIG_BOARD_LOOPSPERMSEC=16717
 CONFIG_BUILTIN=y
-CONFIG_DEBUG_ASSERTIONS=y
-CONFIG_DEBUG_ERROR=y
-CONFIG_DEBUG_FEATURES=y
-CONFIG_DEBUG_WARN=y
-CONFIG_DEBUG_WIRELESS=y
-CONFIG_DEBUG_WIRELESS_ERROR=y
 CONFIG_DRIVERS_IEEE80211=y
 CONFIG_DRIVERS_WIRELESS=y
 CONFIG_ESP32_SPIFLASH=y
diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/wifi/defconfig b/boards/xtensa/esp32/esp32-devkitc/configs/wifi/defconfig
index 5f322498fb..9586f17b0b 100644
--- a/boards/xtensa/esp32/esp32-devkitc/configs/wifi/defconfig
+++ b/boards/xtensa/esp32/esp32-devkitc/configs/wifi/defconfig
@@ -6,6 +6,7 @@
 # modifications.
 #
 # CONFIG_ARCH_LEDS is not set
+# CONFIG_NDEBUG is not set
 # CONFIG_NSH_ARGCAT is not set
 # CONFIG_NSH_CMDOPT_HEXDUMP is not set
 CONFIG_ALLOW_BSD_COMPONENTS=y
@@ -21,10 +22,6 @@ CONFIG_ARCH_STACKDUMP=y
 CONFIG_ARCH_XTENSA=y
 CONFIG_BOARD_LOOPSPERMSEC=16717
 CONFIG_BUILTIN=y
-CONFIG_DEBUG_ASSERTIONS=y
-CONFIG_DEBUG_FEATURES=y
-CONFIG_DEBUG_FULLOPT=y
-CONFIG_DEBUG_SYMBOLS=y
 CONFIG_DEFAULT_TASK_STACKSIZE=4096
 CONFIG_DEV_URANDOM=y
 CONFIG_DRIVERS_IEEE80211=y
@@ -74,14 +71,12 @@ CONFIG_SCHED_WAITPID=y
 CONFIG_SIG_DEFAULT=y
 CONFIG_SPI=y
 CONFIG_SPIFFS_NAME_MAX=48
-CONFIG_STACK_COLORATION=y
 CONFIG_START_DAY=6
 CONFIG_START_MONTH=12
 CONFIG_START_YEAR=2011
 CONFIG_SYSTEM_DHCPC_RENEW=y
 CONFIG_SYSTEM_NSH=y
 CONFIG_SYSTEM_PING=y
-CONFIG_SYSTEM_STACKMONITOR=y
 CONFIG_TLS_TASK_NELEM=4
 CONFIG_UART0_SERIAL_CONSOLE=y
 CONFIG_WIRELESS=y


[nuttx] 04/05: esp32/wifi: add support to WPA3 on Station Mode

Posted by xi...@apache.org.
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/nuttx.git

commit 28361a295d24553088b33b7a55d12250ee70060b
Author: Tiago Medicci Serrano <ti...@espressif.com>
AuthorDate: Thu Apr 27 11:11:56 2023 -0300

    esp32/wifi: add support to WPA3 on Station Mode
    
    Add support to select WPA3-SAE while connecting to an AP. Please
    note that STA mode sets a security threshold, i.e, it was able to
    connect to a WPA3-SAE network prior to this change because it
    connects to an equally or more secure network than the set
    threshold. Considering this patch, the device is now able to
    ignore WPA2-PSK APs when WPA3 is set.
---
 arch/xtensa/src/esp32/esp32_wifi_adapter.c | 51 +++++++-----------------------
 1 file changed, 12 insertions(+), 39 deletions(-)

diff --git a/arch/xtensa/src/esp32/esp32_wifi_adapter.c b/arch/xtensa/src/esp32/esp32_wifi_adapter.c
index f632adbe86..21dad51c16 100644
--- a/arch/xtensa/src/esp32/esp32_wifi_adapter.c
+++ b/arch/xtensa/src/esp32/esp32_wifi_adapter.c
@@ -4177,6 +4177,11 @@ static int esp_wifi_auth_trans(uint32_t wifi_auth)
         auth_mode = IW_AUTH_WPA_VERSION_WPA2;
         break;
 
+      case WIFI_AUTH_WPA3_PSK:
+      case WIFI_AUTH_WPA2_WPA3_PSK:
+        auth_mode = IW_AUTH_WPA_VERSION_WPA3;
+        break;
+
       default:
         wlerr("Failed to transfer wireless authmode: %d", wifi_auth);
         break;
@@ -5576,6 +5581,10 @@ int esp_wifi_sta_auth(struct iwreq *iwr, bool set)
                     wifi_cfg.sta.threshold.authmode = WIFI_AUTH_WPA2_PSK;
                     break;
 
+                  case IW_AUTH_WPA_VERSION_WPA3:
+                    wifi_cfg.sta.threshold.authmode = WIFI_AUTH_WPA3_PSK;
+                    break;
+
                   default:
                     wlerr("Invalid wpa version %" PRId32 "\n",
                           iwr->u.param.value);
@@ -5599,12 +5608,8 @@ int esp_wifi_sta_auth(struct iwreq *iwr, bool set)
                     break;
 
                   case IW_AUTH_CIPHER_TKIP:
-                    wifi_cfg.sta.threshold.authmode = WIFI_AUTH_WPA_PSK;
-                    break;
-
                   case IW_AUTH_CIPHER_CCMP:
                   case IW_AUTH_CIPHER_AES_CMAC:
-                    wifi_cfg.sta.threshold.authmode = WIFI_AUTH_WPA2_PSK;
                     break;
 
                   default:
@@ -6362,40 +6367,12 @@ int esp_wifi_softap_password(struct iwreq *iwr, bool set)
       /* Clear the password field and copy the user password to it */
 
       memset(wifi_cfg.ap.password, 0x0, PWD_MAX_LEN);
-      if (len)
+      if (ext->alg != IW_ENCODE_ALG_NONE)
         {
-          memcpy(wifi_cfg.ap.password, pdata, len);
-          switch (ext->alg)
-            {
-              case IW_ENCODE_ALG_NONE:
-                wifi_cfg.ap.authmode = WIFI_AUTH_OPEN;
-                break;
-
-              case IW_ENCODE_ALG_WEP:
-                wifi_cfg.ap.authmode = WIFI_AUTH_WEP;
-                break;
-
-              case IW_ENCODE_ALG_TKIP:
-                wifi_cfg.ap.authmode = WIFI_AUTH_WPA_PSK;
-                break;
-
-              case IW_ENCODE_ALG_CCMP:
-                wifi_cfg.ap.authmode = WIFI_AUTH_WPA2_PSK;
-                break;
-
-              case IW_ENCODE_ALG_PMK:
-              case IW_ENCODE_ALG_AES_CMAC:
-                wifi_cfg.ap.authmode = WIFI_AUTH_WPA_WPA2_PSK;
-                break;
-
-              default:
-                wlerr("Failed to transfer wireless authmode: %d",
-                      ext->alg);
-                return -EINVAL;
-            }
+          memcpy(wifi_cfg.sta.password, pdata, len);
         }
 
-        if (g_softap_started)
+      if (g_softap_started)
         {
           ret = esp_wifi_set_config(WIFI_IF_AP, &wifi_cfg);
           if (ret)
@@ -6674,12 +6651,8 @@ int esp_wifi_softap_auth(struct iwreq *iwr, bool set)
                     break;
 
                   case IW_AUTH_CIPHER_TKIP:
-                    wifi_cfg.ap.authmode = WIFI_AUTH_WPA_PSK;
-                    break;
-
                   case IW_AUTH_CIPHER_CCMP:
                   case IW_AUTH_CIPHER_AES_CMAC:
-                    wifi_cfg.ap.authmode = WIFI_AUTH_WPA2_PSK;
                     break;
 
                   default:


[nuttx] 01/05: esp32s3/wifi: fix Wi-Fi's NVS-like storage long filename error

Posted by xi...@apache.org.
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/nuttx.git

commit a86a9dc09ecd53796097aaa804dd53a7f9759379
Author: Tiago Medicci Serrano <ti...@espressif.com>
AuthorDate: Thu Apr 27 10:58:38 2023 -0300

    esp32s3/wifi: fix Wi-Fi's NVS-like storage long filename error
    
    While using NVS-like storage of the Wi-Fi driver, an error was
    thrown while trying to access a file whose name was longer than
    the mounted SPIFFS `CONFIG_SPIFFS_NAME_MAX`.
---
 boards/xtensa/esp32s3/esp32s3-devkit/configs/sta_softap/defconfig | 1 +
 boards/xtensa/esp32s3/esp32s3-devkit/configs/wifi/defconfig       | 1 +
 2 files changed, 2 insertions(+)

diff --git a/boards/xtensa/esp32s3/esp32s3-devkit/configs/sta_softap/defconfig b/boards/xtensa/esp32s3/esp32s3-devkit/configs/sta_softap/defconfig
index 1abf757639..8e1215fcab 100644
--- a/boards/xtensa/esp32s3/esp32s3-devkit/configs/sta_softap/defconfig
+++ b/boards/xtensa/esp32s3/esp32s3-devkit/configs/sta_softap/defconfig
@@ -71,6 +71,7 @@ CONFIG_RR_INTERVAL=200
 CONFIG_SCHED_LPWORK=y
 CONFIG_SCHED_WAITPID=y
 CONFIG_SIG_DEFAULT=y
+CONFIG_SPIFFS_NAME_MAX=128
 CONFIG_START_DAY=6
 CONFIG_START_MONTH=12
 CONFIG_START_YEAR=2011
diff --git a/boards/xtensa/esp32s3/esp32s3-devkit/configs/wifi/defconfig b/boards/xtensa/esp32s3/esp32s3-devkit/configs/wifi/defconfig
index 22d35dee42..27062a9185 100644
--- a/boards/xtensa/esp32s3/esp32s3-devkit/configs/wifi/defconfig
+++ b/boards/xtensa/esp32s3/esp32s3-devkit/configs/wifi/defconfig
@@ -68,6 +68,7 @@ CONFIG_RR_INTERVAL=200
 CONFIG_SCHED_LPWORK=y
 CONFIG_SCHED_WAITPID=y
 CONFIG_SIG_DEFAULT=y
+CONFIG_SPIFFS_NAME_MAX=128
 CONFIG_START_DAY=6
 CONFIG_START_MONTH=12
 CONFIG_START_YEAR=2011