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