net: wireless: rockchip_wlan: add rtl8188eu support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8188eu / include / rtl8188e_cmd.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
4  *
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.
8  *
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
12  * more details.
13  *
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
17  *
18  *
19  ******************************************************************************/
20 #ifndef __RTL8188E_CMD_H__
21 #define __RTL8188E_CMD_H__
22
23 #if 0
24 enum cmd_msg_element_id
25 {
26         NONE_CMDMSG_EID,
27         AP_OFFLOAD_EID = 0,
28         SET_PWRMODE_EID = 1,
29         JOINBSS_RPT_EID = 2,
30         RSVD_PAGE_EID = 3,
31         RSSI_4_EID = 4,
32         RSSI_SETTING_EID = 5,
33         MACID_CONFIG_EID = 6,
34         MACID_PS_MODE_EID = 7,
35         P2P_PS_OFFLOAD_EID = 8,
36         SELECTIVE_SUSPEND_ROF_CMD = 9,
37         P2P_PS_CTW_CMD_EID = 32,
38         MAX_CMDMSG_EID   
39 };
40 #else
41 typedef enum _RTL8188E_H2C_CMD_ID
42 {
43         //Class Common
44         H2C_COM_RSVD_PAGE                       =0x00,
45         H2C_COM_MEDIA_STATUS_RPT        =0x01,
46         H2C_COM_SCAN                                    =0x02,  
47         H2C_COM_KEEP_ALIVE                      =0x03,  
48         H2C_COM_DISCNT_DECISION         =0x04,
49 #ifndef CONFIG_WOWLAN
50         H2C_COM_WWLAN                           =0x05,
51 #endif
52         H2C_COM_INIT_OFFLOAD                    =0x06,
53         H2C_COM_REMOTE_WAKE_CTL =0x07,
54         H2C_COM_AP_OFFLOAD                      =0x08,
55         H2C_COM_BCN_RSVD_PAGE           =0x09,
56         H2C_COM_PROB_RSP_RSVD_PAGE      =0x0A,
57
58         //Class PS
59         H2C_PS_PWR_MODE                         =0x20,
60         H2C_PS_TUNE_PARA                                =0x21,
61         H2C_PS_TUNE_PARA_2                      =0x22,
62         H2C_PS_LPS_PARA                         =0x23,
63         H2C_PS_P2P_OFFLOAD                      =0x24,
64
65         //Class DM
66         H2C_DM_MACID_CFG                                =0x40,
67         H2C_DM_TXBF                                     =0x41,
68         H2C_RSSI_REPORT                                 =0x42,
69         //Class BT
70         H2C_BT_COEX_MASK                                =0x60,
71         H2C_BT_COEX_GPIO_MODE           =0x61,
72         H2C_BT_DAC_SWING_VAL                    =0x62,
73         H2C_BT_PSD_RST                          =0x63,
74         
75         //Class Remote WakeUp
76 #ifdef CONFIG_WOWLAN
77         H2C_COM_WWLAN                           =0x80,
78         H2C_COM_REMOTE_WAKE_CTRL        =0x81,
79         H2C_COM_AOAC_GLOBAL_INFO        =0x82,
80         H2C_COM_AOAC_RSVD_PAGE          =0x83,
81 #endif
82
83         //Class 
84          //H2C_RESET_TSF                                =0xc0,
85 }RTL8188E_H2C_CMD_ID;
86         
87 #endif
88
89
90 struct cmd_msg_parm {
91         u8 eid; //element id
92         u8 sz; // sz
93         u8 buf[6];
94 };
95
96 enum{
97         PWRS
98 };
99
100 typedef struct _SETPWRMODE_PARM {
101         u8 Mode;//0:Active,1:LPS,2:WMMPS
102         //u8 RLBM:4;//0:Min,1:Max,2: User define
103         u8 SmartPS_RLBM;//LPS=0:PS_Poll,1:PS_Poll,2:NullData,WMM=0:PS_Poll,1:NullData
104         u8 AwakeInterval;       // unit: beacon interval
105         u8 bAllQueueUAPSD;
106         u8 PwrState;//AllON(0x0c),RFON(0x04),RFOFF(0x00)
107 } SETPWRMODE_PARM, *PSETPWRMODE_PARM;
108
109 struct H2C_SS_RFOFF_PARAM{
110         u8 ROFOn; // 1: on, 0:off
111         u16 gpio_period; // unit: 1024 us
112 }__attribute__ ((packed));
113
114
115 typedef struct JOINBSSRPT_PARM_88E{
116         u8 OpMode;      // RT_MEDIA_STATUS
117 #ifdef CONFIG_WOWLAN
118         u8 MacID;       // MACID
119 #endif //CONFIG_WOWLAN
120 }JOINBSSRPT_PARM_88E, *PJOINBSSRPT_PARM_88E;
121
122 /* move to hal_com_h2c.h
123 typedef struct _RSVDPAGE_LOC_88E {
124         u8 LocProbeRsp;
125         u8 LocPsPoll;
126         u8 LocNullData;
127         u8 LocQosNull;
128         u8 LocBTQosNull;
129 #ifdef CONFIG_WOWLAN
130         u8 LocRemoteCtrlInfo;
131         u8 LocArpRsp;
132         u8 LocNbrAdv;
133         u8 LocGTKRsp;
134         u8 LocGTKInfo;
135         u8 LocProbeReq;
136         u8 LocNetList;
137 #endif //CONFIG_WOWLAN  
138 } RSVDPAGE_LOC_88E, *PRSVDPAGE_LOC_88E;
139 */
140
141 // host message to firmware cmd
142 void rtl8188e_set_FwPwrMode_cmd(PADAPTER padapter, u8 Mode);
143 void rtl8188e_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus);
144 u8 rtl8188e_set_rssi_cmd(PADAPTER padapter, u8 *param);
145 u8 rtl8188e_set_raid_cmd(_adapter *padapter, u32 bitmap, u8 *arg);
146 void rtl8188e_Add_RateATid(PADAPTER padapter, u64 rate_bitmap, u8 *arg, u8 rssi_level);
147 s32 FillH2CCmd_88E(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer);
148 //u8 rtl8192c_set_FwSelectSuspend_cmd(PADAPTER padapter, u8 bfwpoll, u16 period);
149 u8 GetTxBufferRsvdPageNum8188E(_adapter *padapter, bool wowlan);
150
151
152 #ifdef CONFIG_P2P
153 void rtl8188e_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state);
154 #endif //CONFIG_P2P
155
156 void CheckFwRsvdPageContent(PADAPTER padapter);
157
158 #ifdef CONFIG_TSF_RESET_OFFLOAD
159 //u8 rtl8188e_reset_tsf(_adapter *padapter, u8 reset_port);
160 int reset_tsf(PADAPTER Adapter, u8 reset_port );
161 #endif  // CONFIG_TSF_RESET_OFFLOAD
162
163 //#define H2C_8188E_RSVDPAGE_LOC_LEN      5
164 //#define H2C_8188E_AOAC_RSVDPAGE_LOC_LEN 7
165
166 //---------------------------------------------------------------------------------------------------------//
167 //----------------------------------    H2C CMD CONTENT    --------------------------------------------------//
168 //---------------------------------------------------------------------------------------------------------//
169 //
170 /* move to hal_com_h2c.h
171 //_RSVDPAGE_LOC_CMD_0x00
172 #define SET_8188E_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value)     SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
173 #define SET_8188E_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value)            SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value)
174 #define SET_8188E_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value)     SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
175 #define SET_8188E_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value)     SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value)
176 // AOAC_RSVDPAGE_LOC_0x83
177 #define SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(__pH2CCmd, __Value)        SET_BITS_TO_LE_1BYTE((__pH2CCmd), 0, 8, __Value)
178 #define SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(__pH2CCmd, __Value)                  SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value)
179 */
180 #endif//__RTL8188E_CMD_H__
181
182