0001
0002
0003
0004 #ifndef __FW_COMMON_H__
0005 #define __FW_COMMON_H__
0006
0007 #define REG_SYS_FUNC_EN 0x0002
0008 #define REG_MCUFWDL 0x0080
0009 #define FW_8192C_PAGE_SIZE 4096
0010 #define FW_8723A_POLLING_TIMEOUT_COUNT 1000
0011 #define FW_8723B_POLLING_TIMEOUT_COUNT 6000
0012 #define FW_8192C_POLLING_DELAY 5
0013
0014 #define MCUFWDL_RDY BIT(1)
0015 #define FWDL_CHKSUM_RPT BIT(2)
0016 #define WINTINI_RDY BIT(6)
0017
0018 #define REG_RSV_CTRL 0x001C
0019 #define REG_HMETFR 0x01CC
0020
0021 enum version_8723e {
0022 VERSION_TEST_UMC_CHIP_8723 = 0x0081,
0023 VERSION_NORMAL_UMC_CHIP_8723_1T1R_A_CUT = 0x0089,
0024 VERSION_NORMAL_UMC_CHIP_8723_1T1R_B_CUT = 0x1089,
0025 VERSION_TEST_CHIP_1T1R_8723B = 0x0106,
0026 VERSION_NORMAL_SMIC_CHIP_1T1R_8723B = 0x010E,
0027 VERSION_UNKNOWN = 0xFF,
0028 };
0029
0030 enum rtl8723be_cmd {
0031 H2C_8723BE_RSVDPAGE = 0,
0032 H2C_8723BE_JOINBSSRPT = 1,
0033 H2C_8723BE_SCAN = 2,
0034 H2C_8723BE_KEEP_ALIVE_CTRL = 3,
0035 H2C_8723BE_DISCONNECT_DECISION = 4,
0036 H2C_8723BE_INIT_OFFLOAD = 6,
0037 H2C_8723BE_AP_OFFLOAD = 8,
0038 H2C_8723BE_BCN_RSVDPAGE = 9,
0039 H2C_8723BE_PROBERSP_RSVDPAGE = 10,
0040
0041 H2C_8723BE_SETPWRMODE = 0x20,
0042 H2C_8723BE_PS_TUNING_PARA = 0x21,
0043 H2C_8723BE_PS_TUNING_PARA2 = 0x22,
0044 H2C_8723BE_PS_LPS_PARA = 0x23,
0045 H2C_8723BE_P2P_PS_OFFLOAD = 0x24,
0046
0047 H2C_8723BE_WO_WLAN = 0x80,
0048 H2C_8723BE_REMOTE_WAKE_CTRL = 0x81,
0049 H2C_8723BE_AOAC_GLOBAL_INFO = 0x82,
0050 H2C_8723BE_AOAC_RSVDPAGE = 0x83,
0051 H2C_8723BE_RSSI_REPORT = 0x42,
0052 H2C_8723BE_RA_MASK = 0x40,
0053 H2C_8723BE_SELECTIVE_SUSPEND_ROF_CMD,
0054 H2C_8723BE_P2P_PS_MODE,
0055 H2C_8723BE_PSD_RESULT,
0056
0057 H2C_8723BE_P2P_PS_CTW_CMD,
0058 MAX_8723BE_H2CCMD
0059 };
0060
0061 void rtl8723ae_firmware_selfreset(struct ieee80211_hw *hw);
0062 void rtl8723be_firmware_selfreset(struct ieee80211_hw *hw);
0063 void rtl8723_enable_fw_download(struct ieee80211_hw *hw, bool enable);
0064 void rtl8723_write_fw(struct ieee80211_hw *hw,
0065 enum version_8723e version,
0066 u8 *buffer, u32 size, u8 max_page);
0067 int rtl8723_fw_free_to_go(struct ieee80211_hw *hw, bool is_8723be, int count);
0068 int rtl8723_download_fw(struct ieee80211_hw *hw, bool is_8723be, int count);
0069 bool rtl8723_cmd_send_packet(struct ieee80211_hw *hw,
0070 struct sk_buff *skb);
0071
0072 #endif