wmi_unified_sta_param.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. /*
  2. * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /*
  20. * This file contains the API definitions for the STA WMI APIs.
  21. */
  22. #ifndef _WMI_UNIFIED_STA_PARAM_H_
  23. #define _WMI_UNIFIED_STA_PARAM_H_
  24. /**
  25. * struct sta_keep_alive_params - sta keep alive parameters
  26. * @vdev_id: vdev id
  27. * @method: keep alive method
  28. * @timeperiod: time to keep alive
  29. * @hostv4addr: host ipv4 address
  30. * @destv4addr: destination ipv4 address
  31. * @destmac: destination mac address
  32. */
  33. struct sta_keep_alive_params {
  34. uint8_t vdev_id;
  35. uint32_t method;
  36. uint32_t timeperiod;
  37. uint8_t hostv4addr[QDF_IPV4_ADDR_SIZE];
  38. uint8_t destv4addr[QDF_IPV4_ADDR_SIZE];
  39. uint8_t destmac[QDF_MAC_ADDR_SIZE];
  40. };
  41. /**
  42. * struct wmi_gtx_config - GTX config
  43. * @gtx_rt_mask: for HT and VHT rate masks
  44. * @gtx_usrcfg: host request for GTX mask
  45. * @gtx_threshold: PER Threshold (default: 10%)
  46. * @gtx_margin: PER margin (default: 2%)
  47. * @gtx_tpcstep: TPC step (default: 1)
  48. * @gtx_tpcmin: TPC min (default: 5)
  49. * @gtx_bwmask: BW mask (20/40/80/160 Mhz)
  50. */
  51. struct wmi_gtx_config {
  52. uint32_t gtx_rt_mask[2];
  53. uint32_t gtx_usrcfg;
  54. uint32_t gtx_threshold;
  55. uint32_t gtx_margin;
  56. uint32_t gtx_tpcstep;
  57. uint32_t gtx_tpcmin;
  58. uint32_t gtx_bwmask;
  59. };
  60. /**
  61. * struct wlm_latency_level_param - WLM parameters
  62. * @wlm_latency_level: wlm latency level to set
  63. * 0 - normal, 1 - moderate, 2 - low, 3 - ultralow
  64. * @wlm_latency_flags: wlm latency flags to set
  65. * |31 12| 11 | 10 |9 8|7 6|5 4|3 2| 1 | 0 |
  66. * +------+------+------+------+------+------+------+-----+-----+
  67. * | RSVD | SSLP | CSLP | RSVD | Roam | RSVD | DWLT | DFS | SUP |
  68. * +------+-------------+-------------+-------------------------+
  69. * | WAL | PS | Roam | Scan |
  70. *
  71. * bit 0: Avoid scan request from HLOS if setting
  72. * bit 1: Skip DFS channel SCAN if setting
  73. * bit 2-3: Define policy of dwell time/duration for each foreign channel
  74. * (b2 b3)
  75. * (0 0 ): Default scan dwell time
  76. * (0 1 ): Reserve
  77. * (1 0 ): Shrink off channel dwell time
  78. * (1 1 ): Reserve
  79. * bit 4-5: Reserve for scan
  80. * bit 6-7: Define roaming policy
  81. * (b6 b7)
  82. * (0 0 ): Default roaming behavior, allow roaming in all scenarios
  83. * (0 1 ): Disallow all roaming
  84. * (1 0 ): Allow roaming when final bmissed
  85. * (1 1 ): Reserve
  86. * bit 8-9: Reserve for roaming
  87. * bit 10: Disable css power collapse if setting
  88. * bit 11: Disable sys sleep if setting
  89. * bit 12-31: Reserve for future usage
  90. * @vdev_id: vdev id
  91. * @force_reset: bit 0 used as force reset to override the latency level as
  92. * default for all the wlm clients
  93. * @client_id_bitmask: clients of WLM Arbiter
  94. */
  95. struct wlm_latency_level_param {
  96. uint16_t wlm_latency_level;
  97. uint32_t wlm_latency_flags;
  98. uint16_t vdev_id;
  99. #ifdef MULTI_CLIENT_LL_SUPPORT
  100. uint32_t force_reset;
  101. uint32_t client_id_bitmask;
  102. #endif
  103. };
  104. #define WMI_2_4_GHZ_MAX_FREQ 3000
  105. /**
  106. * struct vdev_ie_info_param - IE info
  107. * @vdev_id: vdev for which the IE is being sent
  108. * @ie_id: ID of the IE
  109. * @length: length of the IE data
  110. * @ie_source:
  111. * @band:
  112. * @data: IE data
  113. *
  114. * This structure is used to store the IE information.
  115. */
  116. struct vdev_ie_info_param {
  117. uint32_t vdev_id;
  118. uint32_t ie_id;
  119. uint32_t length;
  120. uint32_t ie_source;
  121. uint32_t band;
  122. uint8_t *data;
  123. };
  124. #define MAX_SAR_LIMIT_ROWS_SUPPORTED 64
  125. /**
  126. * struct sar_limit_cmd_row - sar limits row
  127. * @band_id: Optional param for frequency band
  128. * See %enum wmi_sar_band_id_flags for possible values
  129. * @chain_id: Optional param for antenna chain id
  130. * @mod_id: Optional param for modulation scheme
  131. * See %enum wmi_sar_mod_id_flags for possible values
  132. * @limit_value: Mandatory param providing power limits in steps of 0.5 dbm
  133. * @validity_bitmap: bitmap of valid optional params in sar_limit_cmd_row struct
  134. * See WMI_SAR_*_VALID_MASK for possible values
  135. */
  136. struct sar_limit_cmd_row {
  137. uint32_t band_id;
  138. uint32_t chain_id;
  139. uint32_t mod_id;
  140. uint32_t limit_value;
  141. uint32_t validity_bitmap;
  142. };
  143. /**
  144. * struct sar_limit_cmd_params - sar limits params
  145. * @sar_enable: flag to enable SAR
  146. * See %enum wmi_sar_feature_state_flags for possible values
  147. * @num_limit_rows: number of items in sar_limits
  148. * @commit_limits: indicates firmware to start apply new SAR values
  149. * @sar_limit_row_list: pointer to array of sar limit rows
  150. */
  151. struct sar_limit_cmd_params {
  152. uint32_t sar_enable;
  153. uint32_t num_limit_rows;
  154. uint32_t commit_limits;
  155. struct sar_limit_cmd_row *sar_limit_row_list;
  156. };
  157. /**
  158. * struct sar_limit_event_row - sar limits row
  159. * @band_id: Frequency band.
  160. * See %enum wmi_sar_band_id_flags for possible values
  161. * @chain_id: Chain id
  162. * @mod_id: Modulation scheme
  163. * See %enum wmi_sar_mod_id_flags for possible values
  164. * @limit_value: Power limits in steps of 0.5 dbm that is currently active for
  165. * the given @band_id, @chain_id, and @mod_id
  166. */
  167. struct sar_limit_event_row {
  168. uint32_t band_id;
  169. uint32_t chain_id;
  170. uint32_t mod_id;
  171. uint32_t limit_value;
  172. };
  173. /**
  174. * struct sar_limit_event - sar limits params
  175. * @sar_enable: Current status of SAR enablement.
  176. * See %enum wmi_sar_feature_state_flags for possible values
  177. * @num_limit_rows: number of items in sar_limits
  178. * @sar_limit_row: array of sar limit rows. Only @num_limit_rows
  179. * should be considered valid.
  180. */
  181. struct sar_limit_event {
  182. uint32_t sar_enable;
  183. uint32_t num_limit_rows;
  184. struct sar_limit_event_row
  185. sar_limit_row[MAX_SAR_LIMIT_ROWS_SUPPORTED];
  186. };
  187. #define WMI_UNIFIED_MAX_PMKID_LEN 16
  188. #define WMI_UNIFIED_MAX_PMK_LEN 64
  189. /**
  190. * struct wmi_unified_pmk_cache - used to set del pmkid cache
  191. * @vdev_id: ID of the vdev being configured
  192. * @pmk_len: PMK len
  193. * for big-endian hosts, manual endian conversion will be needed to keep
  194. * the array values in their original order in spite of the automatic
  195. * byte-swap applied to WMI messages during download
  196. * @pmk: PMK array
  197. * @pmkid_len: PMK ID Len
  198. * @pmkid: PMK ID Array
  199. * @bssid: BSSID
  200. * @ssid: SSID
  201. * @cache_id: PMK Cache ID
  202. * @cat_flag: whether (bssid) or (ssid,cache_id) is valid
  203. * @action_flag: add/delete the entry
  204. * @is_flush_all: FLAG to indicate PMKSA flush. True if PMKSA cache flush is
  205. * needed.
  206. */
  207. struct wmi_unified_pmk_cache {
  208. uint8_t vdev_id;
  209. uint32_t pmk_len;
  210. uint8_t pmk[WMI_UNIFIED_MAX_PMK_LEN];
  211. uint32_t pmkid_len;
  212. uint8_t pmkid[WMI_UNIFIED_MAX_PMKID_LEN];
  213. wmi_host_mac_addr bssid;
  214. struct wlan_ssid ssid;
  215. uint32_t cache_id;
  216. uint32_t cat_flag;
  217. uint32_t action_flag;
  218. bool is_flush_all;
  219. };
  220. #define WMI_QOS_NUM_AC_MAX 4
  221. /**
  222. * struct aggr_add_ts_param - ADDTS parameters
  223. * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
  224. * @tspec: tspec value
  225. * @status: QDF status
  226. * @sessionId: session id
  227. * @vdev_id: vdev id
  228. */
  229. struct aggr_add_ts_param {
  230. uint16_t tspecIdx;
  231. struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX];
  232. QDF_STATUS status[WMI_QOS_NUM_AC_MAX];
  233. uint8_t sessionId;
  234. uint8_t vdev_id;
  235. };
  236. #define WMI_PERIODIC_TX_PTRN_MAX_SIZE 1536
  237. /**
  238. * struct periodic_tx_pattern - periodic tx pattern
  239. * @mac_address: MAC Address for the adapter
  240. * @ucPtrnId: Pattern ID
  241. * @ucPtrnSize: Pattern size
  242. * @usPtrnIntervalMs: in ms
  243. * @ucPattern: Pattern buffer
  244. */
  245. struct periodic_tx_pattern {
  246. struct qdf_mac_addr mac_address;
  247. uint8_t ucPtrnId;
  248. uint16_t ucPtrnSize;
  249. uint32_t usPtrnIntervalMs;
  250. uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE];
  251. };
  252. /**
  253. * struct flashing_req_params - led flashing parameter
  254. * @req_id: request id
  255. * @pattern_id: pattern identifier. 0: disconnected 1: connected
  256. * @led_x0: led flashing parameter0
  257. * @led_x1: led flashing parameter1
  258. */
  259. struct flashing_req_params {
  260. uint32_t req_id;
  261. uint32_t pattern_id;
  262. uint32_t led_x0;
  263. uint32_t led_x1;
  264. };
  265. /**
  266. * struct wmi_pcl_chan_weights - Params to get the valid weighed list
  267. * @pcl_list: channel freq list sorted in preferred order
  268. * @pcl_len: Length of the PCL
  269. * @saved_chan_list: Valid channel freq list updated as part of
  270. * WMA_UPDATE_CHAN_LIST_REQ
  271. * @saved_num_chan: Length of the valid channel list
  272. * @weighed_valid_list: Weights of the valid channel list. This will have one
  273. * to one mapping with valid_chan_list. FW expects channel order and size to be
  274. * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
  275. * @weight_list: Weights assigned by policy manager
  276. */
  277. struct wmi_pcl_chan_weights {
  278. uint32_t pcl_list[NUM_CHANNELS];
  279. uint32_t pcl_len;
  280. uint32_t saved_chan_list[NUM_CHANNELS];
  281. uint32_t saved_num_chan;
  282. uint8_t weighed_valid_list[NUM_CHANNELS];
  283. uint8_t weight_list[NUM_CHANNELS];
  284. };
  285. /**
  286. * struct wmi_adaptive_dwelltime_params - the adaptive dwelltime params
  287. * @vdev_id: vdev id
  288. * @is_enabled: Adaptive dwell time is enabled/disabled
  289. * @dwelltime_mode: global default adaptive dwell mode
  290. * @lpf_weight: weight to calculate the average low pass
  291. * filter for channel congestion
  292. * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
  293. * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
  294. *
  295. */
  296. struct wmi_adaptive_dwelltime_params {
  297. uint32_t vdev_id;
  298. bool is_enabled;
  299. enum scan_dwelltime_adaptive_mode dwelltime_mode;
  300. uint8_t lpf_weight;
  301. uint8_t passive_mon_intval;
  302. uint8_t wifi_act_threshold;
  303. };
  304. #define WMI_SCAN_CLIENT_MAX 7
  305. /**
  306. * struct wmi_dbs_scan_sel_params - DBS scan selection params
  307. * @num_clients: Number of scan clients dutycycle
  308. * @pdev_id: pdev_id for identifying the MAC
  309. * @module_id: scan client module id
  310. * @num_dbs_scans: number of DBS scans
  311. * @num_non_dbs_scans: number of non-DBS scans
  312. */
  313. struct wmi_dbs_scan_sel_params {
  314. uint32_t num_clients;
  315. uint32_t pdev_id;
  316. uint32_t module_id[WMI_SCAN_CLIENT_MAX];
  317. uint32_t num_dbs_scans[WMI_SCAN_CLIENT_MAX];
  318. uint32_t num_non_dbs_scans[WMI_SCAN_CLIENT_MAX];
  319. };
  320. /**
  321. * struct set_arp_stats - set/reset arp stats
  322. * @vdev_id: session id
  323. * @flag: enable/disable stats
  324. * @pkt_type: type of packet(1 - arp)
  325. * @ip_addr: subnet ipv4 address in case of encrypted packets
  326. * @pkt_type_bitmap: pkt bitmap
  327. * @tcp_src_port: tcp src port for pkt tracking
  328. * @tcp_dst_port: tcp dst port for pkt tracking
  329. * @icmp_ipv4: target ipv4 address to track ping packets
  330. * @reserved: reserved
  331. */
  332. struct set_arp_stats {
  333. uint32_t vdev_id;
  334. uint8_t flag;
  335. uint8_t pkt_type;
  336. uint32_t ip_addr;
  337. uint32_t pkt_type_bitmap;
  338. uint32_t tcp_src_port;
  339. uint32_t tcp_dst_port;
  340. uint32_t icmp_ipv4;
  341. uint32_t reserved;
  342. };
  343. /**
  344. * struct get_arp_stats - get arp stats from firmware
  345. * @pkt_type: packet type(1 - ARP)
  346. * @vdev_id: session id
  347. */
  348. struct get_arp_stats {
  349. uint8_t pkt_type;
  350. uint32_t vdev_id;
  351. };
  352. #endif /* _WMI_UNIFIED_STA_PARAM_H_ */