1 /*
2  * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ESP_COMMON_I_H
8 #define ESP_COMMON_I_H
9 
10 #include "utils/includes.h"
11 
12 struct wpa_funcs;
13 
14 #ifdef ROAMING_SUPPORT
15 struct ieee_mgmt_frame {
16 	u8 sender[ETH_ALEN];
17 	u8 channel;
18 	u32 rssi;
19 	size_t len;
20 	u8 payload[0];
21 };
22 
23 typedef struct {
24     uint32_t id;
25     uint32_t data;
26 } supplicant_event_t;
27 
28 #define SUPPLICANT_API_LOCK() xSemaphoreTakeRecursive(s_supplicant_api_lock, portMAX_DELAY)
29 #define SUPPLICANT_API_UNLOCK() xSemaphoreGiveRecursive(s_supplicant_api_lock)
30 
31 #define SUPPLICANT_TASK_STACK_SIZE (6144 + TASK_STACK_SIZE_ADD)
32 enum SIG_SUPPLICANT {
33 	SIG_SUPPLICANT_RX_ACTION,
34 	SIG_SUPPLICANT_SCAN_DONE,
35 	SIG_SUPPLICANT_DEL_TASK,
36 	SIG_SUPPLICANT_MAX,
37 };
38 
39 int esp_supplicant_post_evt(uint32_t evt_id, uint32_t data);
40 void esp_get_tx_power(uint8_t *tx_power);
41 int esp_supplicant_common_init(struct wpa_funcs *wpa_cb);
42 void esp_supplicant_common_deinit(void);
43 void esp_set_scan_ie(void);
44 void esp_set_assoc_ie(void);
45 #else
46 
47 #include "esp_rrm.h"
48 #include "esp_wnm.h"
49 #include "esp_mbo.h"
50 
esp_set_scan_ie(void)51 static inline void esp_set_scan_ie(void) { }
esp_set_assoc_ie(void)52 static inline void esp_set_assoc_ie(void) { }
53 
esp_rrm_send_neighbor_rep_request(neighbor_rep_request_cb cb,void * cb_ctx)54 int esp_rrm_send_neighbor_rep_request(neighbor_rep_request_cb cb,
55 				      void *cb_ctx)
56 {
57 	return -1;
58 }
59 
esp_wnm_send_bss_transition_mgmt_query(enum btm_query_reason query_reason,const char * btm_candidates,int cand_list)60 int esp_wnm_send_bss_transition_mgmt_query(enum btm_query_reason query_reason,
61 					   const char *btm_candidates,
62 					   int cand_list)
63 {
64 	return -1;
65 }
66 
esp_mbo_update_non_pref_chan(struct non_pref_chan_s * non_pref_chan)67 int esp_mbo_update_non_pref_chan(struct non_pref_chan_s *non_pref_chan)
68 {
69 	return -1;
70 }
71 #endif
72 #endif
73