1364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger/****************************************************************************** 2364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * 3364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. 4364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * 5364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * This program is free software; you can redistribute it and/or modify it 6364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * under the terms of version 2 of the GNU General Public License as 7364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * published by the Free Software Foundation. 8364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * 9364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * This program is distributed in the hope that it will be useful, but WITHOUT 10364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * more details. 13364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger * 14364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger ******************************************************************************/ 15364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#ifndef __RTL8723A_CMD_H__ 16364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define __RTL8723A_CMD_H__ 17364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 18364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 19364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define H2C_BT_FW_PATCH_LEN 3 20364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define H2C_BT_PWR_FORCE_LEN 3 21364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 22364e30ebd2dbaccba430c603da03e68746eb932aLarry Fingerenum cmd_msg_element_id 23364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger{ 24364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger NONE_CMDMSG_EID, 25364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger AP_OFFLOAD_EID = 0, 26364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger SET_PWRMODE_EID = 1, 27364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger JOINBSS_RPT_EID = 2, 28364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger RSVD_PAGE_EID = 3, 29364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger RSSI_4_EID = 4, 30364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger RSSI_SETTING_EID = 5, 31364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger MACID_CONFIG_EID = 6, 32364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger MACID_PS_MODE_EID = 7, 33364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger P2P_PS_OFFLOAD_EID = 8, 34364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger SELECTIVE_SUSPEND_ROF_CMD = 9, 35364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger BT_QUEUE_PKT_EID = 17, 36364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger BT_ANT_TDMA_EID = 20, 37364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger BT_2ANT_HID_EID = 21, 38364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger P2P_PS_CTW_CMD_EID = 32, 39364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger FORCE_BT_TX_PWR_EID = 33, 40364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger SET_TDMA_WLAN_ACT_TIME_EID = 34, 41364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger SET_BT_TX_RETRY_INDEX_EID = 35, 42364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger HID_PROFILE_ENABLE_EID = 36, 43364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger BT_IGNORE_WLAN_ACT_EID = 37, 44364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger BT_PTA_MANAGER_UPDATE_ENABLE_EID = 38, 45364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger DAC_SWING_VALUE_EID = 41, 46364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger TRADITIONAL_TDMA_EN_EID = 51, 47364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger H2C_BT_FW_PATCH = 54, 48364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger B_TYPE_TDMA_EID = 58, 49364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger SCAN_EN_EID = 59, 50364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger LOWPWR_LPS_EID = 71, 51364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger H2C_RESET_TSF = 75, 52364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger MAX_CMDMSG_EID 53364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger}; 54364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 55364e30ebd2dbaccba430c603da03e68746eb932aLarry Fingerstruct cmd_msg_parm { 56364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 eid; /* element id */ 57364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 sz; /* sz */ 58364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 buf[6]; 59364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger}; 60364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 61364e30ebd2dbaccba430c603da03e68746eb932aLarry Fingerstruct setpwrmode_parm { 62364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 Mode; 63364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 SmartPS; 64364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 AwakeInterval; /* unit: beacon interval */ 65364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 bAllQueueUAPSD; 66364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 67364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define SETPM_LOWRXBCN BIT(0) 68364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define SETPM_AUTOANTSWITCH BIT(1) 69364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define SETPM_PSALLOWBTHIGHPRI BIT(2) 70364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 BcnAntMode; 71364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger} __packed; 72364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 73364e30ebd2dbaccba430c603da03e68746eb932aLarry Fingerstruct H2C_SS_RFOFF_PARAM{ 74364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 ROFOn; /* 1: on, 0:off */ 75364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u16 gpio_period; /* unit: 1024 us */ 76364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger}__attribute__ ((packed)); 77364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 78364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 79364e30ebd2dbaccba430c603da03e68746eb932aLarry Fingerstruct joinbssrpt_parm { 80364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 OpMode; /* enum rt_media_status */ 81364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger}; 82364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 83364e30ebd2dbaccba430c603da03e68746eb932aLarry Fingerstruct rsvdpage_loc { 84364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 LocProbeRsp; 85364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 LocPsPoll; 86364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 LocNullData; 87364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 LocQosNull; 88364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 LocBTQosNull; 89364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger}; 90364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 91364e30ebd2dbaccba430c603da03e68746eb932aLarry Fingerstruct P2P_PS_Offload_t { 92364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 Offload_En:1; 93364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 role:1; /* 1: Owner, 0: Client */ 94364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 CTWindow_En:1; 95364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 NoA0_En:1; 96364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 NoA1_En:1; 97364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 AllStaSleep:1; /* Only valid in Owner */ 98364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 discovery:1; 99364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 rsvd:1; 100364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger}; 101364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 102364e30ebd2dbaccba430c603da03e68746eb932aLarry Fingerstruct P2P_PS_CTWPeriod_t { 103364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 CTWPeriod; /* TU */ 104364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger}; 105364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 106364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define B_TDMA_EN BIT(0) 107364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define B_TDMA_FIXANTINBT BIT(1) 108364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define B_TDMA_TXPSPOLL BIT(2) 109364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define B_TDMA_VAL870 BIT(3) 110364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define B_TDMA_AUTOWAKEUP BIT(4) 111364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define B_TDMA_NOPS BIT(5) 112364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define B_TDMA_WLANHIGHPRI BIT(6) 113364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 114364e30ebd2dbaccba430c603da03e68746eb932aLarry Fingerstruct b_type_tdma_parm { 115364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 option; 116364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 117364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 TBTTOnPeriod; 118364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 MedPeriod; 119364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 rsvd30; 120364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger} __packed; 121364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 122364e30ebd2dbaccba430c603da03e68746eb932aLarry Fingerstruct scan_en_parm { 123364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 En; 124364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger} __packed; 125364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 126364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger/* BT_PWR */ 127364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#define SET_H2CCMD_BT_PWR_IDX(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE_8BIT(__pH2CCmd, 0, 8, __Value) 128364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 129364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger/* BT_FW_PATCH */ 130364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#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) */ 131364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#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) */ 132364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 133364e30ebd2dbaccba430c603da03e68746eb932aLarry Fingerstruct lowpwr_lps_parm{ 134364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 bcn_count:4; 135364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 tb_bcn_threshold:3; 136364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 enable:1; 137364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 bcn_interval; 138364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 drop_threshold; 139364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 max_early_period; 140364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger u8 max_bcn_timeout_period; 141364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger} __packed; 142364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 143364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 144364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger/* host message to firmware cmd */ 14595d412d830f453c021dc6000a8180d18deae7985Jes Sorensenvoid rtl8723a_set_FwPwrMode_cmd(struct rtw_adapter *padapter, u8 Mode); 14695d412d830f453c021dc6000a8180d18deae7985Jes Sorensenvoid rtl8723a_set_FwJoinBssReport_cmd(struct rtw_adapter *padapter, u8 mstatus); 147364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#ifdef CONFIG_8723AU_BT_COEXIST 14895d412d830f453c021dc6000a8180d18deae7985Jes Sorensenvoid rtl8723a_set_BTCoex_AP_mode_FwRsvdPkt_cmd(struct rtw_adapter *padapter); 149ec6d68713434a1cd2a8f1917396399ebe8d02177Jes Sorensen#else 150ec6d68713434a1cd2a8f1917396399ebe8d02177Jes Sorensen#define rtl8723a_set_BTCoex_AP_mode_FwRsvdPkt_cmd(padapter) do {} while(0) 151364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#endif 15295d412d830f453c021dc6000a8180d18deae7985Jes Sorensenint rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param); 15395d412d830f453c021dc6000a8180d18deae7985Jes Sorensenint rtl8723a_set_raid_cmd(struct rtw_adapter *padapter, u32 mask, u8 arg); 15495d412d830f453c021dc6000a8180d18deae7985Jes Sorensenvoid rtl8723a_add_rateatid(struct rtw_adapter *padapter, u32 bitmap, u8 arg, u8 rssi_level); 155364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger 156379878662637a1247f19caf938a22918d702b14bJes Sorensenint FillH2CCmd(struct rtw_adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer); 157379878662637a1247f19caf938a22918d702b14bJes Sorensen 158364e30ebd2dbaccba430c603da03e68746eb932aLarry Finger#endif 159