wmi_unified_roam_param.h 30 KB

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