1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3  *
4  * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
5  *
6  ******************************************************************************/
7 #ifndef __COMMON_H2C_H__
8 #define __COMMON_H2C_H__
9 
10 /*  */
11 /*     H2C CMD DEFINITION    ------------------------------------------------ */
12 /*  */
13 /*  88e, 8723b, 8812, 8821, 92e use the same FW code base */
14 enum h2c_cmd {
15 	/* Common Class: 000 */
16 	H2C_RSVD_PAGE = 0x00,
17 	H2C_MEDIA_STATUS_RPT = 0x01,
18 	H2C_SCAN_ENABLE = 0x02,
19 	H2C_KEEP_ALIVE = 0x03,
20 	H2C_DISCON_DECISION = 0x04,
21 	H2C_PSD_OFFLOAD = 0x05,
22 	H2C_AP_OFFLOAD = 0x08,
23 	H2C_BCN_RSVDPAGE = 0x09,
24 	H2C_PROBERSP_RSVDPAGE = 0x0A,
25 	H2C_FCS_RSVDPAGE = 0x10,
26 	H2C_FCS_INFO = 0x11,
27 	H2C_AP_WOW_GPIO_CTRL = 0x13,
28 
29 	/* PoweSave Class: 001 */
30 	H2C_SET_PWR_MODE = 0x20,
31 	H2C_PS_TUNING_PARA = 0x21,
32 	H2C_PS_TUNING_PARA2 = 0x22,
33 	H2C_P2P_LPS_PARAM = 0x23,
34 	H2C_P2P_PS_OFFLOAD = 0x24,
35 	H2C_PS_SCAN_ENABLE = 0x25,
36 	H2C_SAP_PS_ = 0x26,
37 	H2C_INACTIVE_PS_ = 0x27, /* Inactive_PS */
38 	H2C_FWLPS_IN_IPS_ = 0x28,
39 
40 	/* Dynamic Mechanism Class: 010 */
41 	H2C_MACID_CFG = 0x40,
42 	H2C_TXBF = 0x41,
43 	H2C_RSSI_SETTING = 0x42,
44 	H2C_AP_REQ_TXRPT = 0x43,
45 	H2C_INIT_RATE_COLLECT = 0x44,
46 
47 	/* BT Class: 011 */
48 	H2C_B_TYPE_TDMA = 0x60,
49 	H2C_BT_INFO = 0x61,
50 	H2C_FORCE_BT_TXPWR = 0x62,
51 	H2C_BT_IGNORE_WLANACT = 0x63,
52 	H2C_DAC_SWING_VALUE = 0x64,
53 	H2C_ANT_SEL_RSV = 0x65,
54 	H2C_WL_OPMODE = 0x66,
55 	H2C_BT_MP_OPER = 0x67,
56 	H2C_BT_CONTROL = 0x68,
57 	H2C_BT_WIFI_CTRL = 0x69,
58 	H2C_BT_FW_PATCH = 0x6A,
59 
60 	/* WOWLAN Class: 100 */
61 	H2C_WOWLAN = 0x80,
62 	H2C_REMOTE_WAKE_CTRL = 0x81,
63 	H2C_AOAC_GLOBAL_INFO = 0x82,
64 	H2C_AOAC_RSVD_PAGE = 0x83,
65 	H2C_AOAC_RSVD_PAGE2 = 0x84,
66 	H2C_D0_SCAN_OFFLOAD_CTRL = 0x85,
67 	H2C_D0_SCAN_OFFLOAD_INFO = 0x86,
68 	H2C_CHNL_SWITCH_OFFLOAD = 0x87,
69 	H2C_AOAC_RSVDPAGE3 = 0x88,
70 
71 	H2C_RESET_TSF = 0xC0,
72 	H2C_MAXID,
73 };
74 
75 #define H2C_RSVDPAGE_LOC_LEN		5
76 #define H2C_MEDIA_STATUS_RPT_LEN		3
77 #define H2C_KEEP_ALIVE_CTRL_LEN	2
78 #define H2C_DISCON_DECISION_LEN		3
79 #define H2C_AP_OFFLOAD_LEN		3
80 #define H2C_AP_WOW_GPIO_CTRL_LEN	4
81 #define H2C_AP_PS_LEN			2
82 #define H2C_PWRMODE_LEN			7
83 #define H2C_PSTUNEPARAM_LEN			4
84 #define H2C_MACID_CFG_LEN		7
85 #define H2C_BTMP_OPER_LEN			4
86 #define H2C_WOWLAN_LEN			4
87 #define H2C_REMOTE_WAKE_CTRL_LEN	3
88 #define H2C_AOAC_GLOBAL_INFO_LEN	2
89 #define H2C_AOAC_RSVDPAGE_LOC_LEN	7
90 #define H2C_SCAN_OFFLOAD_CTRL_LEN	4
91 #define H2C_BT_FW_PATCH_LEN			6
92 #define H2C_RSSI_SETTING_LEN		4
93 #define H2C_AP_REQ_TXRPT_LEN		2
94 #define H2C_FORCE_BT_TXPWR_LEN		3
95 #define H2C_BCN_RSVDPAGE_LEN		5
96 #define H2C_PROBERSP_RSVDPAGE_LEN	5
97 
98 #ifdef CONFIG_WOWLAN
99 #define eqMacAddr(a, b)		(((a)[0] == (b)[0] && (a)[1] == (b)[1] && (a)[2] == (b)[2] && (a)[3] == (b)[3] && (a)[4] == (b)[4] && (a)[5] == (b)[5]) ? 1 : 0)
100 #define cpMacAddr(des, src)	((des)[0] = (src)[0], (des)[1] = (src)[1], (des)[2] = (src)[2], (des)[3] = (src)[3], (des)[4] = (src)[4], (des)[5] = (src)[5])
101 #define cpIpAddr(des, src)	((des)[0] = (src)[0], (des)[1] = (src)[1], (des)[2] = (src)[2], (des)[3] = (src)[3])
102 
103 /*  */
104 /*  ARP packet */
105 /*  */
106 /*  LLC Header */
107 #define GET_ARP_PKT_LLC_TYPE(__pHeader)			ReadEF2Byte(((u8 *)(__pHeader)) + 6)
108 
109 /* ARP element */
110 #define GET_ARP_PKT_OPERATION(__pHeader)		ReadEF2Byte(((u8 *)(__pHeader)) + 6)
111 #define GET_ARP_PKT_SENDER_MAC_ADDR(__pHeader, _val)	cpMacAddr((u8 *)(_val), ((u8 *)(__pHeader))+8)
112 #define GET_ARP_PKT_SENDER_IP_ADDR(__pHeader, _val)	cpIpAddr((u8 *)(_val), ((u8 *)(__pHeader))+14)
113 #define GET_ARP_PKT_TARGET_MAC_ADDR(__pHeader, _val)	cpMacAddr((u8 *)(_val), ((u8 *)(__pHeader))+18)
114 #define GET_ARP_PKT_TARGET_IP_ADDR(__pHeader, _val)	cpIpAddr((u8 *)(_val), ((u8 *)(__pHeader))+24)
115 
116 #define SET_ARP_PKT_HW(__pHeader, __Value)		WRITEEF2BYTE(((u8 *)(__pHeader)) + 0, __Value)
117 #define SET_ARP_PKT_PROTOCOL(__pHeader, __Value)	WRITEEF2BYTE(((u8 *)(__pHeader)) + 2, __Value)
118 #define SET_ARP_PKT_HW_ADDR_LEN(__pHeader, __Value)	WRITEEF1BYTE(((u8 *)(__pHeader)) + 4, __Value)
119 #define SET_ARP_PKT_PROTOCOL_ADDR_LEN(__pHeader, __Value)	WRITEEF1BYTE(((u8 *)(__pHeader)) + 5, __Value)
120 #define SET_ARP_PKT_OPERATION(__pHeader, __Value)	WRITEEF2BYTE(((u8 *)(__pHeader)) + 6, __Value)
121 #define SET_ARP_PKT_SENDER_MAC_ADDR(__pHeader, _val)	cpMacAddr(((u8 *)(__pHeader))+8, (u8 *)(_val))
122 #define SET_ARP_PKT_SENDER_IP_ADDR(__pHeader, _val)	cpIpAddr(((u8 *)(__pHeader))+14, (u8 *)(_val))
123 #define SET_ARP_PKT_TARGET_MAC_ADDR(__pHeader, _val)	cpMacAddr(((u8 *)(__pHeader))+18, (u8 *)(_val))
124 #define SET_ARP_PKT_TARGET_IP_ADDR(__pHeader, _val)	cpIpAddr(((u8 *)(__pHeader))+24, (u8 *)(_val))
125 
126 #define FW_WOWLAN_FUN_EN			BIT(0)
127 #define FW_WOWLAN_PATTERN_MATCH			BIT(1)
128 #define FW_WOWLAN_MAGIC_PKT			BIT(2)
129 #define FW_WOWLAN_UNICAST			BIT(3)
130 #define FW_WOWLAN_ALL_PKT_DROP			BIT(4)
131 #define FW_WOWLAN_GPIO_ACTIVE			BIT(5)
132 #define FW_WOWLAN_REKEY_WAKEUP			BIT(6)
133 #define FW_WOWLAN_DEAUTH_WAKEUP			BIT(7)
134 
135 #define FW_WOWLAN_GPIO_WAKEUP_EN		BIT(0)
136 #define FW_FW_PARSE_MAGIC_PKT			BIT(1)
137 
138 #define FW_REMOTE_WAKE_CTRL_EN			BIT(0)
139 #define FW_REALWOWLAN_EN			BIT(5)
140 
141 #define FW_WOWLAN_KEEP_ALIVE_EN			BIT(0)
142 #define FW_ADOPT_USER				BIT(1)
143 #define FW_WOWLAN_KEEP_ALIVE_PKT_TYPE		BIT(2)
144 
145 #define FW_REMOTE_WAKE_CTRL_EN			BIT(0)
146 #define FW_ARP_EN				BIT(1)
147 #define FW_REALWOWLAN_EN			BIT(5)
148 #define FW_WOW_FW_UNICAST_EN			BIT(7)
149 
150 #endif /* CONFIG_WOWLAN */
151 
152 /* _RSVDPAGE_LOC_CMD_0x00 */
153 #define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value)
154 #define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value)			SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value)
155 #define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value)
156 #define SET_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value)
157 #define SET_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(__pH2CCmd, __Value)SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 8, __Value)
158 
159 /* _MEDIA_STATUS_RPT_PARM_CMD_0x01 */
160 #define SET_H2CCMD_MSRRPT_PARM_OPMODE(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
161 #define SET_H2CCMD_MSRRPT_PARM_MACID_IND(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
162 #define SET_H2CCMD_MSRRPT_PARM_MACID(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+1, 0, 8, __Value)
163 #define SET_H2CCMD_MSRRPT_PARM_MACID_END(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+2, 0, 8, __Value)
164 
165 /* _KEEP_ALIVE_CMD_0x03 */
166 #define SET_H2CCMD_KEEPALIVE_PARM_ENABLE(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
167 #define SET_H2CCMD_KEEPALIVE_PARM_ADOPT(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
168 #define SET_H2CCMD_KEEPALIVE_PARM_PKT_TYPE(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value)
169 #define SET_H2CCMD_KEEPALIVE_PARM_CHECK_PERIOD(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+1, 0, 8, __Value)
170 
171 /* _DISCONNECT_DECISION_CMD_0x04 */
172 #define SET_H2CCMD_DISCONDECISION_PARM_ENABLE(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
173 #define SET_H2CCMD_DISCONDECISION_PARM_ADOPT(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
174 #define SET_H2CCMD_DISCONDECISION_PARM_CHECK_PERIOD(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+1, 0, 8, __Value)
175 #define SET_H2CCMD_DISCONDECISION_PARM_TRY_PKT_NUM(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd+2, 0, 8, __Value)
176 
177 #ifdef CONFIG_AP_WOWLAN
178 /* _AP_Offload 0x08 */
179 #define SET_H2CCMD_AP_WOWLAN_EN(__pH2CCmd, __Value)			SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value)
180 /* _BCN_RsvdPage	0x09 */
181 #define SET_H2CCMD_AP_WOWLAN_RSVDPAGE_LOC_BCN(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value)
182 /* _Probersp_RsvdPage 0x0a */
183 #define SET_H2CCMD_AP_WOWLAN_RSVDPAGE_LOC_ProbeRsp(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value)
184 /* _Probersp_RsvdPage 0x13 */
185 #define SET_H2CCMD_AP_WOW_GPIO_CTRL_INDEX(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 4, __Value)
186 #define SET_H2CCMD_AP_WOW_GPIO_CTRL_C2H_EN(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value)
187 #define SET_H2CCMD_AP_WOW_GPIO_CTRL_PLUS(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value)
188 #define SET_H2CCMD_AP_WOW_GPIO_CTRL_HIGH_ACTIVE(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE(__pH2CCmd, 6, 1, __Value)
189 #define SET_H2CCMD_AP_WOW_GPIO_CTRL_EN(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 7, 1, __Value)
190 #define SET_H2CCMD_AP_WOW_GPIO_CTRL_DURATION(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value)
191 #define SET_H2CCMD_AP_WOW_GPIO_CTRL_C2H_DURATION(__pH2CCmd, __Value)SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value)
192 /* _AP_PS 0x26 */
193 #define SET_H2CCMD_AP_WOW_PS_EN(__pH2CCmd, __Value)			SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
194 #define SET_H2CCMD_AP_WOW_PS_32K_EN(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
195 #define SET_H2CCMD_AP_WOW_PS_RF(__pH2CCmd, __Value)			SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value)
196 #define SET_H2CCMD_AP_WOW_PS_DURATION(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value)
197 #endif
198 
199 /*  _WoWLAN PARAM_CMD_0x80 */
200 #define SET_H2CCMD_WOWLAN_FUNC_ENABLE(__pH2CCmd, __Value)			SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
201 #define SET_H2CCMD_WOWLAN_PATTERN_MATCH_ENABLE(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
202 #define SET_H2CCMD_WOWLAN_MAGIC_PKT_ENABLE(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value)
203 #define SET_H2CCMD_WOWLAN_UNICAST_PKT_ENABLE(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value)
204 #define SET_H2CCMD_WOWLAN_ALL_PKT_DROP(__pH2CCmd, __Value)			SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value)
205 #define SET_H2CCMD_WOWLAN_GPIO_ACTIVE(__pH2CCmd, __Value)			SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value)
206 #define SET_H2CCMD_WOWLAN_REKEY_WAKE_UP(__pH2CCmd, __Value)			SET_BITS_TO_LE_1BYTE(__pH2CCmd, 6, 1, __Value)
207 #define SET_H2CCMD_WOWLAN_DISCONNECT_WAKE_UP(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE(__pH2CCmd, 7, 1, __Value)
208 #define SET_H2CCMD_WOWLAN_GPIONUM(__pH2CCmd, __Value)				SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 7, __Value)
209 #define SET_H2CCMD_WOWLAN_DATAPIN_WAKE_UP(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 7, 1, __Value)
210 #define SET_H2CCMD_WOWLAN_GPIO_DURATION(__pH2CCmd, __Value)			SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value)
211 /* define SET_H2CCMD_WOWLAN_GPIO_PULSE_EN(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 1, __Value) */
212 #define SET_H2CCMD_WOWLAN_GPIO_PULSE_COUNT(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value)
213 
214 /*  _REMOTE_WAKEUP_CMD_0x81 */
215 #define SET_H2CCMD_REMOTE_WAKECTRL_ENABLE(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
216 #define SET_H2CCMD_REMOTE_WAKE_CTRL_ARP_OFFLOAD_EN(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
217 #define SET_H2CCMD_REMOTE_WAKE_CTRL_NDP_OFFLOAD_EN(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value)
218 #define SET_H2CCMD_REMOTE_WAKE_CTRL_GTK_OFFLOAD_EN(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value)
219 #define SET_H2CCMD_REMOTE_WAKE_CTRL_NLO_OFFLOAD_EN(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value)
220 #define SET_H2CCMD_REMOTE_WAKE_CTRL_FW_UNICAST_EN(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE(__pH2CCmd, 7, 1, __Value)
221 #define SET_H2CCMD_REMOTE_WAKE_CTRL_ARP_ACTION(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 1, __Value)
222 
223 /*  AOAC_GLOBAL_INFO_0x82 */
224 #define SET_H2CCMD_AOAC_GLOBAL_INFO_PAIRWISE_ENC_ALG(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value)
225 #define SET_H2CCMD_AOAC_GLOBAL_INFO_GROUP_ENC_ALG(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value)
226 
227 /*  AOAC_RSVDPAGE_LOC_0x83 */
228 #define SET_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd), 0, 8, __Value)
229 #define SET_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value)
230 #define SET_H2CCMD_AOAC_RSVDPAGE_LOC_NEIGHBOR_ADV(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value)
231 #define SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_RSP(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value)
232 #define SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_INFO(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+4, 0, 8, __Value)
233 #ifdef CONFIG_GTK_OL
234 #define SET_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_EXT_MEM(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+5, 0, 8, __Value)
235 #endif /* CONFIG_GTK_OL */
236 #ifdef CONFIG_PNO_SUPPORT
237 #define SET_H2CCMD_AOAC_RSVDPAGE_LOC_NLO_INFO(__pH2CCmd, __Value)		SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd), 0, 8, __Value)
238 #endif
239 
240 #ifdef CONFIG_PNO_SUPPORT
241 /*  D0_Scan_Offload_Info_0x86 */
242 #define SET_H2CCMD_AOAC_NLO_FUN_EN(__pH2CCmd, __Value)			SET_BITS_TO_LE_1BYTE((__pH2CCmd), 3, 1, __Value)
243 #define SET_H2CCMD_AOAC_RSVDPAGE_LOC_PROBE_PACKET(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+1, 0, 8, __Value)
244 #define SET_H2CCMD_AOAC_RSVDPAGE_LOC_SCAN_INFO(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+2, 0, 8, __Value)
245 #define SET_H2CCMD_AOAC_RSVDPAGE_LOC_SSID_INFO(__pH2CCmd, __Value)	SET_BITS_TO_LE_1BYTE_8BIT((__pH2CCmd)+3, 0, 8, __Value)
246 #endif /* CONFIG_PNO_SUPPORT */
247 
248 /*  */
249 /*     Structure    -------------------------------------------------- */
250 /*  */
251 typedef struct _RSVDPAGE_LOC {
252 	u8 LocProbeRsp;
253 	u8 LocPsPoll;
254 	u8 LocNullData;
255 	u8 LocQosNull;
256 	u8 LocBTQosNull;
257 #ifdef CONFIG_WOWLAN
258 	u8 LocRemoteCtrlInfo;
259 	u8 LocArpRsp;
260 	u8 LocNbrAdv;
261 	u8 LocGTKRsp;
262 	u8 LocGTKInfo;
263 	u8 LocProbeReq;
264 	u8 LocNetList;
265 #ifdef CONFIG_GTK_OL
266 	u8 LocGTKEXTMEM;
267 #endif /* CONFIG_GTK_OL */
268 #ifdef CONFIG_PNO_SUPPORT
269 	u8 LocPNOInfo;
270 	u8 LocScanInfo;
271 	u8 LocSSIDInfo;
272 	u8 LocProbePacket;
273 #endif /* CONFIG_PNO_SUPPORT */
274 #endif /* CONFIG_WOWLAN */
275 #ifdef CONFIG_AP_WOWLAN
276 	u8 LocApOffloadBCN;
277 #endif /* CONFIG_AP_WOWLAN */
278 } RSVDPAGE_LOC, *PRSVDPAGE_LOC;
279 
280 #endif
281 #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
282 void rtw_get_current_ip_address(struct adapter *padapter, u8 *pcurrentip);
283 void rtw_get_sec_iv(struct adapter *padapter, u8*pcur_dot11txpn, u8 *StaAddr);
284 void rtw_set_sec_pn(struct adapter *padapter);
285 #endif
286