1 /* SPDX-License-Identifier: GPL-2.0 */ 2 3 #ifndef _wl_escan_ 4 #define _wl_escan_ 5 #include <linuxver.h> 6 #include <wl_iw.h> 7 8 #define ESCAN_BUF_SIZE (64 * 1024) 9 10 #define WL_ESCAN_TIMER_INTERVAL_MS 10000 /* Scan timeout */ 11 12 /* donlge escan state */ 13 enum escan_state { 14 ESCAN_STATE_DOWN, 15 ESCAN_STATE_IDLE, 16 ESCAN_STATE_SCANING 17 }; 18 19 typedef struct wl_escan_info { 20 struct net_device *dev; 21 bool scan_params_v2; 22 dhd_pub_t *pub; 23 timer_list_compat_t scan_timeout; /* Timer for catch scan event timeout */ 24 int escan_state; 25 int ioctl_ver; 26 u8 escan_buf[ESCAN_BUF_SIZE]; 27 wl_scan_results_t *bss_list; 28 u8 *escan_ioctl_buf; 29 struct mutex usr_sync; /* maily for up/down synchronization */ 30 int autochannel; 31 int best_2g_ch; 32 int best_5g_ch; 33 #if defined(RSSIAVG) 34 wl_rssi_cache_ctrl_t g_rssi_cache_ctrl; 35 wl_rssi_cache_ctrl_t g_connected_rssi_cache_ctrl; 36 #endif 37 #if defined(BSSCACHE) 38 wl_bss_cache_ctrl_t g_bss_cache_ctrl; 39 #endif 40 } wl_escan_info_t; 41 42 #if defined(WLMESH) 43 enum mesh_info_id { 44 MESH_INFO_MASTER_BSSID = 1, 45 MESH_INFO_MASTER_CHANNEL, 46 MESH_INFO_HOP_CNT, 47 MESH_INFO_PEER_BSSID 48 }; 49 50 #define MAX_HOP_LIST 10 51 typedef struct wl_mesh_params { 52 struct ether_addr master_bssid; 53 uint16 master_channel; 54 uint hop_cnt; 55 struct ether_addr peer_bssid[MAX_HOP_LIST]; 56 uint16 scan_channel; 57 } wl_mesh_params_t; 58 bool wl_escan_mesh_info(struct net_device *dev, 59 struct wl_escan_info *escan, struct ether_addr *peer_bssid, 60 struct wl_mesh_params *mesh_info); 61 bool wl_escan_mesh_peer(struct net_device *dev, 62 struct wl_escan_info *escan, wlc_ssid_t *cur_ssid, uint16 cur_chan, bool sae, 63 struct wl_mesh_params *mesh_info); 64 #endif /* WLMESH */ 65 66 int wl_escan_set_scan(struct net_device *dev, dhd_pub_t *dhdp, 67 wlc_ssid_t *ssid, uint16 channel, bool bcast); 68 int wl_escan_get_scan(struct net_device *dev, dhd_pub_t *dhdp, 69 struct iw_request_info *info, struct iw_point *dwrq, char *extra); 70 int wl_escan_attach(struct net_device *dev, dhd_pub_t *dhdp); 71 void wl_escan_detach(struct net_device *dev, dhd_pub_t *dhdp); 72 int wl_escan_event_attach(struct net_device *dev, dhd_pub_t *dhdp); 73 int wl_escan_event_dettach(struct net_device *dev, dhd_pub_t *dhdp); 74 int wl_escan_up(struct net_device *dev, dhd_pub_t *dhdp); 75 void wl_escan_down(struct net_device *dev, dhd_pub_t *dhdp); 76 77 #endif /* _wl_escan_ */ 78 79