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