• 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-2017, Broadcom Corporation
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 of
17  * the license of that module.  An independent module is a module which is not
18  * 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 707287 2017-06-27 06:44:29Z $
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     (GSCAN_FLUSH_SCAN_CFG | \
105                                 GSCAN_FLUSH_SIGNIFICANT_CFG | \
106                                 GSCAN_FLUSH_HOTLIST_CFG  | \
107                                 GSCAN_FLUSH_EPNO_CFG)
108 #define DHD_EPNO_HIDDEN_SSID          (1 << 0)
109 #define DHD_EPNO_A_BAND_TRIG          (1 << 1)
110 #define DHD_EPNO_BG_BAND_TRIG         (1 << 2)
111 #define DHD_EPNO_STRICT_MATCH         (1 << 3)
112 #define DHD_EPNO_SAME_NETWORK         (1 << 4)
113 #define DHD_PNO_USE_SSID              (DHD_EPNO_HIDDEN_SSID | DHD_EPNO_STRICT_MATCH)
114 
115 /* Do not change GSCAN_BATCH_RETRIEVAL_COMPLETE */
116 #define GSCAN_BATCH_RETRIEVAL_COMPLETE      0
117 #define GSCAN_BATCH_RETRIEVAL_IN_PROGRESS   1
118 #define GSCAN_BATCH_NO_THR_SET              101
119 #define GSCAN_LOST_AP_WINDOW_DEFAULT        4
120 #define GSCAN_MIN_BSSID_TIMEOUT             90
121 #define GSCAN_BATCH_GET_MAX_WAIT            500
122 #define CHANNEL_BUCKET_EMPTY_INDEX                      0xFFFF
123 #define GSCAN_RETRY_THRESHOLD              3
124 
125 #define MAX_EPNO_SSID_NUM                   64
126 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
127 
128 enum scan_status {
129     /* SCAN ABORT by other scan */
130     PNO_STATUS_ABORT,
131     /* RTT is presence or not */
132     PNO_STATUS_RTT_PRESENCE,
133     /* Disable PNO by Driver */
134     PNO_STATUS_DISABLE,
135     /* NORMAL BATCHING GET */
136     PNO_STATUS_NORMAL,
137     /* WLC_E_PFN_BEST_BATCHING */
138     PNO_STATUS_EVENT,
139     PNO_STATUS_MAX
140 };
141 #define PNO_STATUS_ABORT_MASK 0x0001
142 #define PNO_STATUS_RTT_MASK 0x0002
143 #define PNO_STATUS_DISABLE_MASK 0x0004
144 #define PNO_STATUS_OOM_MASK 0x0010
145 
146 enum index_mode {
147     INDEX_OF_LEGACY_PARAMS,
148     INDEX_OF_BATCH_PARAMS,
149     INDEX_OF_HOTLIST_PARAMS,
150     /* GSCAN includes hotlist scan and they do not run
151      * independent of each other
152      */
153     INDEX_OF_GSCAN_PARAMS = INDEX_OF_HOTLIST_PARAMS,
154     INDEX_MODE_MAX
155 };
156 enum dhd_pno_status {
157     DHD_PNO_DISABLED,
158     DHD_PNO_ENABLED,
159     DHD_PNO_SUSPEND
160 };
161 typedef struct cmd_tlv {
162     char prefix;
163     char version;
164     char subtype;
165     char reserved;
166 } cmd_tlv_t;
167 #if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
168 typedef enum {
169     WIFI_BAND_UNSPECIFIED,
170     WIFI_BAND_BG = 1,                       /* 2.4 GHz                   */
171     WIFI_BAND_A = 2,                        /* 5 GHz without DFS         */
172     WIFI_BAND_A_DFS = 4,                    /* 5 GHz DFS only            */
173     WIFI_BAND_A_WITH_DFS = 6,               /* 5 GHz with DFS            */
174     WIFI_BAND_ABG = 3,                      /* 2.4 GHz + 5 GHz; no DFS   */
175     WIFI_BAND_ABG_WITH_DFS = 7,             /* 2.4 GHz + 5 GHz with DFS  */
176 } gscan_wifi_band_t;
177 
178 typedef enum {
179     HOTLIST_LOST,
180     HOTLIST_FOUND
181 } hotlist_type_t;
182 
183 typedef enum dhd_pno_gscan_cmd_cfg {
184     DHD_PNO_BATCH_SCAN_CFG_ID = 0,
185     DHD_PNO_GEOFENCE_SCAN_CFG_ID,
186     DHD_PNO_SIGNIFICANT_SCAN_CFG_ID,
187     DHD_PNO_SCAN_CFG_ID,
188     DHD_PNO_GET_CAPABILITIES,
189     DHD_PNO_GET_BATCH_RESULTS,
190     DHD_PNO_GET_CHANNEL_LIST,
191     DHD_PNO_GET_NEW_EPNO_SSID_ELEM,
192     DHD_PNO_EPNO_CFG_ID,
193     DHD_PNO_GET_AUTOJOIN_CAPABILITIES,
194     DHD_PNO_EPNO_PARAMS_ID
195 } dhd_pno_gscan_cmd_cfg_t;
196 
197 typedef enum dhd_pno_mode {
198     /* Wi-Fi Legacy PNO Mode */
199     DHD_PNO_NONE_MODE   = 0,
200     DHD_PNO_LEGACY_MODE = (1 << (0)),
201     /* Wi-Fi Android BATCH SCAN Mode */
202     DHD_PNO_BATCH_MODE = (1 << (1)),
203     /* Wi-Fi Android Hotlist SCAN Mode */
204     DHD_PNO_HOTLIST_MODE = (1 << (2)),
205     /* Wi-Fi Google Android SCAN Mode */
206     DHD_PNO_GSCAN_MODE = (1 << (3))
207 } dhd_pno_mode_t;
208 #else
209 typedef enum dhd_pno_mode {
210     /* Wi-Fi Legacy PNO Mode */
211     DHD_PNO_NONE_MODE   = 0,
212     DHD_PNO_LEGACY_MODE = (1 << (0)),
213     /* Wi-Fi Android BATCH SCAN Mode */
214     DHD_PNO_BATCH_MODE = (1 << (1)),
215     /* Wi-Fi Android Hotlist SCAN Mode */
216     DHD_PNO_HOTLIST_MODE = (1 << (2))
217 } dhd_pno_mode_t;
218 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
219 
220 typedef struct dhd_pno_ssid {
221     bool        hidden;
222     int8        rssi_thresh;
223     uint8        dummy;
224     uint16        SSID_len;
225     uint32        flags;
226     int32        wpa_auth;
227     uchar        SSID[DOT11_MAX_SSID_LEN];
228     struct list_head list;
229 } dhd_pno_ssid_t;
230 
231 struct dhd_pno_bssid {
232     struct ether_addr    macaddr;
233     /* Bit4: suppress_lost, Bit3: suppress_found */
234     uint16            flags;
235     struct list_head list;
236 };
237 
238 typedef struct dhd_pno_bestnet_entry {
239     struct ether_addr BSSID;
240     uint8    SSID_len;
241     uint8    SSID[DOT11_MAX_SSID_LEN];
242     int8    RSSI;
243     uint8    channel;
244     uint32    timestamp;
245     uint16    rtt0; /* distance_cm based on RTT */
246     uint16    rtt1; /* distance_cm based on sample standard deviation */
247     unsigned long recorded_time;
248     struct list_head list;
249 } dhd_pno_bestnet_entry_t;
250 #define BESTNET_ENTRY_SIZE (sizeof(dhd_pno_bestnet_entry_t))
251 
252 typedef struct dhd_pno_bestnet_header {
253     struct dhd_pno_bestnet_header *next;
254     uint8 reason;
255     uint32 tot_cnt;
256     uint32 tot_size;
257     struct list_head entry_list;
258 } dhd_pno_best_header_t;
259 #define BEST_HEADER_SIZE (sizeof(dhd_pno_best_header_t))
260 
261 typedef struct dhd_pno_scan_results {
262     dhd_pno_best_header_t *bestnetheader;
263     uint8 cnt_header;
264     struct list_head list;
265 } dhd_pno_scan_results_t;
266 #define SCAN_RESULTS_SIZE (sizeof(dhd_pno_scan_results_t))
267 
268 struct dhd_pno_get_batch_info {
269     /* info related to get batch */
270     char *buf;
271     bool batch_started;
272     uint32 tot_scan_cnt;
273     uint32 expired_tot_scan_cnt;
274     uint32 top_node_cnt;
275     uint32 bufsize;
276     uint32 bytes_written;
277     int reason;
278     struct list_head scan_results_list;
279     struct list_head expired_scan_results_list;
280 };
281 struct dhd_pno_legacy_params {
282     uint16 scan_fr;
283     uint16 chan_list[WL_NUMCHANNELS];
284     uint16 nchan;
285     int pno_repeat;
286     int pno_freq_expo_max;
287     int nssid;
288     struct list_head ssid_list;
289 };
290 struct dhd_pno_batch_params {
291     int32 scan_fr;
292     uint8 bestn;
293     uint8 mscan;
294     uint8 band;
295     uint16 chan_list[WL_NUMCHANNELS];
296     uint16 nchan;
297     uint16 rtt;
298     struct dhd_pno_get_batch_info get_batch;
299 };
300 struct dhd_pno_hotlist_params {
301     uint8 band;
302     int32 scan_fr;
303     uint16 chan_list[WL_NUMCHANNELS];
304     uint16 nchan;
305     uint16 nbssid;
306     struct list_head bssid_list;
307 };
308 #if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
309 #define DHD_PNO_REPORT_NO_BATCH      (1 << 2)
310 
311 typedef struct dhd_pno_gscan_channel_bucket {
312     uint16 bucket_freq_multiple;
313     /* band = 1 All bg band channels,
314      * band = 2 All a band channels,
315      * band = 0 chan_list channels
316      */
317     uint16 band;
318     uint8 report_flag;
319     uint8 num_channels;
320     uint16 repeat;
321     uint16 bucket_max_multiple;
322     uint16 chan_list[GSCAN_MAX_CHANNELS_IN_BUCKET];
323 } dhd_pno_gscan_channel_bucket_t;
324 
325 
326 #define DHD_PNO_AUTH_CODE_OPEN  1 /*  Open   */
327 #define DHD_PNO_AUTH_CODE_PSK   2 /* WPA_PSK or WPA2PSK */
328 #define DHD_PNO_AUTH_CODE_EAPOL 4 /* any EAPOL    */
329 
330 #define DHD_EPNO_DEFAULT_INDEX     0xFFFFFFFF
331 
332 typedef struct dhd_epno_params {
333     uint8 ssid[DOT11_MAX_SSID_LEN];
334     uint8 ssid_len;
335     int8 rssi_thresh;
336     uint8 flags;
337     uint8 auth;
338     /* index required only for visble ssid */
339     uint32 index;
340     struct list_head list;
341 } dhd_epno_params_t;
342 
343 typedef struct dhd_epno_results {
344     uint8 ssid[DOT11_MAX_SSID_LEN];
345     uint8 ssid_len;
346     int8 rssi;
347     uint16 channel;
348     uint16 flags;
349     struct ether_addr bssid;
350 } dhd_epno_results_t;
351 
352 typedef struct wifi_gscan_result {
353     uint64 ts;                           /* Time of discovery           */
354     char ssid[DOT11_MAX_SSID_LEN+1];     /* null terminated             */
355     struct ether_addr    macaddr;         /* BSSID                      */
356     uint32 channel;                      /* channel frequency in MHz    */
357     int32 rssi;                          /* in db                       */
358     uint64 rtt;                          /* in nanoseconds              */
359     uint64 rtt_sd;                       /* standard deviation in rtt   */
360     uint16 beacon_period;                /* units are Kusec             */
361     uint16 capability;                   /* Capability information       */
362     uint32 pad;
363 } wifi_gscan_result_t;
364 
365 typedef struct wifi_gscan_full_result {
366     wifi_gscan_result_t fixed;
367     uint32 scan_ch_bucket;
368     uint32 ie_length;        /* byte length of Information Elements */
369     char  ie_data[1];        /* IE  data to follow       */
370 } wifi_gscan_full_result_t;
371 
372 typedef struct gscan_results_cache {
373     struct gscan_results_cache *next;
374     uint8  scan_id;
375     uint8  flag;
376     uint8  tot_count;
377     uint8  tot_consumed;
378     uint32 scan_ch_bucket;
379     wifi_gscan_result_t results[1];
380 } gscan_results_cache_t;
381 
382 typedef struct dhd_pno_gscan_capabilities {
383     int max_scan_cache_size;
384     int max_scan_buckets;
385     int max_ap_cache_per_scan;
386     int max_rssi_sample_size;
387     int max_scan_reporting_threshold;
388     int max_hotlist_aps;
389     int max_significant_wifi_change_aps;
390     int max_epno_ssid_crc32;
391     int max_epno_hidden_ssid;
392     int max_white_list_ssid;
393 } dhd_pno_gscan_capabilities_t;
394 
395 typedef struct dhd_epno_ssid_cfg {
396     wl_pfn_ssid_params_t params;
397     uint32 num_epno_ssid;
398     struct list_head epno_ssid_list;
399 } dhd_epno_ssid_cfg_t;
400 
401 struct dhd_pno_gscan_params {
402     int32 scan_fr;
403     uint8 bestn;
404     uint8 mscan;
405     uint8 buffer_threshold;
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_hotlist;
416     struct dhd_pno_gscan_channel_bucket channel_bucket[GSCAN_MAX_CH_BUCKETS];
417     struct list_head hotlist_bssid_list;
418     dhd_epno_ssid_cfg_t epno_cfg;
419     uint32 scan_id;
420 };
421 
422 typedef struct gscan_scan_params {
423     int32 scan_fr;
424     uint16 nchannel_buckets;
425     struct dhd_pno_gscan_channel_bucket channel_bucket[GSCAN_MAX_CH_BUCKETS];
426 } gscan_scan_params_t;
427 
428 typedef struct gscan_batch_params {
429     uint8 bestn;
430     uint8 mscan;
431     uint8 buffer_threshold;
432 } gscan_batch_params_t;
433 
434 struct bssid_t {
435     struct ether_addr    macaddr;
436     int16 rssi_reporting_threshold;  /* 0 -> no reporting threshold */
437 };
438 
439 typedef struct gscan_hotlist_scan_params {
440     uint16 lost_ap_window; /* number of scans to declare LOST */
441     uint16 nbssid;   /* number of bssids  */
442     struct bssid_t bssid[1];  /* n bssids to follow */
443 } gscan_hotlist_scan_params_t;
444 
445 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
446 typedef union dhd_pno_params {
447     struct dhd_pno_legacy_params params_legacy;
448     struct dhd_pno_batch_params params_batch;
449     struct dhd_pno_hotlist_params params_hotlist;
450 #if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
451     struct dhd_pno_gscan_params params_gscan;
452 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
453 } dhd_pno_params_t;
454 typedef struct dhd_pno_status_info {
455     dhd_pub_t *dhd;
456     struct work_struct work;
457     struct mutex pno_mutex;
458 #ifdef GSCAN_SUPPORT
459     wait_queue_head_t batch_get_wait;
460 #endif /* GSCAN_SUPPORT */
461     struct completion get_batch_done;
462     bool wls_supported; /* wifi location service supported or not */
463     enum dhd_pno_status pno_status;
464     enum dhd_pno_mode pno_mode;
465     dhd_pno_params_t pno_params_arr[INDEX_MODE_MAX];
466     struct list_head head_list;
467 } dhd_pno_status_info_t;
468 
469 /* wrapper functions */
470 extern int
471 dhd_dev_pno_enable(struct net_device *dev, int enable);
472 
473 extern int
474 dhd_dev_pno_stop_for_ssid(struct net_device *dev);
475 
476 extern int
477 dhd_dev_pno_set_for_ssid(struct net_device *dev, wlc_ssid_ext_t* ssids_local, int nssid,
478     uint16 scan_fr, int pno_repeat, int pno_freq_expo_max, uint16 *channel_list, int nchan);
479 
480 extern int
481 dhd_dev_pno_set_for_batch(struct net_device *dev,
482     struct dhd_pno_batch_params *batch_params);
483 
484 extern int
485 dhd_dev_pno_get_for_batch(struct net_device *dev, char *buf, int bufsize);
486 
487 extern int
488 dhd_dev_pno_stop_for_batch(struct net_device *dev);
489 
490 extern int
491 dhd_dev_pno_set_for_hotlist(struct net_device *dev, wl_pfn_bssid_t *p_pfn_bssid,
492     struct dhd_pno_hotlist_params *hotlist_params);
493 extern bool dhd_dev_is_legacy_pno_enabled(struct net_device *dev);
494 #if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
495 extern void *
496 dhd_dev_pno_get_gscan(struct net_device *dev, dhd_pno_gscan_cmd_cfg_t type, void *info,
497         uint32 *len);
498 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
499 #ifdef GSCAN_SUPPORT
500 extern int
501 dhd_dev_pno_set_cfg_gscan(struct net_device *dev, dhd_pno_gscan_cmd_cfg_t type,
502               void *buf, bool flush);
503 int dhd_dev_pno_lock_access_batch_results(struct net_device *dev);
504 void dhd_dev_pno_unlock_access_batch_results(struct net_device *dev);
505 extern int dhd_dev_pno_run_gscan(struct net_device *dev, bool run, bool flush);
506 extern int dhd_dev_pno_enable_full_scan_result(struct net_device *dev, bool real_time);
507 int dhd_retreive_batch_scan_results(dhd_pub_t *dhd);
508 extern void * dhd_dev_hotlist_scan_event(struct net_device *dev,
509             const void  *data, int *send_evt_bytes, hotlist_type_t type);
510 void * dhd_dev_process_full_gscan_result(struct net_device *dev,
511             const void  *data, uint32 len, int *send_evt_bytes);
512 extern int dhd_dev_gscan_batch_cache_cleanup(struct net_device *dev);
513 extern void dhd_dev_gscan_hotlist_cache_cleanup(struct net_device *dev, hotlist_type_t type);
514 extern int dhd_dev_wait_batch_results_complete(struct net_device *dev);
515 extern void * dhd_dev_process_epno_result(struct net_device *dev,
516         const void  *data, uint32 event, int *send_evt_bytes);
517 extern int dhd_dev_set_epno(struct net_device *dev);
518 extern int dhd_dev_flush_fw_epno(struct net_device *dev);
519 #endif /* GSCAN_SUPPORT */
520 /* dhd pno fuctions */
521 extern int dhd_pno_stop_for_ssid(dhd_pub_t *dhd);
522 extern int dhd_pno_enable(dhd_pub_t *dhd, int enable);
523 extern int dhd_pno_set_for_ssid(dhd_pub_t *dhd, wlc_ssid_ext_t* ssid_list, int nssid,
524     uint16  scan_fr, int pno_repeat, int pno_freq_expo_max, uint16 *channel_list, int nchan);
525 
526 extern int dhd_pno_set_for_batch(dhd_pub_t *dhd, struct dhd_pno_batch_params *batch_params);
527 
528 extern int dhd_pno_get_for_batch(dhd_pub_t *dhd, char *buf, int bufsize, int reason);
529 
530 
531 extern int dhd_pno_stop_for_batch(dhd_pub_t *dhd);
532 
533 extern int dhd_pno_set_for_hotlist(dhd_pub_t *dhd, wl_pfn_bssid_t *p_pfn_bssid,
534     struct dhd_pno_hotlist_params *hotlist_params);
535 
536 extern int dhd_pno_stop_for_hotlist(dhd_pub_t *dhd);
537 
538 extern int dhd_pno_event_handler(dhd_pub_t *dhd, wl_event_msg_t *event, void *event_data);
539 extern int dhd_pno_init(dhd_pub_t *dhd);
540 extern int dhd_pno_deinit(dhd_pub_t *dhd);
541 extern bool dhd_is_pno_supported(dhd_pub_t *dhd);
542 extern bool dhd_is_legacy_pno_enabled(dhd_pub_t *dhd);
543 #if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
544 extern void * dhd_pno_get_gscan(dhd_pub_t *dhd, dhd_pno_gscan_cmd_cfg_t type, void *info,
545                        uint32 *len);
546 #endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */
547 #ifdef GSCAN_SUPPORT
548 extern int dhd_pno_set_cfg_gscan(dhd_pub_t *dhd, dhd_pno_gscan_cmd_cfg_t type,
549                        void *buf, bool flush);
550 extern int dhd_pno_lock_batch_results(dhd_pub_t *dhd);
551 extern void dhd_pno_unlock_batch_results(dhd_pub_t *dhd);
552 extern int dhd_pno_initiate_gscan_request(dhd_pub_t *dhd, bool run, bool flush);
553 extern int dhd_pno_enable_full_scan_result(dhd_pub_t *dhd, bool real_time_flag);
554 extern int dhd_pno_cfg_gscan(dhd_pub_t *dhd, dhd_pno_gscan_cmd_cfg_t type, void *buf);
555 extern int dhd_dev_retrieve_batch_scan(struct net_device *dev);
556 extern void *dhd_handle_hotlist_scan_evt(dhd_pub_t *dhd, const void *event_data,
557                        int *send_evt_bytes, hotlist_type_t type);
558 extern void *dhd_process_full_gscan_result(dhd_pub_t *dhd, const void *event_data,
559                        uint32 len, int *send_evt_bytes);
560 extern int dhd_gscan_batch_cache_cleanup(dhd_pub_t *dhd);
561 extern void dhd_gscan_hotlist_cache_cleanup(dhd_pub_t *dhd, hotlist_type_t type);
562 extern int dhd_wait_batch_results_complete(dhd_pub_t *dhd);
563 extern void * dhd_pno_process_epno_result(dhd_pub_t *dhd, const void *data,
564          uint32 event, int *size);
565 extern void dhd_pno_translate_epno_fw_flags(uint32 *flags);
566 extern int dhd_pno_set_epno(dhd_pub_t *dhd);
567 extern int dhd_pno_flush_fw_epno(dhd_pub_t *dhd);
568 extern void dhd_pno_set_epno_auth_flag(uint32 *wpa_auth);
569 #endif /* GSCAN_SUPPORT */
570 #endif
571 
572 #endif /* __DHD_PNO_H__ */
573