wmi_unified_roam_param.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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. * @roam_data_rssi_threshold_triggers: triggers of bad data RSSI threshold to
  93. * roam
  94. * @roam_data_rssi_threshold: Bad data RSSI threshold to roam
  95. * @rx_data_inactivity_time: Rx duration to check data RSSI
  96. * @flags: Flags for Background Roaming
  97. * Bit 0 : BG roaming enabled when we connect to 2G AP only and roaming
  98. * to 5G AP only.
  99. * Bit 1-31: Reserved
  100. */
  101. struct roam_offload_scan_rssi_params {
  102. int8_t rssi_thresh;
  103. uint8_t rssi_thresh_diff;
  104. uint32_t hi_rssi_scan_max_count;
  105. uint32_t hi_rssi_scan_rssi_delta;
  106. int32_t hi_rssi_scan_rssi_ub;
  107. int raise_rssi_thresh_5g;
  108. uint8_t vdev_id;
  109. uint32_t penalty_threshold_5g;
  110. uint32_t boost_threshold_5g;
  111. uint8_t raise_factor_5g;
  112. uint8_t drop_factor_5g;
  113. int max_raise_rssi_5g;
  114. int max_drop_rssi_5g;
  115. uint32_t good_rssi_threshold;
  116. uint32_t roam_earlystop_thres_min;
  117. uint32_t roam_earlystop_thres_max;
  118. int dense_rssi_thresh_offset;
  119. int dense_min_aps_cnt;
  120. int initial_dense_status;
  121. int traffic_threshold;
  122. int32_t rssi_thresh_offset_5g;
  123. int8_t bg_scan_bad_rssi_thresh;
  124. uint8_t roam_bad_rssi_thresh_offset_2g;
  125. uint32_t bg_scan_client_bitmap;
  126. uint32_t roam_data_rssi_threshold_triggers;
  127. int32_t roam_data_rssi_threshold;
  128. uint32_t rx_data_inactivity_time;
  129. uint32_t flags;
  130. };
  131. /**
  132. * struct roam_scan_period_params - Roam scan period parameters
  133. * @vdev_id: Vdev for which the scan period parameters are sent
  134. * @scan_period: Opportunistic scan runs on a timer for scan_period
  135. * @scan_age: Duration after which the scan entries are to be aged out
  136. * @roam_scan_inactivity_time: inactivity monitoring time in ms for which the
  137. * device is considered to be inactive
  138. * @roam_inactive_data_packet_count: Maximum allowed data packets count during
  139. * roam_scan_inactivity_time.
  140. * @roam_scan_period_after_inactivity: Roam scan period in ms after device is
  141. * in inactive state.
  142. * @full_scan_period: Full scan period is the idle period in seconds
  143. * between two successive full channel roam scans.
  144. */
  145. struct roam_scan_period_params {
  146. uint32_t vdev_id;
  147. uint32_t scan_period;
  148. uint32_t scan_age;
  149. uint32_t roam_scan_inactivity_time;
  150. uint32_t roam_inactive_data_packet_count;
  151. uint32_t roam_scan_period_after_inactivity;
  152. uint32_t full_scan_period;
  153. };
  154. #endif
  155. #define WMI_CFG_VALID_CHANNEL_LIST_LEN 100
  156. /* Occupied channel list remains static */
  157. #define WMI_CHANNEL_LIST_STATIC 1
  158. /* Occupied channel list can be learnt after init */
  159. #define WMI_CHANNEL_LIST_DYNAMIC_INIT 2
  160. /* Occupied channel list can be learnt after flush */
  161. #define WMI_CHANNEL_LIST_DYNAMIC_FLUSH 3
  162. /* Occupied channel list can be learnt after update */
  163. #define WMI_CHANNEL_LIST_DYNAMIC_UPDATE 4
  164. /**
  165. * struct plm_req_params - plm req parameter
  166. * @diag_token: Dialog token
  167. * @meas_token: measurement token
  168. * @num_bursts: total number of bursts
  169. * @burst_int: burst interval in seconds
  170. * @meas_duration:in TU's,STA goes off-ch
  171. * @burst_len: no of times the STA should cycle through PLM ch list
  172. * @desired_tx_pwr: desired tx power
  173. * @mac_addr: MC dest addr
  174. * @plm_num_ch: channel numbers
  175. * @plm_ch_freq_list: channel frequency list
  176. * @vdev_id: vdev id
  177. * @enable: enable/disable
  178. */
  179. struct plm_req_params {
  180. uint16_t diag_token;
  181. uint16_t meas_token;
  182. uint16_t num_bursts;
  183. uint16_t burst_int;
  184. uint16_t meas_duration;
  185. /* no of times the STA should cycle through PLM ch list */
  186. uint8_t burst_len;
  187. int8_t desired_tx_pwr;
  188. struct qdf_mac_addr mac_addr;
  189. /* no of channels */
  190. uint8_t plm_num_ch;
  191. /* channel frequency list */
  192. uint32_t plm_ch_freq_list[WMI_CFG_VALID_CHANNEL_LIST_LEN];
  193. uint8_t vdev_id;
  194. bool enable;
  195. };
  196. /**
  197. * struct wmi_roam_invoke_cmd - roam invoke command
  198. * @vdev_id: vdev id
  199. * @bssid: mac address
  200. * @channel: channel
  201. * @frame_len: frame length, includs mac header, fixed params and ies
  202. * @frame_buf: buffer contaning probe response or beacon
  203. * @is_same_bssid: flag to indicate if roaming is requested for same bssid
  204. * @forced_roaming: Roam to any bssid in any ch (here bssid & ch is not given)
  205. */
  206. struct wmi_roam_invoke_cmd {
  207. uint32_t vdev_id;
  208. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  209. uint32_t channel;
  210. uint32_t frame_len;
  211. uint8_t *frame_buf;
  212. uint8_t is_same_bssid;
  213. bool forced_roaming;
  214. };
  215. /**
  216. * struct wmi_limit_off_chan_param - limit off channel parameters
  217. * @vdev_id: vdev id
  218. * @status: status of the command (enable/disable)
  219. * @max_offchan_time: max off channel time
  220. * @rest_time: home channel time
  221. * @skip_dfs_chans: skip dfs channels during scan
  222. */
  223. struct wmi_limit_off_chan_param {
  224. uint32_t vdev_id;
  225. bool status;
  226. uint32_t max_offchan_time;
  227. uint32_t rest_time;
  228. bool skip_dfs_chans;
  229. };
  230. #define WMI_MAX_HLP_IE_LEN 2048
  231. /**
  232. * struct hlp_params - HLP info params
  233. * @vdev_id: vdev id
  234. * @hlp_ie_len: HLP IE length
  235. * @hlp_ie: HLP IE
  236. */
  237. struct hlp_params {
  238. uint8_t vdev_id;
  239. uint32_t hlp_ie_len;
  240. uint8_t hlp_ie[WMI_MAX_HLP_IE_LEN];
  241. };
  242. /**
  243. * struct wmi_roam_auth_status_params - WPA3 roam auth response status
  244. * parameters
  245. * @vdev_id: Vdev on which roam preauth is happening
  246. * @preauth_status: Status of the Auth response.
  247. * IEEE80211_STATUS_SUCCESS(0) for success. Corresponding
  248. * IEEE80211 failure status code for failure.
  249. *
  250. * @bssid: Candidate BSSID
  251. * @pmkid: PMKID derived for the auth
  252. */
  253. struct wmi_roam_auth_status_params {
  254. uint32_t vdev_id;
  255. uint32_t preauth_status;
  256. struct qdf_mac_addr bssid;
  257. uint8_t pmkid[PMKID_LEN];
  258. };
  259. /**
  260. * struct wmi_invoke_neighbor_report_params - Invoke neighbor report request
  261. * from IW to FW
  262. * @vdev_id: vdev id
  263. * @send_resp_to_host: bool to send response to host or not
  264. * @ssid: ssid given from the IW command
  265. */
  266. struct wmi_invoke_neighbor_report_params {
  267. uint32_t vdev_id;
  268. uint32_t send_resp_to_host;
  269. struct wlan_ssid ssid;
  270. };
  271. /**
  272. * set_pcl_cmd_params - Set PCL command params
  273. * @vdev_id: Vdev id
  274. * @weight: PCL weight
  275. */
  276. struct set_pcl_cmd_params {
  277. uint8_t vdev_id;
  278. struct wmi_pcl_chan_weights *weights;
  279. };
  280. #endif /* _WMI_UNIFIED_ROAM_PARAM_H_ */