wmi_unified_roam_param.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  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. #define WMI_CFG_VALID_CHANNEL_LIST_LEN 100
  149. /* Occupied channel list remains static */
  150. #define WMI_CHANNEL_LIST_STATIC 1
  151. /* Occupied channel list can be learnt after init */
  152. #define WMI_CHANNEL_LIST_DYNAMIC_INIT 2
  153. /* Occupied channel list can be learnt after flush */
  154. #define WMI_CHANNEL_LIST_DYNAMIC_FLUSH 3
  155. /* Occupied channel list can be learnt after update */
  156. #define WMI_CHANNEL_LIST_DYNAMIC_UPDATE 4
  157. /**
  158. * struct plm_req_params - plm req parameter
  159. * @diag_token: Dialog token
  160. * @meas_token: measurement token
  161. * @num_bursts: total number of bursts
  162. * @burst_int: burst interval in seconds
  163. * @meas_duration:in TU's,STA goes off-ch
  164. * @burst_len: no of times the STA should cycle through PLM ch list
  165. * @desired_tx_pwr: desired tx power
  166. * @mac_addr: MC dest addr
  167. * @plm_num_ch: channel numbers
  168. * @plm_ch_freq_list: channel frequency list
  169. * @vdev_id: vdev id
  170. * @enable: enable/disable
  171. */
  172. struct plm_req_params {
  173. uint16_t diag_token;
  174. uint16_t meas_token;
  175. uint16_t num_bursts;
  176. uint16_t burst_int;
  177. uint16_t meas_duration;
  178. /* no of times the STA should cycle through PLM ch list */
  179. uint8_t burst_len;
  180. int8_t desired_tx_pwr;
  181. struct qdf_mac_addr mac_addr;
  182. /* no of channels */
  183. uint8_t plm_num_ch;
  184. /* channel frequency list */
  185. uint32_t plm_ch_freq_list[WMI_CFG_VALID_CHANNEL_LIST_LEN];
  186. uint8_t vdev_id;
  187. bool enable;
  188. };
  189. /**
  190. * struct wmi_roam_invoke_cmd - roam invoke command
  191. * @vdev_id: vdev id
  192. * @bssid: mac address
  193. * @channel: channel
  194. * @frame_len: frame length, includs mac header, fixed params and ies
  195. * @frame_buf: buffer contaning probe response or beacon
  196. * @is_same_bssid: flag to indicate if roaming is requested for same bssid
  197. * @forced_roaming: Roam to any bssid in any ch (here bssid & ch is not given)
  198. */
  199. struct wmi_roam_invoke_cmd {
  200. uint32_t vdev_id;
  201. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  202. uint32_t channel;
  203. uint32_t frame_len;
  204. uint8_t *frame_buf;
  205. uint8_t is_same_bssid;
  206. bool forced_roaming;
  207. };
  208. /**
  209. * struct wmi_limit_off_chan_param - limit off channel parameters
  210. * @vdev_id: vdev id
  211. * @status: status of the command (enable/disable)
  212. * @max_offchan_time: max off channel time
  213. * @rest_time: home channel time
  214. * @skip_dfs_chans: skip dfs channels during scan
  215. */
  216. struct wmi_limit_off_chan_param {
  217. uint32_t vdev_id;
  218. bool status;
  219. uint32_t max_offchan_time;
  220. uint32_t rest_time;
  221. bool skip_dfs_chans;
  222. };
  223. #define WMI_MAX_HLP_IE_LEN 2048
  224. /**
  225. * struct hlp_params - HLP info params
  226. * @vdev_id: vdev id
  227. * @hlp_ie_len: HLP IE length
  228. * @hlp_ie: HLP IE
  229. */
  230. struct hlp_params {
  231. uint8_t vdev_id;
  232. uint32_t hlp_ie_len;
  233. uint8_t hlp_ie[WMI_MAX_HLP_IE_LEN];
  234. };
  235. /**
  236. * struct wmi_roam_auth_status_params - WPA3 roam auth response status
  237. * parameters
  238. * @vdev_id: Vdev on which roam preauth is happening
  239. * @preauth_status: Status of the Auth response.
  240. * IEEE80211_STATUS_SUCCESS(0) for success. Corresponding
  241. * IEEE80211 failure status code for failure.
  242. *
  243. * @bssid: Candidate BSSID
  244. * @pmkid: PMKID derived for the auth
  245. */
  246. struct wmi_roam_auth_status_params {
  247. uint32_t vdev_id;
  248. uint32_t preauth_status;
  249. struct qdf_mac_addr bssid;
  250. uint8_t pmkid[PMKID_LEN];
  251. };
  252. /**
  253. * struct wmi_invoke_neighbor_report_params - Invoke neighbor report request
  254. * from IW to FW
  255. * @vdev_id: vdev id
  256. * @send_resp_to_host: bool to send response to host or not
  257. * @ssid: ssid given from the IW command
  258. */
  259. struct wmi_invoke_neighbor_report_params {
  260. uint32_t vdev_id;
  261. uint32_t send_resp_to_host;
  262. struct wlan_ssid ssid;
  263. };
  264. /**
  265. * set_pcl_cmd_params - Set PCL command params
  266. * @vdev_id: Vdev id
  267. * @weight: PCL weight
  268. */
  269. struct set_pcl_cmd_params {
  270. uint8_t vdev_id;
  271. struct wmi_pcl_chan_weights *weights;
  272. };
  273. #endif /* _WMI_UNIFIED_ROAM_PARAM_H_ */