diff --git a/cpu/esp32/Makefile.dep b/cpu/esp32/Makefile.dep index d2ff55b88d..140ba0c59c 100644 --- a/cpu/esp32/Makefile.dep +++ b/cpu/esp32/Makefile.dep @@ -27,6 +27,13 @@ ifneq (,$(filter esp_wifi_any,$(USEMODULE))) USEMODULE += esp_idf_wpa_supplicant_port endif +ifneq (,$(filter esp_wifi_enterprise,$(USEMODULE))) + # add additional modules used for WPA2 Enterprise mode + USEMODULE += esp_idf_wpa_supplicant_wpa2_eap_peer + USEMODULE += esp_idf_wpa_supplicant_wpa2_tls + USEMODULE += esp_idf_wpa_supplicant_wpa2_utils +endif + ifneq (,$(filter esp_idf_nvs_flash,$(USEMODULE))) # add additional modules required by esp_idf_nvs_flash USEMODULE += mtd diff --git a/cpu/esp32/Makefile.features b/cpu/esp32/Makefile.features index 7b7c97e8e6..b7bae5baaa 100644 --- a/cpu/esp32/Makefile.features +++ b/cpu/esp32/Makefile.features @@ -3,4 +3,5 @@ include $(RIOTCPU)/esp_common/Makefile.features FEATURES_PROVIDED += arch_esp32 +FEATURES_PROVIDED += esp_wifi_enterprise FEATURES_PROVIDED += periph_rtc diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index 391ad0c3fa..df9cf44c18 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -44,6 +44,7 @@ PSEUDOMODULES += esp_idf_newlib PSEUDOMODULES += esp_rtc_timer PSEUDOMODULES += esp_rtc_timer_32k PSEUDOMODULES += esp_spi_ram +PSEUDOMODULES += esp_wifi_enterprise USEMODULE += esp_idf_driver USEMODULE += esp_idf_esp32 diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/Makefile b/cpu/esp32/vendor/esp-idf/wpa_supplicant/Makefile index 7278372c79..9fe1d0d041 100644 --- a/cpu/esp32/vendor/esp-idf/wpa_supplicant/Makefile +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/Makefile @@ -1,9 +1,21 @@ -ifneq (,$(filter esp_idf_wpa_supplicant_port ,$(USEMODULE))) +ifneq (,$(filter esp_idf_wpa_supplicant_port,$(USEMODULE))) DIRS += port endif -ifneq (,$(filter esp_idf_wpa_supplicant_crypto ,$(USEMODULE))) +ifneq (,$(filter esp_idf_wpa_supplicant_crypto,$(USEMODULE))) DIRS += src/crypto endif +ifneq (,$(filter esp_idf_wpa_supplicant_wpa2_eap_peer,$(USEMODULE))) + DIRS += src/wpa2/eap_peer +endif + +ifneq (,$(filter esp_idf_wpa_supplicant_wpa2_tls,$(USEMODULE))) + DIRS += src/wpa2/tls +endif + +ifneq (,$(filter esp_idf_wpa_supplicant_wpa2_utils,$(USEMODULE))) + DIRS += src/wpa2/utils +endif + include $(RIOTBASE)/Makefile.base diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Makefile b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Makefile index 508562948f..c853b03be8 100644 --- a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Makefile +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Makefile @@ -5,6 +5,7 @@ include $(RIOTBASE)/Makefile.base # we have to do it in that way to avoid that $(RIOTBASE)/sys/include/crypto # is found first INCLUDES = -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/include +INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/include/wpa INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/port/include INCLUDES += -I$(ESP32_SDK_DIR)/components/wpa_supplicant/include INCLUDES += -I$(ESP32_SDK_DIR)/components/wpa_supplicant/port/include diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/eap_peer/Makefile b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/eap_peer/Makefile new file mode 100644 index 0000000000..0d30181033 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/eap_peer/Makefile @@ -0,0 +1,20 @@ +MODULE=esp_idf_wpa_supplicant_wpa2_eap_peer + +include $(RIOTBASE)/Makefile.base + +# we have to do it in that way to avoid that $(RIOTBASE)/sys/include/crypto +# is found first +INCLUDES = -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/include +INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/include/wpa +INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/port/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/wpa_supplicant/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/wpa_supplicant/port/include +CFLAGS += -D__ets__ -DESPRESSIF_USE -DESP32_IDF_CODE=1 +CFLAGS += -DEAP_PEER_METHOD -DEAP_TLS -DEAP_PEAP -DEAP_TTLS -DEAP_MSCHAPv2 -DUSE_WPA2_TASK + +include $(RIOTCPU)/$(CPU)/Makefile.include + +INCLUDES += -I$(RIOTBASE)/core/include +INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/include/log +INCLUDES += -I$(RIOTCPU)/$(CPU)/include +INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/tls/Makefile b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/tls/Makefile new file mode 100644 index 0000000000..8b996a6afa --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/tls/Makefile @@ -0,0 +1,19 @@ +MODULE=esp_idf_wpa_supplicant_wpa2_tls + +include $(RIOTBASE)/Makefile.base + +# we have to do it in that way to avoid that $(RIOTBASE)/sys/include/crypto +# is found first +INCLUDES = -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/include +INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/include/wpa +INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/port/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/wpa_supplicant/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/wpa_supplicant/port/include +CFLAGS += -D__ets__ -DESPRESSIF_USE -DESP32_IDF_CODE=1 + +include $(RIOTCPU)/$(CPU)/Makefile.include + +INCLUDES += -I$(RIOTBASE)/core/include +INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/include/log +INCLUDES += -I$(RIOTCPU)/$(CPU)/include +INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/utils/Makefile b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/utils/Makefile new file mode 100644 index 0000000000..92a2b91f3e --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/utils/Makefile @@ -0,0 +1,19 @@ +MODULE=esp_idf_wpa_supplicant_wpa2_utils + +include $(RIOTBASE)/Makefile.base + +# we have to do it in that way to avoid that $(RIOTBASE)/sys/include/crypto +# is found first +INCLUDES = -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/include +INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/include/wpa +INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/port/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/wpa_supplicant/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/wpa_supplicant/port/include +CFLAGS += -D__ets__ -DESPRESSIF_USE -DESP32_IDF_CODE=1 + +include $(RIOTCPU)/$(CPU)/Makefile.include + +INCLUDES += -I$(RIOTBASE)/core/include +INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/include/log +INCLUDES += -I$(RIOTCPU)/$(CPU)/include +INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include diff --git a/cpu/esp_common/Makefile.include b/cpu/esp_common/Makefile.include index 597ba6c272..5003ba7fc1 100644 --- a/cpu/esp_common/Makefile.include +++ b/cpu/esp_common/Makefile.include @@ -7,6 +7,11 @@ FLASH_MODE ?= dout # SPECIAL module dependencies # cannot be done in Makefile.dep since Makefile.dep is included too late +ifneq (,$(filter esp_wifi_enterprise,$(USEMODULE))) + FEATURES_REQUIRED += esp_wifi_enterprise + USEMODULE += esp_wifi +endif + ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) ifneq (,$(filter lwip,$(USEMODULE))) # for lwip, use esp_wifi as default netdev if no other netdev is enabled