mirror of
https://github.com/aircrack-ng/rtl8812au.git
synced 2024-11-22 05:14:35 +00:00
parent
dc8dcb4fa2
commit
ca797e114b
280
hal/hal_com.c
280
hal/hal_com.c
@ -4330,6 +4330,28 @@ s32 rtw_hal_set_FwMediaStatusRpt_cmd(_adapter *adapter, bool opmode, bool miraca
|
||||
if (ret != _SUCCESS)
|
||||
goto exit;
|
||||
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (rtw_get_chip_type(adapter) == RTL8188E) {
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
|
||||
/* 8188E FW doesn't set macid no link, driver does it by self */
|
||||
if (opmode)
|
||||
rtw_hal_set_hwreg(adapter, HW_VAR_MACID_LINK, &macid);
|
||||
else
|
||||
rtw_hal_set_hwreg(adapter, HW_VAR_MACID_NOLINK, &macid);
|
||||
|
||||
/* for 8188E RA */
|
||||
#if (RATE_ADAPTIVE_SUPPORT == 1)
|
||||
if (hal_data->fw_ractrl == _FALSE) {
|
||||
u8 max_macid;
|
||||
|
||||
max_macid = rtw_search_max_mac_id(adapter);
|
||||
rtw_hal_set_hwreg(adapter, HW_VAR_TX_RPT_MAX_MACID, &max_macid);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A)
|
||||
/* TODO: this should move to IOT issue area */
|
||||
if (rtw_get_chip_type(adapter) == RTL8812
|
||||
@ -4734,6 +4756,21 @@ static void rtw_hal_force_enable_rxdma(_adapter *adapter)
|
||||
rtw_write32(adapter, REG_RXPKT_NUM,
|
||||
(rtw_read32(adapter, REG_RXPKT_NUM) & (~RW_RELEASE_EN)));
|
||||
}
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
static void rtw_hal_disable_tx_report(_adapter *adapter)
|
||||
{
|
||||
rtw_write8(adapter, REG_TX_RPT_CTRL,
|
||||
((rtw_read8(adapter, REG_TX_RPT_CTRL) & ~BIT(1))) & ~BIT(5));
|
||||
RTW_INFO("disable TXRPT:0x%02x\n", rtw_read8(adapter, REG_TX_RPT_CTRL));
|
||||
}
|
||||
|
||||
static void rtw_hal_enable_tx_report(_adapter *adapter)
|
||||
{
|
||||
rtw_write8(adapter, REG_TX_RPT_CTRL,
|
||||
((rtw_read8(adapter, REG_TX_RPT_CTRL) | BIT(1))) | BIT(5));
|
||||
RTW_INFO("enable TX_RPT:0x%02x\n", rtw_read8(adapter, REG_TX_RPT_CTRL));
|
||||
}
|
||||
#endif
|
||||
static void rtw_hal_release_rx_dma(_adapter *adapter)
|
||||
{
|
||||
u32 val32 = 0;
|
||||
@ -5819,6 +5856,10 @@ static void rtw_hal_ap_wow_enable(_adapter *padapter)
|
||||
issue_beacon(padapter, 0);
|
||||
|
||||
rtw_msleep_os(2);
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(padapter))
|
||||
rtw_hal_disable_tx_report(padapter);
|
||||
#endif
|
||||
/* RX DMA stop */
|
||||
res = rtw_hal_pause_rx_dma(padapter);
|
||||
if (res == _FAIL)
|
||||
@ -5879,6 +5920,11 @@ static void rtw_hal_ap_wow_disable(_adapter *padapter)
|
||||
}
|
||||
#endif /*DBG_CHECK_FW_PS_STATE*/
|
||||
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(padapter))
|
||||
rtw_hal_enable_tx_report(padapter);
|
||||
#endif
|
||||
|
||||
rtw_hal_force_enable_rxdma(padapter);
|
||||
|
||||
rtw_hal_fw_dl(padapter, _FALSE);
|
||||
@ -9558,6 +9604,10 @@ static void rtw_hal_wow_enable(_adapter *adapter)
|
||||
(u8 *)&media_status_rpt);
|
||||
|
||||
/* RX DMA stop */
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(adapter))
|
||||
rtw_hal_disable_tx_report(adapter);
|
||||
#endif
|
||||
|
||||
res = rtw_hal_pause_rx_dma(adapter);
|
||||
if (res == _FAIL)
|
||||
@ -9746,6 +9796,11 @@ static void rtw_hal_wow_disable(_adapter *adapter)
|
||||
#endif
|
||||
rtw_hal_release_rx_dma(adapter);
|
||||
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(adapter))
|
||||
rtw_hal_enable_tx_report(adapter);
|
||||
#endif
|
||||
|
||||
if ((pwrctl->wowlan_wake_reason != RX_DISASSOC) &&
|
||||
(pwrctl->wowlan_wake_reason != RX_DEAUTH) &&
|
||||
(pwrctl->wowlan_wake_reason != FW_DECISION_DISCONNECT)) {
|
||||
@ -12549,6 +12604,61 @@ int hal_efuse_macaddr_offset(_adapter *adapter)
|
||||
interface_type = rtw_get_intf_type(adapter);
|
||||
|
||||
switch (rtw_get_chip_type(adapter)) {
|
||||
#ifdef CONFIG_RTL8723B
|
||||
case RTL8723B:
|
||||
if (interface_type == RTW_USB)
|
||||
addr_offset = EEPROM_MAC_ADDR_8723BU;
|
||||
else if (interface_type == RTW_SDIO)
|
||||
addr_offset = EEPROM_MAC_ADDR_8723BS;
|
||||
else if (interface_type == RTW_PCIE)
|
||||
addr_offset = EEPROM_MAC_ADDR_8723BE;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8703B
|
||||
case RTL8703B:
|
||||
if (interface_type == RTW_USB)
|
||||
addr_offset = EEPROM_MAC_ADDR_8703BU;
|
||||
else if (interface_type == RTW_SDIO)
|
||||
addr_offset = EEPROM_MAC_ADDR_8703BS;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8723D
|
||||
case RTL8723D:
|
||||
if (interface_type == RTW_USB)
|
||||
addr_offset = EEPROM_MAC_ADDR_8723DU;
|
||||
else if (interface_type == RTW_SDIO)
|
||||
addr_offset = EEPROM_MAC_ADDR_8723DS;
|
||||
else if (interface_type == RTW_PCIE)
|
||||
addr_offset = EEPROM_MAC_ADDR_8723DE;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8188E
|
||||
case RTL8188E:
|
||||
if (interface_type == RTW_USB)
|
||||
addr_offset = EEPROM_MAC_ADDR_88EU;
|
||||
else if (interface_type == RTW_SDIO)
|
||||
addr_offset = EEPROM_MAC_ADDR_88ES;
|
||||
else if (interface_type == RTW_PCIE)
|
||||
addr_offset = EEPROM_MAC_ADDR_88EE;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188F
|
||||
case RTL8188F:
|
||||
if (interface_type == RTW_USB)
|
||||
addr_offset = EEPROM_MAC_ADDR_8188FU;
|
||||
else if (interface_type == RTW_SDIO)
|
||||
addr_offset = EEPROM_MAC_ADDR_8188FS;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188GTV
|
||||
case RTL8188GTV:
|
||||
if (interface_type == RTW_USB)
|
||||
addr_offset = EEPROM_MAC_ADDR_8188GTVU;
|
||||
else if (interface_type == RTW_SDIO)
|
||||
addr_offset = EEPROM_MAC_ADDR_8188GTVS;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8812A
|
||||
case RTL8812:
|
||||
if (interface_type == RTW_USB)
|
||||
@ -12567,6 +12677,16 @@ int hal_efuse_macaddr_offset(_adapter *adapter)
|
||||
addr_offset = EEPROM_MAC_ADDR_8821AE;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8192E
|
||||
case RTL8192E:
|
||||
if (interface_type == RTW_USB)
|
||||
addr_offset = EEPROM_MAC_ADDR_8192EU;
|
||||
else if (interface_type == RTW_SDIO)
|
||||
addr_offset = EEPROM_MAC_ADDR_8192ES;
|
||||
else if (interface_type == RTW_PCIE)
|
||||
addr_offset = EEPROM_MAC_ADDR_8192EE;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8814A
|
||||
case RTL8814A:
|
||||
if (interface_type == RTW_USB)
|
||||
@ -12576,6 +12696,46 @@ int hal_efuse_macaddr_offset(_adapter *adapter)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822B
|
||||
case RTL8822B:
|
||||
if (interface_type == RTW_USB)
|
||||
addr_offset = EEPROM_MAC_ADDR_8822BU;
|
||||
else if (interface_type == RTW_SDIO)
|
||||
addr_offset = EEPROM_MAC_ADDR_8822BS;
|
||||
else if (interface_type == RTW_PCIE)
|
||||
addr_offset = EEPROM_MAC_ADDR_8822BE;
|
||||
break;
|
||||
#endif /* CONFIG_RTL8822B */
|
||||
|
||||
#ifdef CONFIG_RTL8821C
|
||||
case RTL8821C:
|
||||
if (interface_type == RTW_USB)
|
||||
addr_offset = EEPROM_MAC_ADDR_8821CU;
|
||||
else if (interface_type == RTW_SDIO)
|
||||
addr_offset = EEPROM_MAC_ADDR_8821CS;
|
||||
else if (interface_type == RTW_PCIE)
|
||||
addr_offset = EEPROM_MAC_ADDR_8821CE;
|
||||
break;
|
||||
#endif /* CONFIG_RTL8821C */
|
||||
|
||||
#ifdef CONFIG_RTL8710B
|
||||
case RTL8710B:
|
||||
if (interface_type == RTW_USB)
|
||||
addr_offset = EEPROM_MAC_ADDR_8710B;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8192F
|
||||
case RTL8192F:
|
||||
if (interface_type == RTW_USB)
|
||||
addr_offset = EEPROM_MAC_ADDR_8192FU;
|
||||
else if (interface_type == RTW_SDIO)
|
||||
addr_offset = EEPROM_MAC_ADDR_8192FS;
|
||||
else if (interface_type == RTW_PCIE)
|
||||
addr_offset = EEPROM_MAC_ADDR_8192FE;
|
||||
break;
|
||||
#endif /* CONFIG_RTL8192F */
|
||||
|
||||
}
|
||||
|
||||
if (addr_offset == -1) {
|
||||
@ -12793,6 +12953,32 @@ void rtw_bb_rf_gain_offset(_adapter *padapter)
|
||||
} else
|
||||
RTW_INFO("Using the default RF gain.\n");
|
||||
|
||||
#elif defined(CONFIG_RTL8188E)
|
||||
if (value & BIT4 && (registry_par->RegPwrTrimEnable == 1)) {
|
||||
RTW_INFO("8188ES Offset RF Gain.\n");
|
||||
RTW_INFO("8188ES Offset RF Gain. EEPROMRFGainVal=0x%x\n",
|
||||
pHalData->EEPROMRFGainVal);
|
||||
|
||||
if (pHalData->EEPROMRFGainVal != 0xff) {
|
||||
res = rtw_hal_read_rfreg(padapter, RF_PATH_A,
|
||||
REG_RF_BB_GAIN_OFFSET, 0xffffffff);
|
||||
|
||||
RTW_INFO("Offset RF Gain. reg 0x55=0x%x\n", res);
|
||||
res &= 0xfff87fff;
|
||||
|
||||
res |= (pHalData->EEPROMRFGainVal & 0x0f) << 15;
|
||||
RTW_INFO("Offset RF Gain. res=0x%x\n", res);
|
||||
|
||||
rtw_hal_write_rfreg(padapter, RF_PATH_A,
|
||||
REG_RF_BB_GAIN_OFFSET,
|
||||
RF_GAIN_OFFSET_MASK, res);
|
||||
} else {
|
||||
RTW_INFO("Offset RF Gain. EEPROMRFGainVal=0x%x == 0xff, didn't run Kfree\n",
|
||||
pHalData->EEPROMRFGainVal);
|
||||
}
|
||||
} else
|
||||
RTW_INFO("Using the default RF gain.\n");
|
||||
#else
|
||||
/* TODO: call this when channel switch */
|
||||
if (kfree_data->flag & KFREE_FLAG_ON)
|
||||
rtw_rf_apply_tx_gain_offset(padapter, 6); /* input ch6 to select BB_GAIN_2G */
|
||||
@ -13524,8 +13710,14 @@ u8 rtw_get_current_tx_sgi(_adapter *padapter, struct sta_info *psta)
|
||||
return curr_tx_sgi;
|
||||
|
||||
if (padapter->fix_rate == 0xff) {
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
#if (RATE_ADAPTIVE_SUPPORT == 1)
|
||||
curr_tx_sgi = hal_data->odmpriv.ra_info[psta->cmn.mac_id].rate_sgi;
|
||||
#endif /* (RATE_ADAPTIVE_SUPPORT == 1)*/
|
||||
#else
|
||||
ra_info = &psta->cmn.ra_info;
|
||||
curr_tx_sgi = ((ra_info->curr_tx_rate) & 0x80) >> 7;
|
||||
#endif
|
||||
} else {
|
||||
curr_tx_sgi = ((padapter->fix_rate) & 0x80) >> 7;
|
||||
}
|
||||
@ -13543,8 +13735,14 @@ u8 rtw_get_current_tx_rate(_adapter *padapter, struct sta_info *psta)
|
||||
return rate_id;
|
||||
|
||||
if (padapter->fix_rate == 0xff) {
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
#if (RATE_ADAPTIVE_SUPPORT == 1)
|
||||
rate_id = hal_data->odmpriv.ra_info[psta->cmn.mac_id].decision_rate;
|
||||
#endif /* (RATE_ADAPTIVE_SUPPORT == 1)*/
|
||||
#else
|
||||
ra_info = &psta->cmn.ra_info;
|
||||
rate_id = ra_info->curr_tx_rate & 0x7f;
|
||||
#endif
|
||||
} else {
|
||||
rate_id = padapter->fix_rate & 0x7f;
|
||||
}
|
||||
@ -13628,6 +13826,14 @@ void hal_set_crystal_cap(_adapter *adapter, u8 crystal_cap)
|
||||
crystal_cap = crystal_cap & 0x3F;
|
||||
|
||||
switch (rtw_get_chip_type(adapter)) {
|
||||
#if defined(CONFIG_RTL8188E) || defined(CONFIG_RTL8188F) || defined(CONFIG_RTL8188GTV)
|
||||
case RTL8188E:
|
||||
case RTL8188F:
|
||||
case RTL8188GTV:
|
||||
/* write 0x24[16:11] = 0x24[22:17] = CrystalCap */
|
||||
phy_set_bb_reg(adapter, REG_AFE_XTAL_CTRL, 0x007FF800, (crystal_cap | (crystal_cap << 6)));
|
||||
break;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8812A)
|
||||
case RTL8812:
|
||||
/* write 0x2C[30:25] = 0x2C[24:19] = CrystalCap */
|
||||
@ -13651,6 +13857,25 @@ void hal_set_crystal_cap(_adapter *adapter, u8 crystal_cap)
|
||||
/* write 0x2C[26:21] = 0x2C[20:15] = CrystalCap*/
|
||||
phy_set_bb_reg(adapter, REG_MAC_PHY_CTRL, 0x07FF8000, (crystal_cap | (crystal_cap << 6)));
|
||||
break;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8192F)
|
||||
|
||||
case RTL8822B:
|
||||
case RTL8821C:
|
||||
case RTL8192F:
|
||||
/* write 0x28[6:1] = 0x24[30:25] = CrystalCap */
|
||||
crystal_cap = crystal_cap & 0x3F;
|
||||
phy_set_bb_reg(adapter, REG_AFE_XTAL_CTRL, 0x7E000000, crystal_cap);
|
||||
phy_set_bb_reg(adapter, REG_AFE_PLL_CTRL, 0x7E, crystal_cap);
|
||||
break;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8710B)
|
||||
case RTL8710B:
|
||||
/*Change by ylb 20160728, Becase 0x2C[23:12] is removed to syson 0x60[29:18] */
|
||||
/* 0x2C[23:18] = 0x2C[29:24] = CrystalCap //Xo:[29:24], Xi:[23:18]*/
|
||||
crystal_cap = crystal_cap & 0x3F;
|
||||
hal_set_syson_reg(adapter, REG_SYS_XTAL_CTRL0, 0x3FFC0000, (crystal_cap | (crystal_cap << 6)));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
rtw_warn_on(1);
|
||||
@ -13665,6 +13890,36 @@ int hal_spec_init(_adapter *adapter)
|
||||
interface_type = rtw_get_intf_type(adapter);
|
||||
|
||||
switch (rtw_get_chip_type(adapter)) {
|
||||
#ifdef CONFIG_RTL8723B
|
||||
case RTL8723B:
|
||||
init_hal_spec_8723b(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8703B
|
||||
case RTL8703B:
|
||||
init_hal_spec_8703b(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8723D
|
||||
case RTL8723D:
|
||||
init_hal_spec_8723d(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188E
|
||||
case RTL8188E:
|
||||
init_hal_spec_8188e(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188F
|
||||
case RTL8188F:
|
||||
init_hal_spec_8188f(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188GTV
|
||||
case RTL8188GTV:
|
||||
init_hal_spec_8188gtv(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8812A
|
||||
case RTL8812:
|
||||
init_hal_spec_8812a(adapter);
|
||||
@ -13675,11 +13930,36 @@ int hal_spec_init(_adapter *adapter)
|
||||
init_hal_spec_8821a(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8192E
|
||||
case RTL8192E:
|
||||
init_hal_spec_8192e(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8814A
|
||||
case RTL8814A:
|
||||
init_hal_spec_8814a(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8822B
|
||||
case RTL8822B:
|
||||
rtl8822b_init_hal_spec(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8821C
|
||||
case RTL8821C:
|
||||
init_hal_spec_rtl8821c(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8710B
|
||||
case RTL8710B:
|
||||
init_hal_spec_8710b(adapter);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8192F
|
||||
case RTL8192F:
|
||||
init_hal_spec_8192f(adapter);
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
RTW_ERR("%s: unknown chip_type:%u\n"
|
||||
|
@ -20,9 +20,20 @@
|
||||
|
||||
const u32 _chip_type_to_odm_ic_type[] = {
|
||||
0,
|
||||
ODM_RTL8188E,
|
||||
ODM_RTL8192E,
|
||||
ODM_RTL8812,
|
||||
ODM_RTL8821,
|
||||
ODM_RTL8723B,
|
||||
ODM_RTL8814A,
|
||||
ODM_RTL8703B,
|
||||
ODM_RTL8188F,
|
||||
ODM_RTL8188F,
|
||||
ODM_RTL8822B,
|
||||
ODM_RTL8723D,
|
||||
ODM_RTL8821C,
|
||||
ODM_RTL8710B,
|
||||
ODM_RTL8192F,
|
||||
0,
|
||||
};
|
||||
|
||||
@ -1402,6 +1413,7 @@ bool rtw_hal_rfkill_poll(_adapter *adapter, u8 *valid)
|
||||
u8 rtw_hal_ops_check(_adapter *padapter)
|
||||
{
|
||||
u8 ret = _SUCCESS;
|
||||
#if 1
|
||||
/*** initialize section ***/
|
||||
if (NULL == padapter->hal_func.read_chip_version) {
|
||||
rtw_hal_error_msg("read_chip_version");
|
||||
@ -1591,6 +1603,12 @@ u8 rtw_hal_ops_check(_adapter *padapter)
|
||||
rtw_hal_error_msg("hal_mac_c2h_handler");
|
||||
ret = _FAIL;
|
||||
}
|
||||
#elif !defined(CONFIG_RTL8188E)
|
||||
if (NULL == padapter->hal_func.c2h_handler) {
|
||||
rtw_hal_error_msg("c2h_handler");
|
||||
ret = _FAIL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_LPS) || defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
|
||||
if (NULL == padapter->hal_func.fill_fake_txdesc) {
|
||||
|
27
hal/hal_mp.c
27
hal/hal_mp.c
@ -21,12 +21,39 @@
|
||||
#ifdef RTW_HALMAC
|
||||
#include <hal_data.h> /* struct HAL_DATA_TYPE, RF register definition and etc. */
|
||||
#else /* !RTW_HALMAC */
|
||||
#ifdef CONFIG_RTL8188E
|
||||
#include <rtl8188e_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8723B
|
||||
#include <rtl8723b_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8192E
|
||||
#include <rtl8192e_hal.h>
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8812A)
|
||||
#include <rtl8814a_hal.h>
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A)
|
||||
#include <rtl8812a_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8703B
|
||||
#include <rtl8703b_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8723D
|
||||
#include <rtl8723d_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8710B
|
||||
#include <rtl8710b_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188F
|
||||
#include <rtl8188f_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188GTV
|
||||
#include <rtl8188gtv_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8192F
|
||||
#include <rtl8192f_hal.h>
|
||||
#endif
|
||||
#endif /* !RTW_HALMAC */
|
||||
|
||||
|
||||
|
@ -1202,6 +1202,16 @@ VOID
|
||||
IN BOOLEAN is2T
|
||||
)
|
||||
{
|
||||
#if (RT_PLATFORM == PLATFORM_WINDOWS)
|
||||
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
|
||||
#endif
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
u4Byte tmpReg, tmpReg2, index, i;
|
||||
u1Byte path, pathbound = PATH_NUM;
|
||||
@ -1216,12 +1226,12 @@ VOID
|
||||
rRx_TO_Rx, rStandby,
|
||||
rSleep, rPMPD_ANAEN };
|
||||
|
||||
u4Byte BB_backup[DP_BB_REG_NUM];
|
||||
u4Byte BB_backup[DP_BB_REG_NUM];
|
||||
u4Byte BB_REG[DP_BB_REG_NUM] = {
|
||||
rOFDM0_TRxPathEnable, rFPGA0_RFMOD,
|
||||
rOFDM0_TRxPathEnable, rFPGA0_RFMOD,
|
||||
rOFDM0_TRMuxPar, rFPGA0_XCD_RFInterfaceSW,
|
||||
rFPGA0_XAB_RFInterfaceSW, rFPGA0_XA_RFInterfaceOE,
|
||||
rFPGA0_XB_RFInterfaceOE};
|
||||
rFPGA0_XAB_RFInterfaceSW, rFPGA0_XA_RFInterfaceOE,
|
||||
rFPGA0_XB_RFInterfaceOE};
|
||||
u4Byte BB_settings[DP_BB_REG_NUM] = {
|
||||
0x00a05430, 0x02040000, 0x000800e4, 0x22208000,
|
||||
0x0, 0x0, 0x0};
|
||||
|
@ -1201,29 +1201,39 @@ VOID
|
||||
IN BOOLEAN is2T
|
||||
)
|
||||
{
|
||||
#if (RT_PLATFORM == PLATFORM_WINDOWS)
|
||||
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
|
||||
#endif
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
u32 tmpReg, tmpReg2, index, i;
|
||||
u8 path, pathbound = PATH_NUM;
|
||||
u32 AFE_backup[IQK_ADDA_REG_NUM];
|
||||
u32 AFE_REG[IQK_ADDA_REG_NUM] = {
|
||||
rFPGA0_XCD_SwitchControl, rBlue_Tooth,
|
||||
u32 AFE_REG[IQK_ADDA_REG_NUM] = {
|
||||
rFPGA0_XCD_SwitchControl, rBlue_Tooth,
|
||||
rRx_Wait_CCA, rTx_CCK_RFON,
|
||||
rTx_CCK_BBON, rTx_OFDM_RFON,
|
||||
rTx_CCK_BBON, rTx_OFDM_RFON,
|
||||
rTx_OFDM_BBON, rTx_To_Rx,
|
||||
rTx_To_Tx, rRx_CCK,
|
||||
rTx_To_Tx, rRx_CCK,
|
||||
rRx_OFDM, rRx_Wait_RIFS,
|
||||
rRx_TO_Rx, rStandby,
|
||||
rRx_TO_Rx, rStandby,
|
||||
rSleep, rPMPD_ANAEN };
|
||||
|
||||
u32 BB_backup[DP_BB_REG_NUM];
|
||||
u32 BB_backup[DP_BB_REG_NUM];
|
||||
u32 BB_REG[DP_BB_REG_NUM] = {
|
||||
rOFDM0_TRxPathEnable, rFPGA0_RFMOD,
|
||||
rOFDM0_TRxPathEnable, rFPGA0_RFMOD,
|
||||
rOFDM0_TRMuxPar, rFPGA0_XCD_RFInterfaceSW,
|
||||
rFPGA0_XAB_RFInterfaceSW, rFPGA0_XA_RFInterfaceOE,
|
||||
rFPGA0_XB_RFInterfaceOE};
|
||||
rFPGA0_XB_RFInterfaceOE};
|
||||
u32 BB_settings[DP_BB_REG_NUM] = {
|
||||
0x00a05430, 0x02040000, 0x000800e4, 0x22208000,
|
||||
0x0, 0x0, 0x0};
|
||||
0x0, 0x0, 0x0};
|
||||
|
||||
u32 RF_backup[DP_PATH_NUM][DP_RF_REG_NUM];
|
||||
u32 RF_REG[DP_RF_REG_NUM] = {
|
||||
|
@ -1585,9 +1585,9 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_HAL_DM);
|
||||
// Reset USB mode switch setting
|
||||
rtw_write8(Adapter, REG_SDIO_CTRL_8814A, 0x0);
|
||||
rtw_write8(Adapter, REG_ACLK_MON, 0x0);
|
||||
|
||||
|
||||
//RT_TRACE(COMP_INIT, DBG_TRACE, ("InitializeAdapter8188EUsb() <====\n"));
|
||||
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_IQK);
|
||||
// 2010/08/26 MH Merge from 8192CE.
|
||||
if(pwrctrlpriv->rf_pwrstate == rf_on)
|
||||
@ -2048,19 +2048,19 @@ InitAdapterVariablesByPROM_8814AU(
|
||||
hal_ReadTxPowerInfo8814A(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
hal_ReadBoardType8814A(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
hal_Read_TRX_antenna_8814A(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
|
||||
|
||||
//
|
||||
// Read Bluetooth co-exist and initialize
|
||||
//
|
||||
hal_EfuseParseBTCoexistInfo8814A(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
|
||||
|
||||
hal_ReadChannelPlan8814A(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
hal_EfuseParseXtal_8814A(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
hal_ReadThermalMeter_8814A(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
hal_ReadRemoteWakeup_8814A(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
hal_ReadAntennaDiversity8814A(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
hal_ReadRFEType_8814A(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
|
||||
|
||||
ReadLEDSetting_8814AU(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
|
||||
hal_ReadUsbModeSwitch_8814AU(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);
|
||||
@ -2074,7 +2074,7 @@ InitAdapterVariablesByPROM_8814AU(
|
||||
static void hal_ReadPROMContent_8814A(
|
||||
IN PADAPTER Adapter
|
||||
)
|
||||
{
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
|
||||
u8 eeValue;
|
||||
|
||||
@ -2097,7 +2097,7 @@ ReadAdapterInfo8814AU(
|
||||
)
|
||||
{
|
||||
Hal_InitEfuseVars_8814A(Adapter);
|
||||
|
||||
|
||||
/* Read all content in Efuse/EEPROM. */
|
||||
hal_ReadPROMContent_8814A(Adapter);
|
||||
|
||||
@ -2118,17 +2118,17 @@ void UpdateInterruptMask8814AU(PADAPTER padapter,u8 bHIMR0 ,u32 AddMSR, u32 Remo
|
||||
himr = &(pHalData->IntrMask[0]);
|
||||
else
|
||||
himr = &(pHalData->IntrMask[1]);
|
||||
|
||||
|
||||
if (AddMSR)
|
||||
*himr |= AddMSR;
|
||||
|
||||
if (RemoveMSR)
|
||||
*himr &= (~RemoveMSR);
|
||||
|
||||
if(bHIMR0)
|
||||
if(bHIMR0)
|
||||
rtw_write32(padapter, REG_HIMR0_8814A, *himr);
|
||||
else
|
||||
rtw_write32(padapter, REG_HIMR1_8814A, *himr);
|
||||
rtw_write32(padapter, REG_HIMR1_8814A, *himr);
|
||||
|
||||
}
|
||||
|
||||
@ -2223,7 +2223,7 @@ u8 SetHwReg8814AU(PADAPTER Adapter, u8 variable, u8* val)
|
||||
|
||||
void GetHwReg8814AU(PADAPTER Adapter, u8 variable, u8* val)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
switch(variable)
|
||||
{
|
||||
@ -2340,7 +2340,7 @@ static void rtl8814au_init_default_value(_adapter * padapter)
|
||||
}
|
||||
|
||||
static u8 rtl8814au_ps_func(PADAPTER Adapter,HAL_INTF_PS_FUNC efunc_id, u8 *val)
|
||||
{
|
||||
{
|
||||
u8 bResult = _TRUE;
|
||||
switch(efunc_id){
|
||||
|
||||
@ -2365,7 +2365,7 @@ void rtl8814au_set_hal_ops(_adapter * padapter)
|
||||
|
||||
pHalFunc->hal_power_on = _InitPowerOn_8814AU;
|
||||
pHalFunc->hal_power_off = hal_carddisable_8814;
|
||||
|
||||
|
||||
pHalFunc->hal_init = &rtl8814au_hal_init;
|
||||
pHalFunc->hal_deinit = &rtl8814au_hal_deinit;
|
||||
|
||||
@ -2384,11 +2384,11 @@ void rtl8814au_set_hal_ops(_adapter * padapter)
|
||||
// pHalFunc->InitSwLeds = NULL;
|
||||
// pHalFunc->DeInitSwLeds = NULL;
|
||||
#endif//CONFIG_RTW_LED
|
||||
|
||||
|
||||
pHalFunc->init_default_value = &rtl8814au_init_default_value;
|
||||
pHalFunc->intf_chip_configure = &rtl8814au_interface_configure;
|
||||
pHalFunc->read_adapter_info = &ReadAdapterInfo8814AU;
|
||||
|
||||
|
||||
pHalFunc->set_hw_reg_handler = &SetHwReg8814AU;
|
||||
pHalFunc->GetHwRegHandler = &GetHwReg8814AU;
|
||||
pHalFunc->get_hal_def_var_handler = &GetHalDefVar8814AUsb;
|
||||
|
@ -15,4 +15,11 @@
|
||||
#ifndef __SDIO_OSINTF_H__
|
||||
#define __SDIO_OSINTF_H__
|
||||
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
extern NDIS_STATUS ce_sd_get_dev_hdl(PADAPTER padapter);
|
||||
SD_API_STATUS ce_sd_int_callback(SD_DEVICE_HANDLE hDevice, PADAPTER padapter);
|
||||
extern void sd_setup_irs(PADAPTER padapter);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -18,6 +18,9 @@
|
||||
#if defined(CONFIG_USB_HCI)
|
||||
|
||||
#ifndef MAX_RECVBUF_SZ
|
||||
#ifdef PLATFORM_OS_CE
|
||||
#define MAX_RECVBUF_SZ (8192+1024) /* 8K+1k */
|
||||
#else
|
||||
#ifndef CONFIG_MINIMAL_MEMORY_USAGE
|
||||
#ifdef CONFIG_PREALLOC_RX_SKB_BUFFER
|
||||
#define MAX_RECVBUF_SZ (rtw_rtkm_get_buff_size()) /*depend rtkm*/
|
||||
@ -36,6 +39,7 @@
|
||||
#else
|
||||
#define MAX_RECVBUF_SZ (4000) /* about 4K */
|
||||
#endif
|
||||
#endif
|
||||
#endif /* !MAX_RECVBUF_SZ */
|
||||
|
||||
#elif defined(CONFIG_PCI_HCI)
|
||||
|
@ -18,6 +18,9 @@
|
||||
#if defined(CONFIG_USB_HCI)
|
||||
|
||||
#ifndef MAX_RECVBUF_SZ
|
||||
#ifdef PLATFORM_OS_CE
|
||||
#define MAX_RECVBUF_SZ (8192+1024) /* 8K+1k */
|
||||
#else
|
||||
#ifndef CONFIG_MINIMAL_MEMORY_USAGE
|
||||
#ifdef CONFIG_PLATFORM_MSTAR
|
||||
#define MAX_RECVBUF_SZ (8192) /* 8K */
|
||||
@ -32,6 +35,7 @@
|
||||
#else
|
||||
#define MAX_RECVBUF_SZ (4000) /* about 4K */
|
||||
#endif
|
||||
#endif
|
||||
#endif /* !MAX_RECVBUF_SZ */
|
||||
|
||||
#elif defined(CONFIG_PCI_HCI)
|
||||
|
@ -26,7 +26,11 @@
|
||||
#define MAX_RSPSZ 512
|
||||
#define MAX_EVTSZ 1024
|
||||
|
||||
#define CMDBUFF_ALIGN_SZ 512
|
||||
#ifdef PLATFORM_OS_CE
|
||||
#define CMDBUFF_ALIGN_SZ 4
|
||||
#else
|
||||
#define CMDBUFF_ALIGN_SZ 512
|
||||
#endif
|
||||
|
||||
struct cmd_obj {
|
||||
_adapter *padapter;
|
||||
@ -110,6 +114,9 @@ struct evt_priv {
|
||||
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
u8 *c2h_mem;
|
||||
u8 *allocated_c2h_mem;
|
||||
#ifdef PLATFORM_OS_XP
|
||||
PMDL pc2h_mdl;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
};
|
||||
|
@ -28,6 +28,10 @@ enum {
|
||||
|
||||
#define DRIVER_PREFIX "RTW: "
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
extern void rtl871x_cedbg(const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
#define RTW_PRINT(x, ...) do {} while (0)
|
||||
#define RTW_ERR(x, ...) do {} while (0)
|
||||
#define RTW_WARN(x,...) do {} while (0)
|
||||
|
@ -19,6 +19,19 @@
|
||||
#define RTW_RX_MSDU_ACT_INDICATE BIT0
|
||||
#define RTW_RX_MSDU_ACT_FORWARD BIT1
|
||||
|
||||
#ifdef PLATFORM_OS_XP
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#define NR_RECVBUFF 1024/* 512 */ /* 128 */
|
||||
#else
|
||||
#define NR_RECVBUFF (16)
|
||||
#endif
|
||||
#elif defined(PLATFORM_OS_CE)
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#define NR_RECVBUFF (128)
|
||||
#else
|
||||
#define NR_RECVBUFF (4)
|
||||
#endif
|
||||
#else /* PLATFORM_LINUX /PLATFORM_BSD */
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
@ -42,6 +55,7 @@
|
||||
#ifdef CONFIG_RTW_NAPI
|
||||
#define RTL_NAPI_WEIGHT (32)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8821C) && defined(CONFIG_SDIO_HCI) && defined(CONFIG_RECV_THREAD_MODE)
|
||||
#ifdef NR_RECVBUFF
|
||||
@ -340,6 +354,17 @@ struct recv_priv {
|
||||
|
||||
_adapter *adapter;
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
_nic_hdl RxPktPoolHdl;
|
||||
_nic_hdl RxBufPoolHdl;
|
||||
|
||||
#ifdef PLATFORM_OS_XP
|
||||
PMDL pbytecnt_mdl;
|
||||
#endif
|
||||
uint counter; /* record the number that up-layer will return to drv; only when counter==0 can we release recv_priv */
|
||||
NDIS_EVENT recv_resource_evt ;
|
||||
#endif
|
||||
|
||||
|
||||
u32 is_any_non_be_pkts;
|
||||
|
||||
@ -508,11 +533,20 @@ struct recv_buf {
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
|
||||
#if defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
|
||||
#if defined(PLATFORM_OS_XP) || defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
|
||||
PURB purb;
|
||||
dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */
|
||||
u32 alloc_sz;
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_OS_XP
|
||||
PIRP pirp;
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
USB_TRANSFER usb_transfer_read_port;
|
||||
#endif
|
||||
|
||||
u8 irp_pending;
|
||||
int transfer_len;
|
||||
|
||||
|
@ -60,6 +60,10 @@
|
||||
#endif
|
||||
#define NR_XMITBUFF (128)
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
#define XMITBUF_ALIGN_SZ 4
|
||||
#else
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
#define XMITBUF_ALIGN_SZ 4
|
||||
#else
|
||||
@ -68,6 +72,7 @@
|
||||
#else
|
||||
#define XMITBUF_ALIGN_SZ 512
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* xmit extension buff defination */
|
||||
|
@ -15,4 +15,11 @@
|
||||
#ifndef __SDIO_OSINTF_H__
|
||||
#define __SDIO_OSINTF_H__
|
||||
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
extern NDIS_STATUS ce_sd_get_dev_hdl(PADAPTER padapter);
|
||||
SD_API_STATUS ce_sd_int_callback(SD_DEVICE_HANDLE hDevice, PADAPTER padapter);
|
||||
extern void sd_setup_irs(PADAPTER padapter);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1135,6 +1135,11 @@ void _rtw_init_sema(_sema *sema, int init_val)
|
||||
sema_init(sema, init_val, "rtw_drv");
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
if (*sema == NULL)
|
||||
*sema = CreateSemaphore(NULL, init_val, SEMA_UPBND, NULL);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void _rtw_free_sema(_sema *sema)
|
||||
@ -1142,6 +1147,9 @@ void _rtw_free_sema(_sema *sema)
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
sema_destroy(sema);
|
||||
#endif
|
||||
#ifdef PLATFORM_OS_CE
|
||||
CloseHandle(*sema);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@ -1156,6 +1164,10 @@ void _rtw_up_sema(_sema *sema)
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
sema_post(sema);
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
ReleaseSemaphore(*sema, 1, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
u32 _rtw_down_sema(_sema *sema)
|
||||
@ -1173,6 +1185,13 @@ u32 _rtw_down_sema(_sema *sema)
|
||||
sema_wait(sema);
|
||||
return _SUCCESS;
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
if (WAIT_OBJECT_0 == WaitForSingleObject(*sema, INFINITE))
|
||||
return _SUCCESS;
|
||||
else
|
||||
return _FAIL;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||
@ -1192,6 +1211,10 @@ inline void kthread_thread_exit(_completion *comp)
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
printf("%s", "RTKTHREAD_exit");
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
ExitThread(STATUS_SUCCESS);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void _rtw_init_completion(_completion *comp)
|
||||
@ -1227,6 +1250,10 @@ void _rtw_mutex_init(_mutex *pmutex)
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
mtx_init(pmutex, "", NULL, MTX_DEF | MTX_RECURSE);
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
*pmutex = CreateMutex(NULL, _FALSE, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void _rtw_mutex_free(_mutex *pmutex);
|
||||
@ -1243,6 +1270,10 @@ void _rtw_mutex_free(_mutex *pmutex)
|
||||
sema_destroy(pmutex);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user