• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Header file of Broadcom Dongle Host Driver (DHD)
3  * Prefered Network Offload code and Wi-Fi Location Service(WLS) code.
4  *
5  * Copyright (C) 1999-2019, Broadcom.
6  *
7  *      Unless you and Broadcom execute a separate written software license
8  * agreement governing use of this software, this software is licensed to you
9  * under the terms of the GNU General Public License version 2 (the "GPL"),
10  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11  * following added to such license:
12  *
13  *      As a special exception, the copyright holders of this software give you
14  * permission to link this software with independent modules, and to copy and
15  * distribute the resulting executable under terms of your choice, provided that
16  * you also meet, for each linked independent module, the terms and conditions
17  * of the license of that module.  An independent module is a module which is
18  * not derived from this software.  The special exception does not apply to any
19  * modifications of the software.
20  *
21  *      Notwithstanding the above, under no circumstances may you combine this
22  * software in any way with any other Broadcom software provided under a license
23  * other than the GPL, without Broadcom's express prior written consent.
24  *
25  *
26  * <<Broadcom-WL-IPTag/Open:>>
27  *
28  * $Id: dhd_pno.h 805174 2019-02-15 17:26:01Z $
29  */
30 
31 #ifndef __DHD_PNO_H__
32 #define __DHD_PNO_H__
33 
34 #if defined(PNO_SUPPORT)
35 #define PNO_TLV_PREFIX 'S'
36 #define PNO_TLV_VERSION '1'
37 #define PNO_TLV_SUBTYPE_LEGACY_PNO '2'
38 #define PNO_TLV_RESERVED '0'
39 
40 #define PNO_BATCHING_SET "SET"
41 #define PNO_BATCHING_GET "GET"
42 #define PNO_BATCHING_STOP "STOP"
43 
44 #define PNO_PARAMS_DELIMETER " "
45 #define PNO_PARAM_CHANNEL_DELIMETER ","
46 #define PNO_PARAM_VALUE_DELLIMETER '='
47 #define PNO_PARAM_SCANFREQ "SCANFREQ"
48 #define PNO_PARAM_BESTN "BESTN"
49 #define PNO_PARAM_MSCAN "MSCAN"
50 #define PNO_PARAM_CHANNEL "CHANNEL"
51 #define PNO_PARAM_RTT "RTT"
52 
53 #define PNO_TLV_TYPE_SSID_IE 'S'
54 #define PNO_TLV_TYPE_TIME 'T'
55 #define PNO_TLV_FREQ_REPEAT 'R'
56 #define PNO_TLV_FREQ_EXPO_MAX 'M'
57 
58 #define MAXNUM_SSID_PER_ADD 16
59 #define MAXNUM_PNO_PARAMS 2
60 #define PNO_TLV_COMMON_LENGTH 1
61 #define DEFAULT_BATCH_MSCAN 16
62 
63 #define RESULTS_END_MARKER "----\n"
64 #define SCAN_END_MARKER "####\n"
65 #define AP_END_MARKER "====\n"
66 #define PNO_RSSI_MARGIN_DBM 30
67 
68 #define CSCAN_COMMAND "CSCAN "
69 #define CSCAN_TLV_PREFIX 'S'
70 #define CSCAN_TLV_VERSION 1
71 #define CSCAN_TLV_SUBVERSION 0
72 #define CSCAN_TLV_TYPE_SSID_IE 'S'
73 #define CSCAN_TLV_TYPE_CHANNEL_IE 'C'
74 #define CSCAN_TLV_TYPE_NPROBE_IE 'N'
75 #define CSCAN_TLV_TYPE_ACTIVE_IE 'A'
76 #define CSCAN_TLV_TYPE_PASSIVE_IE 'P'
77 #define CSCAN_TLV_TYPE_HOME_IE 'H'
78 #define CSCAN_TLV_TYPE_STYPE_IE 'T'
79 
80 #define WL_SCAN_PARAMS_SSID_MAX 10
81 #define GET_SSID "SSID="
82 #define GET_CHANNEL "CH="
83 #define GET_NPROBE "NPROBE="
84 #define GET_ACTIVE_ASSOC_DWELL "ACTIVE="
85 #define GET_PASSIVE_ASSOC_DWELL "PASSIVE="
86 #define GET_HOME_DWELL "HOME="
87 #define GET_SCAN_TYPE "TYPE="
88 
89 #if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
90 #define GSCAN_MAX_CH_BUCKETS 8
91 #define GSCAN_MAX_CHANNELS_IN_BUCKET 32
92 #define GSCAN_MAX_AP_CACHE_PER_SCAN 32
93 #define GSCAN_MAX_AP_CACHE 320
94 #define GSCAN_BG_BAND_MASK (1 << 0)
95 #define GSCAN_A_BAND_MASK (1 << 1)
96 #define GSCAN_DFS_MASK (1 << 2)
97 #define GSCAN_ABG_BAND_MASK (GSCAN_A_BAND_MASK | GSCAN_BG_BAND_MASK)
98 #define GSCAN_BAND_MASK (GSCAN_ABG_BAND_MASK | GSCAN_DFS_MASK)
99 
100 #define GSCAN_FLUSH_HOTLIST_CFG (1 << 0)
101 #define GSCAN_FLUSH_SIGNIFICANT_CFG (1 << 1)
102 #define GSCAN_FLUSH_SCAN_CFG (1 << 2)
103 #define GSCAN_FLUSH_EPNO_CFG (1 << 3)
104 #define GSCAN_FLUSH_ALL_CFG                                                    \
105     (GSCAN_FLUSH_SCAN_CFG | GSCAN_FLUSH_SIGNIFICANT_CFG |                      \
106      GSCAN_FLUSH_HOTLIST_CFG | GSCAN_FLUSH_EPNO_CFG)
107 #define DHD_EPNO_HIDDEN_SSID (1 << 0)
108 #define DHD_EPNO_A_BAND_TRIG (1 << 1)
109 #define DHD_EPNO_BG_BAND_TRIG (1 << 2)
110 #define DHD_EPNO_STRICT_MATCH (1 << 3)
111 #define DHD_EPNO_SAME_NETWORK (1 << 4)
112 #define DHD_PNO_USE_SSID (DHD_EPNO_HIDDEN_SSID | DHD_EPNO_STRICT_MATCH)
113 
114 /* Do not change GSCAN_BATCH_RETRIEVAL_COMPLETE */
115 #define GSCAN_BATCH_RETRIEVAL_COMPLETE 0
116 #define GSCAN_BATCH_RETRIEVAL_IN_PROGRESS 1
117 #define GSCAN_BATCH_NO_THR_SET 101
118 #define GSCAN_LOST_AP_WINDOW_DEFAULT 4
119 #define GSCAN_MIN_BSSID_TIMEOUT 90
120 #define GSCAN_BATCH_GET_MAX_WAIT 500
121 #define CHANNEL_BUCKET_EMPTY_INDEX 0xFFFF
122 #define GSCAN_RETRY_THRESHOLD 3
123 
124 #define MAX_EPNO_SSID_NUM 64
125 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
126 
127 enum scan_status {
128     /* SCAN ABORT by other scan */
129     PNO_STATUS_ABORT,
130     /* RTT is presence or not */
131     PNO_STATUS_RTT_PRESENCE,
132     /* Disable PNO by Driver */
133     PNO_STATUS_DISABLE,
134     /* NORMAL BATCHING GET */
135     PNO_STATUS_NORMAL,
136     /* WLC_E_PFN_BEST_BATCHING */
137     PNO_STATUS_EVENT,
138     PNO_STATUS_MAX
139 };
140 #define PNO_STATUS_ABORT_MASK 0x0001
141 #define PNO_STATUS_RTT_MASK 0x0002
142 #define PNO_STATUS_DISABLE_MASK 0x0004
143 #define PNO_STATUS_OOM_MASK 0x0010
144 
145 enum index_mode {
146     INDEX_OF_LEGACY_PARAMS,
147     INDEX_OF_BATCH_PARAMS,
148     INDEX_OF_HOTLIST_PARAMS,
149     /* GSCAN includes hotlist scan and they do not run
150      * independent of each other
151      */
152     INDEX_OF_GSCAN_PARAMS = INDEX_OF_HOTLIST_PARAMS,
153     INDEX_MODE_MAX
154 };
155 enum dhd_pno_status { DHD_PNO_DISABLED, DHD_PNO_ENABLED, DHD_PNO_SUSPEND };
156 typedef struct cmd_tlv {
157     char prefix;
158     char version;
159     char subtype;
160     char reserved;
161 } cmd_tlv_t;
162 #if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
163 typedef enum {
164     WIFI_BAND_UNSPECIFIED,
165     WIFI_BAND_BG = 1,           /* 2.4 GHz                   */
166     WIFI_BAND_A = 2,            /* 5 GHz without DFS         */
167     WIFI_BAND_A_DFS = 4,        /* 5 GHz DFS only            */
168     WIFI_BAND_A_WITH_DFS = 6,   /* 5 GHz with DFS            */
169     WIFI_BAND_ABG = 3,          /* 2.4 GHz + 5 GHz; no DFS   */
170     WIFI_BAND_ABG_WITH_DFS = 7, /* 2.4 GHz + 5 GHz with DFS  */
171 } gscan_wifi_band_t;
172 
173 typedef enum { HOTLIST_LOST, HOTLIST_FOUND } hotlist_type_t;
174 
175 typedef enum dhd_pno_gscan_cmd_cfg {
176     DHD_PNO_BATCH_SCAN_CFG_ID = 0,
177     DHD_PNO_GEOFENCE_SCAN_CFG_ID,
178     DHD_PNO_SIGNIFICANT_SCAN_CFG_ID,
179     DHD_PNO_SCAN_CFG_ID,
180     DHD_PNO_GET_CAPABILITIES,
181     DHD_PNO_GET_BATCH_RESULTS,
182     DHD_PNO_GET_CHANNEL_LIST,
183     DHD_PNO_GET_NEW_EPNO_SSID_ELEM,
184     DHD_PNO_EPNO_CFG_ID,
185     DHD_PNO_GET_AUTOJOIN_CAPABILITIES,
186     DHD_PNO_EPNO_PARAMS_ID
187 } dhd_pno_gscan_cmd_cfg_t;
188 
189 typedef enum dhd_pno_mode {
190     /* Wi-Fi Legacy PNO Mode */
191     DHD_PNO_NONE_MODE = 0,
192     DHD_PNO_LEGACY_MODE = (1 << (0)),
193     /* Wi-Fi Android BATCH SCAN Mode */
194     DHD_PNO_BATCH_MODE = (1 << (1)),
195     /* Wi-Fi Android Hotlist SCAN Mode */
196     DHD_PNO_HOTLIST_MODE = (1 << (2)),
197     /* Wi-Fi Google Android SCAN Mode */
198     DHD_PNO_GSCAN_MODE = (1 << (3))
199 } dhd_pno_mode_t;
200 #else
201 typedef enum dhd_pno_mode {
202     /* Wi-Fi Legacy PNO Mode */
203     DHD_PNO_NONE_MODE = 0,
204     DHD_PNO_LEGACY_MODE = (1 << (0)),
205     /* Wi-Fi Android BATCH SCAN Mode */
206     DHD_PNO_BATCH_MODE = (1 << (1)),
207     /* Wi-Fi Android Hotlist SCAN Mode */
208     DHD_PNO_HOTLIST_MODE = (1 << (2))
209 } dhd_pno_mode_t;
210 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
211 
212 typedef struct dhd_pno_ssid {
213     bool hidden;
214     int8 rssi_thresh;
215     uint8 dummy;
216     uint16 SSID_len;
217     uint32 flags;
218     int32 wpa_auth;
219     uchar SSID[DOT11_MAX_SSID_LEN];
220     struct list_head list;
221 } dhd_pno_ssid_t;
222 
223 struct dhd_pno_bssid {
224     struct ether_addr macaddr;
225     /* Bit4: suppress_lost, Bit3: suppress_found */
226     uint16 flags;
227     struct list_head list;
228 };
229 
230 typedef struct dhd_pno_bestnet_entry {
231     struct ether_addr BSSID;
232     uint8 SSID_len;
233     uint8 SSID[DOT11_MAX_SSID_LEN];
234     int8 RSSI;
235     uint8 channel;
236     uint32 timestamp;
237     uint16 rtt0; /* distance_cm based on RTT */
238     uint16 rtt1; /* distance_cm based on sample standard deviation */
239     unsigned long recorded_time;
240     struct list_head list;
241 } dhd_pno_bestnet_entry_t;
242 #define BESTNET_ENTRY_SIZE (sizeof(dhd_pno_bestnet_entry_t))
243 
244 typedef struct dhd_pno_bestnet_header {
245     struct dhd_pno_bestnet_header *next;
246     uint8 reason;
247     uint32 tot_cnt;
248     uint32 tot_size;
249     struct list_head entry_list;
250 } dhd_pno_best_header_t;
251 #define BEST_HEADER_SIZE (sizeof(dhd_pno_best_header_t))
252 
253 typedef struct dhd_pno_scan_results {
254     dhd_pno_best_header_t *bestnetheader;
255     uint8 cnt_header;
256     struct list_head list;
257 } dhd_pno_scan_results_t;
258 #define SCAN_RESULTS_SIZE (sizeof(dhd_pno_scan_results_t))
259 
260 struct dhd_pno_get_batch_info {
261     /* info related to get batch */
262     char *buf;
263     bool batch_started;
264     uint32 tot_scan_cnt;
265     uint32 expired_tot_scan_cnt;
266     uint32 top_node_cnt;
267     uint32 bufsize;
268     uint32 bytes_written;
269     int reason;
270     struct list_head scan_results_list;
271     struct list_head expired_scan_results_list;
272 };
273 struct dhd_pno_legacy_params {
274     uint16 scan_fr;
275     uint16 chan_list[WL_NUMCHANNELS];
276     uint16 nchan;
277     int pno_repeat;
278     int pno_freq_expo_max;
279     int nssid;
280     struct list_head ssid_list;
281 };
282 struct dhd_pno_batch_params {
283     int32 scan_fr;
284     uint8 bestn;
285     uint8 mscan;
286     uint8 band;
287     uint16 chan_list[WL_NUMCHANNELS];
288     uint16 nchan;
289     uint16 rtt;
290     struct dhd_pno_get_batch_info get_batch;
291 };
292 struct dhd_pno_hotlist_params {
293     uint8 band;
294     int32 scan_fr;
295     uint16 chan_list[WL_NUMCHANNELS];
296     uint16 nchan;
297     uint16 nbssid;
298     struct list_head bssid_list;
299 };
300 #if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
301 #define DHD_PNO_REPORT_NO_BATCH (1 << 2)
302 
303 typedef struct dhd_pno_gscan_channel_bucket {
304     uint16 bucket_freq_multiple;
305     /* band = 1 All bg band channels,
306      * band = 2 All a band channels,
307      * band = 0 chan_list channels
308      */
309     uint16 band;
310     uint8 report_flag;
311     uint8 num_channels;
312     uint16 repeat;
313     uint16 bucket_max_multiple;
314     uint16 chan_list[GSCAN_MAX_CHANNELS_IN_BUCKET];
315 } dhd_pno_gscan_channel_bucket_t;
316 
317 #define DHD_PNO_AUTH_CODE_OPEN 1  /*  Open   */
318 #define DHD_PNO_AUTH_CODE_PSK 2   /* WPA_PSK or WPA2PSK */
319 #define DHD_PNO_AUTH_CODE_EAPOL 4 /* any EAPOL    */
320 
321 #define DHD_EPNO_DEFAULT_INDEX 0xFFFFFFFF
322 
323 typedef struct dhd_epno_params {
324     uint8 ssid[DOT11_MAX_SSID_LEN];
325     uint8 ssid_len;
326     int8 rssi_thresh;
327     uint8 flags;
328     uint8 auth;
329     /* index required only for visble ssid */
330     uint32 index;
331     struct list_head list;
332 } dhd_epno_params_t;
333 
334 typedef struct dhd_epno_results {
335     uint8 ssid[DOT11_MAX_SSID_LEN];
336     uint8 ssid_len;
337     int8 rssi;
338     uint16 channel;
339     uint16 flags;
340     struct ether_addr bssid;
341 } dhd_epno_results_t;
342 
343 typedef struct dhd_pno_swc_evt_param {
344     uint16 results_rxed_so_far;
345     wl_pfn_significant_net_t *change_array;
346 } dhd_pno_swc_evt_param_t;
347 
348 typedef struct wifi_gscan_result {
349     uint64 ts;                         /* Time of discovery           */
350     char ssid[DOT11_MAX_SSID_LEN + 1]; /* null terminated		*/
351     struct ether_addr macaddr;         /* BSSID                      */
352     uint32 channel;                    /* channel frequency in MHz    */
353     int32 rssi;                        /* in db                       */
354     uint64 rtt;                        /* in nanoseconds              */
355     uint64 rtt_sd;                     /* standard deviation in rtt   */
356     uint16 beacon_period;              /* units are Kusec             */
357     uint16 capability;                 /* Capability information       */
358     uint32 pad;
359 } wifi_gscan_result_t;
360 
361 typedef struct wifi_gscan_full_result {
362     wifi_gscan_result_t fixed;
363     uint32 scan_ch_bucket;
364     uint32 ie_length; /* byte length of Information Elements */
365     char ie_data[1];  /* IE  data to follow       */
366 } wifi_gscan_full_result_t;
367 
368 typedef struct gscan_results_cache {
369     struct gscan_results_cache *next;
370     uint8 scan_id;
371     uint8 flag;
372     uint8 tot_count;
373     uint8 tot_consumed;
374     uint32 scan_ch_bucket;
375     wifi_gscan_result_t results[1];
376 } gscan_results_cache_t;
377 
378 typedef struct dhd_pno_gscan_capabilities {
379     int max_scan_cache_size;
380     int max_scan_buckets;
381     int max_ap_cache_per_scan;
382     int max_rssi_sample_size;
383     int max_scan_reporting_threshold;
384     int max_hotlist_bssids;
385     int max_hotlist_ssids;
386     int max_significant_wifi_change_aps;
387     int max_bssid_history_entries;
388     int max_epno_ssid_crc32;
389     int max_epno_hidden_ssid;
390     int max_white_list_ssid;
391 } dhd_pno_gscan_capabilities_t;
392 
393 typedef struct dhd_epno_ssid_cfg {
394     wl_ssid_ext_params_t params;
395     uint32 num_epno_ssid;
396     struct list_head epno_ssid_list;
397 } dhd_epno_ssid_cfg_t;
398 
399 struct dhd_pno_gscan_params {
400     int32 scan_fr;
401     uint8 bestn;
402     uint8 mscan;
403     uint8 buffer_threshold;
404     uint8 swc_nbssid_threshold;
405     uint8 swc_rssi_window_size;
406     uint8 lost_ap_window;
407     uint8 nchannel_buckets;
408     uint8 reason;
409     uint8 get_batch_flag;
410     uint8 send_all_results_flag;
411     uint16 max_ch_bucket_freq;
412     gscan_results_cache_t *gscan_batch_cache;
413     gscan_results_cache_t *gscan_hotlist_found;
414     gscan_results_cache_t *gscan_hotlist_lost;
415     uint16 nbssid_significant_change;
416     uint16 nbssid_hotlist;
417     struct dhd_pno_swc_evt_param param_significant;
418     struct dhd_pno_gscan_channel_bucket channel_bucket[GSCAN_MAX_CH_BUCKETS];
419     struct list_head hotlist_bssid_list;
420     struct list_head significant_bssid_list;
421     dhd_epno_ssid_cfg_t epno_cfg;
422     uint32 scan_id;
423 };
424 
425 typedef struct gscan_scan_params {
426     int32 scan_fr;
427     uint16 nchannel_buckets;
428     struct dhd_pno_gscan_channel_bucket channel_bucket[GSCAN_MAX_CH_BUCKETS];
429 } gscan_scan_params_t;
430 
431 typedef struct gscan_batch_params {
432     uint8 bestn;
433     uint8 mscan;
434     uint8 buffer_threshold;
435 } gscan_batch_params_t;
436 
437 struct bssid_t {
438     struct ether_addr macaddr;
439     int16 rssi_reporting_threshold; /* 0 -> no reporting threshold */
440 };
441 
442 typedef struct gscan_hotlist_scan_params {
443     uint16 lost_ap_window;   /* number of scans to declare LOST */
444     uint16 nbssid;           /* number of bssids  */
445     struct bssid_t bssid[1]; /* n bssids to follow */
446 } gscan_hotlist_scan_params_t;
447 
448 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
449 
450 typedef union dhd_pno_params {
451     struct dhd_pno_legacy_params params_legacy;
452     struct dhd_pno_batch_params params_batch;
453     struct dhd_pno_hotlist_params params_hotlist;
454 #if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
455     struct dhd_pno_gscan_params params_gscan;
456 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
457 } dhd_pno_params_t;
458 
459 typedef struct dhd_pno_status_info {
460     dhd_pub_t *dhd;
461     struct work_struct work;
462     struct mutex pno_mutex;
463 #ifdef GSCAN_SUPPORT
464     wait_queue_head_t batch_get_wait;
465 #endif /* GSCAN_SUPPORT */
466 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0))
467     wait_queue_head_t get_batch_done;
468     bool batch_recvd;
469 #else
470     struct completion get_batch_done;
471 #endif
472     bool wls_supported; /* wifi location service supported or not */
473     enum dhd_pno_status pno_status;
474     enum dhd_pno_mode pno_mode;
475     dhd_pno_params_t pno_params_arr[INDEX_MODE_MAX];
476     struct list_head head_list;
477 } dhd_pno_status_info_t;
478 
479 /* wrapper functions */
480 extern int dhd_dev_pno_enable(struct net_device *dev, int enable);
481 
482 extern int dhd_dev_pno_stop_for_ssid(struct net_device *dev);
483 
484 extern int dhd_dev_pno_set_for_ssid(struct net_device *dev,
485                                     wlc_ssid_ext_t *ssids_local, int nssid,
486                                     uint16 scan_fr, int pno_repeat,
487                                     int pno_freq_expo_max, uint16 *channel_list,
488                                     int nchan);
489 
490 extern int dhd_dev_pno_set_for_batch(struct net_device *dev,
491                                      struct dhd_pno_batch_params *batch_params);
492 
493 extern int dhd_dev_pno_get_for_batch(struct net_device *dev, char *buf,
494                                      int bufsize);
495 
496 extern int dhd_dev_pno_stop_for_batch(struct net_device *dev);
497 
498 extern int
499 dhd_dev_pno_set_for_hotlist(struct net_device *dev, wl_pfn_bssid_t *p_pfn_bssid,
500                             struct dhd_pno_hotlist_params *hotlist_params);
501 extern bool dhd_dev_is_legacy_pno_enabled(struct net_device *dev);
502 #if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
503 extern void *dhd_dev_pno_get_gscan(struct net_device *dev,
504                                    dhd_pno_gscan_cmd_cfg_t type, void *info,
505                                    uint32 *len);
506 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
507 #ifdef GSCAN_SUPPORT
508 extern int dhd_dev_pno_set_cfg_gscan(struct net_device *dev,
509                                      dhd_pno_gscan_cmd_cfg_t type, void *buf,
510                                      bool flush);
511 int dhd_dev_pno_lock_access_batch_results(struct net_device *dev);
512 void dhd_dev_pno_unlock_access_batch_results(struct net_device *dev);
513 extern int dhd_dev_pno_run_gscan(struct net_device *dev, bool run, bool flush);
514 extern int dhd_dev_pno_enable_full_scan_result(struct net_device *dev,
515                                                bool real_time);
516 int dhd_retreive_batch_scan_results(dhd_pub_t *dhd);
517 extern void *dhd_dev_hotlist_scan_event(struct net_device *dev,
518                                         const void *data, int *send_evt_bytes,
519                                         hotlist_type_t type, u32 *buf_len);
520 void *dhd_dev_process_full_gscan_result(struct net_device *dev,
521                                         const void *data, uint32 len,
522                                         int *send_evt_bytes);
523 extern int dhd_dev_gscan_batch_cache_cleanup(struct net_device *dev);
524 extern void dhd_dev_gscan_hotlist_cache_cleanup(struct net_device *dev,
525                                                 hotlist_type_t type);
526 extern int dhd_dev_wait_batch_results_complete(struct net_device *dev);
527 extern void *dhd_dev_process_epno_result(struct net_device *dev,
528                                          const void *data, uint32 event,
529                                          int *send_evt_bytes);
530 extern int dhd_dev_set_epno(struct net_device *dev);
531 extern int dhd_dev_flush_fw_epno(struct net_device *dev);
532 #endif /* GSCAN_SUPPORT */
533 /* dhd pno fuctions */
534 extern int dhd_pno_stop_for_ssid(dhd_pub_t *dhd);
535 extern int dhd_pno_enable(dhd_pub_t *dhd, int enable);
536 extern int dhd_pno_set_for_ssid(dhd_pub_t *dhd, wlc_ssid_ext_t *ssid_list,
537                                 int nssid, uint16 scan_fr, int pno_repeat,
538                                 int pno_freq_expo_max, uint16 *channel_list,
539                                 int nchan);
540 
541 extern int dhd_pno_set_for_batch(dhd_pub_t *dhd,
542                                  struct dhd_pno_batch_params *batch_params);
543 
544 extern int dhd_pno_get_for_batch(dhd_pub_t *dhd, char *buf, int bufsize,
545                                  int reason);
546 
547 extern int dhd_pno_stop_for_batch(dhd_pub_t *dhd);
548 
549 extern int
550 dhd_pno_set_for_hotlist(dhd_pub_t *dhd, wl_pfn_bssid_t *p_pfn_bssid,
551                         struct dhd_pno_hotlist_params *hotlist_params);
552 
553 extern int dhd_pno_stop_for_hotlist(dhd_pub_t *dhd);
554 
555 extern int dhd_pno_event_handler(dhd_pub_t *dhd, wl_event_msg_t *event,
556                                  void *event_data);
557 extern int dhd_pno_init(dhd_pub_t *dhd);
558 extern int dhd_pno_deinit(dhd_pub_t *dhd);
559 extern bool dhd_is_pno_supported(dhd_pub_t *dhd);
560 extern bool dhd_is_legacy_pno_enabled(dhd_pub_t *dhd);
561 #if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
562 extern void *dhd_pno_get_gscan(dhd_pub_t *dhd, dhd_pno_gscan_cmd_cfg_t type,
563                                void *info, uint32 *len);
564 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
565 #ifdef GSCAN_SUPPORT
566 extern int dhd_pno_set_cfg_gscan(dhd_pub_t *dhd, dhd_pno_gscan_cmd_cfg_t type,
567                                  void *buf, bool flush);
568 extern int dhd_pno_lock_batch_results(dhd_pub_t *dhd);
569 extern void dhd_pno_unlock_batch_results(dhd_pub_t *dhd);
570 extern int dhd_pno_initiate_gscan_request(dhd_pub_t *dhd, bool run, bool flush);
571 extern int dhd_pno_enable_full_scan_result(dhd_pub_t *dhd, bool real_time_flag);
572 extern int dhd_pno_cfg_gscan(dhd_pub_t *dhd, dhd_pno_gscan_cmd_cfg_t type,
573                              void *buf);
574 extern int dhd_dev_retrieve_batch_scan(struct net_device *dev);
575 extern void *dhd_handle_hotlist_scan_evt(dhd_pub_t *dhd, const void *event_data,
576                                          int *send_evt_bytes,
577                                          hotlist_type_t type, u32 *buf_len);
578 extern void *dhd_process_full_gscan_result(dhd_pub_t *dhd,
579                                            const void *event_data, uint32 len,
580                                            int *send_evt_bytes);
581 extern int dhd_gscan_batch_cache_cleanup(dhd_pub_t *dhd);
582 extern void dhd_gscan_hotlist_cache_cleanup(dhd_pub_t *dhd,
583                                             hotlist_type_t type);
584 extern int dhd_wait_batch_results_complete(dhd_pub_t *dhd);
585 extern void *dhd_pno_process_epno_result(dhd_pub_t *dhd, const void *data,
586                                          uint32 event, int *size);
587 extern void dhd_pno_translate_epno_fw_flags(uint32 *flags);
588 extern int dhd_pno_set_epno(dhd_pub_t *dhd);
589 extern int dhd_pno_flush_fw_epno(dhd_pub_t *dhd);
590 extern void dhd_pno_set_epno_auth_flag(uint32 *wpa_auth);
591 #endif /* GSCAN_SUPPORT */
592 #endif // endif
593 
594 #endif /* __DHD_PNO_H__ */
595