1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright(c) 2007 - 2011 Realtek Corporation. */
3 
4 #ifndef __RTL8188E_CMD_H__
5 #define __RTL8188E_CMD_H__
6 
7 enum RTL8188E_H2C_CMD_ID {
8 	/* Class Common */
9 	H2C_COM_RSVD_PAGE		= 0x00,
10 	H2C_COM_MEDIA_STATUS_RPT	= 0x01,
11 	H2C_COM_SCAN			= 0x02,
12 	H2C_COM_KEEP_ALIVE		= 0x03,
13 	H2C_COM_DISCNT_DECISION		= 0x04,
14 	H2C_COM_INIT_OFFLOAD		= 0x06,
15 	H2C_COM_REMOTE_WAKE_CTL		= 0x07,
16 	H2C_COM_AP_OFFLOAD		= 0x08,
17 	H2C_COM_BCN_RSVD_PAGE		= 0x09,
18 	H2C_COM_PROB_RSP_RSVD_PAGE	= 0x0A,
19 
20 	/* Class PS */
21 	H2C_PS_PWR_MODE			= 0x20,
22 	H2C_PS_TUNE_PARA		= 0x21,
23 	H2C_PS_TUNE_PARA_2		= 0x22,
24 	H2C_PS_LPS_PARA			= 0x23,
25 	H2C_PS_P2P_OFFLOAD		= 0x24,
26 
27 	/* Class DM */
28 	H2C_DM_MACID_CFG		= 0x40,
29 	H2C_DM_TXBF			= 0x41,
30 };
31 
32 struct cmd_msg_parm {
33 	u8 eid; /* element id */
34 	u8 sz; /*  sz */
35 	u8 buf[6];
36 };
37 
38 struct setpwrmode_parm {
39 	u8 Mode;/* 0:Active,1:LPS,2:WMMPS */
40 	u8 SmartPS_RLBM;/* LPS= 0:PS_Poll,1:PS_Poll,2:NullData,WMM= 0:PS_Poll,1:NullData */
41 	u8 AwakeInterval;	/*  unit: beacon interval */
42 	u8 bAllQueueUAPSD;
43 	u8 PwrState;/* AllON(0x0c),RFON(0x04),RFOFF(0x00) */
44 };
45 
46 struct H2C_SS_RFOFF_PARAM {
47 	u8 ROFOn; /*  1: on, 0:off */
48 	u16 gpio_period; /*  unit: 1024 us */
49 } __packed;
50 
51 struct joinbssrpt_parm {
52 	u8 OpMode;	/*  RT_MEDIA_STATUS */
53 };
54 
55 struct rsvdpage_loc {
56 	u8 LocProbeRsp;
57 	u8 LocPsPoll;
58 	u8 LocNullData;
59 	u8 LocQosNull;
60 	u8 LocBTQosNull;
61 };
62 
63 struct P2P_PS_Offload_t {
64 	u8 Offload_En:1;
65 	u8 role:1; /*  1: Owner, 0: Client */
66 	u8 CTWindow_En:1;
67 	u8 NoA0_En:1;
68 	u8 NoA1_En:1;
69 	u8 AllStaSleep:1; /*  Only valid in Owner */
70 	u8 discovery:1;
71 	u8 rsvd:1;
72 };
73 
74 struct P2P_PS_CTWPeriod_t {
75 	u8 CTWPeriod;	/* TU */
76 };
77 
78 /*  host message to firmware cmd */
79 void rtl8188e_set_FwPwrMode_cmd(struct adapter *padapter, u8 Mode);
80 void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus);
81 u8 rtl8188e_set_raid_cmd(struct adapter *padapter, u32 mask);
82 void rtl8188e_Add_RateATid(struct adapter *padapter, u32 bitmap, u8 arg,
83 			   u8 rssi_level);
84 
85 void rtl8188e_set_p2p_ps_offload_cmd(struct adapter *adapt, u8 p2p_ps_state);
86 
87 void CheckFwRsvdPageContent(struct adapter *adapt);
88 void rtl8188e_set_FwMediaStatus_cmd(struct adapter *adapt, __le16 mstatus_rpt);
89 
90 #endif/* __RTL8188E_CMD_H__ */
91