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 /* 20 * This file contains the API definitions for the STA WMI APIs. 21 */ 22 23 #ifndef _WMI_UNIFIED_STA_PARAM_H_ 24 #define _WMI_UNIFIED_STA_PARAM_H_ 25 26 /** 27 * struct sta_params - sta keep alive parameters 28 * @vdev_id: vdev id 29 * @method: keep alive method 30 * @timeperiod: time to keep alive 31 * @hostv4addr: host ipv4 address 32 * @destv4addr: destination ipv4 address 33 * @destmac: destination mac address 34 */ 35 struct sta_params { 36 uint8_t vdev_id; 37 uint32_t method; 38 uint32_t timeperiod; 39 uint8_t *hostv4addr; 40 uint8_t *destv4addr; 41 uint8_t *destmac; 42 }; 43 44 /** 45 * struct gtx_config_t - GTX config 46 * @gtx_rt_mask: for HT and VHT rate masks 47 * @gtx_usrcfg: host request for GTX mask 48 * @gtx_threshold: PER Threshold (default: 10%) 49 * @gtx_margin: PER margin (default: 2%) 50 * @gtx_tcpstep: TCP step (default: 1) 51 * @gtx_tpcMin: TCP min (default: 5) 52 * @gtx_bwmask: BW mask (20/40/80/160 Mhz) 53 */ 54 struct wmi_gtx_config { 55 uint32_t gtx_rt_mask[2]; 56 uint32_t gtx_usrcfg; 57 uint32_t gtx_threshold; 58 uint32_t gtx_margin; 59 uint32_t gtx_tpcstep; 60 uint32_t gtx_tpcmin; 61 uint32_t gtx_bwmask; 62 }; 63 64 /** 65 * struct wlm_latency_level_param - WLM parameters 66 * @wlm_latency_level: wlm latency level to set 67 * 0 - normal, 1 - moderate, 2 - low, 3 - ultralow 68 * @wlm_latency_flags: wlm latency flags to set 69 * |31 12| 11 | 10 |9 8|7 6|5 4|3 2| 1 | 0 | 70 * +------+------+------+------+------+------+------+-----+-----+ 71 * | RSVD | SSLP | CSLP | RSVD | Roam | RSVD | DWLT | DFS | SUP | 72 * +------+-------------+-------------+-------------------------+ 73 * | WAL | PS | Roam | Scan | 74 * 75 * bit 0: Avoid scan request from HLOS if setting 76 * bit 1: Skip DFS channel SCAN if setting 77 * bit 2-3: Define policy of dwell time/duration for each foreign channel 78 * (b2 b3) 79 * (0 0 ): Default scan dwell time 80 * (0 1 ): Reserve 81 * (1 0 ): Shrink off channel dwell time 82 * (1 1 ): Reserve 83 * bit 4-5: Reserve for scan 84 * bit 6-7: Define roaming policy 85 * (b6 b7) 86 * (0 0 ): Default roaming behavior, allow roaming in all scenarios 87 * (0 1 ): Disallow all roaming 88 * (1 0 ): Allow roaming when final bmissed 89 * (1 1 ): Reserve 90 * bit 8-9: Reserve for roaming 91 * bit 10: Disable css power collapse if setting 92 * bit 11: Disable sys sleep if setting 93 * bit 12-31: Reserve for future useage 94 * @vdev_id: vdev id 95 */ 96 struct wlm_latency_level_param { 97 uint16_t wlm_latency_level; 98 uint32_t wlm_latency_flags; 99 uint16_t vdev_id; 100 }; 101 102 #ifndef CONVERGED_TDLS_ENABLE 103 /** 104 * struct tdls_chan_switch_params - channel switch parameter structure 105 * @vdev_id: vdev ID 106 * @peer_mac_addr: Peer mac address 107 * @tdls_off_ch_bw_offset: Target off-channel bandwitdh offset 108 * @tdls_off_ch: Target Off Channel 109 * @oper_class: Operating class for target channel 110 * @is_responder: Responder or initiator 111 */ 112 struct tdls_channel_switch_params { 113 uint32_t vdev_id; 114 uint8_t peer_mac_addr[IEEE80211_ADDR_LEN]; 115 uint16_t tdls_off_ch_bw_offset; 116 uint8_t tdls_off_ch; 117 uint8_t tdls_sw_mode; 118 uint8_t oper_class; 119 uint8_t is_responder; 120 }; 121 #endif 122 123 #define WMI_TDLS_MAX_SUPP_CHANNELS 128 124 #define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32 125 #define WMI_2_4_GHZ_MAX_FREQ 3000 126 127 /** 128 * struct tdls_update_ch_params - channel parameters 129 * @chanId: ID of the channel 130 * @pwr: power level 131 * @dfsSet: is dfs supported or not 132 * @half_rate: is the channel operating at 10MHz 133 * @quarter_rate: is the channel operating at 5MHz 134 */ 135 struct tdls_update_ch_params { 136 uint8_t chanId; 137 uint8_t pwr; 138 bool dfsSet; 139 bool half_rate; 140 bool quarter_rate; 141 }; 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 /** 178 * struct tdls_peer_state_params - TDLS peer state parameters 179 * @vdevId: vdev id 180 * @peerMacAddr: peer mac address 181 * @peerCap: peer capabality 182 */ 183 struct tdls_peer_state_params { 184 uint32_t vdevId; 185 uint8_t peerMacAddr[IEEE80211_ADDR_LEN]; 186 uint32_t peerState; 187 struct tdls_peer_cap_params peerCap; 188 }; 189 190 /** 191 * struct vdev_ie_info_param - IE info 192 * @vdev_id - vdev for which the IE is being sent 193 * @ie_id - ID of the IE 194 * @length - length of the IE data 195 * @data - IE data 196 * 197 * This structure is used to store the IE information. 198 */ 199 struct vdev_ie_info_param { 200 uint32_t vdev_id; 201 uint32_t ie_id; 202 uint32_t length; 203 uint32_t ie_source; 204 uint32_t band; 205 uint8_t *data; 206 }; 207 208 #define MAX_SAR_LIMIT_ROWS_SUPPORTED 64 209 /** 210 * struct sar_limit_cmd_row - sar limits row 211 * @band_id: Optional param for frequency band 212 * See %enum wmi_sar_band_id_flags for possible values 213 * @chain_id: Optional param for antenna chain id 214 * @mod_id: Optional param for modulation scheme 215 * See %enum wmi_sar_mod_id_flags for possible values 216 * @limit_value: Mandatory param providing power limits in steps of 0.5 dbm 217 * @validity_bitmap: bitmap of valid optional params in sar_limit_cmd_row struct 218 * See WMI_SAR_*_VALID_MASK for possible values 219 */ 220 struct sar_limit_cmd_row { 221 uint32_t band_id; 222 uint32_t chain_id; 223 uint32_t mod_id; 224 uint32_t limit_value; 225 uint32_t validity_bitmap; 226 }; 227 228 /** 229 * struct sar_limit_cmd_params - sar limits params 230 * @sar_enable: flag to enable SAR 231 * See %enum wmi_sar_feature_state_flags for possible values 232 * @num_limit_rows: number of items in sar_limits 233 * @commit_limits: indicates firmware to start apply new SAR values 234 * @sar_limit_row_list: pointer to array of sar limit rows 235 */ 236 struct sar_limit_cmd_params { 237 uint32_t sar_enable; 238 uint32_t num_limit_rows; 239 uint32_t commit_limits; 240 struct sar_limit_cmd_row *sar_limit_row_list; 241 }; 242 243 /** 244 * struct sar_limit_event_row - sar limits row 245 * @band_id: Frequency band. 246 * See %enum wmi_sar_band_id_flags for possible values 247 * @chain_id: Chain id 248 * @mod_id: Modulation scheme 249 * See %enum wmi_sar_mod_id_flags for possible values 250 * @limit_value: Power limits in steps of 0.5 dbm that is currently active for 251 * the given @band_id, @chain_id, and @mod_id 252 */ 253 struct sar_limit_event_row { 254 uint32_t band_id; 255 uint32_t chain_id; 256 uint32_t mod_id; 257 uint32_t limit_value; 258 }; 259 260 /** 261 * struct sar_limit_event - sar limits params 262 * @sar_enable: Current status of SAR enablement. 263 * See %enum wmi_sar_feature_state_flags for possible values 264 * @num_limit_rows: number of items in sar_limits 265 * @sar_limit_row: array of sar limit rows. Only @num_limit_rows 266 * should be considered valid. 267 */ 268 struct sar_limit_event { 269 uint32_t sar_enable; 270 uint32_t num_limit_rows; 271 struct sar_limit_event_row 272 sar_limit_row[MAX_SAR_LIMIT_ROWS_SUPPORTED]; 273 }; 274 275 #define WMI_UNIFIED_MAX_PMKID_LEN 16 276 #define WMI_UNIFIED_MAX_PMK_LEN 64 277 278 /** 279 * struct wmi_unified_pmk_cache - used to set del pmkid cache 280 * @vdev_id: ID of the vdev being configured 281 * @pmk_len: PMK len 282 * for big-endian hosts, manual endian conversion will be needed to keep 283 * the array values in their original order in spite of the automatic 284 * byte-swap applied to WMI messages during download 285 * @pmk: PMK array 286 * @pmkid_len: PMK ID Len 287 * @pmkid: PMK ID Array 288 * @bssid: BSSID 289 * @ssid: SSID 290 * @cache_id: PMK Cache ID 291 * @cat_flag: whether (bssid) or (ssid,cache_id) is valid 292 * @action_flag: add/delete the entry 293 */ 294 struct wmi_unified_pmk_cache { 295 uint8_t vdev_id; 296 uint32_t pmk_len; 297 uint8_t pmk[WMI_UNIFIED_MAX_PMK_LEN]; 298 uint32_t pmkid_len; 299 uint8_t pmkid[WMI_UNIFIED_MAX_PMKID_LEN]; 300 wmi_host_mac_addr bssid; 301 struct mac_ssid ssid; 302 uint32_t cache_id; 303 uint32_t cat_flag; 304 uint32_t action_flag; 305 }; 306 307 #define WMI_QOS_NUM_AC_MAX 4 308 309 /** 310 * struct aggr_add_ts_param - ADDTS parameters 311 * @staIdx: station index 312 * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS 313 * @tspec: tspec value 314 * @status: CDF status 315 * @sessionId: session id 316 * @vdev_id: vdev id 317 */ 318 struct aggr_add_ts_param { 319 uint16_t staIdx; 320 uint16_t tspecIdx; 321 struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX]; 322 QDF_STATUS status[WMI_QOS_NUM_AC_MAX]; 323 uint8_t sessionId; 324 uint8_t vdev_id; 325 }; 326 327 #define WMI_PERIODIC_TX_PTRN_MAX_SIZE 1536 328 /** 329 * struct periodic_tx_pattern - periodic tx pattern 330 * @mac_address: MAC Address for the adapter 331 * @ucPtrnId: Pattern ID 332 * @ucPtrnSize: Pattern size 333 * @usPtrnIntervalMs: in ms 334 * @ucPattern: Pattern buffer 335 */ 336 struct periodic_tx_pattern { 337 struct qdf_mac_addr mac_address; 338 uint8_t ucPtrnId; 339 uint16_t ucPtrnSize; 340 uint32_t usPtrnIntervalMs; 341 uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE]; 342 }; 343 344 /** 345 * struct flashing_req_params - led flashing parameter 346 * @reqId: request id 347 * @pattern_id: pattern identifier. 0: disconnected 1: connected 348 * @led_x0: led flashing parameter0 349 * @led_x1: led flashing parameter1 350 */ 351 struct flashing_req_params { 352 uint32_t req_id; 353 uint32_t pattern_id; 354 uint32_t led_x0; 355 uint32_t led_x1; 356 }; 357 358 #define MAX_NUM_CHAN 128 359 360 /** 361 * struct wmi_pcl_chan_weights - Params to get the valid weighed list 362 * @pcl_list: Preferred channel list already sorted in the order of preference 363 * @pcl_len: Length of the PCL 364 * @saved_chan_list: Valid channel list updated as part of 365 * WMA_UPDATE_CHAN_LIST_REQ 366 * @saved_num_chan: Length of the valid channel list 367 * @weighed_valid_list: Weights of the valid channel list. This will have one 368 * to one mapping with valid_chan_list. FW expects channel order and size to be 369 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID. 370 * @weight_list: Weights assigned by policy manager 371 */ 372 struct wmi_pcl_chan_weights { 373 uint8_t pcl_list[MAX_NUM_CHAN]; 374 uint32_t pcl_len; 375 uint8_t saved_chan_list[MAX_NUM_CHAN]; 376 uint32_t saved_num_chan; 377 uint8_t weighed_valid_list[MAX_NUM_CHAN]; 378 uint8_t weight_list[MAX_NUM_CHAN]; 379 }; 380 381 /** 382 * struct wmi_adaptive_dwelltime_params - the adaptive dwelltime params 383 * @vdev_id: vdev id 384 * @is_enabled: Adaptive dwell time is enabled/disabled 385 * @dwelltime_mode: global default adaptive dwell mode 386 * @lpf_weight: weight to calculate the average low pass 387 * filter for channel congestion 388 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec 389 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100 390 * 391 */ 392 struct wmi_adaptive_dwelltime_params { 393 uint32_t vdev_id; 394 bool is_enabled; 395 enum scan_dwelltime_adaptive_mode dwelltime_mode; 396 uint8_t lpf_weight; 397 uint8_t passive_mon_intval; 398 uint8_t wifi_act_threshold; 399 }; 400 401 #define WMI_SCAN_CLIENT_MAX 7 402 403 /** 404 * struct wmi_dbs_scan_sel_params - DBS scan selection params 405 * @num_clients: Number of scan clients dutycycle 406 * @pdev_id: pdev_id for identifying the MAC 407 * @module_id: scan client module id 408 * @num_dbs_scans: number of DBS scans 409 * @num_non_dbs_scans: number of non-DBS scans 410 */ 411 struct wmi_dbs_scan_sel_params { 412 uint32_t num_clients; 413 uint32_t pdev_id; 414 uint32_t module_id[WMI_SCAN_CLIENT_MAX]; 415 uint32_t num_dbs_scans[WMI_SCAN_CLIENT_MAX]; 416 uint32_t num_non_dbs_scans[WMI_SCAN_CLIENT_MAX]; 417 }; 418 419 /** 420 * struct set_arp_stats - set/reset arp stats 421 * @vdev_id: session id 422 * @flag: enable/disable stats 423 * @pkt_type: type of packet(1 - arp) 424 * @ip_addr: subnet ipv4 address in case of encrypted packets 425 * @pkt_type_bitmap: pkt bitmap 426 * @tcp_src_port: tcp src port for pkt tracking 427 * @tcp_dst_port: tcp dst port for pkt tracking 428 * @icmp_ipv4: target ipv4 address to track ping packets 429 * @reserved: reserved 430 */ 431 struct set_arp_stats { 432 uint32_t vdev_id; 433 uint8_t flag; 434 uint8_t pkt_type; 435 uint32_t ip_addr; 436 uint32_t pkt_type_bitmap; 437 uint32_t tcp_src_port; 438 uint32_t tcp_dst_port; 439 uint32_t icmp_ipv4; 440 uint32_t reserved; 441 }; 442 443 /** 444 * struct get_arp_stats - get arp stats from firmware 445 * @pkt_type: packet type(1 - ARP) 446 * @vdev_id: session id 447 */ 448 struct get_arp_stats { 449 uint8_t pkt_type; 450 uint32_t vdev_id; 451 }; 452 453 #endif /* _WMI_UNIFIED_STA_PARAM_H_ */ 454