1*30519460SAditya Srivastava /*
2dad0d04fSFariya Fatima * Copyright (c) 2014 Redpine Signals Inc.
3dad0d04fSFariya Fatima *
4dad0d04fSFariya Fatima * Permission to use, copy, modify, and/or distribute this software for any
5dad0d04fSFariya Fatima * purpose with or without fee is hereby granted, provided that the above
6dad0d04fSFariya Fatima * copyright notice and this permission notice appear in all copies.
7dad0d04fSFariya Fatima *
8dad0d04fSFariya Fatima * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9dad0d04fSFariya Fatima * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10dad0d04fSFariya Fatima * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11dad0d04fSFariya Fatima * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12dad0d04fSFariya Fatima * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13dad0d04fSFariya Fatima * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14dad0d04fSFariya Fatima * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15dad0d04fSFariya Fatima */
16dad0d04fSFariya Fatima
17dad0d04fSFariya Fatima #ifndef __RSI_MGMT_H__
18dad0d04fSFariya Fatima #define __RSI_MGMT_H__
19dad0d04fSFariya Fatima
20dad0d04fSFariya Fatima #include <linux/sort.h>
21dad0d04fSFariya Fatima #include "rsi_boot_params.h"
22dad0d04fSFariya Fatima #include "rsi_main.h"
23dad0d04fSFariya Fatima
24dad0d04fSFariya Fatima #define MAX_MGMT_PKT_SIZE 512
25abbe87d3SAmol Hanwate #define RSI_NEEDED_HEADROOM 84
26dad0d04fSFariya Fatima #define RSI_RCV_BUFFER_LEN 2000
27dad0d04fSFariya Fatima
28dad0d04fSFariya Fatima #define RSI_11B_MODE 0
29dad0d04fSFariya Fatima #define RSI_11G_MODE BIT(7)
30dad0d04fSFariya Fatima #define RETRY_COUNT 8
31dad0d04fSFariya Fatima #define RETRY_LONG 4
32dad0d04fSFariya Fatima #define RETRY_SHORT 7
33dad0d04fSFariya Fatima #define WMM_SHORT_SLOT_TIME 9
34dad0d04fSFariya Fatima #define SIFS_DURATION 16
35dad0d04fSFariya Fatima
364fd6c476SPrameela Rani Garnepudi #define EAPOL4_PACKET_LEN 0x85
37dad0d04fSFariya Fatima #define KEY_TYPE_CLEAR 0
38dad0d04fSFariya Fatima #define RSI_PAIRWISE_KEY 1
39dad0d04fSFariya Fatima #define RSI_GROUP_KEY 2
40dad0d04fSFariya Fatima
41dad0d04fSFariya Fatima /* EPPROM_READ_ADDRESS */
42dad0d04fSFariya Fatima #define WLAN_MAC_EEPROM_ADDR 40
43dad0d04fSFariya Fatima #define WLAN_MAC_MAGIC_WORD_LEN 0x01
44dad0d04fSFariya Fatima #define WLAN_HOST_MODE_LEN 0x04
45dad0d04fSFariya Fatima #define WLAN_FW_VERSION_LEN 0x08
46dad0d04fSFariya Fatima #define MAGIC_WORD 0x5A
4709cfb41fSPrameela Rani Garnepudi #define WLAN_EEPROM_RFTYPE_ADDR 424
48dad0d04fSFariya Fatima
49f3ac4e73SKarun Eagalapati /*WOWLAN RESUME WAKEUP TYPES*/
50f3ac4e73SKarun Eagalapati #define RSI_UNICAST_MAGIC_PKT BIT(0)
51f3ac4e73SKarun Eagalapati #define RSI_BROADCAST_MAGICPKT BIT(1)
52f3ac4e73SKarun Eagalapati #define RSI_EAPOL_PKT BIT(2)
53f3ac4e73SKarun Eagalapati #define RSI_DISCONNECT_PKT BIT(3)
54f3ac4e73SKarun Eagalapati #define RSI_HW_BMISS_PKT BIT(4)
55f3ac4e73SKarun Eagalapati #define RSI_INSERT_SEQ_IN_FW BIT(2)
56f3ac4e73SKarun Eagalapati
57f3ac4e73SKarun Eagalapati #define WOW_MAX_FILTERS_PER_LIST 16
58f3ac4e73SKarun Eagalapati #define WOW_PATTERN_SIZE 256
59f3ac4e73SKarun Eagalapati
60dad0d04fSFariya Fatima /* Receive Frame Types */
612108df3cSPrameela Rani Garnepudi #define RSI_RX_DESC_MSG_TYPE_OFFSET 2
62dad0d04fSFariya Fatima #define TA_CONFIRM_TYPE 0x01
63dad0d04fSFariya Fatima #define RX_DOT11_MGMT 0x02
64dad0d04fSFariya Fatima #define TX_STATUS_IND 0x04
65d26a9559SPrameela Rani Garnepudi #define BEACON_EVENT_IND 0x08
664fd6c476SPrameela Rani Garnepudi #define EAPOL4_CONFIRM 1
67dad0d04fSFariya Fatima #define PROBEREQ_CONFIRM 2
68dad0d04fSFariya Fatima #define CARD_READY_IND 0x00
692108df3cSPrameela Rani Garnepudi #define SLEEP_NOTIFY_IND 0x06
704fd6c476SPrameela Rani Garnepudi #define RSI_TX_STATUS_TYPE 15
714fd6c476SPrameela Rani Garnepudi #define RSI_TX_STATUS 12
72dad0d04fSFariya Fatima
73dad0d04fSFariya Fatima #define RSI_DELETE_PEER 0x0
74dad0d04fSFariya Fatima #define RSI_ADD_PEER 0x1
75dad0d04fSFariya Fatima #define START_AMPDU_AGGR 0x1
76dad0d04fSFariya Fatima #define STOP_AMPDU_AGGR 0x0
77dad0d04fSFariya Fatima #define INTERNAL_MGMT_PKT 0x99
78dad0d04fSFariya Fatima
79dad0d04fSFariya Fatima #define PUT_BBP_RESET 0
80dad0d04fSFariya Fatima #define BBP_REG_WRITE 0
81dad0d04fSFariya Fatima #define RF_RESET_ENABLE BIT(3)
82dad0d04fSFariya Fatima #define RATE_INFO_ENABLE BIT(0)
8319844c0aSPrameela Rani Garnepudi #define MORE_DATA_PRESENT BIT(1)
84dad0d04fSFariya Fatima #define RSI_BROADCAST_PKT BIT(9)
856507de6dSPrameela Rani Garnepudi #define RSI_DESC_REQUIRE_CFM_TO_HOST BIT(2)
860eb42586SPavani Muthyala #define RSI_ADD_DELTA_TSF_VAP_ID BIT(3)
870eb42586SPavani Muthyala #define RSI_FETCH_RETRY_CNT_FRM_HST BIT(4)
88af193097SPavani Muthyala #define RSI_QOS_ENABLE BIT(12)
890eb42586SPavani Muthyala #define RSI_REKEY_PURPOSE BIT(13)
90af193097SPavani Muthyala #define RSI_ENCRYPT_PKT BIT(15)
91ce86893fSKarun Eagalapati #define RSI_SET_PS_ENABLE BIT(12)
92dad0d04fSFariya Fatima
936abdf2c1SPrameela Rani Garnepudi #define RSI_CMDDESC_40MHZ BIT(4)
946abdf2c1SPrameela Rani Garnepudi #define RSI_CMDDESC_UPPER_20_ENABLE BIT(5)
956abdf2c1SPrameela Rani Garnepudi #define RSI_CMDDESC_LOWER_20_ENABLE BIT(6)
966abdf2c1SPrameela Rani Garnepudi #define RSI_CMDDESC_FULL_40_ENABLE (BIT(5) | BIT(6))
97dad0d04fSFariya Fatima #define UPPER_20_ENABLE (0x2 << 12)
98dad0d04fSFariya Fatima #define LOWER_20_ENABLE (0x4 << 12)
99dad0d04fSFariya Fatima #define FULL40M_ENABLE 0x6
100dad0d04fSFariya Fatima
101dad0d04fSFariya Fatima #define RSI_LMAC_CLOCK_80MHZ 0x1
102dad0d04fSFariya Fatima #define RSI_ENABLE_40MHZ (0x1 << 3)
1032bfa6969SJahnavi Meher #define ENABLE_SHORTGI_RATE BIT(9)
104dad0d04fSFariya Fatima
105dad0d04fSFariya Fatima #define RX_BA_INDICATION 1
106dad0d04fSFariya Fatima #define RSI_TBL_SZ 40
107dad0d04fSFariya Fatima #define MAX_RETRIES 8
10848d11dc3SJahnavi Meher #define RSI_IFTYPE_STATION 0
109dad0d04fSFariya Fatima
110dad0d04fSFariya Fatima #define STD_RATE_MCS7 0x07
111dad0d04fSFariya Fatima #define STD_RATE_MCS6 0x06
112dad0d04fSFariya Fatima #define STD_RATE_MCS5 0x05
113dad0d04fSFariya Fatima #define STD_RATE_MCS4 0x04
114dad0d04fSFariya Fatima #define STD_RATE_MCS3 0x03
115dad0d04fSFariya Fatima #define STD_RATE_MCS2 0x02
116dad0d04fSFariya Fatima #define STD_RATE_MCS1 0x01
117dad0d04fSFariya Fatima #define STD_RATE_MCS0 0x00
118dad0d04fSFariya Fatima #define STD_RATE_54 0x6c
119dad0d04fSFariya Fatima #define STD_RATE_48 0x60
120dad0d04fSFariya Fatima #define STD_RATE_36 0x48
121dad0d04fSFariya Fatima #define STD_RATE_24 0x30
122dad0d04fSFariya Fatima #define STD_RATE_18 0x24
123dad0d04fSFariya Fatima #define STD_RATE_12 0x18
124dad0d04fSFariya Fatima #define STD_RATE_11 0x16
125dad0d04fSFariya Fatima #define STD_RATE_09 0x12
126dad0d04fSFariya Fatima #define STD_RATE_06 0x0C
127dad0d04fSFariya Fatima #define STD_RATE_5_5 0x0B
128dad0d04fSFariya Fatima #define STD_RATE_02 0x04
129dad0d04fSFariya Fatima #define STD_RATE_01 0x02
130dad0d04fSFariya Fatima
131dad0d04fSFariya Fatima #define RSI_RF_TYPE 1
132dad0d04fSFariya Fatima #define RSI_RATE_00 0x00
133dad0d04fSFariya Fatima #define RSI_RATE_1 0x0
134dad0d04fSFariya Fatima #define RSI_RATE_2 0x2
135dad0d04fSFariya Fatima #define RSI_RATE_5_5 0x4
136dad0d04fSFariya Fatima #define RSI_RATE_11 0x6
137dad0d04fSFariya Fatima #define RSI_RATE_6 0x8b
138dad0d04fSFariya Fatima #define RSI_RATE_9 0x8f
139dad0d04fSFariya Fatima #define RSI_RATE_12 0x8a
140dad0d04fSFariya Fatima #define RSI_RATE_18 0x8e
141dad0d04fSFariya Fatima #define RSI_RATE_24 0x89
142dad0d04fSFariya Fatima #define RSI_RATE_36 0x8d
143dad0d04fSFariya Fatima #define RSI_RATE_48 0x88
144dad0d04fSFariya Fatima #define RSI_RATE_54 0x8c
145dad0d04fSFariya Fatima #define RSI_RATE_MCS0 0x100
146dad0d04fSFariya Fatima #define RSI_RATE_MCS1 0x101
147dad0d04fSFariya Fatima #define RSI_RATE_MCS2 0x102
148dad0d04fSFariya Fatima #define RSI_RATE_MCS3 0x103
149dad0d04fSFariya Fatima #define RSI_RATE_MCS4 0x104
150dad0d04fSFariya Fatima #define RSI_RATE_MCS5 0x105
151dad0d04fSFariya Fatima #define RSI_RATE_MCS6 0x106
152dad0d04fSFariya Fatima #define RSI_RATE_MCS7 0x107
153dad0d04fSFariya Fatima #define RSI_RATE_MCS7_SG 0x307
154af193097SPavani Muthyala #define RSI_RATE_AUTO 0xffff
155dad0d04fSFariya Fatima
156dad0d04fSFariya Fatima #define BW_20MHZ 0
157dad0d04fSFariya Fatima #define BW_40MHZ 1
158dad0d04fSFariya Fatima
159f870a340SJahnavi Meher #define EP_2GHZ_20MHZ 0
160f870a340SJahnavi Meher #define EP_2GHZ_40MHZ 1
161f870a340SJahnavi Meher #define EP_5GHZ_20MHZ 2
162f870a340SJahnavi Meher #define EP_5GHZ_40MHZ 3
163f870a340SJahnavi Meher
1644550faacSJahnavi Meher #define SIFS_TX_11N_VALUE 580
1654550faacSJahnavi Meher #define SIFS_TX_11B_VALUE 346
1664550faacSJahnavi Meher #define SHORT_SLOT_VALUE 360
1674550faacSJahnavi Meher #define LONG_SLOT_VALUE 640
1684550faacSJahnavi Meher #define OFDM_ACK_TOUT_VALUE 2720
1694550faacSJahnavi Meher #define CCK_ACK_TOUT_VALUE 9440
1704550faacSJahnavi Meher #define LONG_PREAMBLE 0x0000
1714550faacSJahnavi Meher #define SHORT_PREAMBLE 0x0001
1724550faacSJahnavi Meher
173dad0d04fSFariya Fatima #define RSI_SUPP_FILTERS (FIF_ALLMULTI | FIF_PROBE_REQ |\
174dad0d04fSFariya Fatima FIF_BCN_PRBRESP_PROMISC)
175e6d64284SPrameela Rani Garnepudi
1764edbcd1aSPrameela Rani Garnepudi #define ANTENNA_SEL_INT 0x02 /* RF_OUT_2 / Integerated */
1774edbcd1aSPrameela Rani Garnepudi #define ANTENNA_SEL_UFL 0x03 /* RF_OUT_1 / U.FL */
178588349a1SPavani Muthyala #define ANTENNA_MASK_VALUE 0x00ff
179588349a1SPavani Muthyala #define ANTENNA_SEL_TYPE 1
1804edbcd1aSPrameela Rani Garnepudi
181e6d64284SPrameela Rani Garnepudi /* Rx filter word definitions */
182e6d64284SPrameela Rani Garnepudi #define PROMISCOUS_MODE BIT(0)
183e6d64284SPrameela Rani Garnepudi #define ALLOW_DATA_ASSOC_PEER BIT(1)
184e6d64284SPrameela Rani Garnepudi #define ALLOW_MGMT_ASSOC_PEER BIT(2)
185e6d64284SPrameela Rani Garnepudi #define ALLOW_CTRL_ASSOC_PEER BIT(3)
186e6d64284SPrameela Rani Garnepudi #define DISALLOW_BEACONS BIT(4)
187e6d64284SPrameela Rani Garnepudi #define ALLOW_CONN_PEER_MGMT_WHILE_BUF_FULL BIT(5)
188e6d64284SPrameela Rani Garnepudi #define DISALLOW_BROADCAST_DATA BIT(6)
189e6d64284SPrameela Rani Garnepudi
19059e006dcSPrameela Rani Garnepudi #define RSI_MPDU_DENSITY 0x8
191f04854faSPrameela Rani Garnepudi #define RSI_CHAN_RADAR BIT(7)
192de1d1813SPrameela Rani Garnepudi #define RSI_BEACON_INTERVAL 200
193de1d1813SPrameela Rani Garnepudi #define RSI_DTIM_COUNT 2
19459e006dcSPrameela Rani Garnepudi
195ce86893fSKarun Eagalapati #define RSI_PS_DISABLE_IND BIT(15)
196ce86893fSKarun Eagalapati #define RSI_PS_ENABLE 1
197ce86893fSKarun Eagalapati #define RSI_PS_DISABLE 0
198ce86893fSKarun Eagalapati #define RSI_DEEP_SLEEP 1
199ce86893fSKarun Eagalapati #define RSI_CONNECTED_SLEEP 2
200ce86893fSKarun Eagalapati #define RSI_SLEEP_REQUEST 1
201ce86893fSKarun Eagalapati #define RSI_WAKEUP_REQUEST 2
202ce86893fSKarun Eagalapati
203db07971dSKarun Eagalapati #define RSI_IEEE80211_UAPSD_QUEUES \
204db07971dSKarun Eagalapati (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO | \
205db07971dSKarun Eagalapati IEEE80211_WMM_IE_STA_QOSINFO_AC_VI | \
206db07971dSKarun Eagalapati IEEE80211_WMM_IE_STA_QOSINFO_AC_BE | \
207db07971dSKarun Eagalapati IEEE80211_WMM_IE_STA_QOSINFO_AC_BK)
208db07971dSKarun Eagalapati
209a39644b2SArnd Bergmann #define RSI_DESC_VAP_ID_MASK 0xC000u
2104671c209SPrameela Rani Garnepudi #define RSI_DESC_VAP_ID_OFST 14
211d26a9559SPrameela Rani Garnepudi #define RSI_DATA_DESC_MAC_BBP_INFO BIT(0)
212d26a9559SPrameela Rani Garnepudi #define RSI_DATA_DESC_NO_ACK_IND BIT(9)
213d26a9559SPrameela Rani Garnepudi #define RSI_DATA_DESC_QOS_EN BIT(12)
214d26a9559SPrameela Rani Garnepudi #define RSI_DATA_DESC_NORMAL_FRAME 0x00
215d26a9559SPrameela Rani Garnepudi #define RSI_DATA_DESC_DTIM_BEACON_GATED_FRAME BIT(10)
216d26a9559SPrameela Rani Garnepudi #define RSI_DATA_DESC_BEACON_FRAME BIT(11)
217d26a9559SPrameela Rani Garnepudi #define RSI_DATA_DESC_DTIM_BEACON (BIT(10) | BIT(11))
218d26a9559SPrameela Rani Garnepudi #define RSI_DATA_DESC_INSERT_TSF BIT(15)
219d26a9559SPrameela Rani Garnepudi #define RSI_DATA_DESC_INSERT_SEQ_NO BIT(2)
220d26a9559SPrameela Rani Garnepudi
221f3ac4e73SKarun Eagalapati #ifdef CONFIG_PM
222f3ac4e73SKarun Eagalapati #define RSI_WOW_ANY BIT(1)
223f3ac4e73SKarun Eagalapati #define RSI_WOW_GTK_REKEY BIT(3)
224f3ac4e73SKarun Eagalapati #define RSI_WOW_MAGIC_PKT BIT(4)
225f3ac4e73SKarun Eagalapati #define RSI_WOW_DISCONNECT BIT(5)
226f3ac4e73SKarun Eagalapati #endif
227f3ac4e73SKarun Eagalapati
228a55e50f0SAmitkumar Karwar #define RSI_MAX_TX_AGGR_FRMS 8
229a55e50f0SAmitkumar Karwar #define RSI_MAX_RX_AGGR_FRMS 8
230a55e50f0SAmitkumar Karwar
2317fdcb8e1SPrameela Rani Garnepudi #define RSI_MAX_SCAN_SSIDS 16
2327fdcb8e1SPrameela Rani Garnepudi #define RSI_MAX_SCAN_IE_LEN 256
2337fdcb8e1SPrameela Rani Garnepudi
234dad0d04fSFariya Fatima enum opmode {
235b8bd3a43SPrameela Rani Garnepudi RSI_OPMODE_UNSUPPORTED = -1,
236b8bd3a43SPrameela Rani Garnepudi RSI_OPMODE_AP = 0,
237b8bd3a43SPrameela Rani Garnepudi RSI_OPMODE_STA,
238b8bd3a43SPrameela Rani Garnepudi RSI_OPMODE_P2P_GO,
239b8bd3a43SPrameela Rani Garnepudi RSI_OPMODE_P2P_CLIENT
240dad0d04fSFariya Fatima };
241dad0d04fSFariya Fatima
24277364aaeSPrameela Rani Garnepudi enum vap_status {
24377364aaeSPrameela Rani Garnepudi VAP_ADD = 1,
24477364aaeSPrameela Rani Garnepudi VAP_DELETE = 2,
24577364aaeSPrameela Rani Garnepudi VAP_UPDATE = 3
24677364aaeSPrameela Rani Garnepudi };
24777364aaeSPrameela Rani Garnepudi
2483528608fSPrameela Rani Garnepudi enum peer_type {
2493528608fSPrameela Rani Garnepudi PEER_TYPE_AP,
2503528608fSPrameela Rani Garnepudi PEER_TYPE_STA,
2513528608fSPrameela Rani Garnepudi };
252dad0d04fSFariya Fatima extern struct ieee80211_rate rsi_rates[12];
253dad0d04fSFariya Fatima extern const u16 rsi_mcsrates[8];
254dad0d04fSFariya Fatima
255dad0d04fSFariya Fatima enum sta_notify_events {
256dad0d04fSFariya Fatima STA_CONNECTED = 0,
257dad0d04fSFariya Fatima STA_DISCONNECTED,
258dad0d04fSFariya Fatima STA_TX_ADDBA_DONE,
259dad0d04fSFariya Fatima STA_TX_DELBA,
260dad0d04fSFariya Fatima STA_RX_ADDBA_DONE,
261dad0d04fSFariya Fatima STA_RX_DELBA
262dad0d04fSFariya Fatima };
263dad0d04fSFariya Fatima
264dad0d04fSFariya Fatima /* Send Frames Types */
265dad0d04fSFariya Fatima enum cmd_frame_type {
266dad0d04fSFariya Fatima TX_DOT11_MGMT,
267dad0d04fSFariya Fatima RESET_MAC_REQ,
268dad0d04fSFariya Fatima RADIO_CAPABILITIES,
269dad0d04fSFariya Fatima BB_PROG_VALUES_REQUEST,
270dad0d04fSFariya Fatima RF_PROG_VALUES_REQUEST,
271dad0d04fSFariya Fatima WAKEUP_SLEEP_REQUEST,
272dad0d04fSFariya Fatima SCAN_REQUEST,
273dad0d04fSFariya Fatima TSF_UPDATE,
274dad0d04fSFariya Fatima PEER_NOTIFY,
275686a2541SJahnavi Meher BLOCK_HW_QUEUE,
276dad0d04fSFariya Fatima SET_KEY_REQ,
277dad0d04fSFariya Fatima AUTO_RATE_IND,
278dad0d04fSFariya Fatima BOOTUP_PARAMS_REQUEST,
279dad0d04fSFariya Fatima VAP_CAPABILITIES,
28009cfb41fSPrameela Rani Garnepudi EEPROM_READ,
281dad0d04fSFariya Fatima EEPROM_WRITE,
282dad0d04fSFariya Fatima GPIO_PIN_CONFIG ,
283dad0d04fSFariya Fatima SET_RX_FILTER,
284dad0d04fSFariya Fatima AMPDU_IND,
285dad0d04fSFariya Fatima STATS_REQUEST_FRAME,
286dad0d04fSFariya Fatima BB_BUF_PROG_VALUES_REQ,
287dad0d04fSFariya Fatima BBP_PROG_IN_TA,
288dad0d04fSFariya Fatima BG_SCAN_PARAMS,
289dad0d04fSFariya Fatima BG_SCAN_PROBE_REQ,
290dad0d04fSFariya Fatima CW_MODE_REQ,
2918b36de8cSPrameela Rani Garnepudi PER_CMD_PKT,
2924edbcd1aSPrameela Rani Garnepudi ANT_SEL_FRAME = 0x20,
29380a88ecfSKarun Eagalapati VAP_DYNAMIC_UPDATE = 0x27,
2949920322cSPrameela Rani Garnepudi COMMON_DEV_CONFIG = 0x28,
295f3ac4e73SKarun Eagalapati RADIO_PARAMS_UPDATE = 0x29,
296f3ac4e73SKarun Eagalapati WOWLAN_CONFIG_PARAMS = 0x2B,
2971533f976SSiva Rebbagondla FEATURES_ENABLE = 0x33,
298f3ac4e73SKarun Eagalapati WOWLAN_WAKEUP_REASON = 0xc5
299dad0d04fSFariya Fatima };
300dad0d04fSFariya Fatima
301dad0d04fSFariya Fatima struct rsi_mac_frame {
302dad0d04fSFariya Fatima __le16 desc_word[8];
303dad0d04fSFariya Fatima } __packed;
304dad0d04fSFariya Fatima
3056c8ab76dSPrameela Rani Garnepudi #define PWR_SAVE_WAKEUP_IND BIT(0)
3066c8ab76dSPrameela Rani Garnepudi #define TCP_CHECK_SUM_OFFLOAD BIT(1)
3076c8ab76dSPrameela Rani Garnepudi #define CONFIRM_REQUIRED_TO_HOST BIT(2)
3086c8ab76dSPrameela Rani Garnepudi #define ADD_DELTA_TSF BIT(3)
3096c8ab76dSPrameela Rani Garnepudi #define FETCH_RETRY_CNT_FROM_HOST_DESC BIT(4)
3106c8ab76dSPrameela Rani Garnepudi #define EOSP_INDICATION BIT(5)
3116c8ab76dSPrameela Rani Garnepudi #define REQUIRE_TSF_SYNC_CONFIRM BIT(6)
3126c8ab76dSPrameela Rani Garnepudi #define ENCAP_MGMT_PKT BIT(7)
3139a629fafSPrameela Rani Garnepudi #define DESC_IMMEDIATE_WAKEUP BIT(15)
3146c8ab76dSPrameela Rani Garnepudi
3155dc36387SPrameela Rani Garnepudi struct rsi_xtended_desc {
3165dc36387SPrameela Rani Garnepudi u8 confirm_frame_type;
3175dc36387SPrameela Rani Garnepudi u8 retry_cnt;
3185dc36387SPrameela Rani Garnepudi u16 reserved;
3195dc36387SPrameela Rani Garnepudi };
3205dc36387SPrameela Rani Garnepudi
3216c8ab76dSPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 {
3226c8ab76dSPrameela Rani Garnepudi __le16 len_qno;
3236c8ab76dSPrameela Rani Garnepudi u8 frame_type;
3246c8ab76dSPrameela Rani Garnepudi u8 misc_flags;
3256c8ab76dSPrameela Rani Garnepudi };
3266c8ab76dSPrameela Rani Garnepudi
3276c8ab76dSPrameela Rani Garnepudi struct rsi_cmd_desc_dword1 {
3286c8ab76dSPrameela Rani Garnepudi u8 xtend_desc_size;
3296c8ab76dSPrameela Rani Garnepudi u8 reserved1;
3306c8ab76dSPrameela Rani Garnepudi __le16 reserved2;
3316c8ab76dSPrameela Rani Garnepudi };
3326c8ab76dSPrameela Rani Garnepudi
3336c8ab76dSPrameela Rani Garnepudi struct rsi_cmd_desc_dword2 {
3346c8ab76dSPrameela Rani Garnepudi __le32 pkt_info; /* Packet specific data */
3356c8ab76dSPrameela Rani Garnepudi };
3366c8ab76dSPrameela Rani Garnepudi
3376c8ab76dSPrameela Rani Garnepudi struct rsi_cmd_desc_dword3 {
3386c8ab76dSPrameela Rani Garnepudi __le16 token;
3396c8ab76dSPrameela Rani Garnepudi u8 qid_tid;
3406c8ab76dSPrameela Rani Garnepudi u8 sta_id;
3416c8ab76dSPrameela Rani Garnepudi };
3426c8ab76dSPrameela Rani Garnepudi
3436c8ab76dSPrameela Rani Garnepudi struct rsi_cmd_desc {
3446c8ab76dSPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword0;
3456c8ab76dSPrameela Rani Garnepudi struct rsi_cmd_desc_dword1 desc_dword1;
3466c8ab76dSPrameela Rani Garnepudi struct rsi_cmd_desc_dword2 desc_dword2;
3476c8ab76dSPrameela Rani Garnepudi struct rsi_cmd_desc_dword3 desc_dword3;
3486c8ab76dSPrameela Rani Garnepudi };
3496c8ab76dSPrameela Rani Garnepudi
350dad0d04fSFariya Fatima struct rsi_boot_params {
351dad0d04fSFariya Fatima __le16 desc_word[8];
352dad0d04fSFariya Fatima struct bootup_params bootup_params;
353dad0d04fSFariya Fatima } __packed;
354dad0d04fSFariya Fatima
355f911c861SSiva Rebbagondla struct rsi_boot_params_9116 {
356f911c861SSiva Rebbagondla struct rsi_cmd_desc_dword0 desc_dword0;
357f911c861SSiva Rebbagondla struct rsi_cmd_desc_dword1 desc_dword1;
358f911c861SSiva Rebbagondla struct rsi_cmd_desc_dword2 desc_dword2;
359f911c861SSiva Rebbagondla __le16 reserved;
360f911c861SSiva Rebbagondla __le16 umac_clk;
361f911c861SSiva Rebbagondla struct bootup_params_9116 bootup_params;
362f911c861SSiva Rebbagondla } __packed;
363f911c861SSiva Rebbagondla
364dad0d04fSFariya Fatima struct rsi_peer_notify {
36559e006dcSPrameela Rani Garnepudi struct rsi_cmd_desc desc;
366dad0d04fSFariya Fatima u8 mac_addr[6];
367dad0d04fSFariya Fatima __le16 command;
368dad0d04fSFariya Fatima __le16 mpdu_density;
369dad0d04fSFariya Fatima __le16 reserved;
370dad0d04fSFariya Fatima __le32 sta_flags;
371dad0d04fSFariya Fatima } __packed;
372dad0d04fSFariya Fatima
3733a9828c9SPrameela Rani Garnepudi /* Aggregation params flags */
3743a9828c9SPrameela Rani Garnepudi #define RSI_AGGR_PARAMS_TID_MASK 0xf
3753a9828c9SPrameela Rani Garnepudi #define RSI_AGGR_PARAMS_START BIT(4)
3763a9828c9SPrameela Rani Garnepudi #define RSI_AGGR_PARAMS_RX_AGGR BIT(5)
3773a9828c9SPrameela Rani Garnepudi struct rsi_aggr_params {
3783a9828c9SPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword0;
3793a9828c9SPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword1;
3803a9828c9SPrameela Rani Garnepudi __le16 seq_start;
3813a9828c9SPrameela Rani Garnepudi __le16 baw_size;
3823a9828c9SPrameela Rani Garnepudi __le16 token;
3833a9828c9SPrameela Rani Garnepudi u8 aggr_params;
3843a9828c9SPrameela Rani Garnepudi u8 peer_id;
3853a9828c9SPrameela Rani Garnepudi } __packed;
3863a9828c9SPrameela Rani Garnepudi
3875c7ca1bbSPrameela Rani Garnepudi struct rsi_bb_rf_prog {
3885c7ca1bbSPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword0;
3895c7ca1bbSPrameela Rani Garnepudi __le16 reserved1;
3905c7ca1bbSPrameela Rani Garnepudi u8 rf_power_mode;
3915c7ca1bbSPrameela Rani Garnepudi u8 reserved2;
3925c7ca1bbSPrameela Rani Garnepudi u8 endpoint;
3935c7ca1bbSPrameela Rani Garnepudi u8 reserved3;
3945c7ca1bbSPrameela Rani Garnepudi __le16 reserved4;
3955c7ca1bbSPrameela Rani Garnepudi __le16 reserved5;
3965c7ca1bbSPrameela Rani Garnepudi __le16 flags;
3975c7ca1bbSPrameela Rani Garnepudi } __packed;
3985c7ca1bbSPrameela Rani Garnepudi
399f04854faSPrameela Rani Garnepudi struct rsi_chan_config {
400f04854faSPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword0;
401f04854faSPrameela Rani Garnepudi struct rsi_cmd_desc_dword1 desc_dword1;
402f04854faSPrameela Rani Garnepudi u8 channel_number;
403f04854faSPrameela Rani Garnepudi u8 antenna_gain_offset_2g;
404f04854faSPrameela Rani Garnepudi u8 antenna_gain_offset_5g;
405f04854faSPrameela Rani Garnepudi u8 channel_width;
406f04854faSPrameela Rani Garnepudi __le16 tx_power;
407f04854faSPrameela Rani Garnepudi u8 region_rftype;
408f04854faSPrameela Rani Garnepudi u8 flags;
409f04854faSPrameela Rani Garnepudi } __packed;
410f04854faSPrameela Rani Garnepudi
411dad0d04fSFariya Fatima struct rsi_vap_caps {
412de1d1813SPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword0;
413de1d1813SPrameela Rani Garnepudi u8 reserved1;
414de1d1813SPrameela Rani Garnepudi u8 status;
415de1d1813SPrameela Rani Garnepudi __le16 reserved2;
416de1d1813SPrameela Rani Garnepudi u8 vif_type;
417de1d1813SPrameela Rani Garnepudi u8 channel_bw;
418de1d1813SPrameela Rani Garnepudi __le16 antenna_info;
419b8bd3a43SPrameela Rani Garnepudi __le16 token;
420de1d1813SPrameela Rani Garnepudi u8 radioid_macid;
421de1d1813SPrameela Rani Garnepudi u8 vap_id;
422dad0d04fSFariya Fatima u8 mac_addr[6];
423dad0d04fSFariya Fatima __le16 keep_alive_period;
424dad0d04fSFariya Fatima u8 bssid[6];
425de1d1813SPrameela Rani Garnepudi __le16 reserved4;
426dad0d04fSFariya Fatima __le32 flags;
427dad0d04fSFariya Fatima __le16 frag_threshold;
428dad0d04fSFariya Fatima __le16 rts_threshold;
429dad0d04fSFariya Fatima __le32 default_mgmt_rate;
430de1d1813SPrameela Rani Garnepudi __le16 default_ctrl_rate;
431de1d1813SPrameela Rani Garnepudi __le16 ctrl_rate_flags;
432dad0d04fSFariya Fatima __le32 default_data_rate;
433dad0d04fSFariya Fatima __le16 beacon_interval;
434dad0d04fSFariya Fatima __le16 dtim_period;
435de1d1813SPrameela Rani Garnepudi __le16 beacon_miss_threshold;
436dad0d04fSFariya Fatima } __packed;
437dad0d04fSFariya Fatima
438588349a1SPavani Muthyala struct rsi_ant_sel_frame {
439588349a1SPavani Muthyala struct rsi_cmd_desc_dword0 desc_dword0;
440588349a1SPavani Muthyala u8 reserved;
441588349a1SPavani Muthyala u8 sub_frame_type;
442588349a1SPavani Muthyala __le16 ant_value;
443588349a1SPavani Muthyala __le32 reserved1;
444588349a1SPavani Muthyala __le32 reserved2;
445588349a1SPavani Muthyala } __packed;
446588349a1SPavani Muthyala
44780a88ecfSKarun Eagalapati struct rsi_dynamic_s {
44880a88ecfSKarun Eagalapati struct rsi_cmd_desc_dword0 desc_dword0;
44980a88ecfSKarun Eagalapati struct rsi_cmd_desc_dword1 desc_dword1;
45080a88ecfSKarun Eagalapati struct rsi_cmd_desc_dword2 desc_dword2;
45180a88ecfSKarun Eagalapati struct rsi_cmd_desc_dword3 desc_dword3;
45280a88ecfSKarun Eagalapati struct framebody {
45380a88ecfSKarun Eagalapati __le16 data_rate;
45480a88ecfSKarun Eagalapati __le16 mgmt_rate;
45580a88ecfSKarun Eagalapati __le16 keep_alive_period;
45680a88ecfSKarun Eagalapati } frame_body;
45780a88ecfSKarun Eagalapati } __packed;
45880a88ecfSKarun Eagalapati
459a84faab0SPrameela Rani Garnepudi /* Key descriptor flags */
460a84faab0SPrameela Rani Garnepudi #define RSI_KEY_TYPE_BROADCAST BIT(1)
461a84faab0SPrameela Rani Garnepudi #define RSI_WEP_KEY BIT(2)
462a84faab0SPrameela Rani Garnepudi #define RSI_WEP_KEY_104 BIT(3)
463a84faab0SPrameela Rani Garnepudi #define RSI_CIPHER_WPA BIT(4)
464a84faab0SPrameela Rani Garnepudi #define RSI_CIPHER_TKIP BIT(5)
46538ef6235SPrameela Rani Garnepudi #define RSI_KEY_MODE_AP BIT(7)
466a84faab0SPrameela Rani Garnepudi #define RSI_PROTECT_DATA_FRAMES BIT(13)
467a84faab0SPrameela Rani Garnepudi #define RSI_KEY_ID_MASK 0xC0
468a84faab0SPrameela Rani Garnepudi #define RSI_KEY_ID_OFFSET 14
469dad0d04fSFariya Fatima struct rsi_set_key {
470a84faab0SPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword0;
471a84faab0SPrameela Rani Garnepudi struct rsi_cmd_desc_dword1 desc_dword1;
472a84faab0SPrameela Rani Garnepudi __le16 key_desc;
473a84faab0SPrameela Rani Garnepudi __le32 bpn;
474a84faab0SPrameela Rani Garnepudi u8 sta_id;
475a84faab0SPrameela Rani Garnepudi u8 vap_id;
476dad0d04fSFariya Fatima u8 key[4][32];
477dad0d04fSFariya Fatima u8 tx_mic_key[8];
478dad0d04fSFariya Fatima u8 rx_mic_key[8];
479dad0d04fSFariya Fatima } __packed;
480dad0d04fSFariya Fatima
481dad0d04fSFariya Fatima struct rsi_auto_rate {
4826572f054SPrameela Rani Garnepudi struct rsi_cmd_desc desc;
483dad0d04fSFariya Fatima __le16 failure_limit;
484dad0d04fSFariya Fatima __le16 initial_boundary;
485dad0d04fSFariya Fatima __le16 max_threshold_limt;
486dad0d04fSFariya Fatima __le16 num_supported_rates;
487dad0d04fSFariya Fatima __le16 aarf_rssi;
488dad0d04fSFariya Fatima __le16 moderate_rate_inx;
489dad0d04fSFariya Fatima __le16 collision_tolerance;
490dad0d04fSFariya Fatima __le16 supported_rates[40];
491dad0d04fSFariya Fatima } __packed;
492dad0d04fSFariya Fatima
49379e590d9SPrameela Rani Garnepudi #define QUIET_INFO_VALID BIT(0)
49479e590d9SPrameela Rani Garnepudi #define QUIET_ENABLE BIT(1)
49579e590d9SPrameela Rani Garnepudi struct rsi_block_unblock_data {
49679e590d9SPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword0;
49779e590d9SPrameela Rani Garnepudi u8 xtend_desc_size;
49879e590d9SPrameela Rani Garnepudi u8 host_quiet_info;
49979e590d9SPrameela Rani Garnepudi __le16 reserved;
50079e590d9SPrameela Rani Garnepudi __le16 block_q_bitmap;
50179e590d9SPrameela Rani Garnepudi __le16 unblock_q_bitmap;
50279e590d9SPrameela Rani Garnepudi __le16 token;
50379e590d9SPrameela Rani Garnepudi __le16 flush_q_bitmap;
50479e590d9SPrameela Rani Garnepudi } __packed;
50579e590d9SPrameela Rani Garnepudi
506dad0d04fSFariya Fatima struct qos_params {
507dad0d04fSFariya Fatima __le16 cont_win_min_q;
508dad0d04fSFariya Fatima __le16 cont_win_max_q;
509dad0d04fSFariya Fatima __le16 aifsn_val_q;
510dad0d04fSFariya Fatima __le16 txop_q;
511dad0d04fSFariya Fatima } __packed;
512dad0d04fSFariya Fatima
513dad0d04fSFariya Fatima struct rsi_radio_caps {
5146abdf2c1SPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword0;
5156abdf2c1SPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword1;
5166abdf2c1SPrameela Rani Garnepudi u8 channel_num;
5176abdf2c1SPrameela Rani Garnepudi u8 rf_model;
5186abdf2c1SPrameela Rani Garnepudi __le16 ppe_ack_rate;
5196abdf2c1SPrameela Rani Garnepudi __le16 mode_11j;
5206abdf2c1SPrameela Rani Garnepudi u8 radio_cfg_info;
5216abdf2c1SPrameela Rani Garnepudi u8 radio_info;
522dad0d04fSFariya Fatima struct qos_params qos_params[MAX_HW_QUEUES];
523dad0d04fSFariya Fatima u8 num_11n_rates;
524dad0d04fSFariya Fatima u8 num_11ac_rates;
525dad0d04fSFariya Fatima __le16 gcpd_per_rate[20];
5264550faacSJahnavi Meher __le16 sifs_tx_11n;
5274550faacSJahnavi Meher __le16 sifs_tx_11b;
5284550faacSJahnavi Meher __le16 slot_rx_11n;
5294550faacSJahnavi Meher __le16 ofdm_ack_tout;
5304550faacSJahnavi Meher __le16 cck_ack_tout;
5314550faacSJahnavi Meher __le16 preamble_type;
532dad0d04fSFariya Fatima } __packed;
533dad0d04fSFariya Fatima
5349920322cSPrameela Rani Garnepudi /* ULP GPIO flags */
5359920322cSPrameela Rani Garnepudi #define RSI_GPIO_MOTION_SENSOR_ULP_WAKEUP BIT(0)
5369920322cSPrameela Rani Garnepudi #define RSI_GPIO_SLEEP_IND_FROM_DEVICE BIT(1)
5379920322cSPrameela Rani Garnepudi #define RSI_GPIO_2_ULP BIT(2)
5389920322cSPrameela Rani Garnepudi #define RSI_GPIO_PUSH_BUTTON_ULP_WAKEUP BIT(3)
5399920322cSPrameela Rani Garnepudi
5409920322cSPrameela Rani Garnepudi /* SOC GPIO flags */
5419920322cSPrameela Rani Garnepudi #define RSI_GPIO_0_PSPI_CSN_0 BIT(0)
5429920322cSPrameela Rani Garnepudi #define RSI_GPIO_1_PSPI_CSN_1 BIT(1)
5439920322cSPrameela Rani Garnepudi #define RSI_GPIO_2_HOST_WAKEUP_INTR BIT(2)
5449920322cSPrameela Rani Garnepudi #define RSI_GPIO_3_PSPI_DATA_0 BIT(3)
5459920322cSPrameela Rani Garnepudi #define RSI_GPIO_4_PSPI_DATA_1 BIT(4)
5469920322cSPrameela Rani Garnepudi #define RSI_GPIO_5_PSPI_DATA_2 BIT(5)
5479920322cSPrameela Rani Garnepudi #define RSI_GPIO_6_PSPI_DATA_3 BIT(6)
5489920322cSPrameela Rani Garnepudi #define RSI_GPIO_7_I2C_SCL BIT(7)
5499920322cSPrameela Rani Garnepudi #define RSI_GPIO_8_I2C_SDA BIT(8)
5509920322cSPrameela Rani Garnepudi #define RSI_GPIO_9_UART1_RX BIT(9)
5519920322cSPrameela Rani Garnepudi #define RSI_GPIO_10_UART1_TX BIT(10)
5529920322cSPrameela Rani Garnepudi #define RSI_GPIO_11_UART1_RTS_I2S_CLK BIT(11)
5539920322cSPrameela Rani Garnepudi #define RSI_GPIO_12_UART1_CTS_I2S_WS BIT(12)
5549920322cSPrameela Rani Garnepudi #define RSI_GPIO_13_DBG_UART_RX_I2S_DIN BIT(13)
5559920322cSPrameela Rani Garnepudi #define RSI_GPIO_14_DBG_UART_RX_I2S_DOUT BIT(14)
5569920322cSPrameela Rani Garnepudi #define RSI_GPIO_15_LP_WAKEUP_BOOT_BYPASS BIT(15)
5579920322cSPrameela Rani Garnepudi #define RSI_GPIO_16_LED_0 BIT(16)
5589920322cSPrameela Rani Garnepudi #define RSI_GPIO_17_BTCOEX_WLAN_ACT_EXT_ANT_SEL BIT(17)
5599920322cSPrameela Rani Garnepudi #define RSI_GPIO_18_BTCOEX_BT_PRIO_EXT_ANT_SEL BIT(18)
5609920322cSPrameela Rani Garnepudi #define RSI_GPIO_19_BTCOEX_BT_ACT_EXT_ON_OFF BIT(19)
5619920322cSPrameela Rani Garnepudi #define RSI_GPIO_20_RF_RESET BIT(20)
5629920322cSPrameela Rani Garnepudi #define RSI_GPIO_21_SLEEP_IND_FROM_DEVICE BIT(21)
5639920322cSPrameela Rani Garnepudi
5649920322cSPrameela Rani Garnepudi #define RSI_UNUSED_SOC_GPIO_BITMAP (RSI_GPIO_9_UART1_RX | \
5659920322cSPrameela Rani Garnepudi RSI_GPIO_10_UART1_TX | \
5669920322cSPrameela Rani Garnepudi RSI_GPIO_11_UART1_RTS_I2S_CLK | \
5679920322cSPrameela Rani Garnepudi RSI_GPIO_12_UART1_CTS_I2S_WS | \
5689920322cSPrameela Rani Garnepudi RSI_GPIO_13_DBG_UART_RX_I2S_DIN | \
5699920322cSPrameela Rani Garnepudi RSI_GPIO_14_DBG_UART_RX_I2S_DOUT | \
5709920322cSPrameela Rani Garnepudi RSI_GPIO_15_LP_WAKEUP_BOOT_BYPASS | \
5719920322cSPrameela Rani Garnepudi RSI_GPIO_17_BTCOEX_WLAN_ACT_EXT_ANT_SEL | \
5729920322cSPrameela Rani Garnepudi RSI_GPIO_18_BTCOEX_BT_PRIO_EXT_ANT_SEL | \
5739920322cSPrameela Rani Garnepudi RSI_GPIO_19_BTCOEX_BT_ACT_EXT_ON_OFF | \
5749920322cSPrameela Rani Garnepudi RSI_GPIO_21_SLEEP_IND_FROM_DEVICE)
5759920322cSPrameela Rani Garnepudi
5769920322cSPrameela Rani Garnepudi #define RSI_UNUSED_ULP_GPIO_BITMAP (RSI_GPIO_MOTION_SENSOR_ULP_WAKEUP | \
5779920322cSPrameela Rani Garnepudi RSI_GPIO_SLEEP_IND_FROM_DEVICE | \
5789920322cSPrameela Rani Garnepudi RSI_GPIO_2_ULP | \
5799920322cSPrameela Rani Garnepudi RSI_GPIO_PUSH_BUTTON_ULP_WAKEUP);
5809920322cSPrameela Rani Garnepudi struct rsi_config_vals {
5819920322cSPrameela Rani Garnepudi __le16 len_qno;
5829920322cSPrameela Rani Garnepudi u8 pkt_type;
5839920322cSPrameela Rani Garnepudi u8 misc_flags;
5849920322cSPrameela Rani Garnepudi __le16 reserved1[6];
5859920322cSPrameela Rani Garnepudi u8 lp_ps_handshake;
5869920322cSPrameela Rani Garnepudi u8 ulp_ps_handshake;
5879920322cSPrameela Rani Garnepudi u8 sleep_config_params; /* 0 for no handshake,
5889920322cSPrameela Rani Garnepudi * 1 for GPIO based handshake,
5899920322cSPrameela Rani Garnepudi * 2 packet handshake
5909920322cSPrameela Rani Garnepudi */
5919920322cSPrameela Rani Garnepudi u8 unused_ulp_gpio;
5929920322cSPrameela Rani Garnepudi __le32 unused_soc_gpio_bitmap;
5939920322cSPrameela Rani Garnepudi u8 ext_pa_or_bt_coex_en;
5949920322cSPrameela Rani Garnepudi u8 opermode;
5959920322cSPrameela Rani Garnepudi u8 wlan_rf_pwr_mode;
5969920322cSPrameela Rani Garnepudi u8 bt_rf_pwr_mode;
5979920322cSPrameela Rani Garnepudi u8 zigbee_rf_pwr_mode;
5989920322cSPrameela Rani Garnepudi u8 driver_mode;
5999920322cSPrameela Rani Garnepudi u8 region_code;
6009920322cSPrameela Rani Garnepudi u8 antenna_sel_val;
6019920322cSPrameela Rani Garnepudi u8 reserved2[16];
6029920322cSPrameela Rani Garnepudi } __packed;
6039920322cSPrameela Rani Garnepudi
60409cfb41fSPrameela Rani Garnepudi /* Packet info flags */
60509cfb41fSPrameela Rani Garnepudi #define RSI_EEPROM_HDR_SIZE_OFFSET 8
60609cfb41fSPrameela Rani Garnepudi #define RSI_EEPROM_HDR_SIZE_MASK 0x300
60709cfb41fSPrameela Rani Garnepudi #define RSI_EEPROM_LEN_OFFSET 20
60809cfb41fSPrameela Rani Garnepudi #define RSI_EEPROM_LEN_MASK 0xFFF00000
60909cfb41fSPrameela Rani Garnepudi
61009cfb41fSPrameela Rani Garnepudi struct rsi_eeprom_read_frame {
61109cfb41fSPrameela Rani Garnepudi __le16 len_qno;
61209cfb41fSPrameela Rani Garnepudi u8 pkt_type;
61309cfb41fSPrameela Rani Garnepudi u8 misc_flags;
61409cfb41fSPrameela Rani Garnepudi __le32 pkt_info;
61509cfb41fSPrameela Rani Garnepudi __le32 eeprom_offset;
61609cfb41fSPrameela Rani Garnepudi __le16 delay_ms;
61709cfb41fSPrameela Rani Garnepudi __le16 reserved3;
61809cfb41fSPrameela Rani Garnepudi } __packed;
61909cfb41fSPrameela Rani Garnepudi
620ce86893fSKarun Eagalapati struct rsi_request_ps {
621ce86893fSKarun Eagalapati struct rsi_cmd_desc desc;
622ce86893fSKarun Eagalapati struct ps_sleep_params ps_sleep;
623ce86893fSKarun Eagalapati u8 ps_mimic_support;
624ce86893fSKarun Eagalapati u8 ps_uapsd_acs;
625ce86893fSKarun Eagalapati u8 ps_uapsd_wakeup_period;
626ce86893fSKarun Eagalapati u8 reserved;
627ce86893fSKarun Eagalapati __le32 ps_listen_interval;
628ce86893fSKarun Eagalapati __le32 ps_dtim_interval_duration;
629ce86893fSKarun Eagalapati __le16 ps_num_dtim_intervals;
630ce86893fSKarun Eagalapati } __packed;
631ce86893fSKarun Eagalapati
632f3ac4e73SKarun Eagalapati struct rsi_wowlan_req {
633f3ac4e73SKarun Eagalapati struct rsi_cmd_desc desc;
634f3ac4e73SKarun Eagalapati u8 sourceid[ETH_ALEN];
635f3ac4e73SKarun Eagalapati u16 wow_flags;
636f3ac4e73SKarun Eagalapati u16 host_sleep_status;
637f3ac4e73SKarun Eagalapati } __packed;
638f3ac4e73SKarun Eagalapati
6397fdcb8e1SPrameela Rani Garnepudi #define RSI_START_BGSCAN 1
6407fdcb8e1SPrameela Rani Garnepudi #define RSI_STOP_BGSCAN 0
6417fdcb8e1SPrameela Rani Garnepudi #define HOST_BG_SCAN_TRIG BIT(4)
6427fdcb8e1SPrameela Rani Garnepudi struct rsi_bgscan_config {
6437fdcb8e1SPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword0;
6447fdcb8e1SPrameela Rani Garnepudi __le64 reserved;
6457fdcb8e1SPrameela Rani Garnepudi __le32 reserved1;
6467fdcb8e1SPrameela Rani Garnepudi __le16 bgscan_threshold;
6477fdcb8e1SPrameela Rani Garnepudi __le16 roam_threshold;
6487fdcb8e1SPrameela Rani Garnepudi __le16 bgscan_periodicity;
6497fdcb8e1SPrameela Rani Garnepudi u8 num_bgscan_channels;
6507fdcb8e1SPrameela Rani Garnepudi u8 two_probe;
6517fdcb8e1SPrameela Rani Garnepudi __le16 active_scan_duration;
6527fdcb8e1SPrameela Rani Garnepudi __le16 passive_scan_duration;
6537fdcb8e1SPrameela Rani Garnepudi __le16 channels2scan[MAX_BGSCAN_CHANNELS_DUAL_BAND];
6547fdcb8e1SPrameela Rani Garnepudi } __packed;
6557fdcb8e1SPrameela Rani Garnepudi
6567fdcb8e1SPrameela Rani Garnepudi struct rsi_bgscan_probe {
6577fdcb8e1SPrameela Rani Garnepudi struct rsi_cmd_desc_dword0 desc_dword0;
6587fdcb8e1SPrameela Rani Garnepudi __le64 reserved;
6597fdcb8e1SPrameela Rani Garnepudi __le32 reserved1;
6607fdcb8e1SPrameela Rani Garnepudi __le16 mgmt_rate;
6617fdcb8e1SPrameela Rani Garnepudi __le16 flags;
6627fdcb8e1SPrameela Rani Garnepudi __le16 def_chan;
6637fdcb8e1SPrameela Rani Garnepudi __le16 channel_scan_time;
6647fdcb8e1SPrameela Rani Garnepudi __le16 probe_req_length;
6657fdcb8e1SPrameela Rani Garnepudi } __packed;
6667fdcb8e1SPrameela Rani Garnepudi
6671533f976SSiva Rebbagondla #define RSI_DUTY_CYCLING BIT(0)
6681533f976SSiva Rebbagondla #define RSI_END_OF_FRAME BIT(1)
6691533f976SSiva Rebbagondla #define RSI_SIFS_TX_ENABLE BIT(2)
6701533f976SSiva Rebbagondla #define RSI_DPD BIT(3)
6711533f976SSiva Rebbagondla struct rsi_wlan_9116_features {
6721533f976SSiva Rebbagondla struct rsi_cmd_desc desc;
6731533f976SSiva Rebbagondla u8 pll_mode;
6741533f976SSiva Rebbagondla u8 rf_type;
6751533f976SSiva Rebbagondla u8 wireless_mode;
6761533f976SSiva Rebbagondla u8 enable_ppe;
6771533f976SSiva Rebbagondla u8 afe_type;
6781533f976SSiva Rebbagondla u8 reserved1;
6791533f976SSiva Rebbagondla __le16 reserved2;
6801533f976SSiva Rebbagondla __le32 feature_enable;
6811533f976SSiva Rebbagondla };
6821533f976SSiva Rebbagondla
rsi_get_queueno(u8 * addr,u16 offset)683dad0d04fSFariya Fatima static inline u32 rsi_get_queueno(u8 *addr, u16 offset)
684dad0d04fSFariya Fatima {
685dad0d04fSFariya Fatima return (le16_to_cpu(*(__le16 *)&addr[offset]) & 0x7000) >> 12;
686dad0d04fSFariya Fatima }
687dad0d04fSFariya Fatima
rsi_get_length(u8 * addr,u16 offset)688dad0d04fSFariya Fatima static inline u32 rsi_get_length(u8 *addr, u16 offset)
689dad0d04fSFariya Fatima {
690dad0d04fSFariya Fatima return (le16_to_cpu(*(__le16 *)&addr[offset])) & 0x0fff;
691dad0d04fSFariya Fatima }
692dad0d04fSFariya Fatima
rsi_get_extended_desc(u8 * addr,u16 offset)693dad0d04fSFariya Fatima static inline u8 rsi_get_extended_desc(u8 *addr, u16 offset)
694dad0d04fSFariya Fatima {
695dad0d04fSFariya Fatima return le16_to_cpu(*((__le16 *)&addr[offset + 4])) & 0x00ff;
696dad0d04fSFariya Fatima }
697dad0d04fSFariya Fatima
rsi_get_rssi(u8 * addr)698dad0d04fSFariya Fatima static inline u8 rsi_get_rssi(u8 *addr)
699dad0d04fSFariya Fatima {
700dad0d04fSFariya Fatima return *(u8 *)(addr + FRAME_DESC_SZ);
701dad0d04fSFariya Fatima }
702dad0d04fSFariya Fatima
rsi_get_channel(u8 * addr)703dad0d04fSFariya Fatima static inline u8 rsi_get_channel(u8 *addr)
704dad0d04fSFariya Fatima {
705dad0d04fSFariya Fatima return *(char *)(addr + 15);
706dad0d04fSFariya Fatima }
707dad0d04fSFariya Fatima
rsi_set_len_qno(__le16 * addr,u16 len,u8 qno)7089920322cSPrameela Rani Garnepudi static inline void rsi_set_len_qno(__le16 *addr, u16 len, u8 qno)
7099920322cSPrameela Rani Garnepudi {
7109920322cSPrameela Rani Garnepudi *addr = cpu_to_le16(len | ((qno & 7) << 12));
7119920322cSPrameela Rani Garnepudi }
7129920322cSPrameela Rani Garnepudi
7132108df3cSPrameela Rani Garnepudi int rsi_handle_card_ready(struct rsi_common *common, u8 *msg);
714dad0d04fSFariya Fatima int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg);
71577364aaeSPrameela Rani Garnepudi int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode,
71603c34c0dSPrameela Rani Garnepudi u8 *mac_addr, u8 vap_id, u8 vap_status);
717dad0d04fSFariya Fatima int rsi_send_aggregation_params_frame(struct rsi_common *common, u16 tid,
71832be57a6SPrameela Rani Garnepudi u16 ssn, u8 buf_size, u8 event,
71932be57a6SPrameela Rani Garnepudi u8 sta_id);
720dad0d04fSFariya Fatima int rsi_hal_load_key(struct rsi_common *common, u8 *data, u16 key_len,
721eac4eed3SPrameela Rani Garnepudi u8 key_type, u8 key_id, u32 cipher, s16 sta_id,
722eac4eed3SPrameela Rani Garnepudi struct ieee80211_vif *vif);
72361d10842SPrameela Rani Garnepudi int rsi_set_channel(struct rsi_common *common,
72461d10842SPrameela Rani Garnepudi struct ieee80211_channel *channel);
72580a88ecfSKarun Eagalapati int rsi_send_vap_dynamic_update(struct rsi_common *common);
726686a2541SJahnavi Meher int rsi_send_block_unblock_frame(struct rsi_common *common, bool event);
7274fd6c476SPrameela Rani Garnepudi int rsi_hal_send_sta_notify_frame(struct rsi_common *common, enum opmode opmode,
7284fd6c476SPrameela Rani Garnepudi u8 notify_event, const unsigned char *bssid,
7294fd6c476SPrameela Rani Garnepudi u8 qos_enable, u16 aid, u16 sta_id,
7304fd6c476SPrameela Rani Garnepudi struct ieee80211_vif *vif);
7313528608fSPrameela Rani Garnepudi void rsi_inform_bss_status(struct rsi_common *common, enum opmode opmode,
7323528608fSPrameela Rani Garnepudi u8 status, const u8 *addr, u8 qos_enable, u16 aid,
7334671c209SPrameela Rani Garnepudi struct ieee80211_sta *sta, u16 sta_id,
7344fd6c476SPrameela Rani Garnepudi u16 assoc_cap, struct ieee80211_vif *vif);
735dad0d04fSFariya Fatima void rsi_indicate_pkt_to_os(struct rsi_common *common, struct sk_buff *skb);
736dad0d04fSFariya Fatima int rsi_mac80211_attach(struct rsi_common *common);
737dad0d04fSFariya Fatima void rsi_indicate_tx_status(struct rsi_hw *common, struct sk_buff *skb,
738dad0d04fSFariya Fatima int status);
739dad0d04fSFariya Fatima bool rsi_is_cipher_wep(struct rsi_common *common);
740dad0d04fSFariya Fatima void rsi_core_qos_processor(struct rsi_common *common);
741dad0d04fSFariya Fatima void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb);
742dad0d04fSFariya Fatima int rsi_send_mgmt_pkt(struct rsi_common *common, struct sk_buff *skb);
743dad0d04fSFariya Fatima int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb);
744df771911SPrameela Rani Garnepudi int rsi_band_check(struct rsi_common *common, struct ieee80211_channel *chan);
745e6d64284SPrameela Rani Garnepudi int rsi_send_rx_filter_frame(struct rsi_common *common, u16 rx_filter_word);
7468b36de8cSPrameela Rani Garnepudi int rsi_send_radio_params_update(struct rsi_common *common);
7474edbcd1aSPrameela Rani Garnepudi int rsi_set_antenna(struct rsi_common *common, u8 antenna);
748e6b3b2edSAmitkumar Karwar #ifdef CONFIG_PM
749f3ac4e73SKarun Eagalapati int rsi_send_wowlan_request(struct rsi_common *common, u16 flags,
750f3ac4e73SKarun Eagalapati u16 sleep_status);
751e6b3b2edSAmitkumar Karwar #endif
752efe877aaSPrameela Rani Garnepudi int rsi_send_ps_request(struct rsi_hw *adapter, bool enable,
753efe877aaSPrameela Rani Garnepudi struct ieee80211_vif *vif);
7547fdcb8e1SPrameela Rani Garnepudi void init_bgscan_params(struct rsi_common *common);
7557fdcb8e1SPrameela Rani Garnepudi int rsi_send_bgscan_params(struct rsi_common *common, int enable);
7567fdcb8e1SPrameela Rani Garnepudi int rsi_send_bgscan_probe_req(struct rsi_common *common,
7577fdcb8e1SPrameela Rani Garnepudi struct ieee80211_vif *vif);
758dad0d04fSFariya Fatima #endif
759