wmi_unified_sta_param.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. /*
  2. * Copyright (c) 2013-2018 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_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_params {
  33. uint8_t vdev_id;
  34. uint32_t method;
  35. uint32_t timeperiod;
  36. uint8_t *hostv4addr;
  37. uint8_t *destv4addr;
  38. uint8_t *destmac;
  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. #ifndef CONVERGED_TDLS_ENABLE
  97. /**
  98. * struct tdls_chan_switch_params - channel switch parameter structure
  99. * @vdev_id: vdev ID
  100. * @peer_mac_addr: Peer mac address
  101. * @tdls_off_ch_bw_offset: Target off-channel bandwitdh offset
  102. * @tdls_off_ch: Target Off Channel
  103. * @oper_class: Operating class for target channel
  104. * @is_responder: Responder or initiator
  105. */
  106. struct tdls_channel_switch_params {
  107. uint32_t vdev_id;
  108. uint8_t peer_mac_addr[IEEE80211_ADDR_LEN];
  109. uint16_t tdls_off_ch_bw_offset;
  110. uint8_t tdls_off_ch;
  111. uint8_t tdls_sw_mode;
  112. uint8_t oper_class;
  113. uint8_t is_responder;
  114. };
  115. #endif
  116. #define WMI_TDLS_MAX_SUPP_CHANNELS 128
  117. #define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32
  118. #define WMI_2_4_GHZ_MAX_FREQ 3000
  119. /**
  120. * struct tdls_update_ch_params - channel parameters
  121. * @chanId: ID of the channel
  122. * @pwr: power level
  123. * @dfsSet: is dfs supported or not
  124. * @half_rate: is the channel operating at 10MHz
  125. * @quarter_rate: is the channel operating at 5MHz
  126. */
  127. struct tdls_update_ch_params {
  128. uint8_t chanId;
  129. uint8_t pwr;
  130. bool dfsSet;
  131. bool half_rate;
  132. bool quarter_rate;
  133. };
  134. /**
  135. * struct tdls_peer_cap_params - TDLS peer capablities parameters
  136. * @isPeerResponder: is peer responder or not
  137. * @peerUapsdQueue: peer uapsd queue
  138. * @peerMaxSp: peer max SP value
  139. * @peerBuffStaSupport: peer buffer sta supported or not
  140. * @peerOffChanSupport: peer offchannel support
  141. * @peerCurrOperClass: peer current operating class
  142. * @selfCurrOperClass: self current operating class
  143. * @peerChanLen: peer channel length
  144. * @peerChan: peer channel list
  145. * @peerOperClassLen: peer operating class length
  146. * @peerOperClass: peer operating class
  147. * @prefOffChanNum: peer offchannel number
  148. * @prefOffChanBandwidth: peer offchannel bandwidth
  149. * @opClassForPrefOffChan: operating class for offchannel
  150. */
  151. struct tdls_peer_cap_params {
  152. uint8_t isPeerResponder;
  153. uint8_t peerUapsdQueue;
  154. uint8_t peerMaxSp;
  155. uint8_t peerBuffStaSupport;
  156. uint8_t peerOffChanSupport;
  157. uint8_t peerCurrOperClass;
  158. uint8_t selfCurrOperClass;
  159. uint8_t peerChanLen;
  160. struct tdls_update_ch_params peerChan[WMI_TDLS_MAX_SUPP_CHANNELS];
  161. uint8_t peerOperClassLen;
  162. uint8_t peerOperClass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
  163. uint8_t prefOffChanNum;
  164. uint8_t prefOffChanBandwidth;
  165. uint8_t opClassForPrefOffChan;
  166. };
  167. /**
  168. * struct tdls_peer_state_params - TDLS peer state parameters
  169. * @vdevId: vdev id
  170. * @peerMacAddr: peer mac address
  171. * @peerCap: peer capabality
  172. */
  173. struct tdls_peer_state_params {
  174. uint32_t vdevId;
  175. uint8_t peerMacAddr[IEEE80211_ADDR_LEN];
  176. uint32_t peerState;
  177. struct tdls_peer_cap_params peerCap;
  178. };
  179. /**
  180. * struct vdev_ie_info_param - IE info
  181. * @vdev_id - vdev for which the IE is being sent
  182. * @ie_id - ID of the IE
  183. * @length - length of the IE data
  184. * @data - IE data
  185. *
  186. * This structure is used to store the IE information.
  187. */
  188. struct vdev_ie_info_param {
  189. uint32_t vdev_id;
  190. uint32_t ie_id;
  191. uint32_t length;
  192. uint32_t ie_source;
  193. uint32_t band;
  194. uint8_t *data;
  195. };
  196. #define MAX_SAR_LIMIT_ROWS_SUPPORTED 64
  197. /**
  198. * struct sar_limit_cmd_row - sar limits row
  199. * @band_id: Optional param for frequency band
  200. * See %enum wmi_sar_band_id_flags for possible values
  201. * @chain_id: Optional param for antenna chain id
  202. * @mod_id: Optional param for modulation scheme
  203. * See %enum wmi_sar_mod_id_flags for possible values
  204. * @limit_value: Mandatory param providing power limits in steps of 0.5 dbm
  205. * @validity_bitmap: bitmap of valid optional params in sar_limit_cmd_row struct
  206. * See WMI_SAR_*_VALID_MASK for possible values
  207. */
  208. struct sar_limit_cmd_row {
  209. uint32_t band_id;
  210. uint32_t chain_id;
  211. uint32_t mod_id;
  212. uint32_t limit_value;
  213. uint32_t validity_bitmap;
  214. };
  215. /**
  216. * struct sar_limit_cmd_params - sar limits params
  217. * @sar_enable: flag to enable SAR
  218. * See %enum wmi_sar_feature_state_flags for possible values
  219. * @num_limit_rows: number of items in sar_limits
  220. * @commit_limits: indicates firmware to start apply new SAR values
  221. * @sar_limit_row_list: pointer to array of sar limit rows
  222. */
  223. struct sar_limit_cmd_params {
  224. uint32_t sar_enable;
  225. uint32_t num_limit_rows;
  226. uint32_t commit_limits;
  227. struct sar_limit_cmd_row *sar_limit_row_list;
  228. };
  229. /**
  230. * struct sar_limit_event_row - sar limits row
  231. * @band_id: Frequency band.
  232. * See %enum wmi_sar_band_id_flags for possible values
  233. * @chain_id: Chain id
  234. * @mod_id: Modulation scheme
  235. * See %enum wmi_sar_mod_id_flags for possible values
  236. * @limit_value: Power limits in steps of 0.5 dbm that is currently active for
  237. * the given @band_id, @chain_id, and @mod_id
  238. */
  239. struct sar_limit_event_row {
  240. uint32_t band_id;
  241. uint32_t chain_id;
  242. uint32_t mod_id;
  243. uint32_t limit_value;
  244. };
  245. /**
  246. * struct sar_limit_event - sar limits params
  247. * @sar_enable: Current status of SAR enablement.
  248. * See %enum wmi_sar_feature_state_flags for possible values
  249. * @num_limit_rows: number of items in sar_limits
  250. * @sar_limit_row: array of sar limit rows. Only @num_limit_rows
  251. * should be considered valid.
  252. */
  253. struct sar_limit_event {
  254. uint32_t sar_enable;
  255. uint32_t num_limit_rows;
  256. struct sar_limit_event_row
  257. sar_limit_row[MAX_SAR_LIMIT_ROWS_SUPPORTED];
  258. };
  259. #define WMI_UNIFIED_MAX_PMKID_LEN 16
  260. #define WMI_UNIFIED_MAX_PMK_LEN 64
  261. /**
  262. * struct wmi_unified_pmk_cache - used to set del pmkid cache
  263. * @vdev_id: ID of the vdev being configured
  264. * @pmk_len: PMK len
  265. * for big-endian hosts, manual endian conversion will be needed to keep
  266. * the array values in their original order in spite of the automatic
  267. * byte-swap applied to WMI messages during download
  268. * @pmk: PMK array
  269. * @pmkid_len: PMK ID Len
  270. * @pmkid: PMK ID Array
  271. * @bssid: BSSID
  272. * @ssid: SSID
  273. * @cache_id: PMK Cache ID
  274. * @cat_flag: whether (bssid) or (ssid,cache_id) is valid
  275. * @action_flag: add/delete the entry
  276. */
  277. struct wmi_unified_pmk_cache {
  278. uint8_t vdev_id;
  279. uint32_t pmk_len;
  280. uint8_t pmk[WMI_UNIFIED_MAX_PMK_LEN];
  281. uint32_t pmkid_len;
  282. uint8_t pmkid[WMI_UNIFIED_MAX_PMKID_LEN];
  283. wmi_host_mac_addr bssid;
  284. struct mac_ssid ssid;
  285. uint32_t cache_id;
  286. uint32_t cat_flag;
  287. uint32_t action_flag;
  288. };
  289. #define WMI_QOS_NUM_AC_MAX 4
  290. /**
  291. * struct aggr_add_ts_param - ADDTS parameters
  292. * @staIdx: station index
  293. * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
  294. * @tspec: tspec value
  295. * @status: CDF status
  296. * @sessionId: session id
  297. * @vdev_id: vdev id
  298. */
  299. struct aggr_add_ts_param {
  300. uint16_t staIdx;
  301. uint16_t tspecIdx;
  302. struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX];
  303. QDF_STATUS status[WMI_QOS_NUM_AC_MAX];
  304. uint8_t sessionId;
  305. uint8_t vdev_id;
  306. };
  307. #define WMI_PERIODIC_TX_PTRN_MAX_SIZE 1536
  308. /**
  309. * struct periodic_tx_pattern - periodic tx pattern
  310. * @mac_address: MAC Address for the adapter
  311. * @ucPtrnId: Pattern ID
  312. * @ucPtrnSize: Pattern size
  313. * @usPtrnIntervalMs: in ms
  314. * @ucPattern: Pattern buffer
  315. */
  316. struct periodic_tx_pattern {
  317. struct qdf_mac_addr mac_address;
  318. uint8_t ucPtrnId;
  319. uint16_t ucPtrnSize;
  320. uint32_t usPtrnIntervalMs;
  321. uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE];
  322. };
  323. /**
  324. * struct flashing_req_params - led flashing parameter
  325. * @reqId: request id
  326. * @pattern_id: pattern identifier. 0: disconnected 1: connected
  327. * @led_x0: led flashing parameter0
  328. * @led_x1: led flashing parameter1
  329. */
  330. struct flashing_req_params {
  331. uint32_t req_id;
  332. uint32_t pattern_id;
  333. uint32_t led_x0;
  334. uint32_t led_x1;
  335. };
  336. #define MAX_NUM_CHAN 128
  337. /**
  338. * struct wmi_pcl_chan_weights - Params to get the valid weighed list
  339. * @pcl_list: Preferred channel list already sorted in the order of preference
  340. * @pcl_len: Length of the PCL
  341. * @saved_chan_list: Valid channel list updated as part of
  342. * WMA_UPDATE_CHAN_LIST_REQ
  343. * @saved_num_chan: Length of the valid channel list
  344. * @weighed_valid_list: Weights of the valid channel list. This will have one
  345. * to one mapping with valid_chan_list. FW expects channel order and size to be
  346. * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
  347. * @weight_list: Weights assigned by policy manager
  348. */
  349. struct wmi_pcl_chan_weights {
  350. uint8_t pcl_list[MAX_NUM_CHAN];
  351. uint32_t pcl_len;
  352. uint8_t saved_chan_list[MAX_NUM_CHAN];
  353. uint32_t saved_num_chan;
  354. uint8_t weighed_valid_list[MAX_NUM_CHAN];
  355. uint8_t weight_list[MAX_NUM_CHAN];
  356. };
  357. /**
  358. * struct wmi_adaptive_dwelltime_params - the adaptive dwelltime params
  359. * @vdev_id: vdev id
  360. * @is_enabled: Adaptive dwell time is enabled/disabled
  361. * @dwelltime_mode: global default adaptive dwell mode
  362. * @lpf_weight: weight to calculate the average low pass
  363. * filter for channel congestion
  364. * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
  365. * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
  366. *
  367. */
  368. struct wmi_adaptive_dwelltime_params {
  369. uint32_t vdev_id;
  370. bool is_enabled;
  371. enum scan_dwelltime_adaptive_mode dwelltime_mode;
  372. uint8_t lpf_weight;
  373. uint8_t passive_mon_intval;
  374. uint8_t wifi_act_threshold;
  375. };
  376. #define WMI_SCAN_CLIENT_MAX 7
  377. /**
  378. * struct wmi_dbs_scan_sel_params - DBS scan selection params
  379. * @num_clients: Number of scan clients dutycycle
  380. * @pdev_id: pdev_id for identifying the MAC
  381. * @module_id: scan client module id
  382. * @num_dbs_scans: number of DBS scans
  383. * @num_non_dbs_scans: number of non-DBS scans
  384. */
  385. struct wmi_dbs_scan_sel_params {
  386. uint32_t num_clients;
  387. uint32_t pdev_id;
  388. uint32_t module_id[WMI_SCAN_CLIENT_MAX];
  389. uint32_t num_dbs_scans[WMI_SCAN_CLIENT_MAX];
  390. uint32_t num_non_dbs_scans[WMI_SCAN_CLIENT_MAX];
  391. };
  392. /**
  393. * struct set_arp_stats - set/reset arp stats
  394. * @vdev_id: session id
  395. * @flag: enable/disable stats
  396. * @pkt_type: type of packet(1 - arp)
  397. * @ip_addr: subnet ipv4 address in case of encrypted packets
  398. * @pkt_type_bitmap: pkt bitmap
  399. * @tcp_src_port: tcp src port for pkt tracking
  400. * @tcp_dst_port: tcp dst port for pkt tracking
  401. * @icmp_ipv4: target ipv4 address to track ping packets
  402. * @reserved: reserved
  403. */
  404. struct set_arp_stats {
  405. uint32_t vdev_id;
  406. uint8_t flag;
  407. uint8_t pkt_type;
  408. uint32_t ip_addr;
  409. uint32_t pkt_type_bitmap;
  410. uint32_t tcp_src_port;
  411. uint32_t tcp_dst_port;
  412. uint32_t icmp_ipv4;
  413. uint32_t reserved;
  414. };
  415. /**
  416. * struct get_arp_stats - get arp stats from firmware
  417. * @pkt_type: packet type(1 - ARP)
  418. * @vdev_id: session id
  419. */
  420. struct get_arp_stats {
  421. uint8_t pkt_type;
  422. uint32_t vdev_id;
  423. };
  424. #endif /* _WMI_UNIFIED_STA_PARAM_H_ */