wmi_unified_roam_param.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. /*
  2. * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /*
  17. * This file contains the API definitions for the ROAMING WMI APIs.
  18. */
  19. #ifndef _WMI_UNIFIED_ROAM_PARAM_H_
  20. #define _WMI_UNIFIED_ROAM_PARAM_H_
  21. #include <wlan_blm_public_struct.h>
  22. #include <wlan_cm_bss_score_param.h>
  23. /**
  24. * struct gateway_update_req_param - gateway parameter update request
  25. * @request_id: request id
  26. * @vdev_id: vdev id
  27. * @max_retries: Max ARP/NS retry attempts
  28. * @timeout: Retry interval
  29. * @ipv4_addr_type: on ipv4 network
  30. * @ipv6_addr_type: on ipv6 network
  31. * @gw_mac_addr: gateway mac addr
  32. * @ipv4_addr: ipv4 addr
  33. * @ipv6_addr: ipv6 addr
  34. */
  35. struct gateway_update_req_param {
  36. uint32_t request_id;
  37. uint32_t vdev_id;
  38. uint32_t max_retries;
  39. uint32_t timeout;
  40. uint32_t ipv4_addr_type;
  41. uint32_t ipv6_addr_type;
  42. struct qdf_mac_addr gw_mac_addr;
  43. uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
  44. uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
  45. };
  46. /**
  47. * struct rssi_monitor_param - rssi monitoring
  48. * @request_id: request id
  49. * @vdev_id: vdev id
  50. * @min_rssi: minimum rssi
  51. * @max_rssi: maximum rssi
  52. * @control: flag to indicate start or stop
  53. */
  54. struct rssi_monitor_param {
  55. uint32_t request_id;
  56. uint32_t vdev_id;
  57. int8_t min_rssi;
  58. int8_t max_rssi;
  59. bool control;
  60. };
  61. #ifndef ROAM_OFFLOAD_V1
  62. /**
  63. * struct roam_offload_scan_rssi_params - structure containing
  64. * parameters for roam offload scan based on RSSI
  65. * @rssi_thresh: rssi threshold
  66. * @rssi_thresh_diff: difference in rssi threshold
  67. * @hi_rssi_scan_max_count: 5G scan max count
  68. * @hi_rssi_scan_rssi_delta: 5G scan rssi change threshold value
  69. * @hi_rssi_scan_rssi_ub: 5G scan upper bound
  70. * @raise_rssi_thresh_5g: flag to determine penalty and boost thresholds
  71. * @vdev_id: vdev id
  72. * @penalty_threshold_5g: RSSI threshold below which 5GHz RSSI is penalized
  73. * @boost_threshold_5g: RSSI threshold above which 5GHz RSSI is favored
  74. * @raise_factor_5g: factor by which 5GHz RSSI is boosted
  75. * @drop_factor_5g: factor by which 5GHz RSSI is penalized
  76. * @max_raise_rssi_5g: maximum boost that can be applied to a 5GHz RSSI
  77. * @max_drop_rssi_5g: maximum penalty that can be applied to a 5GHz RSSI
  78. * @good_rssi_threshold: RSSI below which roam is kicked in by background
  79. * scan although rssi is still good
  80. * @roam_earlystop_thres_min: Minimum RSSI threshold value for early stop,
  81. * unit is dB above NF
  82. * @roam_earlystop_thres_max: Maximum RSSI threshold value for early stop,
  83. * unit is dB above NF
  84. * @dense_rssi_thresh_offset: dense roam RSSI threshold difference
  85. * @dense_min_aps_cnt: dense roam minimum APs
  86. * @initial_dense_status: dense status detected by host
  87. * @traffic_threshold: dense roam RSSI threshold
  88. * @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan
  89. * @roam_bad_rssi_thresh_offset_2g: Offset from Bad RSSI threshold for 2G
  90. * to 5G Roam
  91. * @bg_scan_client_bitmap: Bitmap used to identify the client scans to snoop
  92. * @flags: Flags for Background Roaming
  93. * Bit 0 : BG roaming enabled when we connect to 2G AP only and roaming
  94. * to 5G AP only.
  95. * Bit 1-31: Reserved
  96. */
  97. struct roam_offload_scan_rssi_params {
  98. int8_t rssi_thresh;
  99. uint8_t rssi_thresh_diff;
  100. uint32_t hi_rssi_scan_max_count;
  101. uint32_t hi_rssi_scan_rssi_delta;
  102. int32_t hi_rssi_scan_rssi_ub;
  103. int raise_rssi_thresh_5g;
  104. uint8_t vdev_id;
  105. uint32_t penalty_threshold_5g;
  106. uint32_t boost_threshold_5g;
  107. uint8_t raise_factor_5g;
  108. uint8_t drop_factor_5g;
  109. int max_raise_rssi_5g;
  110. int max_drop_rssi_5g;
  111. uint32_t good_rssi_threshold;
  112. uint32_t roam_earlystop_thres_min;
  113. uint32_t roam_earlystop_thres_max;
  114. int dense_rssi_thresh_offset;
  115. int dense_min_aps_cnt;
  116. int initial_dense_status;
  117. int traffic_threshold;
  118. int32_t rssi_thresh_offset_5g;
  119. int8_t bg_scan_bad_rssi_thresh;
  120. uint8_t roam_bad_rssi_thresh_offset_2g;
  121. uint32_t bg_scan_client_bitmap;
  122. uint32_t flags;
  123. };
  124. /**
  125. * struct roam_scan_period_params - Roam scan period parameters
  126. * @vdev_id: Vdev for which the scan period parameters are sent
  127. * @scan_period: Opportunistic scan runs on a timer for scan_period
  128. * @scan_age: Duration after which the scan entries are to be aged out
  129. * @roam_scan_inactivity_time: inactivity monitoring time in ms for which the
  130. * device is considered to be inactive
  131. * @roam_inactive_data_packet_count: Maximum allowed data packets count during
  132. * roam_scan_inactivity_time.
  133. * @roam_scan_period_after_inactivity: Roam scan period in ms after device is
  134. * in inactive state.
  135. * @full_scan_period: Full scan period is the idle period in seconds
  136. * between two successive full channel roam scans.
  137. */
  138. struct roam_scan_period_params {
  139. uint32_t vdev_id;
  140. uint32_t scan_period;
  141. uint32_t scan_age;
  142. uint32_t roam_scan_inactivity_time;
  143. uint32_t roam_inactive_data_packet_count;
  144. uint32_t roam_scan_period_after_inactivity;
  145. uint32_t full_scan_period;
  146. };
  147. #endif
  148. /**
  149. * struct wmi_mawc_roam_params - Motion Aided wireless connectivity params
  150. * @vdev_id: VDEV on which the parameters should be applied
  151. * @enable: MAWC roaming feature enable/disable
  152. * @traffic_load_threshold: Traffic threshold in kBps for MAWC roaming
  153. * @best_ap_rssi_threshold: AP RSSI Threshold for MAWC roaming
  154. * @rssi_stationary_high_adjust: High RSSI adjustment value to suppress scan
  155. * @rssi_stationary_low_adjust: Low RSSI adjustment value to suppress scan
  156. */
  157. struct wmi_mawc_roam_params {
  158. uint8_t vdev_id;
  159. bool enable;
  160. uint32_t traffic_load_threshold;
  161. uint32_t best_ap_rssi_threshold;
  162. uint8_t rssi_stationary_high_adjust;
  163. uint8_t rssi_stationary_low_adjust;
  164. };
  165. #define WMI_CFG_VALID_CHANNEL_LIST_LEN 100
  166. /* Occupied channel list remains static */
  167. #define WMI_CHANNEL_LIST_STATIC 1
  168. /* Occupied channel list can be learnt after init */
  169. #define WMI_CHANNEL_LIST_DYNAMIC_INIT 2
  170. /* Occupied channel list can be learnt after flush */
  171. #define WMI_CHANNEL_LIST_DYNAMIC_FLUSH 3
  172. /* Occupied channel list can be learnt after update */
  173. #define WMI_CHANNEL_LIST_DYNAMIC_UPDATE 4
  174. /**
  175. * struct plm_req_params - plm req parameter
  176. * @diag_token: Dialog token
  177. * @meas_token: measurement token
  178. * @num_bursts: total number of bursts
  179. * @burst_int: burst interval in seconds
  180. * @meas_duration:in TU's,STA goes off-ch
  181. * @burst_len: no of times the STA should cycle through PLM ch list
  182. * @desired_tx_pwr: desired tx power
  183. * @mac_addr: MC dest addr
  184. * @plm_num_ch: channel numbers
  185. * @plm_ch_freq_list: channel frequency list
  186. * @vdev_id: vdev id
  187. * @enable: enable/disable
  188. */
  189. struct plm_req_params {
  190. uint16_t diag_token;
  191. uint16_t meas_token;
  192. uint16_t num_bursts;
  193. uint16_t burst_int;
  194. uint16_t meas_duration;
  195. /* no of times the STA should cycle through PLM ch list */
  196. uint8_t burst_len;
  197. int8_t desired_tx_pwr;
  198. struct qdf_mac_addr mac_addr;
  199. /* no of channels */
  200. uint8_t plm_num_ch;
  201. /* channel frequency list */
  202. uint32_t plm_ch_freq_list[WMI_CFG_VALID_CHANNEL_LIST_LEN];
  203. uint8_t vdev_id;
  204. bool enable;
  205. };
  206. /**
  207. * struct wmi_roam_invoke_cmd - roam invoke command
  208. * @vdev_id: vdev id
  209. * @bssid: mac address
  210. * @channel: channel
  211. * @frame_len: frame length, includs mac header, fixed params and ies
  212. * @frame_buf: buffer contaning probe response or beacon
  213. * @is_same_bssid: flag to indicate if roaming is requested for same bssid
  214. * @forced_roaming: Roam to any bssid in any ch (here bssid & ch is not given)
  215. */
  216. struct wmi_roam_invoke_cmd {
  217. uint32_t vdev_id;
  218. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  219. uint32_t channel;
  220. uint32_t frame_len;
  221. uint8_t *frame_buf;
  222. uint8_t is_same_bssid;
  223. bool forced_roaming;
  224. };
  225. /**
  226. * struct wmi_per_roam_config - per based roaming parameters
  227. * @enable: if PER based roaming is enabled/disabled
  228. * @tx_high_rate_thresh: high rate threshold at which PER based
  229. * roam will stop in tx path
  230. * @rx_high_rate_thresh: high rate threshold at which PER based
  231. * roam will stop in rx path
  232. * @tx_low_rate_thresh: rate below which traffic will be considered
  233. * for PER based roaming in Tx path
  234. * @rx_low_rate_thresh: rate below which traffic will be considered
  235. * for PER based roaming in Tx path
  236. * @tx_rate_thresh_percnt: % above which when traffic is below low_rate_thresh
  237. * will be considered for PER based scan in tx path
  238. * @rx_rate_thresh_percnt: % above which when traffic is below low_rate_thresh
  239. * will be considered for PER based scan in rx path
  240. * @per_rest_time: time for which PER based roam will wait once it
  241. * issues a roam scan.
  242. * @tx_per_mon_time: Minimum time required to be considered as valid scenario
  243. * for PER based roam in tx path
  244. * @rx_per_mon_time: Minimum time required to be considered as valid scenario
  245. * for PER based roam in rx path
  246. * @min_candidate_rssi: Minimum RSSI threshold for candidate AP to be used for
  247. * PER based roaming
  248. */
  249. struct wmi_per_roam_config {
  250. uint32_t enable;
  251. uint32_t tx_high_rate_thresh;
  252. uint32_t rx_high_rate_thresh;
  253. uint32_t tx_low_rate_thresh;
  254. uint32_t rx_low_rate_thresh;
  255. uint32_t tx_rate_thresh_percnt;
  256. uint32_t rx_rate_thresh_percnt;
  257. uint32_t per_rest_time;
  258. uint32_t tx_per_mon_time;
  259. uint32_t rx_per_mon_time;
  260. uint32_t min_candidate_rssi;
  261. };
  262. /**
  263. * struct wmi_per_roam_config_req: PER based roaming config request
  264. * @vdev_id: vdev id on which config needs to be set
  265. * @per_config: PER config
  266. */
  267. struct wmi_per_roam_config_req {
  268. uint8_t vdev_id;
  269. struct wmi_per_roam_config per_config;
  270. };
  271. /**
  272. * struct wmi_limit_off_chan_param - limit off channel parameters
  273. * @vdev_id: vdev id
  274. * @status: status of the command (enable/disable)
  275. * @max_offchan_time: max off channel time
  276. * @rest_time: home channel time
  277. * @skip_dfs_chans: skip dfs channels during scan
  278. */
  279. struct wmi_limit_off_chan_param {
  280. uint32_t vdev_id;
  281. bool status;
  282. uint32_t max_offchan_time;
  283. uint32_t rest_time;
  284. bool skip_dfs_chans;
  285. };
  286. #define WMI_MAX_HLP_IE_LEN 2048
  287. /**
  288. * struct hlp_params - HLP info params
  289. * @vdev_id: vdev id
  290. * @hlp_ie_len: HLP IE length
  291. * @hlp_ie: HLP IE
  292. */
  293. struct hlp_params {
  294. uint8_t vdev_id;
  295. uint32_t hlp_ie_len;
  296. uint8_t hlp_ie[WMI_MAX_HLP_IE_LEN];
  297. };
  298. /**
  299. * struct wmi_btm_config - BSS Transition Management offload params
  300. * @vdev_id: VDEV on which the parameters should be applied
  301. * @btm_offload_config: BTM config
  302. * @btm_solicited_timeout: Timeout value for waiting BTM request
  303. * @btm_max_attempt_cnt: Maximum attempt for sending BTM query to ESS
  304. * @btm_sticky_time: Stick time after roaming to new AP by BTM
  305. * @disassoc_timer_threshold: threshold value till which the firmware can
  306. * wait before triggering the roam scan after receiving the disassoc iminent
  307. * @btm_query_bitmask: bitmask to btm query with candidate list
  308. * @btm_candidate_min_score: Minimum score of the AP to consider it as a
  309. * candidate if the roam trigger is BTM kickout.
  310. */
  311. struct wmi_btm_config {
  312. uint8_t vdev_id;
  313. uint32_t btm_offload_config;
  314. uint32_t btm_solicited_timeout;
  315. uint32_t btm_max_attempt_cnt;
  316. uint32_t btm_sticky_time;
  317. uint32_t disassoc_timer_threshold;
  318. uint32_t btm_query_bitmask;
  319. uint32_t btm_candidate_min_score;
  320. };
  321. /**
  322. * struct wmi_bss_load_config - BSS load trigger parameters
  323. * @vdev_id: VDEV on which the parameters should be applied
  324. * @bss_load_threshold: BSS load threshold after which roam scan should trigger
  325. * @bss_load_sample_time: Time duration in milliseconds for which the bss load
  326. * trigger needs to be enabled
  327. * @rssi_threshold_5ghz: RSSI threshold of the current connected AP below which
  328. * roam should be triggered if bss load threshold exceeds the configured value.
  329. * This value is applicable only when we are connected in 5GHz band.
  330. * @rssi_threshold_24ghz: RSSI threshold of the current connected AP below which
  331. * roam should be triggered if bss load threshold exceeds the configured value.
  332. * This value is applicable only when we are connected in 2.4GHz band.
  333. */
  334. struct wmi_bss_load_config {
  335. uint32_t vdev_id;
  336. uint32_t bss_load_threshold;
  337. uint32_t bss_load_sample_time;
  338. int32_t rssi_threshold_5ghz;
  339. int32_t rssi_threshold_24ghz;
  340. };
  341. /**
  342. * struct wmi_idle_roam_params - Idle roam trigger parameters
  343. * @vdev_id: VDEV on which the parameters should be applied
  344. * @enable: Enable/Disable Idle roaming
  345. * @band: Connected AP band
  346. * @conn_ap_rssi_delta: Rssi change of connected AP in dBm
  347. * @conn_ap_min_rssi: If connected AP rssi is less than min rssi trigger roam
  348. * @inactive_time: Connected AP idle time
  349. * @data_pkt_count: Data packet count allowed during idle time
  350. */
  351. struct wmi_idle_roam_params {
  352. uint32_t vdev_id;
  353. bool enable;
  354. uint32_t band;
  355. uint32_t conn_ap_rssi_delta;
  356. int32_t conn_ap_min_rssi;
  357. uint32_t inactive_time;
  358. uint32_t data_pkt_count;
  359. };
  360. /**
  361. * struct wmi_disconnect_roam_params - Emergency deauth/disconnect roam params
  362. * @vdev_id: VDEV on which the parameters should be applied
  363. * @enable: Enable or disable disconnect roaming.
  364. */
  365. struct wmi_disconnect_roam_params {
  366. uint32_t vdev_id;
  367. bool enable;
  368. };
  369. /**
  370. * struct wmi_roam_auth_status_params - WPA3 roam auth response status
  371. * parameters
  372. * @vdev_id: Vdev on which roam preauth is happening
  373. * @preauth_status: Status of the Auth response.
  374. * IEEE80211_STATUS_SUCCESS(0) for success. Corresponding
  375. * IEEE80211 failure status code for failure.
  376. *
  377. * @bssid: Candidate BSSID
  378. * @pmkid: PMKID derived for the auth
  379. */
  380. struct wmi_roam_auth_status_params {
  381. uint32_t vdev_id;
  382. uint32_t preauth_status;
  383. struct qdf_mac_addr bssid;
  384. uint8_t pmkid[PMKID_LEN];
  385. };
  386. /**
  387. * @time_offset: time offset after 11k offload command to trigger a neighbor
  388. * report request (in seconds)
  389. * @low_rssi_offset: Offset from rssi threshold to trigger a neighbor
  390. * report request (in dBm)
  391. * @bmiss_count_trigger: Number of beacon miss events to trigger neighbor
  392. * report request
  393. * @per_threshold_offset: offset from PER threshold to trigger neighbor
  394. * report request (in %)
  395. * @neighbor_report_cache_timeout: timeout after which new trigger can enable
  396. * sending of a neighbor report request (in seconds)
  397. * @max_neighbor_report_req_cap: max number of neighbor report requests that
  398. * can be sent to the peer in the current session
  399. * @ssid: Current connect SSID info
  400. */
  401. struct wmi_11k_offload_neighbor_report_params {
  402. uint32_t time_offset;
  403. uint32_t low_rssi_offset;
  404. uint32_t bmiss_count_trigger;
  405. uint32_t per_threshold_offset;
  406. uint32_t neighbor_report_cache_timeout;
  407. uint32_t max_neighbor_report_req_cap;
  408. struct wlan_ssid ssid;
  409. };
  410. /**
  411. * struct wmi_11k_offload_params - offload 11k features to FW
  412. * @vdev_id: vdev id
  413. * @offload_11k_bitmask: bitmask to specify offloaded features
  414. * B0: Neighbor Report Request offload
  415. * B1-B31: Reserved
  416. * @neighbor_report_params: neighbor report offload params
  417. */
  418. struct wmi_11k_offload_params {
  419. uint32_t vdev_id;
  420. uint32_t offload_11k_bitmask;
  421. struct wmi_11k_offload_neighbor_report_params neighbor_report_params;
  422. };
  423. /**
  424. * struct wmi_invoke_neighbor_report_params - Invoke neighbor report request
  425. * from IW to FW
  426. * @vdev_id: vdev id
  427. * @send_resp_to_host: bool to send response to host or not
  428. * @ssid: ssid given from the IW command
  429. */
  430. struct wmi_invoke_neighbor_report_params {
  431. uint32_t vdev_id;
  432. uint32_t send_resp_to_host;
  433. struct wlan_ssid ssid;
  434. };
  435. /**
  436. * set_pcl_cmd_params - Set PCL command params
  437. * @vdev_id: Vdev id
  438. * @weight: PCL weight
  439. */
  440. struct set_pcl_cmd_params {
  441. uint8_t vdev_id;
  442. struct wmi_pcl_chan_weights *weights;
  443. };
  444. #endif /* _WMI_UNIFIED_ROAM_PARAM_H_ */