wmi_unified_sta_param.h 14 KB

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