1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
20 #ifndef __RTL8188E_CMD_H__
21 #define __RTL8188E_CMD_H__
24 enum cmd_msg_element_id {
33 MACID_PS_MODE_EID = 7,
34 P2P_PS_OFFLOAD_EID = 8,
35 SELECTIVE_SUSPEND_ROF_CMD = 9,
36 P2P_PS_CTW_CMD_EID = 32,
40 typedef enum _RTL8188E_H2C_CMD_ID {
42 H2C_COM_RSVD_PAGE = 0x00,
43 H2C_COM_MEDIA_STATUS_RPT = 0x01,
45 H2C_COM_KEEP_ALIVE = 0x03,
46 H2C_COM_DISCNT_DECISION = 0x04,
50 H2C_COM_INIT_OFFLOAD = 0x06,
51 H2C_COM_REMOTE_WAKE_CTL = 0x07,
52 H2C_COM_AP_OFFLOAD = 0x08,
53 H2C_COM_BCN_RSVD_PAGE = 0x09,
54 H2C_COM_PROB_RSP_RSVD_PAGE = 0x0A,
57 H2C_PS_PWR_MODE = 0x20,
58 H2C_PS_TUNE_PARA = 0x21,
59 H2C_PS_TUNE_PARA_2 = 0x22,
60 H2C_PS_LPS_PARA = 0x23,
61 H2C_PS_P2P_OFFLOAD = 0x24,
64 H2C_DM_MACID_CFG = 0x40,
66 H2C_RSSI_REPORT = 0x42,
68 H2C_BT_COEX_MASK = 0x60,
69 H2C_BT_COEX_GPIO_MODE = 0x61,
70 H2C_BT_DAC_SWING_VAL = 0x62,
71 H2C_BT_PSD_RST = 0x63,
73 /* Class Remote WakeUp */
76 H2C_COM_REMOTE_WAKE_CTRL = 0x81,
77 H2C_COM_AOAC_GLOBAL_INFO = 0x82,
78 H2C_COM_AOAC_RSVD_PAGE = 0x83,
82 /* H2C_RESET_TSF =0xc0, */
83 } RTL8188E_H2C_CMD_ID;
89 u8 eid; /* element id */
98 typedef struct _SETPWRMODE_PARM {
99 u8 Mode;/* 0:Active,1:LPS,2:WMMPS */
100 /* u8 RLBM:4; */ /* 0:Min,1:Max,2: User define */
101 u8 SmartPS_RLBM;/* LPS=0:PS_Poll,1:PS_Poll,2:NullData,WMM=0:PS_Poll,1:NullData */
102 u8 AwakeInterval; /* unit: beacon interval */
104 u8 PwrState;/* AllON(0x0c),RFON(0x04),RFOFF(0x00) */
105 } SETPWRMODE_PARM, *PSETPWRMODE_PARM;
107 struct H2C_SS_RFOFF_PARAM {
108 u8 ROFOn; /* 1: on, 0:off */
109 u16 gpio_period; /* unit: 1024 us */
110 } __attribute__((packed));
113 typedef struct JOINBSSRPT_PARM_88E {
114 u8 OpMode; /* RT_MEDIA_STATUS */
116 u8 MacID; /* MACID */
117 #endif /* CONFIG_WOWLAN */
118 } JOINBSSRPT_PARM_88E, *PJOINBSSRPT_PARM_88E;
121 /* move to hal_com_h2c.h */
122 typedef struct _RSVDPAGE_LOC_88E {
129 u8 LocRemoteCtrlInfo;
136 #endif /* CONFIG_WOWLAN */
137 } RSVDPAGE_LOC_88E, *PRSVDPAGE_LOC_88E;
140 /* host message to firmware cmd */
141 void rtl8188e_set_FwPwrMode_cmd(PADAPTER padapter, u8 Mode);
142 void rtl8188e_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus);
143 u8 rtl8188e_set_rssi_cmd(PADAPTER padapter, u8 *param);
144 u8 rtl8188e_set_raid_cmd(_adapter *padapter, u32 bitmap, u8 *arg, u8 bw);
145 s32 FillH2CCmd_88E(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer);
146 /* u8 rtl8192c_set_FwSelectSuspend_cmd(PADAPTER padapter, u8 bfwpoll, u16 period); */
147 u8 GetTxBufferRsvdPageNum8188E(_adapter *padapter, bool wowlan);
151 void rtl8188e_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state);
152 #endif /* CONFIG_P2P */
154 void CheckFwRsvdPageContent(PADAPTER padapter);
156 #ifdef CONFIG_TSF_RESET_OFFLOAD
157 /* u8 rtl8188e_reset_tsf(_adapter *padapter, u8 reset_port); */
158 int reset_tsf(PADAPTER Adapter, u8 reset_port);
159 #endif /* CONFIG_TSF_RESET_OFFLOAD */
161 /* #define H2C_8188E_RSVDPAGE_LOC_LEN 5 */
162 /* #define H2C_8188E_AOAC_RSVDPAGE_LOC_LEN 7 */
164 /* ---------------------------------------------------------------------------------------------------------
165 * ---------------------------------- H2C CMD CONTENT --------------------------------------------------
166 * ---------------------------------------------------------------------------------------------------------
169 /* move to hal_com_h2c.h
170 * _RSVDPAGE_LOC_CMD_0x00 */
171 #define SET_8188E_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
172 #define SET_8188E_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value)
173 #define SET_8188E_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
174 #define SET_8188E_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value)
175 /* AOAC_RSVDPAGE_LOC_0x83 */
176 #define SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd), 0, 8, __Value)
177 #define SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value)
179 #endif/* __RTL8188E_CMD_H__ */