esp_adapter.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include <stddef.h>
  7. #include <stdlib.h>
  8. #include <stdio.h>
  9. #include <string.h>
  10. #include <assert.h>
  11. #include <pthread.h>
  12. #include "freertos/FreeRTOS.h"
  13. #include "freertos/task.h"
  14. #include "freertos/queue.h"
  15. #include "freertos/semphr.h"
  16. #include "freertos/event_groups.h"
  17. #include "freertos/portmacro.h"
  18. #include "riscv/interrupt.h"
  19. #include "esp_types.h"
  20. #include "esp_random.h"
  21. #include "esp_mac.h"
  22. #include "esp_task.h"
  23. #include "esp_intr_alloc.h"
  24. #include "esp_attr.h"
  25. #include "esp_log.h"
  26. #include "esp_event.h"
  27. #include "esp_heap_caps.h"
  28. #include "esp_timer.h"
  29. #include "esp_private/wifi_os_adapter.h"
  30. #include "esp_private/wifi.h"
  31. #include "esp_phy_init.h"
  32. #include "soc/rtc_cntl_reg.h"
  33. #include "soc/rtc.h"
  34. #include "soc/syscon_reg.h"
  35. #include "phy_init_data.h"
  36. #include "esp_private/periph_ctrl.h"
  37. #include "esp_private/esp_clk.h"
  38. #include "nvs.h"
  39. #include "os.h"
  40. #include "esp_smartconfig.h"
  41. #include "private/esp_coexist_internal.h"
  42. #include "esp32c2/rom/ets_sys.h"
  43. #include "private/esp_modem_wrapper.h"
  44. #define TAG "esp_adapter"
  45. #ifdef CONFIG_PM_ENABLE
  46. extern void wifi_apb80m_request(void);
  47. extern void wifi_apb80m_release(void);
  48. #endif
  49. IRAM_ATTR void *wifi_malloc( size_t size )
  50. {
  51. return malloc(size);
  52. }
  53. IRAM_ATTR void *wifi_realloc( void *ptr, size_t size )
  54. {
  55. return realloc(ptr, size);
  56. }
  57. IRAM_ATTR void *wifi_calloc( size_t n, size_t size )
  58. {
  59. return calloc(n, size);
  60. }
  61. static void * IRAM_ATTR wifi_zalloc_wrapper(size_t size)
  62. {
  63. void *ptr = wifi_calloc(1, size);
  64. return ptr;
  65. }
  66. wifi_static_queue_t* wifi_create_queue( int queue_len, int item_size)
  67. {
  68. wifi_static_queue_t *queue = NULL;
  69. queue = (wifi_static_queue_t*)heap_caps_malloc(sizeof(wifi_static_queue_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
  70. if (!queue) {
  71. return NULL;
  72. }
  73. queue->handle = xQueueCreate( queue_len, item_size);
  74. return queue;
  75. }
  76. void wifi_delete_queue(wifi_static_queue_t *queue)
  77. {
  78. if (queue) {
  79. vQueueDelete(queue->handle);
  80. free(queue);
  81. }
  82. }
  83. static void * wifi_create_queue_wrapper(int queue_len, int item_size)
  84. {
  85. return wifi_create_queue(queue_len, item_size);
  86. }
  87. static void wifi_delete_queue_wrapper(void *queue)
  88. {
  89. wifi_delete_queue(queue);
  90. }
  91. static void set_intr_wrapper(int32_t cpu_no, uint32_t intr_source, uint32_t intr_num, int32_t intr_prio)
  92. {
  93. intr_matrix_route(intr_source, intr_num);
  94. esprv_intc_int_set_priority(intr_num, intr_prio);
  95. esprv_intc_int_set_type(intr_num, INTR_TYPE_LEVEL);
  96. }
  97. static void clear_intr_wrapper(uint32_t intr_source, uint32_t intr_num)
  98. {
  99. }
  100. static void set_isr_wrapper(int32_t n, void *f, void *arg)
  101. {
  102. intr_handler_set(n, (intr_handler_t)f, arg);
  103. }
  104. static void enable_intr_wrapper(uint32_t intr_mask)
  105. {
  106. esprv_intc_int_enable(intr_mask);
  107. }
  108. static void disable_intr_wrapper(uint32_t intr_mask)
  109. {
  110. esprv_intc_int_disable(intr_mask);
  111. }
  112. static bool IRAM_ATTR is_from_isr_wrapper(void)
  113. {
  114. return !xPortCanYield();
  115. }
  116. static void wifi_thread_semphr_free(void* data)
  117. {
  118. SemaphoreHandle_t *sem = (SemaphoreHandle_t*)(data);
  119. if (sem) {
  120. vSemaphoreDelete(sem);
  121. }
  122. }
  123. static void * wifi_thread_semphr_get_wrapper(void)
  124. {
  125. static bool s_wifi_thread_sem_key_init = false;
  126. static pthread_key_t s_wifi_thread_sem_key;
  127. SemaphoreHandle_t sem = NULL;
  128. if (s_wifi_thread_sem_key_init == false) {
  129. if (0 != pthread_key_create(&s_wifi_thread_sem_key, wifi_thread_semphr_free)) {
  130. return NULL;
  131. }
  132. s_wifi_thread_sem_key_init = true;
  133. }
  134. sem = pthread_getspecific(s_wifi_thread_sem_key);
  135. if (!sem) {
  136. sem = xSemaphoreCreateCounting(1, 0);
  137. if (sem) {
  138. pthread_setspecific(s_wifi_thread_sem_key, sem);
  139. ESP_LOGV(TAG, "thread sem create: sem=%p", sem);
  140. }
  141. }
  142. ESP_LOGV(TAG, "thread sem get: sem=%p", sem);
  143. return (void*)sem;
  144. }
  145. static void * recursive_mutex_create_wrapper(void)
  146. {
  147. return (void *)xSemaphoreCreateRecursiveMutex();
  148. }
  149. static void * mutex_create_wrapper(void)
  150. {
  151. return (void *)xSemaphoreCreateMutex();
  152. }
  153. static void mutex_delete_wrapper(void *mutex)
  154. {
  155. vSemaphoreDelete(mutex);
  156. }
  157. static int32_t IRAM_ATTR mutex_lock_wrapper(void *mutex)
  158. {
  159. return (int32_t)xSemaphoreTakeRecursive(mutex, portMAX_DELAY);
  160. }
  161. static int32_t IRAM_ATTR mutex_unlock_wrapper(void *mutex)
  162. {
  163. return (int32_t)xSemaphoreGiveRecursive(mutex);
  164. }
  165. static void * queue_create_wrapper(uint32_t queue_len, uint32_t item_size)
  166. {
  167. return (void *)xQueueCreate(queue_len, item_size);
  168. }
  169. static int32_t queue_send_wrapper(void *queue, void *item, uint32_t block_time_tick)
  170. {
  171. if (block_time_tick == OSI_FUNCS_TIME_BLOCKING) {
  172. return (int32_t)xQueueSend(queue, item, portMAX_DELAY);
  173. } else {
  174. return (int32_t)xQueueSend(queue, item, block_time_tick);
  175. }
  176. }
  177. static int32_t IRAM_ATTR queue_send_from_isr_wrapper(void *queue, void *item, void *hptw)
  178. {
  179. return (int32_t)xQueueSendFromISR(queue, item, hptw);
  180. }
  181. static int32_t queue_send_to_back_wrapper(void *queue, void *item, uint32_t block_time_tick)
  182. {
  183. return (int32_t)xQueueGenericSend(queue, item, block_time_tick, queueSEND_TO_BACK);
  184. }
  185. static int32_t queue_send_to_front_wrapper(void *queue, void *item, uint32_t block_time_tick)
  186. {
  187. return (int32_t)xQueueGenericSend(queue, item, block_time_tick, queueSEND_TO_FRONT);
  188. }
  189. static int32_t queue_recv_wrapper(void *queue, void *item, uint32_t block_time_tick)
  190. {
  191. if (block_time_tick == OSI_FUNCS_TIME_BLOCKING) {
  192. return (int32_t)xQueueReceive(queue, item, portMAX_DELAY);
  193. } else {
  194. return (int32_t)xQueueReceive(queue, item, block_time_tick);
  195. }
  196. }
  197. static uint32_t event_group_wait_bits_wrapper(void *event, uint32_t bits_to_wait_for, int clear_on_exit, int wait_for_all_bits, uint32_t block_time_tick)
  198. {
  199. if (block_time_tick == OSI_FUNCS_TIME_BLOCKING) {
  200. return (uint32_t)xEventGroupWaitBits(event, bits_to_wait_for, clear_on_exit, wait_for_all_bits, portMAX_DELAY);
  201. } else {
  202. return (uint32_t)xEventGroupWaitBits(event, bits_to_wait_for, clear_on_exit, wait_for_all_bits, block_time_tick);
  203. }
  204. }
  205. static int32_t task_create_pinned_to_core_wrapper(void *task_func, const char *name, uint32_t stack_depth, void *param, uint32_t prio, void *task_handle, uint32_t core_id)
  206. {
  207. return (uint32_t)xTaskCreatePinnedToCore(task_func, name, stack_depth, param, prio, task_handle, (core_id < portNUM_PROCESSORS ? core_id : tskNO_AFFINITY));
  208. }
  209. static int32_t task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth, void *param, uint32_t prio, void *task_handle)
  210. {
  211. return (uint32_t)xTaskCreate(task_func, name, stack_depth, param, prio, task_handle);
  212. }
  213. static int32_t IRAM_ATTR task_ms_to_tick_wrapper(uint32_t ms)
  214. {
  215. return (int32_t)(ms / portTICK_PERIOD_MS);
  216. }
  217. static int32_t task_get_max_priority_wrapper(void)
  218. {
  219. return (int32_t)(configMAX_PRIORITIES);
  220. }
  221. static int32_t esp_event_post_wrapper(const char* event_base, int32_t event_id, void* event_data, size_t event_data_size, uint32_t ticks_to_wait)
  222. {
  223. if (ticks_to_wait == OSI_FUNCS_TIME_BLOCKING) {
  224. return (int32_t)esp_event_post(event_base, event_id, event_data, event_data_size, portMAX_DELAY);
  225. } else {
  226. return (int32_t)esp_event_post(event_base, event_id, event_data, event_data_size, ticks_to_wait);
  227. }
  228. }
  229. static void IRAM_ATTR wifi_apb80m_request_wrapper(void)
  230. {
  231. #ifdef CONFIG_PM_ENABLE
  232. wifi_apb80m_request();
  233. #endif
  234. }
  235. static void IRAM_ATTR wifi_apb80m_release_wrapper(void)
  236. {
  237. #ifdef CONFIG_PM_ENABLE
  238. wifi_apb80m_release();
  239. #endif
  240. }
  241. static void IRAM_ATTR timer_arm_wrapper(void *timer, uint32_t tmout, bool repeat)
  242. {
  243. ets_timer_arm(timer, tmout, repeat);
  244. }
  245. static void wifi_reset_mac_wrapper(void)
  246. {
  247. periph_module_reset(PERIPH_WIFI_MODULE);
  248. }
  249. static void wifi_clock_enable_wrapper(void)
  250. {
  251. wifi_module_enable();
  252. }
  253. static void wifi_clock_disable_wrapper(void)
  254. {
  255. wifi_module_disable();
  256. }
  257. static int get_time_wrapper(void *t)
  258. {
  259. return os_get_time(t);
  260. }
  261. static void * IRAM_ATTR realloc_internal_wrapper(void *ptr, size_t size)
  262. {
  263. return heap_caps_realloc(ptr, size, MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL);
  264. }
  265. static void * IRAM_ATTR calloc_internal_wrapper(size_t n, size_t size)
  266. {
  267. return heap_caps_calloc(n, size, MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL);
  268. }
  269. static void * IRAM_ATTR zalloc_internal_wrapper(size_t size)
  270. {
  271. void *ptr = heap_caps_calloc(1, size, MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL);
  272. return ptr;
  273. }
  274. static esp_err_t nvs_open_wrapper(const char* name, unsigned int open_mode, nvs_handle_t *out_handle)
  275. {
  276. return nvs_open(name,(nvs_open_mode_t)open_mode, out_handle);
  277. }
  278. static void esp_log_writev_wrapper(unsigned int level, const char *tag, const char *format, va_list args)
  279. {
  280. return esp_log_writev((esp_log_level_t)level,tag,format,args);
  281. }
  282. static void esp_log_write_wrapper(unsigned int level,const char *tag,const char *format, ...)
  283. {
  284. va_list list;
  285. va_start(list, format);
  286. esp_log_writev((esp_log_level_t)level, tag, format, list);
  287. va_end(list);
  288. }
  289. static esp_err_t esp_read_mac_wrapper(uint8_t* mac, unsigned int type)
  290. {
  291. return esp_read_mac(mac, (esp_mac_type_t)type);
  292. }
  293. static int coex_init_wrapper(void)
  294. {
  295. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  296. return coex_init();
  297. #else
  298. return 0;
  299. #endif
  300. }
  301. static void coex_deinit_wrapper(void)
  302. {
  303. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  304. coex_deinit();
  305. #endif
  306. }
  307. static int coex_enable_wrapper(void)
  308. {
  309. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  310. return coex_enable();
  311. #else
  312. return 0;
  313. #endif
  314. }
  315. static void coex_disable_wrapper(void)
  316. {
  317. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  318. coex_disable();
  319. #endif
  320. }
  321. static IRAM_ATTR uint32_t coex_status_get_wrapper(void)
  322. {
  323. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  324. return coex_status_get();
  325. #else
  326. return 0;
  327. #endif
  328. }
  329. static int coex_wifi_request_wrapper(uint32_t event, uint32_t latency, uint32_t duration)
  330. {
  331. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  332. return coex_wifi_request(event, latency, duration);
  333. #else
  334. return 0;
  335. #endif
  336. }
  337. static IRAM_ATTR int coex_wifi_release_wrapper(uint32_t event)
  338. {
  339. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  340. return coex_wifi_release(event);
  341. #else
  342. return 0;
  343. #endif
  344. }
  345. static int coex_wifi_channel_set_wrapper(uint8_t primary, uint8_t secondary)
  346. {
  347. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  348. return coex_wifi_channel_set(primary, secondary);
  349. #else
  350. return 0;
  351. #endif
  352. }
  353. static IRAM_ATTR int coex_event_duration_get_wrapper(uint32_t event, uint32_t *duration)
  354. {
  355. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  356. return coex_event_duration_get(event, duration);
  357. #else
  358. return 0;
  359. #endif
  360. }
  361. static int coex_pti_get_wrapper(uint32_t event, uint8_t *pti)
  362. {
  363. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  364. return coex_pti_get(event, pti);
  365. #else
  366. return 0;
  367. #endif
  368. }
  369. static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status)
  370. {
  371. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  372. coex_schm_status_bit_clear(type, status);
  373. #endif
  374. }
  375. static void coex_schm_status_bit_set_wrapper(uint32_t type, uint32_t status)
  376. {
  377. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  378. coex_schm_status_bit_set(type, status);
  379. #endif
  380. }
  381. static IRAM_ATTR int coex_schm_interval_set_wrapper(uint32_t interval)
  382. {
  383. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  384. return coex_schm_interval_set(interval);
  385. #else
  386. return 0;
  387. #endif
  388. }
  389. static uint32_t coex_schm_interval_get_wrapper(void)
  390. {
  391. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  392. return coex_schm_interval_get();
  393. #else
  394. return 0;
  395. #endif
  396. }
  397. static uint8_t coex_schm_curr_period_get_wrapper(void)
  398. {
  399. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  400. return coex_schm_curr_period_get();
  401. #else
  402. return 0;
  403. #endif
  404. }
  405. static void * coex_schm_curr_phase_get_wrapper(void)
  406. {
  407. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  408. return coex_schm_curr_phase_get();
  409. #else
  410. return NULL;
  411. #endif
  412. }
  413. static int coex_register_start_cb_wrapper(int (* cb)(void))
  414. {
  415. #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
  416. return coex_register_start_cb(cb);
  417. #else
  418. return 0;
  419. #endif
  420. }
  421. static int coex_schm_process_restart_wrapper(void)
  422. {
  423. #if CONFIG_SW_COEXIST_ENABLE
  424. return coex_schm_process_restart();
  425. #else
  426. return 0;
  427. #endif
  428. }
  429. static int coex_schm_register_cb_wrapper(int type, int(*cb)(int))
  430. {
  431. #if CONFIG_SW_COEXIST_ENABLE
  432. return coex_schm_register_callback(type, cb);
  433. #else
  434. return 0;
  435. #endif
  436. }
  437. static void IRAM_ATTR esp_empty_wrapper(void)
  438. {
  439. }
  440. static void esp_phy_enable_wrapper(void)
  441. {
  442. esp_phy_enable(PHY_MODEM_WIFI);
  443. phy_wifi_enable_set(1);
  444. }
  445. static void esp_phy_disable_wrapper(void)
  446. {
  447. phy_wifi_enable_set(0);
  448. esp_phy_disable(PHY_MODEM_WIFI);
  449. }
  450. wifi_osi_funcs_t g_wifi_osi_funcs = {
  451. ._version = ESP_WIFI_OS_ADAPTER_VERSION,
  452. ._env_is_chip = esp_coex_common_env_is_chip_wrapper,
  453. ._set_intr = set_intr_wrapper,
  454. ._clear_intr = clear_intr_wrapper,
  455. ._set_isr = set_isr_wrapper,
  456. ._ints_on = enable_intr_wrapper,
  457. ._ints_off = disable_intr_wrapper,
  458. ._is_from_isr = is_from_isr_wrapper,
  459. ._spin_lock_create = esp_coex_common_spin_lock_create_wrapper,
  460. ._spin_lock_delete = free,
  461. ._wifi_int_disable = esp_coex_common_int_disable_wrapper,
  462. ._wifi_int_restore = esp_coex_common_int_restore_wrapper,
  463. ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper,
  464. ._semphr_create = esp_coex_common_semphr_create_wrapper,
  465. ._semphr_delete = esp_coex_common_semphr_delete_wrapper,
  466. ._semphr_take = esp_coex_common_semphr_take_wrapper,
  467. ._semphr_give = esp_coex_common_semphr_give_wrapper,
  468. ._wifi_thread_semphr_get = wifi_thread_semphr_get_wrapper,
  469. ._mutex_create = mutex_create_wrapper,
  470. ._recursive_mutex_create = recursive_mutex_create_wrapper,
  471. ._mutex_delete = mutex_delete_wrapper,
  472. ._mutex_lock = mutex_lock_wrapper,
  473. ._mutex_unlock = mutex_unlock_wrapper,
  474. ._queue_create = queue_create_wrapper,
  475. ._queue_delete = (void(*)(void *))vQueueDelete,
  476. ._queue_send = queue_send_wrapper,
  477. ._queue_send_from_isr = queue_send_from_isr_wrapper,
  478. ._queue_send_to_back = queue_send_to_back_wrapper,
  479. ._queue_send_to_front = queue_send_to_front_wrapper,
  480. ._queue_recv = queue_recv_wrapper,
  481. ._queue_msg_waiting = (uint32_t(*)(void *))uxQueueMessagesWaiting,
  482. ._event_group_create = (void *(*)(void))xEventGroupCreate,
  483. ._event_group_delete = (void(*)(void *))vEventGroupDelete,
  484. ._event_group_set_bits = (uint32_t(*)(void *,uint32_t))xEventGroupSetBits,
  485. ._event_group_clear_bits = (uint32_t(*)(void *,uint32_t))xEventGroupClearBits,
  486. ._event_group_wait_bits = event_group_wait_bits_wrapper,
  487. ._task_create_pinned_to_core = task_create_pinned_to_core_wrapper,
  488. ._task_create = task_create_wrapper,
  489. ._task_delete = (void(*)(void *))vTaskDelete,
  490. ._task_delay = vTaskDelay,
  491. ._task_ms_to_tick = task_ms_to_tick_wrapper,
  492. ._task_get_current_task = (void *(*)(void))xTaskGetCurrentTaskHandle,
  493. ._task_get_max_priority = task_get_max_priority_wrapper,
  494. ._malloc = malloc,
  495. ._free = free,
  496. ._event_post = esp_event_post_wrapper,
  497. ._get_free_heap_size = esp_get_free_internal_heap_size,
  498. ._rand = esp_random,
  499. ._dport_access_stall_other_cpu_start_wrap = esp_empty_wrapper,
  500. ._dport_access_stall_other_cpu_end_wrap = esp_empty_wrapper,
  501. ._wifi_apb80m_request = wifi_apb80m_request_wrapper,
  502. ._wifi_apb80m_release = wifi_apb80m_release_wrapper,
  503. ._phy_disable = esp_phy_disable_wrapper,
  504. ._phy_enable = esp_phy_enable_wrapper,
  505. ._phy_update_country_info = esp_phy_update_country_info,
  506. ._read_mac = esp_read_mac_wrapper,
  507. ._timer_arm = timer_arm_wrapper,
  508. ._timer_disarm = esp_coex_common_timer_disarm_wrapper,
  509. ._timer_done = esp_coex_common_timer_done_wrapper,
  510. ._timer_setfn = esp_coex_common_timer_setfn_wrapper,
  511. ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper,
  512. ._wifi_reset_mac = wifi_reset_mac_wrapper,
  513. ._wifi_clock_enable = wifi_clock_enable_wrapper,
  514. ._wifi_clock_disable = wifi_clock_disable_wrapper,
  515. ._wifi_rtc_enable_iso = esp_empty_wrapper,
  516. ._wifi_rtc_disable_iso = esp_empty_wrapper,
  517. ._esp_timer_get_time = esp_timer_get_time,
  518. ._nvs_set_i8 = nvs_set_i8,
  519. ._nvs_get_i8 = nvs_get_i8,
  520. ._nvs_set_u8 = nvs_set_u8,
  521. ._nvs_get_u8 = nvs_get_u8,
  522. ._nvs_set_u16 = nvs_set_u16,
  523. ._nvs_get_u16 = nvs_get_u16,
  524. ._nvs_open = nvs_open_wrapper,
  525. ._nvs_close = nvs_close,
  526. ._nvs_commit = nvs_commit,
  527. ._nvs_set_blob = nvs_set_blob,
  528. ._nvs_get_blob = nvs_get_blob,
  529. ._nvs_erase_key = nvs_erase_key,
  530. ._get_random = os_get_random,
  531. ._get_time = get_time_wrapper,
  532. ._random = os_random,
  533. ._slowclk_cal_get = esp_coex_common_clk_slowclk_cal_get_wrapper,
  534. ._log_write = esp_log_write_wrapper,
  535. ._log_writev = esp_log_writev_wrapper,
  536. ._log_timestamp = esp_log_timestamp,
  537. ._malloc_internal = esp_coex_common_malloc_internal_wrapper,
  538. ._realloc_internal = realloc_internal_wrapper,
  539. ._calloc_internal = calloc_internal_wrapper,
  540. ._zalloc_internal = zalloc_internal_wrapper,
  541. ._wifi_malloc = wifi_malloc,
  542. ._wifi_realloc = wifi_realloc,
  543. ._wifi_calloc = wifi_calloc,
  544. ._wifi_zalloc = wifi_zalloc_wrapper,
  545. ._wifi_create_queue = wifi_create_queue_wrapper,
  546. ._wifi_delete_queue = wifi_delete_queue_wrapper,
  547. ._coex_init = coex_init_wrapper,
  548. ._coex_deinit = coex_deinit_wrapper,
  549. ._coex_enable = coex_enable_wrapper,
  550. ._coex_disable = coex_disable_wrapper,
  551. ._coex_status_get = coex_status_get_wrapper,
  552. ._coex_wifi_request = coex_wifi_request_wrapper,
  553. ._coex_wifi_release = coex_wifi_release_wrapper,
  554. ._coex_wifi_channel_set = coex_wifi_channel_set_wrapper,
  555. ._coex_event_duration_get = coex_event_duration_get_wrapper,
  556. ._coex_pti_get = coex_pti_get_wrapper,
  557. ._coex_schm_status_bit_clear = coex_schm_status_bit_clear_wrapper,
  558. ._coex_schm_status_bit_set = coex_schm_status_bit_set_wrapper,
  559. ._coex_schm_interval_set = coex_schm_interval_set_wrapper,
  560. ._coex_schm_interval_get = coex_schm_interval_get_wrapper,
  561. ._coex_schm_curr_period_get = coex_schm_curr_period_get_wrapper,
  562. ._coex_schm_curr_phase_get = coex_schm_curr_phase_get_wrapper,
  563. ._coex_register_start_cb = coex_register_start_cb_wrapper,
  564. ._coex_schm_process_restart = coex_schm_process_restart_wrapper,
  565. ._coex_schm_register_cb = coex_schm_register_cb_wrapper,
  566. ._magic = ESP_WIFI_OS_ADAPTER_MAGIC,
  567. };