wmi_unified_roam_param.h 26 KB

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