wmi_unified_roam_param.h 26 KB

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