1 /******************************************************************************
3 * Copyright(c) 2007 - 2012 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 ******************************************************************************/
15 #ifndef __RTL8723A_CMD_H__
16 #define __RTL8723A_CMD_H__
19 #define H2C_BT_FW_PATCH_LEN 3
20 #define H2C_BT_PWR_FORCE_LEN 3
22 enum cmd_msg_element_id
32 MACID_PS_MODE_EID
= 7,
33 P2P_PS_OFFLOAD_EID
= 8,
34 SELECTIVE_SUSPEND_ROF_CMD
= 9,
35 BT_QUEUE_PKT_EID
= 17,
38 P2P_PS_CTW_CMD_EID
= 32,
39 FORCE_BT_TX_PWR_EID
= 33,
40 SET_TDMA_WLAN_ACT_TIME_EID
= 34,
41 SET_BT_TX_RETRY_INDEX_EID
= 35,
42 HID_PROFILE_ENABLE_EID
= 36,
43 BT_IGNORE_WLAN_ACT_EID
= 37,
44 BT_PTA_MANAGER_UPDATE_ENABLE_EID
= 38,
45 DAC_SWING_VALUE_EID
= 41,
46 TRADITIONAL_TDMA_EN_EID
= 51,
56 u8 eid
; /* element id */
61 struct setpwrmode_parm
{
64 u8 AwakeInterval
; /* unit: beacon interval */
67 #define SETPM_LOWRXBCN BIT(0)
68 #define SETPM_AUTOANTSWITCH BIT(1)
69 #define SETPM_PSALLOWBTHIGHPRI BIT(2)
73 struct H2C_SS_RFOFF_PARAM
{
74 u8 ROFOn
; /* 1: on, 0:off */
75 u16 gpio_period
; /* unit: 1024 us */
76 }__attribute__ ((packed
));
79 struct joinbssrpt_parm
{
80 u8 OpMode
; /* enum rt_media_status */
91 struct P2P_PS_Offload_t
{
93 u8 role
:1; /* 1: Owner, 0: Client */
97 u8 AllStaSleep
:1; /* Only valid in Owner */
102 struct P2P_PS_CTWPeriod_t
{
103 u8 CTWPeriod
; /* TU */
106 #define B_TDMA_EN BIT(0)
107 #define B_TDMA_FIXANTINBT BIT(1)
108 #define B_TDMA_TXPSPOLL BIT(2)
109 #define B_TDMA_VAL870 BIT(3)
110 #define B_TDMA_AUTOWAKEUP BIT(4)
111 #define B_TDMA_NOPS BIT(5)
112 #define B_TDMA_WLANHIGHPRI BIT(6)
114 struct b_type_tdma_parm
{
122 struct scan_en_parm
{
127 #define SET_H2CCMD_BT_PWR_IDX(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value)
130 #define SET_H2CCMD_BT_FW_PATCH_ENABLE(__pH2CCmd, __Value) SET_BITS_TO_LE_4BYTE(__pH2CCmd, 0, 8, __Value) /* SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) */
131 #define SET_H2CCMD_BT_FW_PATCH_SIZE(__pH2CCmd, __Value) SET_BITS_TO_LE_4BYTE(__pH2CCmd, 8, 16, __Value) /* SET_BITS_TO_LE_2BYTE((__pH2CCmd)+1, 0, 16, __Value) */
133 struct lowpwr_lps_parm
{
135 u8 tb_bcn_threshold
:3;
140 u8 max_bcn_timeout_period
;
144 /* host message to firmware cmd */
145 void rtl8723a_set_FwPwrMode_cmd(struct rtw_adapter
*padapter
, u8 Mode
);
146 void rtl8723a_set_FwJoinBssReport_cmd(struct rtw_adapter
*padapter
, u8 mstatus
);
147 #ifdef CONFIG_8723AU_BT_COEXIST
148 void rtl8723a_set_BTCoex_AP_mode_FwRsvdPkt_cmd(struct rtw_adapter
*padapter
);
150 #define rtl8723a_set_BTCoex_AP_mode_FwRsvdPkt_cmd(padapter) do {} while(0)
152 int rtl8723a_set_rssi_cmd(struct rtw_adapter
*padapter
, u32 param
);
153 int rtl8723a_set_raid_cmd(struct rtw_adapter
*padapter
, u32 mask
, u8 arg
);
154 void rtl8723a_add_rateatid(struct rtw_adapter
*padapter
, u32 bitmap
, u8 arg
, u8 rssi_level
);
156 int FillH2CCmd(struct rtw_adapter
*padapter
, u8 ElementID
, u32 CmdLen
, u8
*pCmdBuffer
);