Skip to content

Commit

Permalink
cpu/esp_common: rename ESP_WIFI_EAP_* -> WIFI_EAP_*
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Feb 17, 2023
1 parent 50802b8 commit cebd768
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 37 deletions.
14 changes: 7 additions & 7 deletions cpu/esp32/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1612,16 +1612,16 @@ following configuration parameters have to be defined:

Parameter | Default | Description
:-------------------|:----------|:------------
#WIFI_SSID | "RIOT_AP" | SSID of the AP to be used.
ESP_WIFI_EAP_ID | none | Optional anonymous identity used in phase 1 (outer) EAP authentication.[1]
ESP_WIFI_EAP_USER | none | User name used in phase 2 (inner) EAP authentication.
ESP_WIFI_EAP_PASS | none | Password used in phase 2 (inner) EAP authentication.
#WIFI_SSID | "RIOT_AP" | SSID of the AP to be used.
WIFI_EAP_ID | none | Optional anonymous identity used in phase 1 (outer) EAP authentication.[1]
WIFI_EAP_USER | none | User name used in phase 2 (inner) EAP authentication.
WIFI_EAP_PASS | none | Password used in phase 2 (inner) EAP authentication.
#ESP_WIFI_STACKSIZE | #THREAD_STACKSIZE_DEFAULT | Stack size used for the WiFi netdev driver thread.

</center><br>

[1] If the optional anonymous identy `ESP_WIFI_EAP_ID` is not defined, the user
name `ESP_WIFI_EAP_USER` defined for phase 2 (inner) EAP authentication is used
[1] If the optional anonymous identy `WIFI_EAP_ID` is not defined, the user
name `WIFI_EAP_USER` defined for phase 2 (inner) EAP authentication is used
as identity in phase 1.

These configuration parameter definitions, as well as enabling the `esp_wifi`
Expand All @@ -1630,7 +1630,7 @@ line, for example:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
USEMODULE=esp_wifi_enterprise \
CFLAGS='-DWIFI_SSID=\"MySSID\" -DESP_WIFI_EAP_ID=\"anonymous\" -DESP_WIFI_EAP_USER=\"MyUserName\" -DESP_WIFI_EAP_PASS=\"MyPassphrase\"' \
CFLAGS='-DWIFI_SSID=\"MySSID\" -DWIFI_EAP_ID=\"anonymous\" -DWIFI_EAP_USER=\"MyUserName\" -DWIFI_EAP_PASS=\"MyPassphrase\"' \
make -C examples/gnrc_networking BOARD=...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
10 changes: 5 additions & 5 deletions cpu/esp_common/esp-wifi/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ following configuration parameters have to be defined:

Parameter | Default | Description
:------------------|:----------|:------------
WIFI_SSID | "RIOT_AP" | SSID of the AP to be used.
ESP_WIFI_EAP_ID | none | Optional anonymous identity used in phase 1 (outer) EAP authentication. If it is not defined, the user name defined for phase 2 (inner) EAP authentication is used as idendity in phase 1.
ESP_WIFI_EAP_USER | none | User name used in phase 2 (inner) EAP authentication.
ESP_WIFI_EAP_PASS | none | Password used in phase 2 (inner) EAP authentication.
WIFI_SSID | "RIOT_AP" | SSID of the AP to be used.
WIFI_EAP_ID | none | Optional anonymous identity used in phase 1 (outer) EAP authentication. If it is not defined, the user name defined for phase 2 (inner) EAP authentication is used as idendity in phase 1.
WIFI_EAP_USER | none | User name used in phase 2 (inner) EAP authentication.
WIFI_EAP_PASS | none | Password used in phase 2 (inner) EAP authentication.
ESP_WIFI_STACKSIZE | #THREAD_STACKSIZE_DEFAULT | Stack size used for the WiFi netdev driver thread.

</center>
Expand All @@ -101,7 +101,7 @@ line, for example:

```
USEMODULE=esp_wifi_enterprise \
CFLAGS='-DWIFI_SSID=\"MySSID\" -DESP_WIFI_EAP_ID=\"anonymous\" -DESP_WIFI_EAP_USER=\"MyUserName\" -DESP_WIFI_EAP_PASS=\"MyPassphrase\"' \
CFLAGS='-DWIFI_SSID=\"MySSID\" -DWIFI_EAP_ID=\"anonymous\" -DWIFI_EAP_USER=\"MyUserName\" -DWIFI_EAP_PASS=\"MyPassphrase\"' \
make -C examples/gnrc_networking BOARD=...
```

Expand Down
38 changes: 25 additions & 13 deletions cpu/esp_common/esp-wifi/esp_wifi_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,20 +947,32 @@ void esp_wifi_setup (esp_wifi_netdev_t* dev)

#if defined(MODULE_ESP_WIFI_ENTERPRISE) && !defined(MODULE_ESP_WIFI_AP)

#ifdef ESP_WIFI_EAP_ID
esp_wifi_sta_wpa2_ent_set_identity((const unsigned char *)ESP_WIFI_EAP_ID,
strlen(ESP_WIFI_EAP_ID));
#endif /* ESP_WIFI_EAP_ID */
#if defined(ESP_WIFI_EAP_USER) && defined(ESP_WIFI_EAP_PASS)
#if !defined(WIFI_EAP_ID) && defined(ESP_WIFI_EAP_ID)
#define WIFI_EAP_ID ESP_WIFI_EAP_ID
#endif

#if !defined(WIFI_EAP_USER) && defined(ESP_WIFI_EAP_USER)
#define WIFI_EAP_USER ESP_WIFI_EAP_USER
#endif

#if !defined(WIFI_EAP_PASS) && defined(ESP_WIFI_EAP_PASS)
#define WIFI_EAP_PASS ESP_WIFI_EAP_PASS
#endif

#ifdef WIFI_EAP_ID
esp_wifi_sta_wpa2_ent_set_identity((const unsigned char *)WIFI_EAP_ID,
strlen(WIFI_EAP_ID));
#endif /* WIFI_EAP_ID */
#if defined(WIFI_EAP_USER) && defined(WIFI_EAP_PASS)
ESP_WIFI_DEBUG("eap_user=%s eap_pass=%s\n",
ESP_WIFI_EAP_USER, ESP_WIFI_EAP_PASS);
esp_wifi_sta_wpa2_ent_set_username((const unsigned char *)ESP_WIFI_EAP_USER,
strlen(ESP_WIFI_EAP_USER));
esp_wifi_sta_wpa2_ent_set_password((const unsigned char *)ESP_WIFI_EAP_PASS,
strlen(ESP_WIFI_EAP_PASS));
#else /* defined(ESP_WIFI_EAP_USER) && defined(ESP_WIFI_EAP_PASS) */
#error "ESP_WIFI_EAP_USER and ESP_WIFI_EAP_PASS have to be defined for EAP phase 2 authentication"
#endif /* defined(ESP_WIFI_EAP_USER) && defined(ESP_WIFI_EAP_PASS) */
WIFI_EAP_USER, WIFI_EAP_PASS);
esp_wifi_sta_wpa2_ent_set_username((const unsigned char *)WIFI_EAP_USER,
strlen(WIFI_EAP_USER));
esp_wifi_sta_wpa2_ent_set_password((const unsigned char *)WIFI_EAP_PASS,
strlen(WIFI_EAP_PASS));
#else /* defined(WIFI_EAP_USER) && defined(WIFI_EAP_PASS) */
#error "WIFI_EAP_USER and WIFI_EAP_PASS have to be defined for EAP phase 2 authentication"
#endif /* defined(WIFI_EAP_USER) && defined(WIFI_EAP_PASS) */
esp_wifi_sta_wpa2_ent_enable();
#endif /* defined(MODULE_ESP_WIFI_ENTERPRISE) && !defined(MODULE_ESP_WIFI_AP) */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# to also include the main board header
INCLUDES += $(addprefix -I,$(wildcard $(RIOTBOARD)/esp32-wrover-kit/include))

# ESP_WIFI_EAP_USER and ESP_WIFI_EAP_PASS have to be defined to compile the
# WIFI_EAP_USER and WIFI_EAP_PASS have to be defined to compile the
# optional module esp_wifi_enterprise in CI
CFLAGS += -DESP_WIFI_EAP_USER=\"[email protected]\"
CFLAGS += -DESP_WIFI_EAP_PASS=\"riot\"
CFLAGS += -DWIFI_EAP_USER=\"[email protected]\"
CFLAGS += -DWIFI_EAP_PASS=\"riot\"

include $(RIOTBOARD)/esp32-wrover-kit/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# to also include the main board header
INCLUDES += $(addprefix -I,$(wildcard $(RIOTBOARD)/esp32c3-devkit/include))

# ESP_WIFI_EAP_USER and ESP_WIFI_EAP_PASS have to be defined to compile the
# WIFI_EAP_USER and WIFI_EAP_PASS have to be defined to compile the
# optional module esp_wifi_enterprise in CI
CFLAGS += -DESP_WIFI_EAP_USER=\"[email protected]\"
CFLAGS += -DESP_WIFI_EAP_PASS=\"riot\"
CFLAGS += -DWIFI_EAP_USER=\"[email protected]\"
CFLAGS += -DWIFI_EAP_PASS=\"riot\"

include $(RIOTBOARD)/esp32c3-devkit/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# to also include the main board header
INCLUDES += $(addprefix -I,$(wildcard $(RIOTBOARD)/esp32s2-devkit/include))

# ESP_WIFI_EAP_USER and ESP_WIFI_EAP_PASS have to be defined to compile the
# WIFI_EAP_USER and WIFI_EAP_PASS have to be defined to compile the
# optional module esp_wifi_enterprise in CI
CFLAGS += -DESP_WIFI_EAP_USER=\"[email protected]\"
CFLAGS += -DESP_WIFI_EAP_PASS=\"riot\"
CFLAGS += -DWIFI_EAP_USER=\"[email protected]\"
CFLAGS += -DWIFI_EAP_PASS=\"riot\"

include $(RIOTBOARD)/esp32s2-devkit/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# to also include the main board header
INCLUDES += $(addprefix -I,$(wildcard $(RIOTBOARD)/esp32s3-devkit/include))

# ESP_WIFI_EAP_USER and ESP_WIFI_EAP_PASS have to be defined to compile the
# WIFI_EAP_USER and WIFI_EAP_PASS have to be defined to compile the
# optional module esp_wifi_enterprise in CI
CFLAGS += -DESP_WIFI_EAP_USER=\"[email protected]\"
CFLAGS += -DESP_WIFI_EAP_PASS=\"riot\"
CFLAGS += -DWIFI_EAP_USER=\"[email protected]\"
CFLAGS += -DWIFI_EAP_PASS=\"riot\"

include $(RIOTBOARD)/esp32s3-devkit/Makefile.include

0 comments on commit cebd768

Please sign in to comment.