blob: 95a1ad5b40e6fecc77e97a2dfcdb86488895480c [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#ifndef WMA_H
29#define WMA_H
30
31#include "a_types.h"
32#include "cdf_types.h"
33#include "osapi_linux.h"
34#include "htc_packet.h"
35#include "i_cdf_event.h"
36#include "wmi_services.h"
37#include "wmi_unified.h"
38#include "wmi_version.h"
39#include "cdf_types.h"
40#include "cfg_api.h"
41#include "cdf_status.h"
42#include "cds_sched.h"
43#include "ol_txrx_api.h"
44#include "sir_mac_prot_def.h"
45#include "wma_types.h"
46#include "ol_txrx_types.h"
47#include <linux/workqueue.h>
48#include "utils_api.h"
49#include "lim_types.h"
50#include "wmi_unified_api.h"
51
52/* Platform specific configuration for max. no. of fragments */
53#define QCA_OL_11AC_TX_MAX_FRAGS 2
54
55/* Private */
56
57#ifndef QCA_WIFI_3_0_EMU
58
59#define WMA_READY_EVENTID_TIMEOUT 2000
Chandrasekaran, Manishekarc8416922015-10-14 11:19:00 +053060#define WMA_SERVICE_READY_EXT_TIMEOUT 2000
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080061#define WMA_TGT_SUSPEND_COMPLETE_TIMEOUT 6000
62#define WMA_WAKE_LOCK_TIMEOUT 1000
63#define WMA_MAX_RESUME_RETRY 1000
64#define WMA_RESUME_TIMEOUT 6000
65#define MAX_MEM_CHUNKS 32
66
67#else
68
69#define WMA_READY_EVENTID_TIMEOUT 200000
Chandrasekaran, Manishekarc8416922015-10-14 11:19:00 +053070#define WMA_SERVICE_READY_EXT_TIMEOUT 200000
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080071#define WMA_TGT_SUSPEND_COMPLETE_TIMEOUT 300000
72#define WMA_WAKE_LOCK_TIMEOUT 1000
73#define WMA_MAX_RESUME_RETRY 1000
74#define WMA_RESUME_TIMEOUT 300000
75#define MAX_MEM_CHUNKS 32
76
77#endif
78
79#define WMA_CRASH_INJECT_TIMEOUT 5000
80
81/* In prima 12 HW stations are supported including BCAST STA(staId 0)
82 * and SELF STA(staId 1) so total ASSOC stations which can connect to Prima
83 * SoftAP = 12 - 1(Self STa) - 1(Bcast Sta) = 10 Stations.
84 */
85
86#ifdef WLAN_SOFTAP_VSTA_FEATURE
87#define WMA_MAX_SUPPORTED_STAS 38
88#else
89#define WMA_MAX_SUPPORTED_STAS 12
90#endif
91#define WMA_MAX_SUPPORTED_BSS 5
92
93#define FRAGMENT_SIZE 3072
94
95#define WMA_INVALID_VDEV_ID 0xFF
96#define MAX_MEM_CHUNKS 32
97#define WMA_MAX_VDEV_SIZE 20
98#define WMA_VDEV_TBL_ENTRY_ADD 1
99#define WMA_VDEV_TBL_ENTRY_DEL 0
100
101/* 11A/G channel boundary */
102#define WMA_11A_CHANNEL_BEGIN 34
103#define WMA_11A_CHANNEL_END 165
104#define WMA_11G_CHANNEL_BEGIN 1
105#define WMA_11G_CHANNEL_END 14
106
107#define WMA_11P_CHANNEL_BEGIN (170)
108#define WMA_11P_CHANNEL_END (184)
109
110#define WMA_LOGD(args ...) \
111 CDF_TRACE(CDF_MODULE_ID_WMA, CDF_TRACE_LEVEL_DEBUG, ## args)
112#define WMA_LOGI(args ...) \
113 CDF_TRACE(CDF_MODULE_ID_WMA, CDF_TRACE_LEVEL_INFO, ## args)
114#define WMA_LOGW(args ...) \
115 CDF_TRACE(CDF_MODULE_ID_WMA, CDF_TRACE_LEVEL_WARN, ## args)
116#define WMA_LOGE(args ...) \
117 CDF_TRACE(CDF_MODULE_ID_WMA, CDF_TRACE_LEVEL_ERROR, ## args)
118#define WMA_LOGP(args ...) \
119 CDF_TRACE(CDF_MODULE_ID_WMA, CDF_TRACE_LEVEL_FATAL, ## args)
120
121#define WMA_DEBUG_ALWAYS
122
123#ifdef WMA_DEBUG_ALWAYS
124#define WMA_LOGA(args ...) \
125 CDF_TRACE(CDF_MODULE_ID_WMA, CDF_TRACE_LEVEL_FATAL, ## args)
126#else
127#define WMA_LOGA(args ...)
128#endif
129
130#define ALIGNED_WORD_SIZE 4
131#define WLAN_HAL_MSG_TYPE_MAX_ENUM_SIZE 0x7FFF
132
133/* Prefix used by scan req ids generated on the host */
134#define WMA_HOST_SCAN_REQID_PREFIX 0xA000
135/* Prefix used by roam scan req ids generated on the host */
136#define WMA_HOST_ROAM_SCAN_REQID_PREFIX 0xA800
137/* Prefix used by scan requestor id on host */
138#define WMA_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
139
140#define WMA_HW_DEF_SCAN_MAX_DURATION 30000 /* 30 secs */
141
142/* Max offchannel duration */
143#define WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS (3)
144#define WMA_SCAN_NPROBES_DEFAULT (2)
145#define WMA_SCAN_IDLE_TIME_DEFAULT (25)
146#define WMA_P2P_SCAN_MAX_BURST_DURATION (180)
147#define WMA_CTS_DURATION_MS_MAX (32)
148#define WMA_GO_MIN_ACTIVE_SCAN_BURST_DURATION (40)
149#define WMA_GO_MAX_ACTIVE_SCAN_BURST_DURATION (120)
150#define WMA_DWELL_TIME_PASSIVE_DEFAULT (110)
151#define WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE (11)
152#define WMA_3PORT_CONC_SCAN_MAX_BURST_DURATION (25)
153
154#define WMA_SEC_TO_USEC (1000000)
155
156#define BEACON_TX_BUFFER_SIZE (512)
157
158/* WMA_ETHER_TYPE_OFFSET = sa(6) + da(6) */
159#define WMA_ETHER_TYPE_OFFSET (6 + 6)
160/* WMA_ICMP_V6_HEADER_OFFSET = sa(6) + da(6) + eth_type(2) + icmp_v6_hdr(6)*/
161#define WMA_ICMP_V6_HEADER_OFFSET (6 + 6 + 2 + 6)
162/* WMA_ICMP_V6_TYPE_OFFSET = sa(6) + da(6) + eth_type(2) + 40 */
163#define WMA_ICMP_V6_TYPE_OFFSET (6 + 6 + 2 + 40)
164#define WMA_ICMP_V6_HEADER_TYPE (0x3A)
165#define WMA_ICMP_V6_RA_TYPE (0x86)
166#define WMA_ICMP_V6_NS_TYPE (0x87)
167#define WMA_ICMP_V6_NA_TYPE (0x88)
168#define WMA_BCAST_MAC_ADDR (0xFF)
169#define WMA_MCAST_IPV4_MAC_ADDR (0x01)
170#define WMA_MCAST_IPV6_MAC_ADDR (0x33)
171
172
173/* Roaming default values
174 * All time and period values are in milliseconds.
175 * All rssi values are in dB except for WMA_NOISE_FLOOR_DBM_DEFAULT.
176 */
177
178#define WMA_ROAM_SCAN_CHANNEL_SWITCH_TIME (4)
179#define WMA_NOISE_FLOOR_DBM_DEFAULT (-96)
180#define WMA_ROAM_RSSI_DIFF_DEFAULT (5)
181#define WMA_ROAM_DWELL_TIME_ACTIVE_DEFAULT (100)
182#define WMA_ROAM_DWELL_TIME_PASSIVE_DEFAULT (110)
183#define WMA_ROAM_MIN_REST_TIME_DEFAULT (50)
184#define WMA_ROAM_MAX_REST_TIME_DEFAULT (500)
185#define WMA_ROAM_LOW_RSSI_TRIGGER_DEFAULT (20)
186#define WMA_ROAM_LOW_RSSI_TRIGGER_VERYLOW (10)
187#define WMA_ROAM_BEACON_WEIGHT_DEFAULT (14)
188#define WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT (120000)
189#define WMA_ROAM_OPP_SCAN_AGING_PERIOD_DEFAULT (WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT * 5)
190#define WMA_ROAM_PREAUTH_SCAN_TIME (50)
191#define WMA_ROAM_PREAUTH_REST_TIME (0)
192#define WMA_ROAM_PREAUTH_MAX_SCAN_TIME (10000)
193#define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT (10)
194#define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT (10)
195#define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT_P2P (15)
196#define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT_P2P (45)
197
198#define WMA_INVALID_KEY_IDX 0xff
199#define WMA_DFS_RADAR_FOUND 1
200
201#define WMA_MAX_RF_CHAINS(x) ((1 << x) - 1)
202#define WMA_MIN_RF_CHAINS (1)
203
204#ifdef FEATURE_WLAN_EXTSCAN
205#define WMA_MAX_EXTSCAN_MSG_SIZE 1536
206#define WMA_EXTSCAN_REST_TIME 100
207#define WMA_EXTSCAN_MAX_SCAN_TIME 50000
208#define WMA_EXTSCAN_BURST_DURATION 150
209#endif
210
211#define WMA_BCN_BUF_MAX_SIZE 2500
212#define WMA_NOA_IE_SIZE(num_desc) (2 + (13 * (num_desc)))
213#define WMA_MAX_NOA_DESCRIPTORS 4
214
215#define WMA_TIM_SUPPORTED_PVB_LENGTH ((HAL_NUM_STA / 8) + 1)
216
217#define WMA_WOW_PTRN_MASK_VALID 0xFF
218#define WMA_NUM_BITS_IN_BYTE 8
219
220#define WMA_AP_WOW_DEFAULT_PTRN_MAX 4
221#define WMA_STA_WOW_DEFAULT_PTRN_MAX 4
222
223#define WMA_BSS_STATUS_STARTED 0x1
224#define WMA_BSS_STATUS_STOPPED 0x2
225
226#define WMA_FW_PHY_STATS 0x1
227#define WMA_FW_RX_REORDER_STATS 0x2
228#define WMA_FW_RX_RC_STATS 0x3
229#define WMA_FW_TX_PPDU_STATS 0x4
230#define WMA_FW_TX_CONCISE_STATS 0x5
231#define WMA_FW_TX_RC_STATS 0x6
232#define WMA_FW_TXBF_INFO_STATS 0x07
233#define WMA_FW_SND_INFO_STATS 0x08
234#define WMA_FW_ERROR_INFO_STATS 0x09
235#define WMA_FW_TX_SELFGEN_INFO_STATS 0xa
236#define WMA_FW_RX_REM_RING_BUF 0xc
237#define WMA_FW_RX_TXBF_MUSU_NDPA 0xf
238
239#define WMA_TARGET_REQ_TYPE_VDEV_START 0x1
240#define WMA_TARGET_REQ_TYPE_VDEV_STOP 0x2
241#define WMA_TARGET_REQ_TYPE_VDEV_DEL 0x3
242
243#define WMA_PEER_ASSOC_CNF_START 0x01
244#define WMA_PEER_ASSOC_TIMEOUT (3000) /* 3 seconds */
245
246#define WMA_VDEV_START_REQUEST_TIMEOUT (3000) /* 3 seconds */
247#define WMA_VDEV_STOP_REQUEST_TIMEOUT (3000) /* 3 seconds */
248
249#define WMA_TGT_INVALID_SNR (-1)
250
251#define WMA_TX_Q_RECHECK_TIMER_WAIT 2 /* 2 ms */
252#define WMA_TX_Q_RECHECK_TIMER_MAX_WAIT 20 /* 20 ms */
253#define WMA_MAX_NUM_ARGS 8
254
255#define WMA_SMPS_MASK_LOWER_16BITS 0xFF
256#define WMA_SMPS_MASK_UPPER_3BITS 0x7
257#define WMA_SMPS_PARAM_VALUE_S 29
258
259#define WMA_MAX_SCAN_ID 0x00FF
260
261/*
262 * Setting the Tx Comp Timeout to 1 secs.
263 * TODO: Need to Revist the Timing
264 */
265#define WMA_TX_FRAME_COMPLETE_TIMEOUT 1000
266#define WMA_TX_FRAME_BUFFER_NO_FREE 0
267#define WMA_TX_FRAME_BUFFER_FREE 1
268
269
270/* Default InActivity Time is 200 ms */
271#define POWERSAVE_DEFAULT_INACTIVITY_TIME 200
272
273/* Default Listen Interval */
274#define POWERSAVE_DEFAULT_LISTEN_INTERVAL 1
275
276/*
277 * TODO: Add WMI_CMD_ID_MAX as part of WMI_CMD_ID
278 * instead of assigning it to the last valid wmi
279 * cmd+1 to avoid updating this when a command is
280 * added/deleted.
281 */
282#define WMI_CMDID_MAX (WMI_TXBF_CMDID + 1)
283
284#define WMA_NLO_FREQ_THRESH 1000 /* in MHz */
285#define WMA_SEC_TO_MSEC(sec) (sec * 1000) /* sec to msec */
286#define WMA_MSEC_TO_USEC(msec) (msec * 1000) /* msec to usec */
287
288/* Default rssi threshold defined in CFG80211 */
289#define WMA_RSSI_THOLD_DEFAULT -300
290
291#ifdef FEATURE_WLAN_SCAN_PNO
292#define WMA_PNO_MATCH_WAKE_LOCK_TIMEOUT (5 * 1000) /* in msec */
293#define WMA_PNO_SCAN_COMPLETE_WAKE_LOCK_TIMEOUT (2 * 1000) /* in msec */
294#endif
295#define WMA_AUTH_REQ_RECV_WAKE_LOCK_TIMEOUT (5 * 1000) /* in msec */
296#define WMA_ASSOC_REQ_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
297#define WMA_DEAUTH_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
298#define WMA_DISASSOC_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
299#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
300#define WMA_AUTO_SHUTDOWN_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
301#endif
302#define WMA_BMISS_EVENT_WAKE_LOCK_DURATION (4 * 1000) /* in msec */
303
304#define WMA_TXMIC_LEN 8
305#define WMA_RXMIC_LEN 8
306
307/*
308 * Length = (2 octets for Index and CTWin/Opp PS) and
309 * (13 octets for each NOA Descriptors)
310 */
311
312#define WMA_P2P_NOA_IE_OPP_PS_SET (0x80)
313#define WMA_P2P_NOA_IE_CTWIN_MASK (0x7F)
314
315#define WMA_P2P_IE_ID 0xdd
316#define WMA_P2P_WFA_OUI { 0x50, 0x6f, 0x9a }
317#define WMA_P2P_WFA_VER 0x09 /* ver 1.0 */
318#define WMA_WSC_OUI { 0x00, 0x50, 0xF2 } /* Microsoft WSC OUI byte */
319
320/* P2P Sub element defintions (according to table 5 of Wifi's P2P spec) */
321#define WMA_P2P_SUB_ELEMENT_STATUS 0
322#define WMA_P2P_SUB_ELEMENT_MINOR_REASON 1
323#define WMA_P2P_SUB_ELEMENT_CAPABILITY 2
324#define WMA_P2P_SUB_ELEMENT_DEVICE_ID 3
325#define WMA_P2P_SUB_ELEMENT_GO_INTENT 4
326#define WMA_P2P_SUB_ELEMENT_CONFIGURATION_TIMEOUT 5
327#define WMA_P2P_SUB_ELEMENT_LISTEN_CHANNEL 6
328#define WMA_P2P_SUB_ELEMENT_GROUP_BSSID 7
329#define WMA_P2P_SUB_ELEMENT_EXTENDED_LISTEN_TIMING 8
330#define WMA_P2P_SUB_ELEMENT_INTENDED_INTERFACE_ADDR 9
331#define WMA_P2P_SUB_ELEMENT_MANAGEABILITY 10
332#define WMA_P2P_SUB_ELEMENT_CHANNEL_LIST 11
333#define WMA_P2P_SUB_ELEMENT_NOA 12
334#define WMA_P2P_SUB_ELEMENT_DEVICE_INFO 13
335#define WMA_P2P_SUB_ELEMENT_GROUP_INFO 14
336#define WMA_P2P_SUB_ELEMENT_GROUP_ID 15
337#define WMA_P2P_SUB_ELEMENT_INTERFACE 16
338#define WMA_P2P_SUB_ELEMENT_OP_CHANNEL 17
339#define WMA_P2P_SUB_ELEMENT_INVITATION_FLAGS 18
340#define WMA_P2P_SUB_ELEMENT_VENDOR 221
341
342/* Macros for handling unaligned memory accesses */
343#define P2PIE_PUT_LE16(a, val) \
344 do { \
345 (a)[1] = ((u16) (val)) >> 8; \
346 (a)[0] = ((u16) (val)) & 0xff; \
347 } while (0)
348
349#define P2PIE_PUT_LE32(a, val) \
350 do { \
351 (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
352 (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
353 (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
354 (a)[0] = (u8) (((u32) (val)) & 0xff); \
355 } while (0)
356
357
358#define WMA_DEFAULT_MAX_PSPOLL_BEFORE_WAKE 1
359
360#define WMA_DEFAULT_QPOWER_MAX_PSPOLL_BEFORE_WAKE 1
361#define WMA_DEFAULT_QPOWER_TX_WAKE_THRESHOLD 2
362#define WMA_DEFAULT_SIFS_BURST_DURATION 8160
363
364#define WMA_VHT_PPS_PAID_MATCH 1
365#define WMA_VHT_PPS_GID_MATCH 2
366#define WMA_VHT_PPS_DELIM_CRC_FAIL 3
367
368#define WMA_DFS_MAX_20M_SUB_CH 8
369
370#define WMA_DEFAULT_HW_MODE_INDEX 0xFFFF
371
372/**
373 * struct probeTime_dwellTime - probe time, dwell time map
374 * @dwell_time: dwell time
375 * @probe_time: repeat probe time
376 */
377typedef struct probeTime_dwellTime {
378 uint8_t dwell_time;
379 uint8_t probe_time;
380} t_probeTime_dwellTime;
381
382static const t_probeTime_dwellTime
383 probe_time_dwell_time_map[WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE] = {
384 {28, 0}, /* 0 SSID */
385 {28, 20}, /* 1 SSID */
386 {28, 20}, /* 2 SSID */
387 {28, 20}, /* 3 SSID */
388 {28, 20}, /* 4 SSID */
389 {28, 20}, /* 5 SSID */
390 {28, 20}, /* 6 SSID */
391 {28, 11}, /* 7 SSID */
392 {28, 11}, /* 8 SSID */
393 {28, 11}, /* 9 SSID */
394 {28, 8} /* 10 SSID */
395};
396
397/**
398 * enum t_wma_drv_type - wma driver type
399 * @WMA_DRIVER_TYPE_PRODUCTION: production driver type
400 * @WMA_DRIVER_TYPE_MFG: manufacture driver type
401 * @WMA_DRIVER_TYPE_INVALID: invalid driver type
402 */
403typedef enum {
404 WMA_DRIVER_TYPE_PRODUCTION = 0,
405 WMA_DRIVER_TYPE_MFG = 1,
406 WMA_DRIVER_TYPE_INVALID = 0x7FFFFFFF
407} t_wma_drv_type;
408
409#ifdef FEATURE_WLAN_TDLS
410/**
Kabilan Kannan421714b2015-11-23 04:44:59 -0800411 * enum t_wma_tdls_mode - TDLS mode
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800412 * @WMA_TDLS_SUPPORT_NOT_ENABLED: tdls is disable
413 * @WMA_TDLS_SUPPORT_DISABLED: suppress implicit trigger and not respond to peer
414 * @WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: suppress implicit trigger,
415 * but respond to the peer
416 * @WMA_TDLS_SUPPORT_ENABLED: implicit trigger
Kabilan Kannan421714b2015-11-23 04:44:59 -0800417 * @WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL: External control means
418 * implicit trigger but only to a peer mac configured by user space.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800419 */
420typedef enum {
421 WMA_TDLS_SUPPORT_NOT_ENABLED = 0,
422 WMA_TDLS_SUPPORT_DISABLED,
423 WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY,
424 WMA_TDLS_SUPPORT_ENABLED,
Kabilan Kannan421714b2015-11-23 04:44:59 -0800425 WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800426} t_wma_tdls_mode;
427
428/**
429 * enum wma_tdls_peer_notification - TDLS events
430 * @WMA_TDLS_SHOULD_DISCOVER: tdls discovery recommended for peer (always based
431 * on tx bytes per second > tx_discover threshold
432 * NB: notification will be re-sent after
433 * discovery_request_interval_ms
434 * @WMA_TDLS_SHOULD_TEARDOWN: tdls link tear down recommended for peer
435 * due to tx bytes per second below
436 * tx_teardown_threshold
437 * NB: this notification sent once
438 * @WMA_TDLS_PEER_DISCONNECTED: tx peer TDLS link tear down complete
439 */
440enum wma_tdls_peer_notification {
441 WMA_TDLS_SHOULD_DISCOVER,
442 WMA_TDLS_SHOULD_TEARDOWN,
443 WMA_TDLS_PEER_DISCONNECTED,
444};
445
446/**
447 * enum wma_tdls_peer_reason - TDLS peer reason
448 * @WMA_TDLS_TEARDOWN_REASON_TX: tdls teardown recommended due to low transmits
449 * @WMA_TDLS_TEARDOWN_REASON_RATE: tdls tear down recommended due to
450 * packet rates < AP rates
451 * @WMA_TDLS_TEARDOWN_REASON_RSSI: tdls link tear down recommended
452 * due to poor RSSI
453 * @WMA_TDLS_TEARDOWN_REASON_SCAN: tdls link tear down recommended
454 * due to offchannel scan
455 * @WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE: tdls peer disconnected
456 * due to peer deletion
457 */
458enum wma_tdls_peer_reason {
459 WMA_TDLS_TEARDOWN_REASON_TX,
460 WMA_TDLS_TEARDOWN_REASON_RATE,
461 WMA_TDLS_TEARDOWN_REASON_RSSI,
462 WMA_TDLS_TEARDOWN_REASON_SCAN,
463 WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE,
464};
465#endif /* FEATURE_WLAN_TDLS */
466
467
468/**
469 * enum t_wma_roam_preauth_chan_state_t - Roaming preauth channel state
470 * @WMA_ROAM_PREAUTH_CHAN_NONE: no preauth in progress
471 * @WMA_ROAM_PREAUTH_CHAN_REQUESTED: preaduth channel requested
472 * @WMA_ROAM_PREAUTH_ON_CHAN: preauth on channel
473 * @WMA_ROAM_PREAUTH_CHAN_CANCEL_REQUESTED: preauth channel cancel requested
474 * @WMA_ROAM_PREAUTH_CHAN_COMPLETED: preauth completed
475 */
476typedef enum {
477 WMA_ROAM_PREAUTH_CHAN_NONE,
478 WMA_ROAM_PREAUTH_CHAN_REQUESTED,
479 WMA_ROAM_PREAUTH_ON_CHAN,
480 WMA_ROAM_PREAUTH_CHAN_CANCEL_REQUESTED,
481 WMA_ROAM_PREAUTH_CHAN_COMPLETED
482} t_wma_roam_preauth_chan_state_t;
483
484/**
485 * struct wma_mem_chunk - memory chunks
486 * @vaddr: virtual address
487 * @paddr: physical address
488 * @memctx: dma mapped memory
489 * @len: length of data
490 * @req_id: request id
491 *
492 * memory chunck allocated by Host to be managed by FW
493 * used only for low latency interfaces like pcie
494 */
495struct wma_mem_chunk {
496 uint32_t *vaddr;
497 uint32_t paddr;
498 cdf_dma_mem_context(memctx);
499 uint32_t len;
500 uint32_t req_id;
501};
502
503/**
504 * struct p2p_scan_param - p2p scan listen parameters
505 * @scan_id: scan id
506 * @p2p_scan_type: p2p scan type
507 */
508struct p2p_scan_param {
509 uint32_t scan_id;
510 tSirP2pScanType p2p_scan_type;
511};
512
513/**
514 * struct scan_param - scan parameters
515 * @scan_id: scan id
516 * @scan_requestor_id: scan requestor id
517 * @p2p_scan_type: p2p scan type
518 */
519struct scan_param {
520 uint32_t scan_id;
521 uint32_t scan_requestor_id;
522 tSirP2pScanType p2p_scan_type;
523};
524
525/**
526 * struct beacon_info - structure to store beacon template
527 * @buf: skb ptr
528 * @len: length
529 * @dma_mapped: is it dma mapped or not
530 * @tim_ie_offset: TIM IE offset
531 * @dtim_count: DTIM count
532 * @seq_no: sequence no
533 * @noa_sub_ie: NOA sub IE
534 * @noa_sub_ie_len: NOA sub IE length
535 * @noa_ie: NOA IE
536 * @p2p_ie_offset: p2p IE offset
537 * @lock: lock
538 */
539struct beacon_info {
540 cdf_nbuf_t buf;
541 uint32_t len;
542 uint8_t dma_mapped;
543 uint32_t tim_ie_offset;
544 uint8_t dtim_count;
545 uint16_t seq_no;
546 uint8_t noa_sub_ie[2 + WMA_NOA_IE_SIZE(WMA_MAX_NOA_DESCRIPTORS)];
547 uint16_t noa_sub_ie_len;
548 uint8_t *noa_ie;
549 uint16_t p2p_ie_offset;
550 cdf_spinlock_t lock;
551};
552
553/**
554 * struct beacon_tim_ie - structure to store TIM IE of beacon
555 * @tim_ie: tim ie
556 * @tim_len: tim ie length
557 * @dtim_count: dtim count
558 * @dtim_period: dtim period
559 * @tim_bitctl: tim bit control
560 * @tim_bitmap: tim bitmap
561 */
562struct beacon_tim_ie {
563 uint8_t tim_ie;
564 uint8_t tim_len;
565 uint8_t dtim_count;
566 uint8_t dtim_period;
567 uint8_t tim_bitctl;
568 uint8_t tim_bitmap[1];
569} __ATTRIB_PACK;
570
571/**
572 * struct pps - packet power save parameter
573 * @paid_match_enable: paid match enable
574 * @gid_match_enable: gid match enable
575 * @tim_clear: time clear
576 * @dtim_clear: dtim clear
577 * @eof_delim: eof delim
578 * @mac_match: mac match
579 * @delim_fail: delim fail
580 * @nsts_zero: nsts zero
581 * @rssi_chk: RSSI check
582 * @ebt_5g: ebt 5GHz
583 */
584struct pps {
585 bool paid_match_enable;
586 bool gid_match_enable;
587 bool tim_clear;
588 bool dtim_clear;
589 bool eof_delim;
590 bool mac_match;
591 bool delim_fail;
592 bool nsts_zero;
593 bool rssi_chk;
594 bool ebt_5g;
595};
596
597/**
598 * struct qpower_params - qpower related parameters
599 * @max_ps_poll_cnt: max ps poll count
600 * @max_tx_before_wake: max tx before wake
601 * @spec_ps_poll_wake_interval: ps poll wake interval
602 * @max_spec_nodata_ps_poll: no data ps poll
603 */
604struct qpower_params {
605 uint32_t max_ps_poll_cnt;
606 uint32_t max_tx_before_wake;
607 uint32_t spec_ps_poll_wake_interval;
608 uint32_t max_spec_nodata_ps_poll;
609};
610
611
612/**
613 * struct gtx_config_t - GTX config
614 * @gtxRTMask: for HT and VHT rate masks
615 * @gtxUsrcfg: host request for GTX mask
616 * @gtxPERThreshold: PER Threshold (default: 10%)
617 * @gtxPERMargin: PER margin (default: 2%)
618 * @gtxTPCstep: TCP step (default: 1)
619 * @gtxTPCMin: TCP min (default: 5)
620 * @gtxBWMask: BW mask (20/40/80/160 Mhz)
621 */
622typedef struct {
623 uint32_t gtxRTMask[2];
624 uint32_t gtxUsrcfg;
625 uint32_t gtxPERThreshold;
626 uint32_t gtxPERMargin;
627 uint32_t gtxTPCstep;
628 uint32_t gtxTPCMin;
629 uint32_t gtxBWMask;
630} gtx_config_t;
631
632/**
633 * struct pdev_cli_config_t - store pdev parameters
634 * @ani_enable: ANI is enabled/disable on target
635 * @ani_poll_len: store ANI polling period
636 * @ani_listen_len: store ANI listening period
637 * @ani_ofdm_level: store ANI OFDM immunity level
638 * @ani_cck_level: store ANI CCK immunity level
639 * @cwmenable: Dynamic bw is enable/disable in fw
640 * @txchainmask: tx chain mask
641 * @rxchainmask: rx chain mask
642 * @txpow2g: tx power limit for 2GHz
643 * @txpow5g: tx power limit for 5GHz
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800644 * @burst_enable: is burst enable/disable
645 * @burst_dur: burst duration
646 *
647 * This structure stores pdev parameters.
648 * Some of these parameters are set in fw and some
649 * parameters are only maintained in host.
650 */
651typedef struct {
652 uint32_t ani_enable;
653 uint32_t ani_poll_len;
654 uint32_t ani_listen_len;
655 uint32_t ani_ofdm_level;
656 uint32_t ani_cck_level;
657 uint32_t cwmenable;
658 uint32_t cts_cbw;
659 uint32_t txchainmask;
660 uint32_t rxchainmask;
661 uint32_t txpow2g;
662 uint32_t txpow5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800663 uint32_t burst_enable;
664 uint32_t burst_dur;
665} pdev_cli_config_t;
666
667/**
668 * struct vdev_cli_config_t - store vdev parameters
669 * @nss: nss width
670 * @ldpc: is ldpc is enable/disable
671 * @tx_stbc: TX STBC is enable/disable
672 * @rx_stbc: RX STBC is enable/disable
673 * @shortgi: short gi is enable/disable
674 * @rtscts_en: RTS/CTS is enable/disable
675 * @chwidth: channel width
676 * @tx_rate: tx rate
677 * @ampdu: ampdu size
678 * @amsdu: amsdu size
679 * @erx_adjust: enable/disable early rx enable
680 * @erx_bmiss_num: target bmiss number per sample
681 * @erx_bmiss_cycle: sample cycle
682 * @erx_slop_step: slop_step value
683 * @erx_init_slop: init slop
684 * @erx_adj_pause: pause adjust enable/disable
685 * @erx_dri_sample: enable/disable drift sample
686 * @pps_params: packet power save parameters
687 * @qpower_params: qpower parameters
688 * @gtx_info: GTX offload info
689 *
690 * This structure stores vdev parameters.
691 * Some of these parameters are set in fw and some
692 * parameters are only maintained in host.
693 */
694typedef struct {
695 uint32_t nss;
696 uint32_t ldpc;
697 uint32_t tx_stbc;
698 uint32_t rx_stbc;
699 uint32_t shortgi;
700 uint32_t rtscts_en;
701 uint32_t chwidth;
702 uint32_t tx_rate;
703 uint32_t ampdu;
704 uint32_t amsdu;
705 uint32_t erx_adjust;
706 uint32_t erx_bmiss_num;
707 uint32_t erx_bmiss_cycle;
708 uint32_t erx_slop_step;
709 uint32_t erx_init_slop;
710 uint32_t erx_adj_pause;
711 uint32_t erx_dri_sample;
712 struct pps pps_params;
713 struct qpower_params qpower_params;
714 gtx_config_t gtx_info;
715} vdev_cli_config_t;
716
717/**
718 * struct wma_wow - store wow patterns
719 * @magic_ptrn_enable: magic pattern enable/disable
720 * @wow_enable: wow enable/disable
721 * @wow_enable_cmd_sent: is wow enable command sent to fw
722 * @deauth_enable: is deauth wakeup enable/disable
723 * @disassoc_enable: is disassoc wakeup enable/disable
724 * @bmiss_enable: is bmiss wakeup enable/disable
725 * @gtk_pdev_enable: is GTK based wakeup enable/disable
726 * @gtk_err_enable: is GTK error wakeup enable/disable
727 * @lphb_cache: lphb cache
728 *
729 * This structure stores wow patterns and
730 * wow related parameters in host.
731 */
732struct wma_wow {
733 bool magic_ptrn_enable;
734 bool wow_enable;
735 bool wow_enable_cmd_sent;
736 bool deauth_enable;
737 bool disassoc_enable;
738 bool bmiss_enable;
739 bool gtk_pdev_enable;
740 bool gtk_err_enable[WMA_MAX_SUPPORTED_BSS];
741#ifdef FEATURE_WLAN_LPHB
742 /* currently supports only vdev 0.
743 * cache has two entries: one for TCP and one for UDP.
744 */
745 tSirLPHBReq lphb_cache[2];
746#endif
747};
748
749#ifdef WLAN_FEATURE_11W
750#define CMAC_IPN_LEN (6)
751#define WMA_IGTK_KEY_INDEX_4 (4)
752#define WMA_IGTK_KEY_INDEX_5 (5)
753
754/**
755 * struct wma_igtk_ipn_t - GTK IPN info
756 * @ipn: IPN info
757 */
758typedef struct {
759 uint8_t ipn[CMAC_IPN_LEN];
760} wma_igtk_ipn_t;
761
762/**
763 * struct wma_igtk_key_t - GTK key
764 * @key_length: key length
765 * @key: key
766 * @key_id: key id
767 */
768typedef struct {
769 uint16_t key_length;
770 uint8_t key[CSR_AES_KEY_LEN];
771
772 /* IPN is maintained per iGTK keyID
773 * 0th index for iGTK keyID = 4;
774 * 1st index for iGTK KeyID = 5
775 */
776 wma_igtk_ipn_t key_id[2];
777} wma_igtk_key_t;
778#endif
779
780/**
781 * struct vdev_restart_params_t - vdev restart parameters
782 * @vdev_id: vdev id
783 * @ssid: ssid
784 * @flags: flags
785 * @requestor_id: requestor id
786 * @chan: channel
787 * @hidden_ssid_restart_in_progress: hidden ssid restart flag
788 * @ssidHidden: is ssid hidden or not
789 */
790typedef struct {
791 A_UINT32 vdev_id;
792 wmi_ssid ssid;
793 A_UINT32 flags;
794 A_UINT32 requestor_id;
795 A_UINT32 disable_hw_ack;
796 wmi_channel chan;
797 cdf_atomic_t hidden_ssid_restart_in_progress;
798 uint8_t ssidHidden;
799} vdev_restart_params_t;
800
801/**
802 * struct wma_txrx_node - txrx node
803 * @addr: mac address
804 * @bssid: bssid
805 * @handle: wma handle
806 * @beacon: beacon info
807 * @vdev_restart_params: vdev restart parameters
808 * @config: per vdev config parameters
809 * @scan_info: scan info
810 * @type: type
811 * @sub_type: sub type
812 * @nlo_match_evt_received: is nlo match event received or not
813 * @pno_in_progress: is pno in progress or not
814 * @plm_in_progress: is plm in progress or not
815 * @ptrn_match_enable: is pattern match is enable or not
816 * @num_wow_default_patterns: number of default wow patterns configured for vdev
817 * @num_wow_user_patterns: number of user wow patterns configured for vdev
818 * @conn_state: connection state
819 * @beaconInterval: beacon interval
820 * @llbCoexist: 11b coexist
821 * @shortSlotTimeSupported: is short slot time supported or not
822 * @dtimPeriod: DTIM period
823 * @chanmode: channel mode
824 * @vht_capable: VHT capablity flag
825 * @ht_capable: HT capablity flag
826 * @mhz: channel frequency in KHz
827 * @vdev_up: is vdev up or not
828 * @tsfadjust: TSF adjust
829 * @addBssStaContext: add bss context
830 * @aid: association id
831 * @rmfEnabled: Robust Management Frame (RMF) enabled/disabled
832 * @key: GTK key
833 * @uapsd_cached_val: uapsd cached value
834 * @stats_rsp: stats response
835 * @fw_stats_set: fw stats value
836 * @del_staself_req: delete sta self request
837 * @bss_status: bss status
838 * @rate_flags: rate flags
839 * @nss: nss value
840 * @is_channel_switch: is channel switch
841 * @pause_bitmap: pause bitmap
842 * @tx_power: tx power in dbm
843 * @max_tx_power: max tx power in dbm
844 * @nwType: network type (802.11a/b/g/n/ac)
845 * @staKeyParams: sta key parameters
846 * @ps_enabled: is powersave enable/disable
847 * @dtim_policy: DTIM policy
848 * @peer_count: peer count
849 * @roam_synch_in_progress: flag is in progress or not
850 * @plink_status_req: link status request
851 * @psnr_req: snr request
852 * @delay_before_vdev_stop: delay
853 * @tx_streams: number of tx streams can be used by the vdev
854 * @rx_streams: number of rx streams can be used by the vdev
855 * @chain_mask: chain mask can be used by the vdev
856 * @mac_id: the mac on which vdev is on
857 *
858 * It stores parameters per vdev in wma.
859 */
860struct wma_txrx_node {
861 uint8_t addr[IEEE80211_ADDR_LEN];
862 uint8_t bssid[IEEE80211_ADDR_LEN];
863 void *handle;
864 struct beacon_info *beacon;
865 vdev_restart_params_t vdev_restart_params;
866 vdev_cli_config_t config;
867 struct scan_param scan_info;
868 struct p2p_scan_param p2p_scan_info;
869 uint32_t type;
870 uint32_t sub_type;
871#ifdef FEATURE_WLAN_SCAN_PNO
872 bool nlo_match_evt_received;
873 bool pno_in_progress;
874#endif
875#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
876 bool plm_in_progress;
877#endif
878 bool ptrn_match_enable;
879 uint8_t num_wow_default_patterns;
880 uint8_t num_wow_user_patterns;
881 bool conn_state;
882 tSirMacBeaconInterval beaconInterval;
883 uint8_t llbCoexist;
884 uint8_t shortSlotTimeSupported;
885 uint8_t dtimPeriod;
886 WLAN_PHY_MODE chanmode;
887 uint8_t vht_capable;
888 uint8_t ht_capable;
889 A_UINT32 mhz;
890 bool vdev_up;
891 uint64_t tsfadjust;
892 void *addBssStaContext;
893 uint8_t aid;
894 uint8_t rmfEnabled;
895#ifdef WLAN_FEATURE_11W
896 wma_igtk_key_t key;
897#endif /* WLAN_FEATURE_11W */
898 uint32_t uapsd_cached_val;
899 tAniGetPEStatsRsp *stats_rsp;
900 uint8_t fw_stats_set;
901 void *del_staself_req;
902 cdf_atomic_t bss_status;
903 uint8_t rate_flags;
904 uint8_t nss;
905 bool is_channel_switch;
906 uint16_t pause_bitmap;
907 tPowerdBm tx_power;
908 tPowerdBm max_tx_power;
909 uint32_t nwType;
910#if defined WLAN_FEATURE_VOWIFI_11R
911 void *staKeyParams;
912#endif
913 bool ps_enabled;
914 uint32_t dtim_policy;
915 uint32_t peer_count;
916 bool roam_synch_in_progress;
917 void *plink_status_req;
918 void *psnr_req;
919 uint8_t delay_before_vdev_stop;
920#ifdef FEATURE_WLAN_EXTSCAN
921 bool extscan_in_progress;
922#endif
923 uint32_t alt_modulated_dtim;
924 bool alt_modulated_dtim_enabled;
925 uint32_t tx_streams;
926 uint32_t rx_streams;
927 uint32_t chain_mask;
928 uint32_t mac_id;
929};
930
931#if defined(QCA_WIFI_FTM)
932#define MAX_UTF_EVENT_LENGTH 2048
933#define MAX_WMI_UTF_LEN 252
934
935/**
936 * struct SEG_HDR_INFO_STRUCT - header info
937 * @len: length
938 * @msgref: message refrence
939 * @segmentInfo: segment info
940 * @pad: padding
941 */
942typedef struct {
943 A_UINT32 len;
944 A_UINT32 msgref;
945 A_UINT32 segmentInfo;
946 A_UINT32 pad;
947} SEG_HDR_INFO_STRUCT;
948
949/**
950 * struct utf_event_info - UTF event info
951 * @data: data ptr
952 * @length: length
953 * @offset: offset
954 * @currentSeq: curent squence
955 * @expectedSeq: expected sequence
956 */
957struct utf_event_info {
958 uint8_t *data;
959 uint32_t length;
960 cdf_size_t offset;
961 uint8_t currentSeq;
962 uint8_t expectedSeq;
963};
964#endif
965
966/**
967 * struct scan_timer_info - scan timer info
968 * @vdev_id: vdev id
969 * @scan_id: scan id
970 */
971typedef struct {
972 uint8_t vdev_id;
973 uint32_t scan_id;
974} scan_timer_info;
975
976/**
977 * struct ibss_power_save_params - IBSS power save parameters
978 * @atimWindowLength: ATIM window length
979 * @isPowerSaveAllowed: is power save allowed
980 * @isPowerCollapseAllowed: is power collapsed allowed
981 * @isAwakeonTxRxEnabled: is awake on tx/rx enabled
982 * @inactivityCount: inactivity count
983 * @txSPEndInactivityTime: tx SP end inactivity time
984 * @ibssPsWarmupTime: IBSS power save warm up time
985 * @ibssPs1RxChainInAtimEnable: IBSS power save rx chain in ATIM enable
986 */
987typedef struct {
988 uint32_t atimWindowLength;
989 uint32_t isPowerSaveAllowed;
990 uint32_t isPowerCollapseAllowed;
991 uint32_t isAwakeonTxRxEnabled;
992 uint32_t inactivityCount;
993 uint32_t txSPEndInactivityTime;
994 uint32_t ibssPsWarmupTime;
995 uint32_t ibssPs1RxChainInAtimEnable;
996} ibss_power_save_params;
997
998/**
999 * struct dbs_hw_mode_info - WLAN_DBS_HW_MODES_TLV Format
1000 * @tlv_header: TLV header, TLV tag and len; tag equals WMITLV_TAG_ARRAY_UINT32
1001 * @hw_mode_list: WLAN_DBS_HW_MODE_LIST entries
1002 */
1003struct dbs_hw_mode_info {
1004 uint32_t tlv_header;
1005 uint32_t *hw_mode_list;
1006};
1007
1008/* Current HTC credit is 2, pool size of 50 is sufficient */
1009#define WMI_DESC_POOL_MAX 50
1010
1011/**
1012 * struct wmi_desc_t - wmi management Tx descriptor.
1013 * @tx_cmpl_cb_func: completion callback function, when DL completion and
1014 * OTA done.
1015 * @ota_post_proc_func: Post process callback function registered.
1016 * @nbuf: Network buffer to be freed.
1017 * @desc_id: WMI descriptor.
1018 */
1019
1020struct wmi_desc_t {
1021 pWMATxRxCompFunc tx_cmpl_cb;
1022 pWMAAckFnTxComp ota_post_proc_cb;
1023 cdf_nbuf_t nbuf;
1024 uint32_t desc_id;
1025};
1026
1027/**
1028 * union wmi_desc_elem_t - linked list wmi desc pool.
1029 * @next: Pointer next descritor in the pool.
1030 * @wmi_desc: wmi descriptor element.
1031 */
1032union wmi_desc_elem_t {
1033 union wmi_desc_elem_t *next;
1034 struct wmi_desc_t wmi_desc;
1035};
1036
1037/**
1038 * struct dual_mac_config - Dual MAC configurations
1039 * @prev_scan_config: Previous scan configuration
1040 * @prev_fw_mode_config: Previous FW mode configuration
1041 * @cur_scan_config: Current scan configuration
1042 * @cur_fw_mode_config: Current FW mode configuration
1043 * @req_scan_config: Requested scan configuration
1044 * @req_fw_mode_config: Requested FW mode configuration
1045 */
1046struct dual_mac_config {
1047 uint32_t prev_scan_config;
1048 uint32_t prev_fw_mode_config;
1049 uint32_t cur_scan_config;
1050 uint32_t cur_fw_mode_config;
1051 uint32_t req_scan_config;
1052 uint32_t req_fw_mode_config;
1053
1054};
1055
1056/**
1057 * struct wmi_init_cmd - Saved wmi INIT command
1058 * @buf: Buffer containing the wmi INIT command
1059 * @buf_len: Length of the buffer
1060 */
1061struct wmi_init_cmd {
1062 wmi_buf_t buf;
1063 uint32_t buf_len;
1064};
1065
1066/**
1067 * struct t_wma_handle - wma context
1068 * @wmi_handle: wmi handle
1069 * @htc_handle: htc handle
1070 * @cds_context: cds handle
1071 * @mac_context: mac context
1072 * @wma_ready_event: wma rx ready event
1073 * @wma_resume_event: wma resume event
1074 * @target_suspend: target suspend event
1075 * @recovery_event: wma FW recovery event
1076 * @max_station: max stations
1077 * @max_bssid: max bssid
1078 * @frame_xln_reqd: frame transmission required
1079 * @driver_type: driver type
1080 * @myaddr: current mac address
1081 * @hwaddr: mac address from EEPROM
1082 * @target_abi_vers: target firmware version
1083 * @final_abi_vers: The final ABI version to be used for communicating
1084 * @target_fw_version: Target f/w build version
1085 * @lpss_support: LPSS feature is supported in target or not
1086 * @wmi_ready: wmi status flag
1087 * @wlan_init_status: wlan init status
1088 * @cdf_dev: cdf device
1089 * @phy_capability: PHY Capability from Target
1090 * @max_frag_entry: Max number of Fragment entry
1091 * @wmi_service_bitmap: wmi services bitmap received from Target
1092 * @wlan_resource_config: resource config
1093 * @frameTransRequired: frame transmission required
1094 * @wmaGlobalSystemRole: global system role
1095 * @tx_frm_download_comp_cb: Tx Frame Compl Cb registered by umac
1096 * @tx_frm_download_comp_event: Event to wait for tx download completion
1097 * @tx_queue_empty_event: wait for tx queue to get flushed
1098 * @umac_ota_ack_cb: Ack Complete Callback registered by umac
1099 * @umac_data_ota_ack_cb: ack complete callback
1100 * @last_umac_data_ota_timestamp: timestamp when OTA of last umac data was done
1101 * @last_umac_data_nbuf: cache nbuf ptr for the last umac data buf
1102 * @needShutdown: is shutdown needed or not
1103 * @num_mem_chunks: number of memory chunk
1104 * @mem_chunks: memory chunks
1105 * @tgt_cfg_update_cb: configuration update callback
1106 * @dfs_radar_indication_cb: Callback to indicate radar to HDD
1107 * @reg_cap: regulatory capablities
1108 * @scan_id: scan id
1109 * @interfaces: txrx nodes(per vdev)
1110 * @pdevconfig: pdev related configrations
1111 * @vdev_resp_queue: vdev response queue
1112 * @vdev_respq_lock: vdev response queue lock
1113 * @ht_cap_info: HT capablity info
1114 * @vht_cap_info: VHT capablity info
1115 * @vht_supp_mcs: VHT supported MCS
1116 * @num_rf_chains: number of RF chains
1117 * @utf_event_info: UTF event information
1118 * @is_fw_assert: is fw asserted
1119 * @wow: wow related patterns & parameters
1120 * @no_of_suspend_ind: number of suspend indications
1121 * @no_of_resume_ind: number of resume indications
1122 * @mArpInfo: arp info
1123 * @powersave_mode: power save mode
1124 * @ptrn_match_enable_all_vdev: is pattern match is enable/disable
1125 * @pGetRssiReq: get RSSI request
1126 * @thermal_mgmt_info: Thermal mitigation related info
1127 * @roam_offload_enabled: is roam offload enable/disable
1128 * @roam_preauth_scan_state: roam preauth scan state
1129 * @roam_preauth_scan_id: roam preauth scan id
1130 * @roam_preauth_chanfreq: roam preauth channel frequency
1131 * @roam_preauth_chan_context: roam preauth chan context
1132 * @ol_ini_info: store ini status of arp offload, ns offload
1133 * @ssdp: ssdp flag
1134 * @ibss_started: is IBSS started or not
1135 * @ibsskey_info: IBSS key info
1136 * @dfs_ic: DFS umac interface information
1137 * @hddTxFailCb: tx fail indication callback
1138 * @pno_wake_lock: PNO wake lock
1139 * @extscan_wake_lock: extscan wake lock
1140 * @wow_wake_lock: wow wake lock
1141 * @wow_nack: wow negative ack flag
1142 * @ap_client_cnt: ap client count
1143 * @is_wow_bus_suspended: is wow bus suspended flag
1144 * @wma_scan_comp_timer: scan completion timer
1145 * @dfs_phyerr_filter_offload: dfs phy error filter is offloaded or not
1146 * @suitable_ap_hb_failure: better ap found
1147 * @wma_ibss_power_save_params: IBSS Power Save config Parameters
1148 * @IsRArateLimitEnabled: RA rate limiti s enabled or not
1149 * @RArateLimitInterval: RA rate limit interval
1150 * @is_lpass_enabled: Flag to indicate if LPASS feature is enabled or not
1151 * @is_nan_enabled: Flag to indicate if NaN feature is enabled or not
1152 * @staMaxLIModDtim: station max listen interval
1153 * @staModDtim: station mode DTIM
1154 * @staDynamicDtim: station dynamic DTIM
1155 * @enable_mhf_offload: is MHF offload enable/disable
1156 * @last_mhf_entries_timestamp: timestamp when last entries where set
1157 * @dfs_pri_multiplier: DFS multiplier
1158 * @hw_bd_id: hardware board id
1159 * @hw_bd_info: hardware board info
1160 * @in_d0wow: D0WOW is enable/disable
1161 * @miracast_value: miracast value
1162 * @log_completion_timer: log completion timer
1163 * @mgmt_rx: management rx callback
1164 * @num_dbs_hw_modes: Number of HW modes supported by the FW
1165 * @dbs_mode: DBS HW mode list
1166 * @old_hw_mode_index: Previous configured HW mode index
1167 * @new_hw_mode_index: Current configured HW mode index
1168 * @peer_authorized_cb: peer authorized hdd callback
1169 * @ocb_callback: callback to OCB commands
1170 * @ocb_resp: response to OCB commands
1171 * @wow_pno_match_wake_up_count: PNO match wake up count
1172 * @wow_pno_complete_wake_up_count: PNO complete wake up count
1173 * @wow_gscan_wake_up_count: Gscan wake up count
1174 * @wow_low_rssi_wake_up_count: Low rssi wake up count
1175 * @wow_rssi_breach_wake_up_count: RSSI breach wake up count
1176 * @wow_ucast_wake_up_count: WoW unicast packet wake up count
1177 * @wow_bcast_wake_up_count: WoW brodcast packet wake up count
1178 * @wow_ipv4_mcast_wake_up_count: WoW IPV4 mcast packet wake up count
1179 * @wow_ipv6_mcast_wake_up_count: WoW IPV6 mcast packet wake up count
1180 * @wow_ipv6_mcast_ra_stats: WoW IPV6 mcast RA packet wake up count
1181 * @wow_ipv6_mcast_ns_stats: WoW IPV6 mcast NS packet wake up count
1182 * @wow_ipv6_mcast_na_stats: WoW IPV6 mcast NA packet wake up count
1183 * @dual_mac_cfg: Dual mac configuration params for scan and fw mode
1184 *
1185 * @max_scan: maximum scan requests than can be queued
1186 * This structure is global wma context
1187 * It contains global wma module parameters and
1188 * handle of other modules.
1189 * @saved_wmi_init_cmd: Saved WMI INIT command
1190 * @service_ready_ext_evt: Wait event for service ready ext
1191 */
1192typedef struct {
1193 void *wmi_handle;
1194 void *htc_handle;
1195 void *cds_context;
1196 void *mac_context;
1197 cdf_event_t wma_ready_event;
1198 cdf_event_t wma_resume_event;
1199 cdf_event_t target_suspend;
1200 cdf_event_t recovery_event;
1201 uint16_t max_station;
1202 uint16_t max_bssid;
1203 uint32_t frame_xln_reqd;
1204 t_wma_drv_type driver_type;
1205 uint8_t myaddr[IEEE80211_ADDR_LEN];
1206 uint8_t hwaddr[IEEE80211_ADDR_LEN];
1207 wmi_abi_version target_abi_vers;
1208 wmi_abi_version final_abi_vers;
1209 uint32_t target_fw_version;
1210#ifdef WLAN_FEATURE_LPSS
1211 uint8_t lpss_support;
1212#endif
1213 uint8_t ap_arpns_support;
1214 bool wmi_ready;
1215 uint32_t wlan_init_status;
1216 cdf_device_t cdf_dev;
1217 uint32_t phy_capability;
1218 uint32_t max_frag_entry;
1219 uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
1220 wmi_resource_config wlan_resource_config;
1221 uint32_t frameTransRequired;
1222 tBssSystemRole wmaGlobalSystemRole;
1223 pWMATxRxCompFunc tx_frm_download_comp_cb;
1224 cdf_event_t tx_frm_download_comp_event;
1225 /*
1226 * Dummy event to wait for draining MSDUs left in hardware tx
1227 * queue and before requesting VDEV_STOP. Nobody will set this
1228 * and wait will timeout, and code will poll the pending tx
1229 * descriptors number to be zero.
1230 */
1231 cdf_event_t tx_queue_empty_event;
1232 pWMAAckFnTxComp umac_ota_ack_cb[SIR_MAC_MGMT_RESERVED15];
1233 pWMAAckFnTxComp umac_data_ota_ack_cb;
1234 v_TIME_t last_umac_data_ota_timestamp;
1235 cdf_nbuf_t last_umac_data_nbuf;
1236 bool needShutdown;
1237 uint32_t num_mem_chunks;
1238 struct wma_mem_chunk mem_chunks[MAX_MEM_CHUNKS];
1239 wma_tgt_cfg_cb tgt_cfg_update_cb;
1240 wma_dfs_radar_indication_cb dfs_radar_indication_cb;
1241 HAL_REG_CAPABILITIES reg_cap;
1242 uint32_t scan_id;
1243 struct wma_txrx_node *interfaces;
1244 pdev_cli_config_t pdevconfig;
Krishna Kumaar Natarajana5c53bd2015-10-27 11:48:27 -07001245 cdf_list_t vdev_resp_queue;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001246 cdf_spinlock_t vdev_respq_lock;
1247 cdf_list_t wma_hold_req_queue;
1248 cdf_spinlock_t wma_hold_req_q_lock;
1249 uint32_t ht_cap_info;
1250#ifdef WLAN_FEATURE_11AC
1251 uint32_t vht_cap_info;
1252 uint32_t vht_supp_mcs;
1253#endif
1254 uint32_t num_rf_chains;
1255#if defined(QCA_WIFI_FTM)
1256 struct utf_event_info utf_event_info;
1257#endif
1258 uint8_t is_fw_assert;
1259 struct wma_wow wow;
1260 uint8_t no_of_suspend_ind;
1261 uint8_t no_of_resume_ind;
1262 /* Have a back up of arp info to send along
1263 * with ns info suppose if ns also enabled
1264 */
1265 tSirHostOffloadReq mArpInfo;
1266 struct wma_tx_ack_work_ctx *ack_work_ctx;
1267 uint8_t powersave_mode;
1268 bool ptrn_match_enable_all_vdev;
1269 void *pGetRssiReq;
1270 t_thermal_mgmt thermal_mgmt_info;
1271 bool roam_offload_enabled;
1272 t_wma_roam_preauth_chan_state_t roam_preauth_scan_state;
1273 uint32_t roam_preauth_scan_id;
1274 uint16_t roam_preauth_chanfreq;
1275 void *roam_preauth_chan_context;
1276 /* Here ol_ini_info is used to store ini
1277 * status of arp offload, ns offload
1278 * and others. Currently 1st bit is used
1279 * for arp off load and 2nd bit for ns
1280 * offload currently, rest bits are unused
1281 */
1282 uint8_t ol_ini_info;
1283 bool ssdp;
1284 uint8_t ibss_started;
1285 tSetBssKeyParams ibsskey_info;
1286 struct ieee80211com *dfs_ic;
1287
1288#ifdef FEATURE_WLAN_SCAN_PNO
1289 cdf_wake_lock_t pno_wake_lock;
1290#endif
1291#ifdef FEATURE_WLAN_EXTSCAN
1292 cdf_wake_lock_t extscan_wake_lock;
1293#endif
1294 cdf_wake_lock_t wow_wake_lock;
1295 int wow_nack;
1296 cdf_atomic_t is_wow_bus_suspended;
1297 cdf_mc_timer_t wma_scan_comp_timer;
1298 uint8_t dfs_phyerr_filter_offload;
1299 bool suitable_ap_hb_failure;
1300 ibss_power_save_params wma_ibss_power_save_params;
1301#ifdef FEATURE_WLAN_RA_FILTERING
1302 bool IsRArateLimitEnabled;
1303 uint16_t RArateLimitInterval;
1304#endif
1305#ifdef WLAN_FEATURE_LPSS
1306 bool is_lpass_enabled;
1307#endif
1308#ifdef WLAN_FEATURE_NAN
1309 bool is_nan_enabled;
1310#endif
1311 uint8_t staMaxLIModDtim;
1312 uint8_t staModDtim;
1313 uint8_t staDynamicDtim;
1314 int32_t dfs_pri_multiplier;
1315 uint32_t hw_bd_id;
1316 uint32_t hw_bd_info[HW_BD_INFO_SIZE];
1317 uint32_t miracast_value;
1318 cdf_mc_timer_t log_completion_timer;
1319 wma_mgmt_frame_rx_callback mgmt_rx;
1320 uint32_t num_dbs_hw_modes;
1321 struct dbs_hw_mode_info hw_mode;
1322 uint32_t old_hw_mode_index;
1323 uint32_t new_hw_mode_index;
1324 cdf_atomic_t scan_id_counter;
1325 wma_peer_authorized_fp peer_authorized_cb;
1326 uint32_t num_of_diag_events_logs;
1327 uint32_t *events_logs_list;
1328
1329 uint32_t wow_pno_match_wake_up_count;
1330 uint32_t wow_pno_complete_wake_up_count;
1331 uint32_t wow_gscan_wake_up_count;
1332 uint32_t wow_low_rssi_wake_up_count;
1333 uint32_t wow_rssi_breach_wake_up_count;
1334 uint32_t wow_ucast_wake_up_count;
1335 uint32_t wow_bcast_wake_up_count;
1336 uint32_t wow_ipv4_mcast_wake_up_count;
1337 uint32_t wow_ipv6_mcast_wake_up_count;
1338 uint32_t wow_ipv6_mcast_ra_stats;
1339 uint32_t wow_ipv6_mcast_ns_stats;
1340 uint32_t wow_ipv6_mcast_na_stats;
1341
1342 /* OCB request contexts */
1343 struct sir_ocb_config *ocb_config_req;
1344 struct dual_mac_config dual_mac_cfg;
1345 struct {
1346 uint16_t pool_size;
1347 uint16_t num_free;
1348 union wmi_desc_elem_t *array;
1349 union wmi_desc_elem_t *freelist;
1350 cdf_spinlock_t wmi_desc_pool_lock;
1351 } wmi_desc_pool;
1352 uint8_t max_scan;
1353 struct wmi_init_cmd saved_wmi_init_cmd;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001354 uint16_t self_gen_frm_pwr;
1355 bool tx_chain_mask_cck;
Chandrasekaran, Manishekarc8416922015-10-14 11:19:00 +05301356 /* Going with a timer instead of wait event because on receiving the
1357 * service ready event, we will be waiting on the MC thread for the
1358 * service extended ready event which is also processed in MC thread.
1359 * This leads to MC thread being stuck. Alternative was to process
1360 * these events in tasklet/workqueue context. But, this leads to
1361 * race conditions when the events are processed in two different
1362 * context. So, processing ready event and extended ready event in
1363 * the serialized MC thread context with a timer.
1364 */
1365 cdf_mc_timer_t service_ready_ext_timer;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001366} t_wma_handle, *tp_wma_handle;
1367
1368/**
1369 * struct wma_target_cap - target capabality
1370 * @wmi_service_bitmap: wmi services bitmap
1371 * @wlan_resource_config: resource config
1372 */
1373struct wma_target_cap {
1374 /* wmi services bitmap received from Target */
1375 uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
1376 /* default resource config,the os shim can overwrite it */
1377 wmi_resource_config wlan_resource_config;
1378};
1379
1380/**
1381 * struct t_wma_start_req - wma start request parameters
1382 * @pConfigBuffer: config buffer
1383 * @usConfigBufferLen: Length of the config buffer above
1384 * @driver_type: Production or FTM driver
1385 * @pUserData: user data
1386 * @pIndUserData: indication function pointer to send to UMAC
1387 *
1388 * The shared memory between WDI and HAL is 4K so maximum data can be
1389 * transferred from WDI to HAL is 4K
1390 */
1391typedef struct {
1392 void *pConfigBuffer;
1393 uint16_t usConfigBufferLen;
1394 t_wma_drv_type driver_type;
1395 void *pUserData;
1396 void *pIndUserData;
1397} t_wma_start_req;
1398
1399/* Enumeration for Version */
1400typedef enum {
1401 WLAN_HAL_MSG_VERSION0 = 0,
1402 WLAN_HAL_MSG_VERSION1 = 1,
1403 WLAN_HAL_MSG_WCNSS_CTRL_VERSION = 0x7FFF, /*define as 2 bytes data */
1404 WLAN_HAL_MSG_VERSION_MAX_FIELD = WLAN_HAL_MSG_WCNSS_CTRL_VERSION
1405} tHalHostMsgVersion;
1406
1407/**
1408 * struct sHalMacStartParameter - mac start request parameters
1409 * @driverType: driver type (production/FTM)
1410 * @uConfigBufferLen: length of config buffer
1411 */
1412typedef struct cdf_packed sHalMacStartParameter {
1413 tDriverType driverType;
1414 uint32_t uConfigBufferLen;
1415
1416 /* Following this there is a TLV formatted buffer of length
1417 * "uConfigBufferLen" bytes containing all config values.
1418 * The TLV is expected to be formatted like this:
1419 * 0 15 31 31+CFG_LEN-1 length-1
1420 * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......|
1421 */
1422} tHalMacStartParameter, *tpHalMacStartParameter;
1423
1424extern void cds_wma_complete_cback(void *p_cds_context);
1425extern void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
1426 uint16_t regdmn5G, int8_t ctl2G,
1427 int8_t ctl5G);
1428void wma_get_modeselect(tp_wma_handle wma, uint32_t *modeSelect);
1429
1430/**
1431 * enum frame_index - Frame index
1432 * @GENERIC_NODOWNLD_NOACK_COMP_INDEX: Frame index for no download comp no ack
1433 * @GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX: Frame index for download comp no ack
1434 * @GENERIC_DOWNLD_COMP_ACK_COMP_INDEX: Frame index for download comp and ack
1435 * @GENERIC_NODOWLOAD_ACK_COMP_INDEX: Frame index for no download comp and ack
1436 * @FRAME_INDEX_MAX: maximum frame index
1437 */
1438enum frame_index {
1439 GENERIC_NODOWNLD_NOACK_COMP_INDEX,
1440 GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX,
1441 GENERIC_DOWNLD_COMP_ACK_COMP_INDEX,
1442 GENERIC_NODOWLOAD_ACK_COMP_INDEX,
1443 FRAME_INDEX_MAX
1444};
1445
1446/**
1447 * struct wma_tx_ack_work_ctx - tx ack work context
1448 * @wma_handle: wma handle
1449 * @sub_type: sub type
1450 * @status: status
1451 * @ack_cmp_work: work structure
1452 */
1453struct wma_tx_ack_work_ctx {
1454 tp_wma_handle wma_handle;
1455 uint16_t sub_type;
1456 int32_t status;
Krishna Kumaar Natarajan9f421702015-11-10 14:56:16 -08001457 cdf_work_t ack_cmp_work;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001458};
1459
1460/**
1461 * struct wma_target_req - target request parameters
1462 * @event_timeout: event timeout
1463 * @node: list
1464 * @user_data: user data
1465 * @msg_type: message type
1466 * @vdev_id: vdev id
1467 * @type: type
1468 */
1469struct wma_target_req {
1470 cdf_mc_timer_t event_timeout;
1471 cdf_list_node_t node;
1472 void *user_data;
1473 uint32_t msg_type;
1474 uint8_t vdev_id;
1475 uint8_t type;
1476};
1477
1478/**
1479 * struct wma_vdev_start_req - vdev start request parameters
1480 * @beacon_intval: beacon interval
1481 * @dtim_period: dtim period
1482 * @max_txpow: max tx power
1483 * @chan_offset: channel offset
1484 * @is_dfs: is dfs supported or not
1485 * @vdev_id: vdev id
1486 * @chan: channel
1487 * @oper_mode: operating mode
1488 * @ssid: ssid
1489 * @hidden_ssid: hidden ssid
1490 * @pmf_enabled: is pmf enabled or not
1491 * @vht_capable: VHT capabality
1492 * @ht_capable: HT capabality
1493 * @dfs_pri_multiplier: DFS multiplier
1494 * @dot11_mode: 802.11 mode
1495 * @is_half_rate: is the channel operating at 10MHz
1496 * @is_quarter_rate: is the channel operating at 5MHz
1497 * @preferred_tx_streams: policy manager indicates the preferred
1498 * number of transmit streams
1499 * @preferred_rx_streams: policy manager indicates the preferred
1500 * number of receive streams
1501 */
1502struct wma_vdev_start_req {
1503 uint32_t beacon_intval;
1504 uint32_t dtim_period;
1505 int32_t max_txpow;
1506 phy_ch_width chan_width;
1507 bool is_dfs;
1508 uint8_t vdev_id;
1509 uint8_t chan;
1510 uint8_t oper_mode;
1511 tSirMacSSid ssid;
1512 uint8_t hidden_ssid;
1513 uint8_t pmf_enabled;
1514 uint8_t vht_capable;
1515 uint8_t ch_center_freq_seg0;
1516 uint8_t ch_center_freq_seg1;
1517 uint8_t ht_capable;
1518 int32_t dfs_pri_multiplier;
1519 uint8_t dot11_mode;
1520 bool is_half_rate;
1521 bool is_quarter_rate;
1522 uint32_t preferred_tx_streams;
1523 uint32_t preferred_rx_streams;
1524};
1525
1526/**
1527 * struct wma_set_key_params - set key parameters
1528 * @vdev_id: vdev id
1529 * @def_key_idx: used to see if we have to read the key from cfg
1530 * @key_len: key length
1531 * @peer_mac: peer mac address
1532 * @singl_tid_rc: 1=Single TID based Replay Count, 0=Per TID based RC
1533 * @key_type: key type
1534 * @key_idx: key index
1535 * @unicast: unicast flag
1536 * @key_data: key data
1537 */
1538struct wma_set_key_params {
1539 uint8_t vdev_id;
1540 /* def_key_idx can be used to see if we have to read the key from cfg */
1541 uint32_t def_key_idx;
1542 uint16_t key_len;
1543 uint8_t peer_mac[IEEE80211_ADDR_LEN];
1544 uint8_t singl_tid_rc;
1545 enum eAniEdType key_type;
1546 uint32_t key_idx;
1547 bool unicast;
1548 uint8_t key_data[SIR_MAC_MAX_KEY_LENGTH];
1549};
1550
1551/**
1552 * struct t_thermal_cmd_params - thermal command parameters
1553 * @minTemp: minimum temprature
1554 * @maxTemp: maximum temprature
1555 * @thermalEnable: thermal enable
1556 */
1557typedef struct {
1558 uint16_t minTemp;
1559 uint16_t maxTemp;
1560 uint8_t thermalEnable;
1561} t_thermal_cmd_params, *tp_thermal_cmd_params;
1562
1563/**
1564 * enum wma_cfg_cmd_id - wma cmd ids
1565 * @WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID: txrx firmware stats enable command
1566 * @WMA_VDEV_TXRX_FWSTATS_RESET_CMDID: txrx firmware stats reset command
1567 * @WMA_VDEV_MCC_SET_TIME_LATENCY: set MCC latency time
1568 * @WMA_VDEV_MCC_SET_TIME_QUOTA: set MCC time quota
1569 * @WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE: set IBSS ATIM window size
1570 * @WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED: set IBSS enable power save
1571 * @WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED: set IBSS power collapse enable
1572 * @WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX: awake IBSS on TX/RX
1573 * @WMA_VDEV_IBSS_SET_INACTIVITY_TIME: set IBSS inactivity time
1574 * @WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME: set IBSS TXSP
1575 * @WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS: set IBSS power save warmup time
1576 * @WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW: set IBSS power save ATIM
1577 * @WMA_VDEV_DFS_CONTROL_CMDID: DFS control command
1578 * @WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID: get IPA microcontroller fw stats
1579 *
1580 * wma command ids for configuration request which
1581 * does not involve sending a wmi command.
1582 */
1583enum wma_cfg_cmd_id {
1584 WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID = WMI_CMDID_MAX,
1585 WMA_VDEV_TXRX_FWSTATS_RESET_CMDID,
1586 WMA_VDEV_MCC_SET_TIME_LATENCY,
1587 WMA_VDEV_MCC_SET_TIME_QUOTA,
1588 WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE,
1589 WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED,
1590 WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED,
1591 WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX,
1592 WMA_VDEV_IBSS_SET_INACTIVITY_TIME,
1593 WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
1594 WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
1595 WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
1596 WMA_VDEV_DFS_CONTROL_CMDID,
1597 WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID,
1598 WMA_CMD_ID_MAX
1599};
1600
1601/**
1602 * struct wma_trigger_uapsd_params - trigger uapsd parameters
1603 * @wmm_ac: wmm access catagory
1604 * @user_priority: user priority
1605 * @service_interval: service interval
1606 * @suspend_interval: suspend interval
1607 * @delay_interval: delay interval
1608 */
1609typedef struct wma_trigger_uapsd_params {
1610 uint32_t wmm_ac;
1611 uint32_t user_priority;
1612 uint32_t service_interval;
1613 uint32_t suspend_interval;
1614 uint32_t delay_interval;
1615} t_wma_trigger_uapsd_params, *tp_wma_trigger_uapsd_params;
1616
1617/**
1618 * enum uapsd_peer_param_max_sp - U-APSD maximum service period of peer station
1619 * @UAPSD_MAX_SP_LEN_UNLIMITED: unlimited max service period
1620 * @UAPSD_MAX_SP_LEN_2: max service period = 2
1621 * @UAPSD_MAX_SP_LEN_4: max service period = 4
1622 * @UAPSD_MAX_SP_LEN_6: max service period = 6
1623 */
1624enum uapsd_peer_param_max_sp {
1625 UAPSD_MAX_SP_LEN_UNLIMITED = 0,
1626 UAPSD_MAX_SP_LEN_2 = 2,
1627 UAPSD_MAX_SP_LEN_4 = 4,
1628 UAPSD_MAX_SP_LEN_6 = 6
1629};
1630
1631/**
1632 * enum uapsd_peer_param_enabled_ac - U-APSD Enabled AC's of peer station
1633 * @UAPSD_VO_ENABLED: enable uapsd for voice
1634 * @UAPSD_VI_ENABLED: enable uapsd for video
1635 * @UAPSD_BK_ENABLED: enable uapsd for background
1636 * @UAPSD_BE_ENABLED: enable uapsd for best effort
1637 */
1638enum uapsd_peer_param_enabled_ac {
1639 UAPSD_VO_ENABLED = 0x01,
1640 UAPSD_VI_ENABLED = 0x02,
1641 UAPSD_BK_ENABLED = 0x04,
1642 UAPSD_BE_ENABLED = 0x08
1643};
1644
1645/**
Govind Singha471e5e2015-10-12 17:11:14 +05301646 * enum profile_id_t - Firmware profiling index
1647 * @PROF_CPU_IDLE: cpu idle profile
1648 * @PROF_PPDU_PROC: ppdu processing profile
1649 * @PROF_PPDU_POST: ppdu post profile
1650 * @PROF_HTT_TX_INPUT: htt tx input profile
1651 * @PROF_MSDU_ENQ: msdu enqueue profile
1652 * @PROF_PPDU_POST_HAL: ppdu post profile
1653 * @PROF_COMPUTE_TX_TIME: tx time profile
1654 * @PROF_MAX_ID: max profile index
1655 */
1656enum profile_id_t {
1657 PROF_CPU_IDLE,
1658 PROF_PPDU_PROC,
1659 PROF_PPDU_POST,
1660 PROF_HTT_TX_INPUT,
1661 PROF_MSDU_ENQ,
1662 PROF_PPDU_POST_HAL,
1663 PROF_COMPUTE_TX_TIME,
1664 PROF_MAX_ID,
1665};
1666
1667/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001668 * struct p2p_ie - P2P IE structural definition.
1669 * @p2p_id: p2p id
1670 * @p2p_len: p2p length
1671 * @p2p_oui: p2p OUI
1672 * @p2p_oui_type: p2p OUI type
1673 */
1674struct p2p_ie {
1675 uint8_t p2p_id;
1676 uint8_t p2p_len;
1677 uint8_t p2p_oui[3];
1678 uint8_t p2p_oui_type;
1679} __packed;
1680
1681/**
1682 * struct p2p_noa_descriptor - noa descriptor
1683 * @type_count: 255: continuous schedule, 0: reserved
1684 * @duration: Absent period duration in micro seconds
1685 * @interval: Absent period interval in micro seconds
1686 * @start_time: 32 bit tsf time when in starts
1687 */
1688struct p2p_noa_descriptor {
1689 uint8_t type_count;
1690 uint32_t duration;
1691 uint32_t interval;
1692 uint32_t start_time;
1693} __packed;
1694
1695/**
1696 * struct p2p_sub_element_noa - p2p noa element
1697 * @p2p_sub_id: p2p sub id
1698 * @p2p_sub_len: p2p sub length
1699 * @index: identifies instance of NOA su element
1700 * @oppPS: oppPS state of the AP
1701 * @ctwindow: ctwindow in TUs
1702 * @num_descriptors: number of NOA descriptors
1703 * @noa_descriptors: noa descriptors
1704 */
1705struct p2p_sub_element_noa {
1706 uint8_t p2p_sub_id;
1707 uint8_t p2p_sub_len;
1708 uint8_t index; /* identifies instance of NOA su element */
1709 uint8_t oppPS:1, /* oppPS state of the AP */
1710 ctwindow:7; /* ctwindow in TUs */
1711 uint8_t num_descriptors; /* number of NOA descriptors */
1712 struct p2p_noa_descriptor noa_descriptors[WMA_MAX_NOA_DESCRIPTORS];
1713};
1714
1715/**
1716 * struct wma_decap_info_t - decapsulation info
1717 * @hdr: header
1718 * @hdr_len: header length
1719 */
1720struct wma_decap_info_t {
1721 uint8_t hdr[sizeof(struct ieee80211_qosframe_addr4)];
1722 int32_t hdr_len;
1723};
1724
1725/**
1726 * enum packet_power_save - packet power save params
1727 * @WMI_VDEV_PPS_PAID_MATCH: paid match param
1728 * @WMI_VDEV_PPS_GID_MATCH: gid match param
1729 * @WMI_VDEV_PPS_EARLY_TIM_CLEAR: early tim clear param
1730 * @WMI_VDEV_PPS_EARLY_DTIM_CLEAR: early dtim clear param
1731 * @WMI_VDEV_PPS_EOF_PAD_DELIM: eof pad delim param
1732 * @WMI_VDEV_PPS_MACADDR_MISMATCH: macaddr mismatch param
1733 * @WMI_VDEV_PPS_DELIM_CRC_FAIL: delim CRC fail param
1734 * @WMI_VDEV_PPS_GID_NSTS_ZERO: gid nsts zero param
1735 * @WMI_VDEV_PPS_RSSI_CHECK: RSSI check param
1736 * @WMI_VDEV_PPS_5G_EBT: 5G ebt param
1737 */
1738typedef enum {
1739 WMI_VDEV_PPS_PAID_MATCH = 0,
1740 WMI_VDEV_PPS_GID_MATCH = 1,
1741 WMI_VDEV_PPS_EARLY_TIM_CLEAR = 2,
1742 WMI_VDEV_PPS_EARLY_DTIM_CLEAR = 3,
1743 WMI_VDEV_PPS_EOF_PAD_DELIM = 4,
1744 WMI_VDEV_PPS_MACADDR_MISMATCH = 5,
1745 WMI_VDEV_PPS_DELIM_CRC_FAIL = 6,
1746 WMI_VDEV_PPS_GID_NSTS_ZERO = 7,
1747 WMI_VDEV_PPS_RSSI_CHECK = 8,
1748 WMI_VDEV_VHT_SET_GID_MGMT = 9,
1749 WMI_VDEV_PPS_5G_EBT = 10
1750} packet_power_save;
1751
1752/**
1753 * enum green_tx_param - green tx parameters
1754 * @WMI_VDEV_PARAM_GTX_HT_MCS: ht mcs param
1755 * @WMI_VDEV_PARAM_GTX_VHT_MCS: vht mcs param
1756 * @WMI_VDEV_PARAM_GTX_USR_CFG: user cfg param
1757 * @WMI_VDEV_PARAM_GTX_THRE: thre param
1758 * @WMI_VDEV_PARAM_GTX_MARGIN: green tx margin param
1759 * @WMI_VDEV_PARAM_GTX_STEP: green tx step param
1760 * @WMI_VDEV_PARAM_GTX_MINTPC: mintpc param
1761 * @WMI_VDEV_PARAM_GTX_BW_MASK: bandwidth mask
1762 */
1763typedef enum {
1764 WMI_VDEV_PARAM_GTX_HT_MCS,
1765 WMI_VDEV_PARAM_GTX_VHT_MCS,
1766 WMI_VDEV_PARAM_GTX_USR_CFG,
1767 WMI_VDEV_PARAM_GTX_THRE,
1768 WMI_VDEV_PARAM_GTX_MARGIN,
1769 WMI_VDEV_PARAM_GTX_STEP,
1770 WMI_VDEV_PARAM_GTX_MINTPC,
1771 WMI_VDEV_PARAM_GTX_BW_MASK,
1772} green_tx_param;
1773
1774#ifdef FEATURE_WLAN_TDLS
1775/**
1776 * struct wma_tdls_params - TDLS parameters
1777 * @vdev_id: vdev id
1778 * @tdls_state: TDLS state
1779 * @notification_interval_ms: notification inerval
1780 * @tx_discovery_threshold: tx discovery threshold
1781 * @tx_teardown_threshold: tx teardown threashold
1782 * @rssi_teardown_threshold: RSSI teardown threshold
1783 * @rssi_delta: RSSI delta
1784 * @tdls_options: TDLS options
1785 * @peer_traffic_ind_window: raffic indication window
1786 * @peer_traffic_response_timeout: traffic response timeout
1787 * @puapsd_mask: uapsd mask
1788 * @puapsd_inactivity_time: uapsd inactivity time
1789 * @puapsd_rx_frame_threshold: uapsd rx frame threshold
Kabilan Kannanca670be2015-11-23 01:56:12 -08001790 * @teardown_notification_ms: tdls teardown notification interval
Kabilan Kannan421714b2015-11-23 04:44:59 -08001791 * @tdls_peer_kickout_threshold: tdls packet threshold for
1792 * peer kickout operation
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001793 */
1794typedef struct wma_tdls_params {
1795 uint32_t vdev_id;
1796 uint32_t tdls_state;
1797 uint32_t notification_interval_ms;
1798 uint32_t tx_discovery_threshold;
1799 uint32_t tx_teardown_threshold;
1800 int32_t rssi_teardown_threshold;
1801 int32_t rssi_delta;
1802 uint32_t tdls_options;
1803 uint32_t peer_traffic_ind_window;
1804 uint32_t peer_traffic_response_timeout;
1805 uint32_t puapsd_mask;
1806 uint32_t puapsd_inactivity_time;
1807 uint32_t puapsd_rx_frame_threshold;
Kabilan Kannanca670be2015-11-23 01:56:12 -08001808 uint32_t teardown_notification_ms;
Kabilan Kannan421714b2015-11-23 04:44:59 -08001809 uint32_t tdls_peer_kickout_threshold;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001810} t_wma_tdls_params;
1811
1812/**
1813 * struct wma_tdls_peer_event - TDLS peer event
1814 * @vdev_id: vdev id
1815 * @peer_macaddr: peer MAC address
1816 * @peer_status: TDLS peer status
1817 * @peer_reason: TDLS peer reason
1818 */
1819typedef struct {
1820 A_UINT32 vdev_id;
1821 wmi_mac_addr peer_macaddr;
1822 A_UINT32 peer_status;
1823 A_UINT32 peer_reason;
1824} wma_tdls_peer_event;
1825
1826#endif /* FEATURE_WLAN_TDLS */
1827
1828/**
1829 * struct wma_dfs_radar_channel_list - dfs radar channel list
1830 * @nchannels: nuber of channels
1831 * @channels: Channel number including bonded channels on which
1832 * radar is present
1833 */
1834struct wma_dfs_radar_channel_list {
1835 A_UINT32 nchannels;
1836 uint8_t channels[WMA_DFS_MAX_20M_SUB_CH];
1837};
1838
1839/**
1840 * struct wma_dfs_radar_indication - Structure to indicate RADAR
1841 * @vdev_id: vdev id
1842 * @chan_list: Channel list on which RADAR is detected
1843 * @dfs_radar_status: Flag to Indicate RADAR presence on the current channel
1844 * @use_nol: Flag to indicate use NOL
1845 */
1846struct wma_dfs_radar_indication {
1847 A_UINT32 vdev_id;
1848 struct wma_dfs_radar_channel_list chan_list;
1849 uint32_t dfs_radar_status;
1850 int use_nol;
1851};
1852
1853/**
1854 * enum uapsd_ac - U-APSD Access Categories
1855 * @UAPSD_BE: best effort
1856 * @UAPSD_BK: back ground
1857 * @UAPSD_VI: video
1858 * @UAPSD_VO: voice
1859 */
1860enum uapsd_ac {
1861 UAPSD_BE,
1862 UAPSD_BK,
1863 UAPSD_VI,
1864 UAPSD_VO
1865};
1866
1867CDF_STATUS wma_disable_uapsd_per_ac(tp_wma_handle wma_handle,
1868 uint32_t vdev_id, enum uapsd_ac ac);
1869
1870/**
1871 * enum uapsd_up - U-APSD User Priorities
1872 * @UAPSD_UP_BE: best effort
1873 * @UAPSD_UP_BK: back ground
1874 * @UAPSD_UP_RESV: reserve
1875 * @UAPSD_UP_EE: Excellent Effort
1876 * @UAPSD_UP_CL: Critical Applications
1877 * @UAPSD_UP_VI: video
1878 * @UAPSD_UP_VO: voice
1879 * @UAPSD_UP_NC: Network Control
1880 */
1881enum uapsd_up {
1882 UAPSD_UP_BE,
1883 UAPSD_UP_BK,
1884 UAPSD_UP_RESV,
1885 UAPSD_UP_EE,
1886 UAPSD_UP_CL,
1887 UAPSD_UP_VI,
1888 UAPSD_UP_VO,
1889 UAPSD_UP_NC,
1890 UAPSD_UP_MAX
1891};
1892
1893/**
1894 * struct wma_unit_test_cmd - unit test command parameters
1895 * @vdev_id: vdev id
1896 * @module_id: module id
1897 * @num_args: number of arguments
1898 * @args: arguments
1899 */
1900typedef struct wma_unit_test_cmd {
1901 uint32_t vdev_id;
1902 WLAN_MODULE_ID module_id;
1903 uint32_t num_args;
1904 uint32_t args[WMA_MAX_NUM_ARGS];
1905} t_wma_unit_test_cmd;
1906
1907/**
1908 * struct wma_roam_invoke_cmd - roam invoke command
1909 * @vdev_id: vdev id
1910 * @bssid: mac address
1911 * @channel: channel
1912 */
1913struct wma_roam_invoke_cmd {
1914 uint32_t vdev_id;
1915 uint8_t bssid[IEEE80211_ADDR_LEN];
1916 uint32_t channel;
1917};
1918
1919/**
1920 * struct wma_process_fw_event_params - fw event parameters
1921 * @wmi_handle: wmi handle
1922 * @evt_buf: event buffer
1923 */
1924typedef struct {
1925 void *wmi_handle;
1926 void *evt_buf;
1927} wma_process_fw_event_params;
1928
1929int wma_process_fw_event_handler(struct wmi_unified *wmi_handle,
1930 wmi_buf_t evt_buf);
1931
1932A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
1933 eCsrEncryptionType encr);
1934A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
1935
1936/*
1937 * WMA-DFS Hooks
1938 */
1939int ol_if_dfs_attach(struct ieee80211com *ic, void *ptr, void *radar_info);
1940uint64_t ol_if_get_tsf64(struct ieee80211com *ic);
1941int ol_if_dfs_disable(struct ieee80211com *ic);
Chandrasekaran, Manishekar22a7e1e2015-11-05 10:38:49 +05301942struct dfs_ieee80211_channel *ieee80211_find_channel(struct ieee80211com *ic,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001943 int freq, uint32_t flags);
1944int ol_if_dfs_enable(struct ieee80211com *ic, int *is_fastclk, void *pe);
1945uint32_t ieee80211_ieee2mhz(uint32_t chan, uint32_t flags);
1946int ol_if_dfs_get_ext_busy(struct ieee80211com *ic);
1947int ol_if_dfs_get_mib_cycle_counts_pct(struct ieee80211com *ic,
1948 uint32_t *rxc_pcnt, uint32_t *rxf_pcnt,
1949 uint32_t *txf_pcnt);
1950uint16_t ol_if_dfs_usenol(struct ieee80211com *ic);
1951void ieee80211_mark_dfs(struct ieee80211com *ic,
Chandrasekaran, Manishekar22a7e1e2015-11-05 10:38:49 +05301952 struct dfs_ieee80211_channel *ichan);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001953int wma_dfs_indicate_radar(struct ieee80211com *ic,
Chandrasekaran, Manishekar22a7e1e2015-11-05 10:38:49 +05301954 struct dfs_ieee80211_channel *ichan);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001955uint16_t dfs_usenol(struct ieee80211com *ic);
1956
1957CDF_STATUS wma_trigger_uapsd_params(tp_wma_handle wma_handle, uint32_t vdev_id,
1958 tp_wma_trigger_uapsd_params
1959 trigger_uapsd_params);
1960
1961/* added to get average snr for both data and beacon */
1962CDF_STATUS wma_send_snr_request(tp_wma_handle wma_handle, void *pGetRssiReq);
1963
1964
1965CDF_STATUS wma_update_vdev_tbl(tp_wma_handle wma_handle, uint8_t vdev_id,
1966 ol_txrx_vdev_handle tx_rx_vdev_handle,
1967 uint8_t *mac, uint32_t vdev_type, bool add_del);
1968
1969void wma_send_flush_logs_to_fw(tp_wma_handle wma_handle);
1970void wma_log_completion_timeout(void *data);
1971
1972CDF_STATUS wma_set_rssi_monitoring(tp_wma_handle wma,
1973 struct rssi_monitor_req *req);
1974
1975CDF_STATUS wma_send_soc_set_pcl_cmd(tp_wma_handle wma_handle,
1976 struct sir_pcl_list *msg);
1977
1978CDF_STATUS wma_send_soc_set_hw_mode_cmd(tp_wma_handle wma_handle,
1979 struct sir_hw_mode *msg);
1980CDF_STATUS wma_get_scan_id(uint32_t *scan_id);
1981
1982CDF_STATUS wma_send_soc_set_dual_mac_config(tp_wma_handle wma_handle,
1983 struct sir_dual_mac_config *msg);
1984int wma_crash_inject(tp_wma_handle wma_handle, uint32_t type,
1985 uint32_t delay_time_ms);
1986
1987struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
1988 uint8_t vdev_id,
1989 uint32_t msg_type, uint8_t type,
1990 void *params, uint32_t timeout);
1991struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
1992 uint8_t vdev_id, uint32_t msg_type,
1993 uint8_t type, void *params,
1994 uint32_t timeout);
1995
1996CDF_STATUS wma_vdev_start(tp_wma_handle wma,
1997 struct wma_vdev_start_req *req, bool isRestart);
1998
1999void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
2000 uint8_t type);
2001
2002int wmi_desc_pool_init(tp_wma_handle wma_handle, uint32_t pool_size);
2003void wmi_desc_pool_deinit(tp_wma_handle wma_handle);
2004struct wmi_desc_t *wmi_desc_get(tp_wma_handle wma_handle);
2005void wmi_desc_put(tp_wma_handle wma_handle, struct wmi_desc_t *wmi_desc);
2006int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
2007 uint32_t len);
2008void wma_set_dfs_region(tp_wma_handle wma, uint8_t dfs_region);
Naveen Rawatc0c91cd2015-11-05 14:27:37 -08002009uint32_t wma_get_vht_ch_width(void);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002010
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002011#ifdef FEATURE_LFR_SUBNET_DETECTION
2012CDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
2013 struct gateway_param_update_req *req);
2014#else
2015static inline CDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
2016 struct gateway_param_update_req *req)
2017{
2018 return CDF_STATUS_SUCCESS;
2019}
2020#endif /* FEATURE_LFR_SUBNET_DETECTION */
2021
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002022#if defined(FEATURE_LRO)
2023CDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
2024 struct wma_lro_config_cmd_t *wma_lro_cmd);
2025#else
2026static inline CDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
2027 struct wma_lro_config_cmd_t *wma_lro_cmd)
2028{
2029 return CDF_STATUS_SUCCESS;
2030}
2031#endif
2032#endif