dhd_pno.h 20 KB

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