wmi_unified_roam_param.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786
  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
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /*
  19. * This file contains the API definitions for the ROAMING WMI APIs.
  20. */
  21. #ifndef _WMI_UNIFIED_ROAM_PARAM_H_
  22. #define _WMI_UNIFIED_ROAM_PARAM_H_
  23. #include <wlan_blm_public_struct.h>
  24. /**
  25. * struct gateway_update_req_param - gateway parameter update request
  26. * @request_id: request id
  27. * @vdev_id: vdev id
  28. * @max_retries: Max ARP/NS retry attempts
  29. * @timeout: Retry interval
  30. * @ipv4_addr_type: on ipv4 network
  31. * @ipv6_addr_type: on ipv6 network
  32. * @gw_mac_addr: gateway mac addr
  33. * @ipv4_addr: ipv4 addr
  34. * @ipv6_addr: ipv6 addr
  35. */
  36. struct gateway_update_req_param {
  37. uint32_t request_id;
  38. uint32_t vdev_id;
  39. uint32_t max_retries;
  40. uint32_t timeout;
  41. uint32_t ipv4_addr_type;
  42. uint32_t ipv6_addr_type;
  43. struct qdf_mac_addr gw_mac_addr;
  44. uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
  45. uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
  46. };
  47. /**
  48. * struct rssi_monitor_param - rssi monitoring
  49. * @request_id: request id
  50. * @vdev_id: vdev id
  51. * @min_rssi: minimum rssi
  52. * @max_rssi: maximum rssi
  53. * @control: flag to indicate start or stop
  54. */
  55. struct rssi_monitor_param {
  56. uint32_t request_id;
  57. uint32_t vdev_id;
  58. int8_t min_rssi;
  59. int8_t max_rssi;
  60. bool control;
  61. };
  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. /**
  148. * struct wmi_mawc_roam_params - Motion Aided wireless connectivity params
  149. * @vdev_id: VDEV on which the parameters should be applied
  150. * @enable: MAWC roaming feature enable/disable
  151. * @traffic_load_threshold: Traffic threshold in kBps for MAWC roaming
  152. * @best_ap_rssi_threshold: AP RSSI Threshold for MAWC roaming
  153. * @rssi_stationary_high_adjust: High RSSI adjustment value to suppress scan
  154. * @rssi_stationary_low_adjust: Low RSSI adjustment value to suppress scan
  155. */
  156. struct wmi_mawc_roam_params {
  157. uint8_t vdev_id;
  158. bool enable;
  159. uint32_t traffic_load_threshold;
  160. uint32_t best_ap_rssi_threshold;
  161. uint8_t rssi_stationary_high_adjust;
  162. uint8_t rssi_stationary_low_adjust;
  163. };
  164. #define MAX_SSID_ALLOWED_LIST 4
  165. #define MAX_BSSID_AVOID_LIST 16
  166. #define MAX_BSSID_FAVORED 16
  167. /**
  168. * struct roam_scan_filter_params - Structure holding roaming scan
  169. * parameters
  170. * @op_bitmap: bitmap to determine reason of roaming
  171. * @vdev_id: vdev id
  172. * @num_bssid_black_list: The number of BSSID's that we should avoid
  173. * connecting to. It is like a blacklist of BSSID's.
  174. * @num_ssid_white_list: The number of SSID profiles that are in the
  175. * Whitelist. When roaming, we consider the BSSID's with
  176. * this SSID also for roaming apart from the connected
  177. * one's
  178. * @num_bssid_preferred_list: Number of BSSID's which have a preference over
  179. * others
  180. * @bssid_avoid_list: Blacklist SSID's
  181. * @ssid_allowed_list: Whitelist SSID's
  182. * @bssid_favored: Favorable BSSID's
  183. * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
  184. * @lca_disallow_config_present: LCA [Last Connected AP] disallow config
  185. * present
  186. * @disallow_duration: How long LCA AP will be disallowed before it can be a
  187. * roaming candidate again, in seconds
  188. * @rssi_channel_penalization: How much RSSI will be penalized if candidate(s)
  189. * are found in the same channel as disallowed
  190. * AP's, in units of db
  191. * @num_disallowed_aps: How many APs the target should maintain in its LCA
  192. * list
  193. * @delta_rssi: (dB units) when AB in RSSI blacklist improved by at least
  194. * delta_rssi,it will be removed from blacklist
  195. *
  196. * This structure holds all the key parameters related to
  197. * initial connection and roaming connections.
  198. */
  199. struct roam_scan_filter_params {
  200. uint32_t op_bitmap;
  201. uint8_t vdev_id;
  202. uint32_t num_bssid_black_list;
  203. uint32_t num_ssid_white_list;
  204. uint32_t num_bssid_preferred_list;
  205. struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
  206. struct mac_ssid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
  207. struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
  208. uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
  209. uint8_t lca_disallow_config_present;
  210. uint32_t disallow_duration;
  211. uint32_t rssi_channel_penalization;
  212. uint32_t num_disallowed_aps;
  213. uint32_t num_rssi_rejection_ap;
  214. struct reject_ap_config_params
  215. rssi_rejection_ap[MAX_RSSI_AVOID_BSSID_LIST];
  216. uint32_t delta_rssi;
  217. };
  218. #define WMI_CFG_VALID_CHANNEL_LIST_LEN 100
  219. /* Occupied channel list remains static */
  220. #define WMI_CHANNEL_LIST_STATIC 1
  221. /* Occupied channel list can be learnt after init */
  222. #define WMI_CHANNEL_LIST_DYNAMIC_INIT 2
  223. /* Occupied channel list can be learnt after flush */
  224. #define WMI_CHANNEL_LIST_DYNAMIC_FLUSH 3
  225. /* Occupied channel list can be learnt after update */
  226. #define WMI_CHANNEL_LIST_DYNAMIC_UPDATE 4
  227. /**
  228. * struct plm_req_params - plm req parameter
  229. * @diag_token: Dialog token
  230. * @meas_token: measurement token
  231. * @num_bursts: total number of bursts
  232. * @burst_int: burst interval in seconds
  233. * @meas_duration:in TU's,STA goes off-ch
  234. * @burst_len: no of times the STA should cycle through PLM ch list
  235. * @desired_tx_pwr: desired tx power
  236. * @mac_addr: MC dest addr
  237. * @plm_num_ch: channel numbers
  238. * @plm_ch_freq_list: channel frequency list
  239. * @vdev_id: vdev id
  240. * @enable: enable/disable
  241. */
  242. struct plm_req_params {
  243. uint16_t diag_token;
  244. uint16_t meas_token;
  245. uint16_t num_bursts;
  246. uint16_t burst_int;
  247. uint16_t meas_duration;
  248. /* no of times the STA should cycle through PLM ch list */
  249. uint8_t burst_len;
  250. int8_t desired_tx_pwr;
  251. struct qdf_mac_addr mac_addr;
  252. /* no of channels */
  253. uint8_t plm_num_ch;
  254. /* channel frequency list */
  255. uint32_t plm_ch_freq_list[WMI_CFG_VALID_CHANNEL_LIST_LEN];
  256. uint8_t vdev_id;
  257. bool enable;
  258. };
  259. /**
  260. * struct ap_profile - Structure ap profile to match candidate
  261. * @flags: flags
  262. * @rssi_threshold: the value of the the candidate AP should higher by this
  263. * threshold than the rssi of the currrently associated AP
  264. * @ssid: ssid vlaue to be matched
  265. * @rsn_authmode: security params to be matched
  266. * @rsn_ucastcipherset: unicast cipher set
  267. * @rsn_mcastcipherset: mcast/group cipher set
  268. * @rsn_mcastmgmtcipherset: mcast/group management frames cipher set
  269. * @rssi_abs_thresh: the value of the candidate AP should higher than this
  270. * absolute RSSI threshold. Zero means no absolute minimum
  271. * RSSI is required. units are the offset from the noise
  272. * floor in dB
  273. */
  274. struct ap_profile {
  275. uint32_t flags;
  276. uint32_t rssi_threshold;
  277. struct mac_ssid ssid;
  278. uint32_t rsn_authmode;
  279. uint32_t rsn_ucastcipherset;
  280. uint32_t rsn_mcastcipherset;
  281. uint32_t rsn_mcastmgmtcipherset;
  282. uint32_t rssi_abs_thresh;
  283. };
  284. /**
  285. * struct rssi_scoring - rssi scoring param to sortlist selected AP
  286. * @best_rssi_threshold: Roamable AP RSSI equal or better than this threshold,
  287. * full rssi score 100. Units in dBm.
  288. * @good_rssi_threshold: Below threshold, scoring linear percentage between
  289. * rssi_good_pnt and 100. Units in dBm.
  290. * @bad_rssi_threshold: Between good and bad rssi threshold, scoring linear
  291. * % between rssi_bad_pcnt and rssi_good_pct in dBm.
  292. * @good_rssi_pcnt: Used to assigned scoring percentage of each slot between
  293. * best to good rssi threshold. Units in percentage.
  294. * @bad_rssi_pcnt: Used to assigned scoring percentage of each slot between good
  295. * to bad rssi threshold. Unites in percentage.
  296. * @good_bucket_size : bucket size of slot in good zone
  297. * @bad_bucket_size : bucket size of slot in bad zone
  298. * @rssi_pref_5g_rssi_thresh: Below rssi threshold, 5G AP have given preference
  299. * of band percentage. Units in dBm.
  300. */
  301. struct rssi_scoring {
  302. int32_t best_rssi_threshold;
  303. int32_t good_rssi_threshold;
  304. int32_t bad_rssi_threshold;
  305. uint32_t good_rssi_pcnt;
  306. uint32_t bad_rssi_pcnt;
  307. uint32_t good_bucket_size;
  308. uint32_t bad_bucket_size;
  309. int32_t rssi_pref_5g_rssi_thresh;
  310. };
  311. /**
  312. * struct param_slot_scoring - define % score for differents slots for a
  313. * scoring param.
  314. * @num_slot: number of slots in which the param will be divided.
  315. * Max 15. index 0 is used for 'not_present. Num_slot will
  316. * equally divide 100. e.g, if num_slot = 4 slot 0 = 0-25%, slot
  317. * 1 = 26-50% slot 2 = 51-75%, slot 3 = 76-100%
  318. * @score_pcnt3_to_0: Conatins score percentage for slot 0-3
  319. * BITS 0-7 :- the scoring pcnt when not present
  320. * BITS 8-15 :- SLOT_1
  321. * BITS 16-23 :- SLOT_2
  322. * BITS 24-31 :- SLOT_3
  323. * @score_pcnt7_to_4: Conatins score percentage for slot 4-7
  324. * BITS 0-7 :- SLOT_4
  325. * BITS 8-15 :- SLOT_5
  326. * BITS 16-23 :- SLOT_6
  327. * BITS 24-31 :- SLOT_7
  328. * @score_pcnt11_to_8: Conatins score percentage for slot 8-11
  329. * BITS 0-7 :- SLOT_8
  330. * BITS 8-15 :- SLOT_9
  331. * BITS 16-23 :- SLOT_10
  332. * BITS 24-31 :- SLOT_11
  333. * @score_pcnt15_to_12: Conatins score percentage for slot 12-15
  334. * BITS 0-7 :- SLOT_12
  335. * BITS 8-15 :- SLOT_13
  336. * BITS 16-23 :- SLOT_14
  337. * BITS 24-31 :- SLOT_15
  338. */
  339. struct param_slot_scoring {
  340. uint32_t num_slot;
  341. uint32_t score_pcnt3_to_0;
  342. uint32_t score_pcnt7_to_4;
  343. uint32_t score_pcnt11_to_8;
  344. uint32_t score_pcnt15_to_12;
  345. };
  346. /**
  347. * struct scoring_param - scoring param to sortlist selected AP
  348. * @disable_bitmap: Each bit will be either allow(0)/disallow(1) to
  349. * considered the roam score param.
  350. * @rssi_weightage: RSSI weightage out of total score in %
  351. * @ht_weightage: HT weightage out of total score in %.
  352. * @vht_weightage: VHT weightage out of total score in %.
  353. * @he_weightaget: 11ax weightage out of total score in %.
  354. * @bw_weightage: Bandwidth weightage out of total score in %.
  355. * @band_weightage: Band(2G/5G) weightage out of total score in %.
  356. * @nss_weightage: NSS(1x1 / 2x2)weightage out of total score in %.
  357. * @esp_qbss_weightage: ESP/QBSS weightage out of total score in %.
  358. * @beamforming_weightage: Beamforming weightage out of total score in %.
  359. * @pcl_weightage: PCL weightage out of total score in %.
  360. * @oce_wan_weightage OCE WAN metrics weightage out of total score in %.
  361. * @oce_ap_tx_pwr_weightage: OCE AP TX power score in %
  362. * @bw_index_score: channel BW scoring percentage information.
  363. * BITS 0-7 :- It contains scoring percentage of 20MHz BW
  364. * BITS 8-15 :- It contains scoring percentage of 40MHz BW
  365. * BITS 16-23 :- It contains scoring percentage of 80MHz BW
  366. * BITS 24-31 :- It contains scoring percentage of 1600MHz BW
  367. * The value of each index must be 0-100
  368. * @band_index_score: band scording percentage information.
  369. * BITS 0-7 :- It contains scoring percentage of 2G
  370. * BITS 8-15 :- It contains scoring percentage of 5G
  371. * BITS 16-23 :- reserved
  372. * BITS 24-31 :- reserved
  373. * The value of each index must be 0-100
  374. * @nss_index_score: NSS scoring percentage information.
  375. * BITS 0-7 :- It contains scoring percentage of 1x1
  376. * BITS 8-15 :- It contains scoring percentage of 2x2
  377. * BITS 16-23 :- It contains scoring percentage of 3x3
  378. * BITS 24-31 :- It contains scoring percentage of 4x4
  379. * The value of each index must be 0-100
  380. * @roam_score_delta: delta value expected over the roam score of the candidate
  381. * ap over the roam score of the current ap
  382. * @roam_trigger_bitmap: bitmap of roam triggers on which roam_score_delta
  383. * will be applied
  384. * @vendor_roam_score_algorithm: Prefered algorithm for roam candidate selection
  385. * @cand_min_roam_score_delta: candidate min roam score delta value
  386. * @rssi_scoring: RSSI scoring information.
  387. * @esp_qbss_scoring: ESP/QBSS scoring percentage information
  388. * @oce_wan_scoring: OCE WAN metrics percentage information
  389. */
  390. struct scoring_param {
  391. uint32_t disable_bitmap;
  392. int32_t rssi_weightage;
  393. int32_t ht_weightage;
  394. int32_t vht_weightage;
  395. int32_t he_weightage;
  396. int32_t bw_weightage;
  397. int32_t band_weightage;
  398. int32_t nss_weightage;
  399. int32_t esp_qbss_weightage;
  400. int32_t beamforming_weightage;
  401. int32_t pcl_weightage;
  402. int32_t oce_wan_weightage;
  403. uint32_t oce_ap_tx_pwr_weightage;
  404. uint32_t bw_index_score;
  405. uint32_t band_index_score;
  406. uint32_t nss_index_score;
  407. uint32_t roam_score_delta;
  408. uint32_t roam_trigger_bitmap;
  409. uint32_t vendor_roam_score_algorithm;
  410. uint32_t cand_min_roam_score_delta;
  411. struct rssi_scoring rssi_scoring;
  412. struct param_slot_scoring esp_qbss_scoring;
  413. struct param_slot_scoring oce_wan_scoring;
  414. };
  415. /*
  416. * Currently roam score delta value and min rssi values are sent
  417. * for 2 triggers
  418. */
  419. #define NUM_OF_ROAM_TRIGGERS 2
  420. #define IDLE_ROAM_TRIGGER 0
  421. #define BTM_ROAM_TRIGGER 1
  422. #define DEAUTH_MIN_RSSI 0
  423. #define BMISS_MIN_RSSI 1
  424. /**
  425. * enum roam_trigger_reason - Reason for triggering roam
  426. * ROAM_TRIGGER_REASON_NONE: Roam trigger reason none
  427. * ROAM_TRIGGER_REASON_PER: Roam triggered due to packet error
  428. * ROAM_TRIGGER_REASON_BMISS: Roam triggered due to beacon miss
  429. * ROAM_TRIGGER_REASON_LOW_RSSI: Roam triggered due to low RSSI of current
  430. * connected AP.
  431. * ROAM_TRIGGER_REASON_HIGH_RSSI: Roam triggered because sta is connected to
  432. * a AP in 2.4GHz band and a better 5GHz AP is available
  433. * ROAM_TRIGGER_REASON_PERIODIC: Roam triggered as better AP was found during
  434. * periodic roam scan.
  435. * ROAM_TRIGGER_REASON_MAWC: Motion Aided WiFi Connectivity triggered roam.
  436. * ROAM_TRIGGER_REASON_DENSE: Roaming triggered due to dense environment
  437. * detected.
  438. * ROAM_TRIGGER_REASON_BACKGROUND: Roam triggered due to current AP having
  439. * poor rssi and scan candidate found in scan results provided by other
  440. * scan clients.
  441. * ROAM_TRIGGER_REASON_FORCED: Forced roam trigger.
  442. * ROAM_TRIGGER_REASON_BTM: Roam triggered due to AP sent BTM query with
  443. * Disassoc imminent bit set.
  444. * ROAM_TRIGGER_REASON_UNIT_TEST: Roam triggered due to unit test command.
  445. * ROAM_TRIGGER_REASON_BSS_LOAD: Roam triggered due to high channel utilization
  446. * in the current connected channel
  447. * ROAM_TRIGGER_REASON_DEAUTH: Roam triggered due to deauth received from the
  448. * current connected AP.
  449. * ROAM_TRIGGER_REASON_IDLE: Roam triggered due to inactivity of the device.
  450. * ROAM_TRIGGER_REASON_STA_KICKOUT: Roam triggered due to sta kickout event.
  451. * ROAM_TRIGGER_REASON_MAX: Maximum number of roam triggers
  452. */
  453. enum roam_trigger_reason {
  454. ROAM_TRIGGER_REASON_NONE = 0,
  455. ROAM_TRIGGER_REASON_PER,
  456. ROAM_TRIGGER_REASON_BMISS,
  457. ROAM_TRIGGER_REASON_LOW_RSSI,
  458. ROAM_TRIGGER_REASON_HIGH_RSSI,
  459. ROAM_TRIGGER_REASON_PERIODIC,
  460. ROAM_TRIGGER_REASON_MAWC,
  461. ROAM_TRIGGER_REASON_DENSE,
  462. ROAM_TRIGGER_REASON_BACKGROUND,
  463. ROAM_TRIGGER_REASON_FORCED,
  464. ROAM_TRIGGER_REASON_BTM,
  465. ROAM_TRIGGER_REASON_UNIT_TEST,
  466. ROAM_TRIGGER_REASON_BSS_LOAD,
  467. ROAM_TRIGGER_REASON_DEAUTH,
  468. ROAM_TRIGGER_REASON_IDLE,
  469. ROAM_TRIGGER_REASON_STA_KICKOUT,
  470. ROAM_TRIGGER_REASON_MAX,
  471. };
  472. /**
  473. * struct roam_trigger_min_rssi - structure to hold minimum rssi value of
  474. * candidate APs for each roam trigger
  475. * @min_rssi: minimum RSSI of candidate AP for the trigger reason specified in
  476. * trigger_id
  477. * @trigger_reason: Roam trigger reason
  478. */
  479. struct roam_trigger_min_rssi {
  480. int32_t min_rssi;
  481. enum roam_trigger_reason trigger_reason;
  482. };
  483. /**
  484. * struct roam_trigger_score_delta - structure to hold roam score delta value of
  485. * candidate APs for each roam trigger
  486. * @roam_score_delta: delta value in score of the candidate AP for the roam
  487. * trigger mentioned in the trigger_id.
  488. * @trigger_reason: Roam trigger reason
  489. */
  490. struct roam_trigger_score_delta {
  491. uint32_t roam_score_delta;
  492. enum roam_trigger_reason trigger_reason;
  493. };
  494. /**
  495. * struct ap_profile_params - ap profile params
  496. * @vdev_id: vdev id
  497. * @profile: ap profile to match candidate
  498. * @param: scoring params to short candidate
  499. * @min_rssi_params: Min RSSI values for different roam triggers
  500. * @score_delta_params: Roam score delta values for different triggers
  501. */
  502. struct ap_profile_params {
  503. uint8_t vdev_id;
  504. struct ap_profile profile;
  505. struct scoring_param param;
  506. struct roam_trigger_min_rssi min_rssi_params[NUM_OF_ROAM_TRIGGERS];
  507. struct roam_trigger_score_delta score_delta_param[NUM_OF_ROAM_TRIGGERS];
  508. };
  509. /**
  510. * struct wmi_roam_invoke_cmd - roam invoke command
  511. * @vdev_id: vdev id
  512. * @bssid: mac address
  513. * @channel: channel
  514. * @frame_len: frame length, includs mac header, fixed params and ies
  515. * @frame_buf: buffer contaning probe response or beacon
  516. * @is_same_bssid: flag to indicate if roaming is requested for same bssid
  517. * @forced_roaming: Roam to any bssid in any ch (here bssid & ch is not given)
  518. */
  519. struct wmi_roam_invoke_cmd {
  520. uint32_t vdev_id;
  521. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  522. uint32_t channel;
  523. uint32_t frame_len;
  524. uint8_t *frame_buf;
  525. uint8_t is_same_bssid;
  526. bool forced_roaming;
  527. };
  528. /**
  529. * struct wmi_per_roam_config - per based roaming parameters
  530. * @enable: if PER based roaming is enabled/disabled
  531. * @tx_high_rate_thresh: high rate threshold at which PER based
  532. * roam will stop in tx path
  533. * @rx_high_rate_thresh: high rate threshold at which PER based
  534. * roam will stop in rx path
  535. * @tx_low_rate_thresh: rate below which traffic will be considered
  536. * for PER based roaming in Tx path
  537. * @rx_low_rate_thresh: rate below which traffic will be considered
  538. * for PER based roaming in Tx path
  539. * @tx_rate_thresh_percnt: % above which when traffic is below low_rate_thresh
  540. * will be considered for PER based scan in tx path
  541. * @rx_rate_thresh_percnt: % above which when traffic is below low_rate_thresh
  542. * will be considered for PER based scan in rx path
  543. * @per_rest_time: time for which PER based roam will wait once it
  544. * issues a roam scan.
  545. * @tx_per_mon_time: Minimum time required to be considered as valid scenario
  546. * for PER based roam in tx path
  547. * @rx_per_mon_time: Minimum time required to be considered as valid scenario
  548. * for PER based roam in rx path
  549. * @min_candidate_rssi: Minimum RSSI threshold for candidate AP to be used for
  550. * PER based roaming
  551. */
  552. struct wmi_per_roam_config {
  553. uint32_t enable;
  554. uint32_t tx_high_rate_thresh;
  555. uint32_t rx_high_rate_thresh;
  556. uint32_t tx_low_rate_thresh;
  557. uint32_t rx_low_rate_thresh;
  558. uint32_t tx_rate_thresh_percnt;
  559. uint32_t rx_rate_thresh_percnt;
  560. uint32_t per_rest_time;
  561. uint32_t tx_per_mon_time;
  562. uint32_t rx_per_mon_time;
  563. uint32_t min_candidate_rssi;
  564. };
  565. /**
  566. * struct wmi_per_roam_config_req: PER based roaming config request
  567. * @vdev_id: vdev id on which config needs to be set
  568. * @per_config: PER config
  569. */
  570. struct wmi_per_roam_config_req {
  571. uint8_t vdev_id;
  572. struct wmi_per_roam_config per_config;
  573. };
  574. /**
  575. * struct wmi_limit_off_chan_param - limit off channel parameters
  576. * @vdev_id: vdev id
  577. * @status: status of the command (enable/disable)
  578. * @max_offchan_time: max off channel time
  579. * @rest_time: home channel time
  580. * @skip_dfs_chans: skip dfs channels during scan
  581. */
  582. struct wmi_limit_off_chan_param {
  583. uint32_t vdev_id;
  584. bool status;
  585. uint32_t max_offchan_time;
  586. uint32_t rest_time;
  587. bool skip_dfs_chans;
  588. };
  589. #define WMI_MAX_HLP_IE_LEN 2048
  590. /**
  591. * struct hlp_params - HLP info params
  592. * @vdev_id: vdev id
  593. * @hlp_ie_len: HLP IE length
  594. * @hlp_ie: HLP IE
  595. */
  596. struct hlp_params {
  597. uint8_t vdev_id;
  598. uint32_t hlp_ie_len;
  599. uint8_t hlp_ie[WMI_MAX_HLP_IE_LEN];
  600. };
  601. /**
  602. * struct wmi_btm_config - BSS Transition Management offload params
  603. * @vdev_id: VDEV on which the parameters should be applied
  604. * @btm_offload_config: BTM config
  605. * @btm_solicited_timeout: Timeout value for waiting BTM request
  606. * @btm_max_attempt_cnt: Maximum attempt for sending BTM query to ESS
  607. * @btm_sticky_time: Stick time after roaming to new AP by BTM
  608. * @disassoc_timer_threshold: threshold value till which the firmware can
  609. * wait before triggering the roam scan after receiving the disassoc iminent
  610. * @btm_query_bitmask: bitmask to btm query with candidate list
  611. * @btm_candidate_min_score: Minimum score of the AP to consider it as a
  612. * candidate if the roam trigger is BTM kickout.
  613. */
  614. struct wmi_btm_config {
  615. uint8_t vdev_id;
  616. uint32_t btm_offload_config;
  617. uint32_t btm_solicited_timeout;
  618. uint32_t btm_max_attempt_cnt;
  619. uint32_t btm_sticky_time;
  620. uint32_t disassoc_timer_threshold;
  621. uint32_t btm_query_bitmask;
  622. uint32_t btm_candidate_min_score;
  623. };
  624. /**
  625. * struct wmi_bss_load_config - BSS load trigger parameters
  626. * @vdev_id: VDEV on which the parameters should be applied
  627. * @bss_load_threshold: BSS load threshold after which roam scan should trigger
  628. * @bss_load_sample_time: Time duration in milliseconds for which the bss load
  629. * trigger needs to be enabled
  630. * @rssi_threshold_5ghz: RSSI threshold of the current connected AP below which
  631. * roam should be triggered if bss load threshold exceeds the configured value.
  632. * This value is applicable only when we are connected in 5GHz band.
  633. * @rssi_threshold_24ghz: RSSI threshold of the current connected AP below which
  634. * roam should be triggered if bss load threshold exceeds the configured value.
  635. * This value is applicable only when we are connected in 2.4GHz band.
  636. */
  637. struct wmi_bss_load_config {
  638. uint32_t vdev_id;
  639. uint32_t bss_load_threshold;
  640. uint32_t bss_load_sample_time;
  641. int32_t rssi_threshold_5ghz;
  642. int32_t rssi_threshold_24ghz;
  643. };
  644. /**
  645. * struct wmi_idle_roam_params - Idle roam trigger parameters
  646. * @vdev_id: VDEV on which the parameters should be applied
  647. * @enable: Enable/Disable Idle roaming
  648. * @band: Connected AP band
  649. * @conn_ap_rssi_delta: Rssi change of connected AP in dBm
  650. * @conn_ap_min_rssi: If connected AP rssi is less than min rssi trigger roam
  651. * @inactive_time: Connected AP idle time
  652. * @data_pkt_count: Data packet count allowed during idle time
  653. */
  654. struct wmi_idle_roam_params {
  655. uint32_t vdev_id;
  656. bool enable;
  657. uint32_t band;
  658. uint32_t conn_ap_rssi_delta;
  659. int32_t conn_ap_min_rssi;
  660. uint32_t inactive_time;
  661. uint32_t data_pkt_count;
  662. };
  663. /**
  664. * struct wmi_disconnect_roam_params - Emergency deauth/disconnect roam params
  665. * @vdev_id: VDEV on which the parameters should be applied
  666. * @enable: Enable or disable disconnect roaming.
  667. */
  668. struct wmi_disconnect_roam_params {
  669. uint32_t vdev_id;
  670. bool enable;
  671. };
  672. /**
  673. * struct wmi_roam_auth_status_params - WPA3 roam auth response status
  674. * parameters
  675. * @vdev_id: Vdev on which roam preauth is happening
  676. * @preauth_status: Status of the Auth response.
  677. * IEEE80211_STATUS_SUCCESS(0) for success. Corresponding
  678. * IEEE80211 failure status code for failure.
  679. *
  680. * @bssid: Candidate BSSID
  681. * @pmkid: PMKID derived for the auth
  682. */
  683. struct wmi_roam_auth_status_params {
  684. uint32_t vdev_id;
  685. uint32_t preauth_status;
  686. struct qdf_mac_addr bssid;
  687. uint8_t pmkid[PMKID_LEN];
  688. };
  689. /**
  690. * @time_offset: time offset after 11k offload command to trigger a neighbor
  691. * report request (in seconds)
  692. * @low_rssi_offset: Offset from rssi threshold to trigger a neighbor
  693. * report request (in dBm)
  694. * @bmiss_count_trigger: Number of beacon miss events to trigger neighbor
  695. * report request
  696. * @per_threshold_offset: offset from PER threshold to trigger neighbor
  697. * report request (in %)
  698. * @neighbor_report_cache_timeout: timeout after which new trigger can enable
  699. * sending of a neighbor report request (in seconds)
  700. * @max_neighbor_report_req_cap: max number of neighbor report requests that
  701. * can be sent to the peer in the current session
  702. * @ssid: Current connect SSID info
  703. */
  704. struct wmi_11k_offload_neighbor_report_params {
  705. uint32_t time_offset;
  706. uint32_t low_rssi_offset;
  707. uint32_t bmiss_count_trigger;
  708. uint32_t per_threshold_offset;
  709. uint32_t neighbor_report_cache_timeout;
  710. uint32_t max_neighbor_report_req_cap;
  711. struct mac_ssid ssid;
  712. };
  713. /**
  714. * struct wmi_11k_offload_params - offload 11k features to FW
  715. * @vdev_id: vdev id
  716. * @offload_11k_bitmask: bitmask to specify offloaded features
  717. * B0: Neighbor Report Request offload
  718. * B1-B31: Reserved
  719. * @neighbor_report_params: neighbor report offload params
  720. */
  721. struct wmi_11k_offload_params {
  722. uint32_t vdev_id;
  723. uint32_t offload_11k_bitmask;
  724. struct wmi_11k_offload_neighbor_report_params neighbor_report_params;
  725. };
  726. /**
  727. * struct wmi_invoke_neighbor_report_params - Invoke neighbor report request
  728. * from IW to FW
  729. * @vdev_id: vdev id
  730. * @send_resp_to_host: bool to send response to host or not
  731. * @ssid: ssid given from the IW command
  732. */
  733. struct wmi_invoke_neighbor_report_params {
  734. uint32_t vdev_id;
  735. uint32_t send_resp_to_host;
  736. struct mac_ssid ssid;
  737. };
  738. /**
  739. * struct roam_triggers - vendor configured roam triggers
  740. * @vdev_id: vdev id
  741. * @trigger_bitmap: vendor configured roam trigger bitmap as
  742. * defined @enum roam_control_trigger_reason
  743. */
  744. struct roam_triggers {
  745. uint32_t vdev_id;
  746. uint32_t trigger_bitmap;
  747. };
  748. #endif /* _WMI_UNIFIED_ROAM_PARAM_H_ */