wmi_unified_sta_param.h 11 KB

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