From: Jes Sorensen Date: Wed, 9 Apr 2014 21:20:46 +0000 (+0200) Subject: staging: rtl8723au: Remove HW_VAR_EFUSE_{BT_,}BYTES X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a2342292e59a42d357ad98cc516438d476855a0b;p=linux-beck.git staging: rtl8723au: Remove HW_VAR_EFUSE_{BT_,}BYTES Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index d5ab4d787861..6c1af4919214 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -619,6 +619,7 @@ hal_ReadEFuse_WiFi(struct rtw_adapter *padapter, u8 offset, wden; u8 efuseHeader, efuseExtHdr, efuseData; u16 i, total, used; + struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); /* Do NOT excess total size of EFuse table. Added by Roger, 2008.11.10. */ @@ -696,7 +697,7 @@ hal_ReadEFuse_WiFi(struct rtw_adapter *padapter, EFUSE_GetEfuseDefinition23a(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total); used = eFuse_Addr - 1; - rtw_hal_set_hwreg23a(padapter, HW_VAR_EFUSE_BYTES, (u8 *)&used); + pHalData->EfuseUsedBytes = used; kfree(efuseTbl); } @@ -711,6 +712,7 @@ hal_ReadEFuse_BT(struct rtw_adapter *padapter, u8 efuseHeader, efuseExtHdr, efuseData; u8 offset, wden; u16 i, total, used; + struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); /* Do NOT excess total size of EFuse table. Added by Roger, 2008.11.10. */ @@ -812,7 +814,7 @@ hal_ReadEFuse_BT(struct rtw_adapter *padapter, EFUSE_GetEfuseDefinition23a(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total); used = (EFUSE_BT_REAL_BANK_CONTENT_LEN * (bank - 1)) + eFuse_Addr - 1; - rtw_hal_set_hwreg23a(padapter, HW_VAR_EFUSE_BT_BYTES, (u8 *) &used); + pHalData->BTEfuseUsedBytes = used; exit: kfree(efuseTbl); @@ -834,8 +836,9 @@ hal_EfuseGetCurrentSize_WiFi(struct rtw_adapter *padapter) u16 efuse_addr = 0; u8 hoffset = 0, hworden = 0; u8 efuse_data, word_cnts = 0; + struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); - rtw23a_hal_get_hwreg(padapter, HW_VAR_EFUSE_BYTES, (u8 *) &efuse_addr); + efuse_addr = pHalData->EfuseUsedBytes; DBG_8723A("%s: start_efuse_addr = 0x%X\n", __func__, efuse_addr); @@ -872,7 +875,7 @@ hal_EfuseGetCurrentSize_WiFi(struct rtw_adapter *padapter) efuse_addr += (word_cnts * 2) + 1; } - rtw_hal_set_hwreg23a(padapter, HW_VAR_EFUSE_BYTES, (u8 *) &efuse_addr); + pHalData->EfuseUsedBytes = efuse_addr; DBG_8723A("%s: CurrentSize =%d\n", __func__, efuse_addr); @@ -888,8 +891,9 @@ hal_EfuseGetCurrentSize_BT(struct rtw_adapter *padapter) u8 hoffset = 0, hworden = 0; u8 efuse_data, word_cnts = 0; u16 retU2 = 0; + struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); - rtw23a_hal_get_hwreg(padapter, HW_VAR_EFUSE_BT_BYTES, (u8 *) &btusedbytes); + btusedbytes = pHalData->BTEfuseUsedBytes; efuse_addr = (u16) ((btusedbytes % EFUSE_BT_REAL_BANK_CONTENT_LEN)); startBank = (u8) (1 + (btusedbytes / EFUSE_BT_REAL_BANK_CONTENT_LEN)); @@ -954,7 +958,7 @@ hal_EfuseGetCurrentSize_BT(struct rtw_adapter *padapter) } retU2 = ((bank - 1) * EFUSE_BT_REAL_BANK_CONTENT_LEN) + efuse_addr; - rtw_hal_set_hwreg23a(padapter, HW_VAR_EFUSE_BT_BYTES, (u8 *)&retU2); + pHalData->BTEfuseUsedBytes = retU2; DBG_8723A("%s: CurrentSize =%d\n", __func__, retU2); return retU2; @@ -1144,6 +1148,7 @@ static u8 hal_EfusePartialWriteCheck(struct rtw_adapter *padapter, u8 efuseType, u16 *pAddr, struct pg_pkt_struct *pTargetPkt) { + struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); u8 bRet = false; u16 startAddr = 0, efuse_max_available_len = 0, efuse_max = 0; u8 efuse_data = 0; @@ -1154,13 +1159,11 @@ hal_EfusePartialWriteCheck(struct rtw_adapter *padapter, u8 efuseType, EFUSE_GetEfuseDefinition23a(padapter, efuseType, TYPE_EFUSE_CONTENT_LEN_BANK, &efuse_max); - if (efuseType == EFUSE_WIFI) { - rtw23a_hal_get_hwreg(padapter, HW_VAR_EFUSE_BYTES, - (u8 *) &startAddr); - } else { - rtw23a_hal_get_hwreg(padapter, HW_VAR_EFUSE_BT_BYTES, - (u8 *) &startAddr); - } + if (efuseType == EFUSE_WIFI) + startAddr = pHalData->EfuseUsedBytes; + else + startAddr = pHalData->BTEfuseUsedBytes; + startAddr %= efuse_max; while (1) { @@ -3131,20 +3134,11 @@ void hw_var_set_mlme_join(struct rtw_adapter *padapter, u8 type) void SetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val) { - struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); - switch (variable) { case HW_VAR_TXPAUSE: rtl8723a_set_tx_pause(padapter, *val); break; - case HW_VAR_EFUSE_BYTES: - pHalData->EfuseUsedBytes = *((u16 *) val); - break; - case HW_VAR_EFUSE_BT_BYTES: - pHalData->BTEfuseUsedBytes = *((u16 *) val); - break; - default: break; } @@ -3184,13 +3178,6 @@ void GetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val) } } break; - case HW_VAR_EFUSE_BYTES: - *((u16 *) val) = pHalData->EfuseUsedBytes; - break; - - case HW_VAR_EFUSE_BT_BYTES: - *((u16 *) val) = pHalData->BTEfuseUsedBytes; - break; case HW_VAR_CHK_HI_QUEUE_EMPTY: *val = diff --git a/drivers/staging/rtl8723au/include/hal_intf.h b/drivers/staging/rtl8723au/include/hal_intf.h index 39ddbcb3d717..b6362deff01a 100644 --- a/drivers/staging/rtl8723au/include/hal_intf.h +++ b/drivers/staging/rtl8723au/include/hal_intf.h @@ -52,8 +52,6 @@ enum HW_VARIABLES { HW_VAR_ANTENNA_DIVERSITY_LINK, HW_VAR_ANTENNA_DIVERSITY_SELECT, HW_VAR_SWITCH_EPHY_WoWLAN, - HW_VAR_EFUSE_BYTES, - HW_VAR_EFUSE_BT_BYTES, /* The valid upper nav range for the HW updating, if the true value is larger than the upper range, the HW won't update it. */ /* Unit in microsecond. 0 means disable this function. */ HW_VAR_RPT_TIMER_SETTING,