wmi_unified_roam_param.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  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. * @bw_index_score: channel BW scoring percentage information.
  362. * BITS 0-7 :- It contains scoring percentage of 20MHz BW
  363. * BITS 8-15 :- It contains scoring percentage of 40MHz BW
  364. * BITS 16-23 :- It contains scoring percentage of 80MHz BW
  365. * BITS 24-31 :- It contains scoring percentage of 1600MHz BW
  366. * The value of each index must be 0-100
  367. * @band_index_score: band scording percentage information.
  368. * BITS 0-7 :- It contains scoring percentage of 2G
  369. * BITS 8-15 :- It contains scoring percentage of 5G
  370. * BITS 16-23 :- reserved
  371. * BITS 24-31 :- reserved
  372. * The value of each index must be 0-100
  373. * @nss_index_score: NSS scoring percentage information.
  374. * BITS 0-7 :- It contains scoring percentage of 1x1
  375. * BITS 8-15 :- It contains scoring percentage of 2x2
  376. * BITS 16-23 :- It contains scoring percentage of 3x3
  377. * BITS 24-31 :- It contains scoring percentage of 4x4
  378. * The value of each index must be 0-100
  379. * @roam_score_delta: delta value expected over the roam score of the candidate
  380. * ap over the roam score of the current ap
  381. * @roam_trigger_bitmap: bitmap of roam triggers on which roam_score_delta
  382. * will be applied
  383. * @vendor_roam_score_algorithm: Prefered algorithm for roam candidate selection
  384. * @cand_min_roam_score_delta: candidate min roam score delta value
  385. * @rssi_scoring: RSSI scoring information.
  386. * @esp_qbss_scoring: ESP/QBSS scoring percentage information
  387. * @oce_wan_scoring: OCE WAN metrics percentage information
  388. */
  389. struct scoring_param {
  390. uint32_t disable_bitmap;
  391. int32_t rssi_weightage;
  392. int32_t ht_weightage;
  393. int32_t vht_weightage;
  394. int32_t he_weightage;
  395. int32_t bw_weightage;
  396. int32_t band_weightage;
  397. int32_t nss_weightage;
  398. int32_t esp_qbss_weightage;
  399. int32_t beamforming_weightage;
  400. int32_t pcl_weightage;
  401. int32_t oce_wan_weightage;
  402. uint32_t bw_index_score;
  403. uint32_t band_index_score;
  404. uint32_t nss_index_score;
  405. uint32_t roam_score_delta;
  406. uint32_t roam_trigger_bitmap;
  407. uint32_t vendor_roam_score_algorithm;
  408. uint32_t cand_min_roam_score_delta;
  409. struct rssi_scoring rssi_scoring;
  410. struct param_slot_scoring esp_qbss_scoring;
  411. struct param_slot_scoring oce_wan_scoring;
  412. };
  413. /*
  414. * Currently roam score delta value and min rssi values are sent
  415. * for 2 triggers
  416. */
  417. #define NUM_OF_ROAM_TRIGGERS 2
  418. #define IDLE_ROAM_TRIGGER 0
  419. #define BTM_ROAM_TRIGGER 1
  420. #define DEAUTH_MIN_RSSI 0
  421. #define BMISS_MIN_RSSI 1
  422. /**
  423. * enum roam_trigger_reason - Reason for triggering roam
  424. * ROAM_TRIGGER_REASON_NONE: Roam trigger reason none
  425. * ROAM_TRIGGER_REASON_PER: Roam triggered due to packet error
  426. * ROAM_TRIGGER_REASON_BMISS: Roam triggered due to beacon miss
  427. * ROAM_TRIGGER_REASON_LOW_RSSI: Roam triggered due to low RSSI of current
  428. * connected AP.
  429. * ROAM_TRIGGER_REASON_HIGH_RSSI: Roam triggered because sta is connected to
  430. * a AP in 2.4GHz band and a better 5GHz AP is available
  431. * ROAM_TRIGGER_REASON_PERIODIC: Roam triggered as better AP was found during
  432. * periodic roam scan.
  433. * ROAM_TRIGGER_REASON_MAWC: Motion Aided WiFi Connectivity triggered roam.
  434. * ROAM_TRIGGER_REASON_DENSE: Roaming triggered due to dense environment
  435. * detected.
  436. * ROAM_TRIGGER_REASON_BACKGROUND: Roam triggered due to current AP having
  437. * poor rssi and scan candidate found in scan results provided by other
  438. * scan clients.
  439. * ROAM_TRIGGER_REASON_FORCED: Forced roam trigger.
  440. * ROAM_TRIGGER_REASON_BTM: Roam triggered due to AP sent BTM query with
  441. * Disassoc imminent bit set.
  442. * ROAM_TRIGGER_REASON_UNIT_TEST: Roam triggered due to unit test command.
  443. * ROAM_TRIGGER_REASON_BSS_LOAD: Roam triggered due to high channel utilization
  444. * in the current connected channel
  445. * ROAM_TRIGGER_REASON_DEAUTH: Roam triggered due to deauth received from the
  446. * current connected AP.
  447. * ROAM_TRIGGER_REASON_IDLE: Roam triggered due to inactivity of the device.
  448. * ROAM_TRIGGER_REASON_STA_KICKOUT: Roam triggered due to sta kickout event.
  449. * ROAM_TRIGGER_REASON_MAX: Maximum number of roam triggers
  450. */
  451. enum roam_trigger_reason {
  452. ROAM_TRIGGER_REASON_NONE = 0,
  453. ROAM_TRIGGER_REASON_PER,
  454. ROAM_TRIGGER_REASON_BMISS,
  455. ROAM_TRIGGER_REASON_LOW_RSSI,
  456. ROAM_TRIGGER_REASON_HIGH_RSSI,
  457. ROAM_TRIGGER_REASON_PERIODIC,
  458. ROAM_TRIGGER_REASON_MAWC,
  459. ROAM_TRIGGER_REASON_DENSE,
  460. ROAM_TRIGGER_REASON_BACKGROUND,
  461. ROAM_TRIGGER_REASON_FORCED,
  462. ROAM_TRIGGER_REASON_BTM,
  463. ROAM_TRIGGER_REASON_UNIT_TEST,
  464. ROAM_TRIGGER_REASON_BSS_LOAD,
  465. ROAM_TRIGGER_REASON_DEAUTH,
  466. ROAM_TRIGGER_REASON_IDLE,
  467. ROAM_TRIGGER_REASON_STA_KICKOUT,
  468. ROAM_TRIGGER_REASON_MAX,
  469. };
  470. /**
  471. * struct roam_trigger_min_rssi - structure to hold minimum rssi value of
  472. * candidate APs for each roam trigger
  473. * @min_rssi: minimum RSSI of candidate AP for the trigger reason specified in
  474. * trigger_id
  475. * @trigger_reason: Roam trigger reason
  476. */
  477. struct roam_trigger_min_rssi {
  478. int32_t min_rssi;
  479. enum roam_trigger_reason trigger_reason;
  480. };
  481. /**
  482. * struct roam_trigger_score_delta - structure to hold roam score delta value of
  483. * candidate APs for each roam trigger
  484. * @roam_score_delta: delta value in score of the candidate AP for the roam
  485. * trigger mentioned in the trigger_id.
  486. * @trigger_reason: Roam trigger reason
  487. */
  488. struct roam_trigger_score_delta {
  489. uint32_t roam_score_delta;
  490. enum roam_trigger_reason trigger_reason;
  491. };
  492. /**
  493. * struct ap_profile_params - ap profile params
  494. * @vdev_id: vdev id
  495. * @profile: ap profile to match candidate
  496. * @param: scoring params to short candidate
  497. * @min_rssi_params: Min RSSI values for different roam triggers
  498. * @score_delta_params: Roam score delta values for different triggers
  499. */
  500. struct ap_profile_params {
  501. uint8_t vdev_id;
  502. struct ap_profile profile;
  503. struct scoring_param param;
  504. struct roam_trigger_min_rssi min_rssi_params[NUM_OF_ROAM_TRIGGERS];
  505. struct roam_trigger_score_delta score_delta_param[NUM_OF_ROAM_TRIGGERS];
  506. };
  507. /**
  508. * struct wmi_roam_invoke_cmd - roam invoke command
  509. * @vdev_id: vdev id
  510. * @bssid: mac address
  511. * @channel: channel
  512. * @frame_len: frame length, includs mac header, fixed params and ies
  513. * @frame_buf: buffer contaning probe response or beacon
  514. * @is_same_bssid: flag to indicate if roaming is requested for same bssid
  515. * @forced_roaming: Roam to any bssid in any ch (here bssid & ch is not given)
  516. */
  517. struct wmi_roam_invoke_cmd {
  518. uint32_t vdev_id;
  519. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  520. uint32_t channel;
  521. uint32_t frame_len;
  522. uint8_t *frame_buf;
  523. uint8_t is_same_bssid;
  524. bool forced_roaming;
  525. };
  526. /**
  527. * struct wmi_per_roam_config - per based roaming parameters
  528. * @enable: if PER based roaming is enabled/disabled
  529. * @tx_high_rate_thresh: high rate threshold at which PER based
  530. * roam will stop in tx path
  531. * @rx_high_rate_thresh: high rate threshold at which PER based
  532. * roam will stop in rx path
  533. * @tx_low_rate_thresh: rate below which traffic will be considered
  534. * for PER based roaming in Tx path
  535. * @rx_low_rate_thresh: rate below which traffic will be considered
  536. * for PER based roaming in Tx path
  537. * @tx_rate_thresh_percnt: % above which when traffic is below low_rate_thresh
  538. * will be considered for PER based scan in tx path
  539. * @rx_rate_thresh_percnt: % above which when traffic is below low_rate_thresh
  540. * will be considered for PER based scan in rx path
  541. * @per_rest_time: time for which PER based roam will wait once it
  542. * issues a roam scan.
  543. * @tx_per_mon_time: Minimum time required to be considered as valid scenario
  544. * for PER based roam in tx path
  545. * @rx_per_mon_time: Minimum time required to be considered as valid scenario
  546. * for PER based roam in rx path
  547. * @min_candidate_rssi: Minimum RSSI threshold for candidate AP to be used for
  548. * PER based roaming
  549. */
  550. struct wmi_per_roam_config {
  551. uint32_t enable;
  552. uint32_t tx_high_rate_thresh;
  553. uint32_t rx_high_rate_thresh;
  554. uint32_t tx_low_rate_thresh;
  555. uint32_t rx_low_rate_thresh;
  556. uint32_t tx_rate_thresh_percnt;
  557. uint32_t rx_rate_thresh_percnt;
  558. uint32_t per_rest_time;
  559. uint32_t tx_per_mon_time;
  560. uint32_t rx_per_mon_time;
  561. uint32_t min_candidate_rssi;
  562. };
  563. /**
  564. * struct wmi_per_roam_config_req: PER based roaming config request
  565. * @vdev_id: vdev id on which config needs to be set
  566. * @per_config: PER config
  567. */
  568. struct wmi_per_roam_config_req {
  569. uint8_t vdev_id;
  570. struct wmi_per_roam_config per_config;
  571. };
  572. /**
  573. * struct wmi_limit_off_chan_param - limit off channel parameters
  574. * @vdev_id: vdev id
  575. * @status: status of the command (enable/disable)
  576. * @max_offchan_time: max off channel time
  577. * @rest_time: home channel time
  578. * @skip_dfs_chans: skip dfs channels during scan
  579. */
  580. struct wmi_limit_off_chan_param {
  581. uint32_t vdev_id;
  582. bool status;
  583. uint32_t max_offchan_time;
  584. uint32_t rest_time;
  585. bool skip_dfs_chans;
  586. };
  587. #define WMI_MAX_HLP_IE_LEN 2048
  588. /**
  589. * struct hlp_params - HLP info params
  590. * @vdev_id: vdev id
  591. * @hlp_ie_len: HLP IE length
  592. * @hlp_ie: HLP IE
  593. */
  594. struct hlp_params {
  595. uint8_t vdev_id;
  596. uint32_t hlp_ie_len;
  597. uint8_t hlp_ie[WMI_MAX_HLP_IE_LEN];
  598. };
  599. /**
  600. * struct wmi_btm_config - BSS Transition Management offload params
  601. * @vdev_id: VDEV on which the parameters should be applied
  602. * @btm_offload_config: BTM config
  603. * @btm_solicited_timeout: Timeout value for waiting BTM request
  604. * @btm_max_attempt_cnt: Maximum attempt for sending BTM query to ESS
  605. * @btm_sticky_time: Stick time after roaming to new AP by BTM
  606. * @disassoc_timer_threshold: threshold value till which the firmware can
  607. * wait before triggering the roam scan after receiving the disassoc iminent
  608. * @btm_query_bitmask: bitmask to btm query with candidate list
  609. * @btm_candidate_min_score: Minimum score of the AP to consider it as a
  610. * candidate if the roam trigger is BTM kickout.
  611. */
  612. struct wmi_btm_config {
  613. uint8_t vdev_id;
  614. uint32_t btm_offload_config;
  615. uint32_t btm_solicited_timeout;
  616. uint32_t btm_max_attempt_cnt;
  617. uint32_t btm_sticky_time;
  618. uint32_t disassoc_timer_threshold;
  619. uint32_t btm_query_bitmask;
  620. uint32_t btm_candidate_min_score;
  621. };
  622. /**
  623. * struct wmi_bss_load_config - BSS load trigger parameters
  624. * @vdev_id: VDEV on which the parameters should be applied
  625. * @bss_load_threshold: BSS load threshold after which roam scan should trigger
  626. * @bss_load_sample_time: Time duration in milliseconds for which the bss load
  627. * trigger needs to be enabled
  628. * @rssi_threshold_5ghz: RSSI threshold of the current connected AP below which
  629. * roam should be triggered if bss load threshold exceeds the configured value.
  630. * This value is applicable only when we are connected in 5GHz band.
  631. * @rssi_threshold_24ghz: RSSI threshold of the current connected AP below which
  632. * roam should be triggered if bss load threshold exceeds the configured value.
  633. * This value is applicable only when we are connected in 2.4GHz band.
  634. */
  635. struct wmi_bss_load_config {
  636. uint32_t vdev_id;
  637. uint32_t bss_load_threshold;
  638. uint32_t bss_load_sample_time;
  639. int32_t rssi_threshold_5ghz;
  640. int32_t rssi_threshold_24ghz;
  641. };
  642. /**
  643. * struct wmi_idle_roam_params - Idle roam trigger parameters
  644. * @vdev_id: VDEV on which the parameters should be applied
  645. * @enable: Enable/Disable Idle roaming
  646. * @band: Connected AP band
  647. * @conn_ap_rssi_delta: Rssi change of connected AP in dBm
  648. * @conn_ap_min_rssi: If connected AP rssi is less than min rssi trigger roam
  649. * @inactive_time: Connected AP idle time
  650. * @data_pkt_count: Data packet count allowed during idle time
  651. */
  652. struct wmi_idle_roam_params {
  653. uint32_t vdev_id;
  654. bool enable;
  655. uint32_t band;
  656. uint32_t conn_ap_rssi_delta;
  657. int32_t conn_ap_min_rssi;
  658. uint32_t inactive_time;
  659. uint32_t data_pkt_count;
  660. };
  661. /**
  662. * struct wmi_disconnect_roam_params - Emergency deauth/disconnect roam params
  663. * @vdev_id: VDEV on which the parameters should be applied
  664. * @enable: Enable or disable disconnect roaming.
  665. */
  666. struct wmi_disconnect_roam_params {
  667. uint32_t vdev_id;
  668. bool enable;
  669. };
  670. /**
  671. * struct wmi_roam_auth_status_params - WPA3 roam auth response status
  672. * parameters
  673. * @vdev_id: Vdev on which roam preauth is happening
  674. * @preauth_status: Status of the Auth response.
  675. * IEEE80211_STATUS_SUCCESS(0) for success. Corresponding
  676. * IEEE80211 failure status code for failure.
  677. *
  678. * @bssid: Candidate BSSID
  679. * @pmkid: PMKID derived for the auth
  680. */
  681. struct wmi_roam_auth_status_params {
  682. uint32_t vdev_id;
  683. uint32_t preauth_status;
  684. struct qdf_mac_addr bssid;
  685. uint8_t pmkid[PMKID_LEN];
  686. };
  687. /**
  688. * @time_offset: time offset after 11k offload command to trigger a neighbor
  689. * report request (in seconds)
  690. * @low_rssi_offset: Offset from rssi threshold to trigger a neighbor
  691. * report request (in dBm)
  692. * @bmiss_count_trigger: Number of beacon miss events to trigger neighbor
  693. * report request
  694. * @per_threshold_offset: offset from PER threshold to trigger neighbor
  695. * report request (in %)
  696. * @neighbor_report_cache_timeout: timeout after which new trigger can enable
  697. * sending of a neighbor report request (in seconds)
  698. * @max_neighbor_report_req_cap: max number of neighbor report requests that
  699. * can be sent to the peer in the current session
  700. * @ssid: Current connect SSID info
  701. */
  702. struct wmi_11k_offload_neighbor_report_params {
  703. uint32_t time_offset;
  704. uint32_t low_rssi_offset;
  705. uint32_t bmiss_count_trigger;
  706. uint32_t per_threshold_offset;
  707. uint32_t neighbor_report_cache_timeout;
  708. uint32_t max_neighbor_report_req_cap;
  709. struct mac_ssid ssid;
  710. };
  711. /**
  712. * struct wmi_11k_offload_params - offload 11k features to FW
  713. * @vdev_id: vdev id
  714. * @offload_11k_bitmask: bitmask to specify offloaded features
  715. * B0: Neighbor Report Request offload
  716. * B1-B31: Reserved
  717. * @neighbor_report_params: neighbor report offload params
  718. */
  719. struct wmi_11k_offload_params {
  720. uint32_t vdev_id;
  721. uint32_t offload_11k_bitmask;
  722. struct wmi_11k_offload_neighbor_report_params neighbor_report_params;
  723. };
  724. /**
  725. * struct wmi_invoke_neighbor_report_params - Invoke neighbor report request
  726. * from IW to FW
  727. * @vdev_id: vdev id
  728. * @send_resp_to_host: bool to send response to host or not
  729. * @ssid: ssid given from the IW command
  730. */
  731. struct wmi_invoke_neighbor_report_params {
  732. uint32_t vdev_id;
  733. uint32_t send_resp_to_host;
  734. struct mac_ssid ssid;
  735. };
  736. /**
  737. * struct roam_triggers - vendor configured roam triggers
  738. * @vdev_id: vdev id
  739. * @trigger_bitmap: vendor configured roam trigger bitmap as
  740. * defined @enum roam_control_trigger_reason
  741. */
  742. struct roam_triggers {
  743. uint32_t vdev_id;
  744. uint32_t trigger_bitmap;
  745. };
  746. #endif /* _WMI_UNIFIED_ROAM_PARAM_H_ */