]> granicus.if.org Git - esp-idf/commitdiff
derive esp_wifi from esp32 component
authormorris <maoshengrong@espressif.com>
Fri, 22 Mar 2019 06:21:15 +0000 (14:21 +0800)
committersuda-morris <362953310@qq.com>
Mon, 1 Apr 2019 12:04:52 +0000 (20:04 +0800)
48 files changed:
.gitlab-ci.yml
.gitmodules
components/bootloader/subproject/main/Makefile.projbuild
components/esp32/CMakeLists.txt
components/esp32/component.mk
components/esp32/esp_adapter.c
components/esp32/linker.lf
components/esp32/system_api.c
components/esp32/test/CMakeLists.txt
components/esp32/test/component.mk
components/esp_event/event_default_handlers.c
components/esp_wifi/CMakeLists.txt [new file with mode: 0644]
components/esp_wifi/component.mk [new file with mode: 0644]
components/esp_wifi/include/esp_coexist.h [moved from components/esp32/include/esp_coexist.h with 100% similarity]
components/esp_wifi/include/esp_coexist_adapter.h [moved from components/esp32/include/esp_coexist_adapter.h with 100% similarity]
components/esp_wifi/include/esp_coexist_internal.h [moved from components/esp32/include/esp_coexist_internal.h with 100% similarity]
components/esp_wifi/include/esp_mesh.h [moved from components/esp32/include/esp_mesh.h with 100% similarity]
components/esp_wifi/include/esp_mesh_internal.h [moved from components/esp32/include/esp_mesh_internal.h with 99% similarity]
components/esp_wifi/include/esp_now.h [moved from components/esp32/include/esp_now.h with 100% similarity]
components/esp_wifi/include/esp_phy_init.h [moved from components/esp32/include/esp_phy_init.h with 100% similarity]
components/esp_wifi/include/esp_private/wifi.h [moved from components/esp32/include/esp_wifi_internal.h with 100% similarity]
components/esp_wifi/include/esp_private/wifi_os_adapter.h [moved from components/esp32/include/esp_wifi_os_adapter.h with 100% similarity]
components/esp_wifi/include/esp_smartconfig.h [moved from components/esp32/include/esp_smartconfig.h with 100% similarity]
components/esp_wifi/include/esp_wifi.h [moved from components/esp32/include/esp_wifi.h with 99% similarity]
components/esp_wifi/include/esp_wifi_crypto_types.h [moved from components/esp32/include/esp_wifi_crypto_types.h with 100% similarity]
components/esp_wifi/include/esp_wifi_types.h [moved from components/esp32/include/esp_wifi_types.h with 100% similarity]
components/esp_wifi/include/esp_wpa2.h [moved from components/esp32/include/esp_wpa2.h with 100% similarity]
components/esp_wifi/include/esp_wps.h [moved from components/esp32/include/esp_wps.h with 100% similarity]
components/esp_wifi/include/phy.h [moved from components/esp32/phy.h with 100% similarity]
components/esp_wifi/include/phy_init_data.h [moved from components/esp32/phy_init_data.h with 100% similarity]
components/esp_wifi/lib_esp32 [moved from components/esp32/lib with 100% similarity]
components/esp_wifi/linker.lf [new file with mode: 0644]
components/esp_wifi/src/coexist.c [moved from components/esp32/coexist.c with 100% similarity]
components/esp_wifi/src/fast_crypto_ops.c [moved from components/esp32/fast_crypto_ops.c with 100% similarity]
components/esp_wifi/src/lib_printf.c [moved from components/esp32/lib_printf.c with 100% similarity]
components/esp_wifi/src/phy_init.c [moved from components/esp32/phy_init.c with 99% similarity]
components/esp_wifi/src/restore.c [moved from components/esp32/restore.c with 100% similarity]
components/esp_wifi/src/wifi_init.c [moved from components/esp32/wifi_init.c with 99% similarity]
components/esp_wifi/test/CMakeLists.txt [new file with mode: 0644]
components/esp_wifi/test/component.mk [new file with mode: 0644]
components/esp_wifi/test/test_header_files_md5.c [moved from components/esp32/test/test_header_files_md5.c with 97% similarity]
components/esp_wifi/test/test_phy_rtc.c [moved from components/esp32/test/test_phy_rtc.c with 100% similarity]
components/esp_wifi/test/test_wifi.c [moved from components/esp32/test/test_wifi.c with 100% similarity]
components/esp_wifi/test/test_wifi_lib_git_commit.c [moved from components/esp32/test/test_wifi_lib_git_commit.c with 85% similarity]
components/lwip/CMakeLists.txt
components/lwip/port/esp32/include/netif/wlanif.h
docs/Doxyfile
tools/ci/mirror-list.txt

index da7db2a35944a1aa16985d312b5d99da2a556bd7..75d56d9f935406fa6c1bbc77e9075d8cac8bf18f 100644 (file)
@@ -163,7 +163,7 @@ build_template_app:
     - sed -i.bak -e's/CONFIG_OPTIMIZATION_LEVEL_DEBUG\=y/CONFIG_OPTIMIZATION_LEVEL_RELEASE=y/' sdkconfig
     - make all V=1
     # Check if there are any stray printf/ets_printf references in WiFi libs
-    - cd ../components/esp32/lib
+    - cd ../components/esp_wifi/lib_esp32
     - test $(xtensa-esp32-elf-nm *.a | grep -w printf | wc -l) -eq 0
     - test $(xtensa-esp32-elf-nm *.a | grep -w ets_printf | wc -l) -eq 0
 
index a9489d8a1a1952b00a6af8fc927e3f54a5326f69..9c1e24c7b5ce862a85aeac3858beebb69d573a25 100644 (file)
@@ -1,7 +1,3 @@
-[submodule "components/esp32/lib"]
-       path = components/esp32/lib
-       url = https://github.com/espressif/esp32-wifi-lib.git
-
 [submodule "components/esptool_py/esptool"]
        path = components/esptool_py/esptool
        url = https://github.com/espressif/esptool.git
@@ -69,3 +65,7 @@
 [submodule "examples/build_system/cmake/import_lib/main/lib/tinyxml2"]
        path = examples/build_system/cmake/import_lib/main/lib/tinyxml2
        url = https://github.com/leethomason/tinyxml2
+
+[submodule "components/esp_wifi/lib_esp32"]
+       path = components/esp_wifi/lib_esp32
+       url = https://github.com/espressif/esp32-wifi-lib.git
index c368c68416c7014b5091eaedb3b7e96d81a9b9f4..2e628b6d55424ff384c841df8cb8fd7a29ce177e 100644 (file)
@@ -1,4 +1,4 @@
 # Submodules normally added in component.mk, but fully qualified
 # paths can be added at this level (we need binary librtc to be
 # available to link bootloader).
-COMPONENT_SUBMODULES += $(IDF_PATH)/components/esp32/lib
+COMPONENT_SUBMODULES += $(IDF_PATH)/components/esp_wifi/lib_esp32
index 5b418269da07a4f063395a2f9b034820d8cedbca..e16888ac6e7c91a3e03edad2339d24c27b1d7126 100644 (file)
@@ -13,7 +13,6 @@ else()
                    "cache_err_int.c"
                    "cache_sram_mmu.c"
                    "clk.c"
-                   "coexist.c"
                    "cpu_start.c"
                    "crosscore_int.c"
                    "dport_access.c"
@@ -21,26 +20,21 @@ else()
                    "esp_adapter.c"
                    "esp_timer_esp32.c"
                    "esp_himem.c"
-                   "fast_crypto_ops.c"
                    "freertos_hooks.c"
                    "gdbstub.c"
                    "hw_random.c"
                    "int_wdt.c"
                    "intr_alloc.c"
                    "ipc.c"
-                   "lib_printf.c"
                    "panic.c"
-                   "phy_init.c"
                    "pm_esp32.c"
                    "pm_trace.c"
                    "reset_reason.c"
-                   "restore.c"
                    "sleep_modes.c"
                    "spiram.c"
                    "spiram_psram.c"
                    "system_api.c"
-                   "task_wdt.c"
-                   "wifi_init.c")
+                   "task_wdt.c")
     set(COMPONENT_ADD_INCLUDEDIRS "include")
 
     set(COMPONENT_REQUIRES driver esp_event efuse)
@@ -48,16 +42,12 @@ else()
     # app_update is added here because cpu_start.c uses esp_ota_get_app_description() function.
     set(COMPONENT_PRIV_REQUIRES
         app_trace app_update bootloader_support log mbedtls nvs_flash
-        pthread smartconfig_ack spi_flash vfs wpa_supplicant espcoredump esp_common)
+        pthread smartconfig_ack spi_flash vfs wpa_supplicant espcoredump esp_common esp_wifi)
 
     set(COMPONENT_ADD_LDFRAGMENTS linker.lf ld/esp32_fragments.lf)
 
     register_component()
 
-    target_link_libraries(${COMPONENT_TARGET} "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib")
-    if(NOT CONFIG_NO_BLOBS)
-        target_link_libraries(${COMPONENT_TARGET} coexist core espnow mesh net80211 phy pp rtc smartconfig wpa2 wpa wps)
-    endif()
     target_linker_script(${COMPONENT_TARGET} "${CMAKE_CURRENT_BINARY_DIR}/esp32_out.ld")
 
     if(CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY)
@@ -101,27 +91,6 @@ else()
     add_custom_target(esp32_linker_script DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/esp32_out.ld)
     add_dependencies(${COMPONENT_TARGET} esp32_linker_script)
 
-    if(CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION AND IDF_BUILD_ARTIFACTS)
-        partition_table_get_partition_info(phy_partition_offset "--partition-type data --partition-subtype phy" "offset")
-        set(phy_init_data_bin "${IDF_BUILD_ARTIFACTS_DIR}/phy_init_data.bin")
-
-        # To get the phy_init_data.bin file, compile phy_init_data.h as a C file and then objcopy
-        # the object file to a raw binary
-        add_custom_command(
-            OUTPUT ${phy_init_data_bin}
-            DEPENDS ${CMAKE_CURRENT_LIST_DIR}/phy_init_data.h
-            COMMAND ${CMAKE_C_COMPILER} -x c -c
-            -I ${CMAKE_CURRENT_LIST_DIR} -I ${CMAKE_CURRENT_LIST_DIR}/include -I ${IDF_BUILD_ARTIFACTS_DIR}
-            -o phy_init_data.obj
-            ${CMAKE_CURRENT_LIST_DIR}/phy_init_data.h
-            COMMAND ${CMAKE_OBJCOPY} -O binary phy_init_data.obj ${phy_init_data_bin}
-            )
-        add_custom_target(phy_init_data ALL DEPENDS ${phy_init_data_bin})
-        add_dependencies(flash phy_init_data)
-
-        esptool_py_flash_project_args(phy ${phy_partition_offset} ${phy_init_data_bin} FLASH_IN_PROJECT)
-    endif()
-
     # Enable dynamic esp_timer overflow value if building unit tests
     if(esp32_test IN_LIST BUILD_TEST_COMPONENTS)
         add_definitions(-DESP_TIMER_DYNAMIC_OVERFLOW_VAL)
index abba9bbaf70836e70f7739fe9f248b315a22fc58..a067b6035927754f75ebd54b0403d5d01c87f882 100644 (file)
@@ -3,10 +3,6 @@
 #
 
 COMPONENT_SRCDIRS := .
-LIBS ?=
-ifndef CONFIG_NO_BLOBS
-LIBS += core rtc net80211 pp wpa smartconfig coexist wps wpa2 espnow phy mesh
-endif
 
 ifdef CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
    # This linker script must come before esp32.project.ld
@@ -22,8 +18,6 @@ LINKER_SCRIPTS += $(COMPONENT_BUILD_DIR)/esp32.project.ld esp32.peripherals.ld
 #linker will ignore panic_highint_hdl.S as it has no other files depending on any
 #symbols in it.
 COMPONENT_ADD_LDFLAGS += $(COMPONENT_PATH)/libhal.a \
-                         -L$(COMPONENT_PATH)/lib \
-                         $(addprefix -l,$(LIBS)) \
                          -L $(COMPONENT_PATH)/ld \
                          -T esp32_out.ld \
                          -u ld_include_panic_highint_hdl \
@@ -31,14 +25,9 @@ COMPONENT_ADD_LDFLAGS += $(COMPONENT_PATH)/libhal.a \
 
 COMPONENT_ADD_LDFRAGMENTS += ld/esp32_fragments.lf linker.lf
 
-ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
-
-COMPONENT_SUBMODULES += lib
-
 # final linking of project ELF depends on all binary libraries, and
 # all linker scripts (except esp32_out.ld, as this is code generated here.)
-COMPONENT_ADD_LINKER_DEPS := $(ALL_LIB_FILES) \
-                            $(addprefix ld/, $(filter-out $(COMPONENT_BUILD_DIR)/esp32.project.ld, $(LINKER_SCRIPTS))) \
+COMPONENT_ADD_LINKER_DEPS := $(addprefix ld/, $(filter-out $(COMPONENT_BUILD_DIR)/esp32.project.ld, $(LINKER_SCRIPTS))) \
                             $(COMPONENT_BUILD_DIR)/esp32.project.ld
 
 # Preprocess esp32.ld linker script into esp32_out.ld
index 342494233f96de1389874e646253051e81a37e86..7224414e8aa76570947c80e6ce77b277698b1d26 100644 (file)
@@ -33,8 +33,8 @@
 #include "esp_attr.h"
 #include "esp_log.h"
 #include "esp_heap_caps.h"
-#include "esp_wifi_os_adapter.h"
-#include "esp_wifi_internal.h"
+#include "esp_private/wifi_os_adapter.h"
+#include "esp_private/wifi.h"
 #include "esp_phy_init.h"
 #include "crypto/md5.h"
 #include "crypto/sha1.h"
index 040e29336e9ec7b936e1ef4c1cb766ec12f7718e..f4b9a5d5f0e80bff827a2ccda6398220e291af78 100644 (file)
@@ -1,42 +1,19 @@
 [mapping]
 archive: libesp32.a
-entries: 
+entries:
     panic (noflash)
 
-[mapping]
-archive: libphy.a
-entries: 
-    * (noflash_data)
-
 [mapping]
 archive: libhal.a
-entries: 
-    * (noflash_text)
-
-[mapping]
-archive: librtc.a
-entries: 
+entries:
     * (noflash_text)
 
 [mapping]
 archive: libgcc.a
-entries: 
+entries:
     lib2funcs (noflash_text)
 
 [mapping]
 archive: libgcov.a
-entries: 
+entries:
     * (noflash)
-
-[mapping]
-archive: libpp.a
-entries: 
-    : ESP32_WIFI_IRAM_OPT = y
-    * (wifi_iram)
-[mapping]
-archive: libnet80211.a
-entries: 
-    : ESP32_WIFI_IRAM_OPT = y
-    * (wifi_iram)
index cf6f74b41f748e2ad436df5ea22eb1abab886f1e..120e9ec465e5acc306d028382e88c0f8843fd922 100644 (file)
@@ -17,7 +17,7 @@
 #include "esp_system.h"
 #include "esp_attr.h"
 #include "esp_wifi.h"
-#include "esp_wifi_internal.h"
+#include "esp_private/wifi.h"
 #include "esp_log.h"
 #include "sdkconfig.h"
 #include "esp32/rom/efuse.h"
index bae2493d32b73e4c1595073461324d4548f1bb74..56ef10f5eba60112cc35067e89fa8ff142f7836c 100644 (file)
@@ -10,28 +10,6 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h"
                 WORKING_DIRECTORY ${COMPONENT_PATH}
                 DEPENDS "${CMAKE_CURRENT_LIST_DIR}/logo.jpg")
 
-# Calculate MD5 value of header file esp_wifi_os_adapter.h
-execute_process(COMMAND md5sum ${IDF_PATH}/components/esp32/include/esp_wifi_os_adapter.h
-                COMMAND cut -c 1-7
-                OUTPUT_VARIABLE WIFI_OS_ADAPTER_MD5
-                OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-# Calculate MD5 value of header file esp_wifi_crypto_types.h
-execute_process(COMMAND md5sum ${IDF_PATH}/components/esp32/include/esp_wifi_crypto_types.h
-                COMMAND cut -c 1-7
-                OUTPUT_VARIABLE WIFI_CRYPTO_MD5
-                OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-# Calculate MD5 value of header file esp_coexist_adapter.h
-execute_process(COMMAND md5sum ${IDF_PATH}/components/esp32/include/esp_coexist_adapter.h
-                COMMAND cut -c 1-7
-                OUTPUT_VARIABLE COEX_ADAPTER_MD5
-                OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-add_definitions(-DWIFI_OS_ADAPTER_MD5=\"${WIFI_OS_ADAPTER_MD5}\")
-add_definitions(-DWIFI_CRYPTO_MD5=\"${WIFI_CRYPTO_MD5}\")
-add_definitions(-DCOEX_ADAPTER_MD5=\"${COEX_ADAPTER_MD5}\")
-
 add_custom_target(esp32_test_logo DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h")
 
 add_dependencies(${COMPONENT_TARGET} esp32_test_logo)
index 6fb41f30a6ab4c3be3847417dace663a3854e540..eefb592ac217205d12a4bb1d3afcd0acb269cb3c 100644 (file)
@@ -8,18 +8,6 @@ COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-a
 
 COMPONENT_SRCDIRS := .
 
-# Calculate MD5 value of header file esp_wifi_os_adapter.h
-WIFI_OS_ADAPTER_MD5_VAL=\"$(shell md5sum $(IDF_PATH)/components/esp32/include/esp_wifi_os_adapter.h | cut -c 1-7)\"
-CFLAGS+=-DWIFI_OS_ADAPTER_MD5=$(WIFI_OS_ADAPTER_MD5_VAL)
-
-# Calculate MD5 value of header file esp_wifi_crypto_types.h
-WIFI_CRYPTO_MD5_VAL=\"$(shell md5sum $(IDF_PATH)/components/esp32/include/esp_wifi_crypto_types.h | cut -c 1-7)\"
-CFLAGS+=-DWIFI_CRYPTO_MD5=$(WIFI_CRYPTO_MD5_VAL)
-
-# Calculate MD5 value of header file esp_coexist_adapter.h
-COEX_ADAPTER_MD5_VAL=\"$(shell md5sum $(IDF_PATH)/components/esp32/include/esp_coexist_adapter.h | cut -c 1-7)\"
-CFLAGS+=-DCOEX_ADAPTER_MD5=$(COEX_ADAPTER_MD5_VAL)
-
 test_tjpgd.o: test_tjpgd_logo.h
 
 test_tjpgd_logo.h: $(COMPONENT_PATH)/logo.jpg
index 1a08e7e48ff046a9c9cda654bfda9a43f2d9c6ff..7506d9614295f70b81d7187170e35d6980e9114b 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "esp_err.h"
 #include "esp_wifi.h"
-#include "esp_wifi_internal.h"
+#include "esp_private/wifi.h"
 #include "esp_event.h"
 #include "esp_event_loop.h"
 #include "esp_task.h"
diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt
new file mode 100644 (file)
index 0000000..433d20f
--- /dev/null
@@ -0,0 +1,41 @@
+set(COMPONENT_SRCS
+    "src/coexist.c"
+    "src/fast_crypto_ops.c"
+    "src/lib_printf.c"
+    "src/phy_init.c"
+    "src/restore.c"
+    "src/wifi_init.c")
+set(COMPONENT_ADD_INCLUDEDIRS "include")
+set(COMPONENT_PRIV_INCLUDEDIRS)
+set(COMPONENT_REQUIRES)
+set(COMPONENT_PRIV_REQUIRES "wpa_supplicant" "nvs_flash")
+set(COMPONENT_ADD_LDFRAGMENTS "linker.lf")
+
+register_component()
+
+target_link_libraries(${COMPONENT_TARGET} "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib_${IDF_TARGET}")
+
+if(NOT CONFIG_NO_BLOBS)
+    target_link_libraries(${COMPONENT_TARGET} coexist core espnow mesh net80211 phy pp rtc smartconfig wpa2 wpa wps)
+endif()
+
+if(CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION AND IDF_BUILD_ARTIFACTS)
+    partition_table_get_partition_info(phy_partition_offset "--partition-type data --partition-subtype phy" "offset")
+    set(phy_init_data_bin "${IDF_BUILD_ARTIFACTS_DIR}/phy_init_data.bin")
+    # To get the phy_init_data.bin file, compile phy_init_data.h as a C file and then objcopy
+    # the object file to a raw binary
+    add_custom_command(
+        OUTPUT ${phy_init_data_bin}
+        DEPENDS ${CMAKE_CURRENT_LIST_DIR}/include/phy_init_data.h
+        COMMAND ${CMAKE_C_COMPILER} -x c -c
+        -I ${CMAKE_CURRENT_LIST_DIR} -I ${CMAKE_CURRENT_LIST_DIR}/include -I ${IDF_BUILD_ARTIFACTS_DIR}
+        -o phy_init_data.obj
+        ${CMAKE_CURRENT_LIST_DIR}/include/phy_init_data.h
+        COMMAND ${CMAKE_OBJCOPY} -O binary phy_init_data.obj ${phy_init_data_bin}
+        )
+    add_custom_target(phy_init_data ALL DEPENDS ${phy_init_data_bin})
+    add_dependencies(flash phy_init_data)
+
+    esptool_py_flash_project_args(phy ${phy_partition_offset} ${phy_init_data_bin} FLASH_IN_PROJECT)
+
+endif()
diff --git a/components/esp_wifi/component.mk b/components/esp_wifi/component.mk
new file mode 100644 (file)
index 0000000..cc865ea
--- /dev/null
@@ -0,0 +1,21 @@
+#
+# Component Makefile
+#
+
+COMPONENT_ADD_INCLUDEDIRS := include
+COMPONENT_SRCDIRS := src
+
+LIBS ?=
+ifndef CONFIG_NO_BLOBS
+LIBS += core rtc net80211 pp wpa smartconfig coexist wps wpa2 espnow phy mesh
+endif
+
+COMPONENT_ADD_LDFLAGS += -L$(COMPONENT_PATH)/lib_esp32 \
+                         $(addprefix -l,$(LIBS)) \
+
+COMPONENT_ADD_LDFRAGMENTS += linker.lf
+
+COMPONENT_SUBMODULES += lib_esp32
+
+ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib_esp32/lib%.a,$(LIBS))
+COMPONENT_ADD_LINKER_DEPS += $(ALL_LIB_FILES)
similarity index 99%
rename from components/esp32/include/esp_mesh_internal.h
rename to components/esp_wifi/include/esp_mesh_internal.h
index e061c45772571a852ee4c43646964655f0340cdf..89b03e7f2a31840e3fc1e90bfe45cd6680b2cf17 100644 (file)
@@ -18,7 +18,7 @@
 #include "esp_err.h"
 #include "esp_wifi.h"
 #include "esp_wifi_types.h"
-#include "esp_wifi_internal.h"
+#include "esp_private/wifi.h"
 #include "esp_wifi_crypto_types.h"
 
 #ifdef __cplusplus
similarity index 99%
rename from components/esp32/include/esp_wifi.h
rename to components/esp_wifi/include/esp_wifi.h
index bc8d0a844bc644acee3106096f3d5dc23b1b5f90..05265257a03c47d60613ff9ba7dd481084fcb2f7 100644 (file)
@@ -67,7 +67,7 @@
 #include "esp_wifi_types.h"
 #include "esp_wifi_crypto_types.h"
 #include "esp_event.h"
-#include "esp_wifi_os_adapter.h"
+#include "esp_private/wifi_os_adapter.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/components/esp_wifi/linker.lf b/components/esp_wifi/linker.lf
new file mode 100644 (file)
index 0000000..4c01c31
--- /dev/null
@@ -0,0 +1,22 @@
+[mapping]
+archive: libphy.a
+entries:
+    * (noflash_data)
+
+[mapping]
+archive: librtc.a
+entries:
+    * (noflash_text)
+
+[mapping]
+archive: libpp.a
+entries:
+    : ESP32_WIFI_IRAM_OPT = y
+    * (wifi_iram)
+
+[mapping]
+archive: libnet80211.a
+entries:
+    : ESP32_WIFI_IRAM_OPT = y
+    * (wifi_iram)
+
similarity index 99%
rename from components/esp32/phy_init.c
rename to components/esp_wifi/src/phy_init.c
index 6dfe83795ce1e62daacc95acaa5685b5e40e68ad..2fade4e35ce3033a0d61da04991ae8f27afee4e4 100644 (file)
@@ -38,7 +38,7 @@
 #include "phy_init_data.h"
 #include "esp_coexist_internal.h"
 #include "driver/periph_ctrl.h"
-#include "esp_wifi_internal.h"
+#include "esp_private/wifi.h"
 
 extern wifi_mac_time_update_cb_t s_wifi_mac_time_update_cb;
 
similarity index 99%
rename from components/esp32/wifi_init.c
rename to components/esp_wifi/src/wifi_init.c
index cf5d79b7b8ceca4eacb6d6c9dd50273ed0ccffc6..2115dc614d0192916d22675de29608da1d19353b 100644 (file)
@@ -15,7 +15,7 @@
 #include <esp_event.h>
 #include <esp_wifi.h>
 #include "esp_log.h"
-#include "esp_wifi_internal.h"
+#include "esp_private/wifi.h"
 #include "esp_pm.h"
 #include "soc/rtc.h"
 #include "esp_mesh.h"
diff --git a/components/esp_wifi/test/CMakeLists.txt b/components/esp_wifi/test/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4c300ea
--- /dev/null
@@ -0,0 +1,28 @@
+set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_ADD_INCLUDEDIRS ". ${CMAKE_CURRENT_BINARY_DIR}")
+
+set(COMPONENT_REQUIRES unity test_utils nvs_flash ulp esp_common)
+
+register_component()
+
+# Calculate MD5 value of header file esp_wifi_os_adapter.h
+execute_process(COMMAND md5sum ${IDF_PATH}/components/esp_wifi/include/esp_private/wifi_os_adapter.h
+                COMMAND cut -c 1-7
+                OUTPUT_VARIABLE WIFI_OS_ADAPTER_MD5
+                OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+# Calculate MD5 value of header file esp_wifi_crypto_types.h
+execute_process(COMMAND md5sum ${IDF_PATH}/components/esp_wifi/include/esp_wifi_crypto_types.h
+                COMMAND cut -c 1-7
+                OUTPUT_VARIABLE WIFI_CRYPTO_MD5
+                OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+# Calculate MD5 value of header file esp_coexist_adapter.h
+execute_process(COMMAND md5sum ${IDF_PATH}/components/esp_wifi/include/esp_coexist_adapter.h
+                COMMAND cut -c 1-7
+                OUTPUT_VARIABLE COEX_ADAPTER_MD5
+                OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+add_definitions(-DWIFI_OS_ADAPTER_MD5=\"${WIFI_OS_ADAPTER_MD5}\")
+add_definitions(-DWIFI_CRYPTO_MD5=\"${WIFI_CRYPTO_MD5}\")
+add_definitions(-DCOEX_ADAPTER_MD5=\"${COEX_ADAPTER_MD5}\")
diff --git a/components/esp_wifi/test/component.mk b/components/esp_wifi/test/component.mk
new file mode 100644 (file)
index 0000000..88f939f
--- /dev/null
@@ -0,0 +1,19 @@
+#
+#Component Makefile
+#
+
+COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive
+
+COMPONENT_SRCDIRS := .
+
+# Calculate MD5 value of header file esp_wifi_os_adapter.h
+WIFI_OS_ADAPTER_MD5_VAL=\"$(shell md5sum $(IDF_PATH)/components/esp_wifi/include/esp_private/wifi_os_adapter.h | cut -c 1-7)\"
+CFLAGS+=-DWIFI_OS_ADAPTER_MD5=$(WIFI_OS_ADAPTER_MD5_VAL)
+
+# Calculate MD5 value of header file esp_wifi_crypto_types.h
+WIFI_CRYPTO_MD5_VAL=\"$(shell md5sum $(IDF_PATH)/components/esp_wifi/include/esp_wifi_crypto_types.h | cut -c 1-7)\"
+CFLAGS+=-DWIFI_CRYPTO_MD5=$(WIFI_CRYPTO_MD5_VAL)
+
+# Calculate MD5 value of header file esp_coexist_adapter.h
+COEX_ADAPTER_MD5_VAL=\"$(shell md5sum $(IDF_PATH)/components/esp_wifi/include/esp_coexist_adapter.h | cut -c 1-7)\"
+CFLAGS+=-DCOEX_ADAPTER_MD5=$(COEX_ADAPTER_MD5_VAL)
similarity index 97%
rename from components/esp32/test/test_header_files_md5.c
rename to components/esp_wifi/test/test_header_files_md5.c
index c2d80350ac190a48192e652d40b984b96fa73a0a..cccf7028a698284708e90260bead9ed255962323 100644 (file)
@@ -3,7 +3,7 @@
 */
 #include "unity.h"
 #include "esp_log.h"
-#include "esp_wifi_internal.h"
+#include "esp_private/wifi.h"
 #include "esp_coexist_internal.h"
 
 static const char* TAG = "test_header_files_md5";
similarity index 85%
rename from components/esp32/test/test_wifi_lib_git_commit.c
rename to components/esp_wifi/test/test_wifi_lib_git_commit.c
index fbf1dea0e5a29257c584e7b985c220f166d7e3fd..f8e6f3940def3b6185b60bfc6f2100d1a2e88e87 100644 (file)
@@ -3,7 +3,7 @@
 */
 #include "unity.h"
 #include "esp_log.h"
-#include "esp_wifi_internal.h"
+#include "esp_private/wifi.h"
 
 TEST_CASE("wifi lib git commit id","[wifi]")
 {    
index aa53a6fecc63f8709546ab1e66f2ba00af862ddf..b5e1ee8a2133fca3b7ec07e98af3394ae0165213 100644 (file)
@@ -121,7 +121,7 @@ if(CONFIG_PPP_SUPPORT)
                    "lwip/src/netif/ppp/polarssl/sha1.c")
 endif()
 
-set(COMPONENT_REQUIRES vfs)
+set(COMPONENT_REQUIRES vfs esp_wifi)
 set(COMPONENT_PRIV_REQUIRES ethernet tcpip_adapter nvs_flash)
 
 set(COMPONENT_ADD_LDFRAGMENTS linker.lf)
index 9c79f5b0aff2aa5d07c6afed3779f4a88e635481..21fa91c3457e9ed31842ce0818b066bdc6763655 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "esp_wifi.h"
 
-#include "esp_wifi_internal.h"
+#include "esp_private/wifi.h"
 
 #include "lwip/err.h"
 
index aa3096bad40fa230298a5e53a125490f1dc73f88..250384d2e26bea7bf4f674df2cc242c0b16f91b6 100644 (file)
@@ -24,12 +24,12 @@ INPUT = \
     ##
     ## Wi-Fi - API Reference
     ##
-    ../../components/esp32/include/esp_wifi.h \
-    ../../components/esp32/include/esp_wifi_types.h \
-    ../../components/esp32/include/esp_smartconfig.h \
-    ../../components/esp32/include/esp_now.h \
+    ../../components/esp_wifi/include/esp_wifi.h \
+    ../../components/esp_wifi/include/esp_wifi_types.h \
+    ../../components/esp_wifi/include/esp_smartconfig.h \
+    ../../components/esp_wifi/include/esp_now.h \
     ## Mesh - API Reference
-    ../../components/esp32/include/esp_mesh.h \
+    ../../components/esp_wifi/include/esp_mesh.h \
     ## Bluetooth - API Reference
     ## Controller && VHCI
     ../../components/bt/include/esp_bt.h \
index 8495ee139f619627b90e04545f911e3eb61787b8..fbb8f154483d661cc1d57249680588204e60cf41 100644 (file)
@@ -1,4 +1,4 @@
-components/esp32/lib                                        @GENERAL_MIRROR_SERVER@/idf/esp32-wifi-lib.git
+components/esp_wifi/lib_esp32                               @GENERAL_MIRROR_SERVER@/idf/esp32-wifi-lib.git
 components/bt/lib                                           @GENERAL_MIRROR_SERVER@/idf/esp32-bt-lib.git
 components/esptool_py/esptool                               @GENERAL_MIRROR_SERVER@/idf/esptool.git
 components/aws_iot/aws-iot-device-sdk-embedded-C            @GENERAL_MIRROR_SERVER@/idf/aws-iot-device-sdk-embedded-C.git   ALLOW_TO_SYNC_FROM_PUBLIC