summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8723au/hal
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2015-09-15 16:32:46 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-16 21:50:04 -0700
commite5241dc0198760e945aa94c9080e65aa49149aa4 (patch)
tree1c51eb91fa6aa53610937ed509a07f147a24ced8 /drivers/staging/rtl8723au/hal
parent8b9283234e8f8f6195de37d38d4979900681e198 (diff)
staging: rtl8723au: Fold getTxPowerIndex() into PHY_SetTxPowerLevel8723A()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723au/hal')
-rw-r--r--drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c46
1 files changed, 19 insertions, 27 deletions
diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c b/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
index 8764538f523c..26d7f408eb04 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
@@ -748,31 +748,6 @@ PHY_BBConfig8723A(struct rtw_adapter *Adapter)
return rtStatus;
}
-static void getTxPowerIndex(struct rtw_adapter *Adapter,
- u8 channel, u8 *cckPowerLevel, u8 *ofdmPowerLevel)
-{
- struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
- u8 index = (channel - 1);
- /* 1. CCK */
- cckPowerLevel[RF_PATH_A] = pHalData->TxPwrLevelCck[RF_PATH_A][index];
- cckPowerLevel[RF_PATH_B] = pHalData->TxPwrLevelCck[RF_PATH_B][index];
-
- /* 2. OFDM for 1S or 2S */
- if (GET_RF_TYPE(Adapter) == RF_1T2R || GET_RF_TYPE(Adapter) == RF_1T1R) {
- /* Read HT 40 OFDM TX power */
- ofdmPowerLevel[RF_PATH_A] =
- pHalData->TxPwrLevelHT40_1S[RF_PATH_A][index];
- ofdmPowerLevel[RF_PATH_B] =
- pHalData->TxPwrLevelHT40_1S[RF_PATH_B][index];
- } else if (GET_RF_TYPE(Adapter) == RF_2T2R) {
- /* Read HT 40 OFDM TX power */
- ofdmPowerLevel[RF_PATH_A] =
- pHalData->TxPwrLevelHT40_2S[RF_PATH_A][index];
- ofdmPowerLevel[RF_PATH_B] =
- pHalData->TxPwrLevelHT40_2S[RF_PATH_B][index];
- }
-}
-
/*-----------------------------------------------------------------------------
* Function: SetTxPowerLevel8723A()
*
@@ -791,12 +766,29 @@ void PHY_SetTxPowerLevel8723A(struct rtw_adapter *Adapter, u8 channel)
{
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
u8 cckPowerLevel[2], ofdmPowerLevel[2]; /* [0]:RF-A, [1]:RF-B */
+ int index = channel - 1;
if (pHalData->bTXPowerDataReadFromEEPORM == false)
return;
- getTxPowerIndex(Adapter, channel, &cckPowerLevel[0],
- &ofdmPowerLevel[0]);
+ /* 1. CCK */
+ cckPowerLevel[RF_PATH_A] = pHalData->TxPwrLevelCck[RF_PATH_A][index];
+ cckPowerLevel[RF_PATH_B] = pHalData->TxPwrLevelCck[RF_PATH_B][index];
+
+ /* 2. OFDM for 1S or 2S */
+ if (GET_RF_TYPE(Adapter) == RF_1T2R || GET_RF_TYPE(Adapter) == RF_1T1R) {
+ /* Read HT 40 OFDM TX power */
+ ofdmPowerLevel[RF_PATH_A] =
+ pHalData->TxPwrLevelHT40_1S[RF_PATH_A][index];
+ ofdmPowerLevel[RF_PATH_B] =
+ pHalData->TxPwrLevelHT40_1S[RF_PATH_B][index];
+ } else if (GET_RF_TYPE(Adapter) == RF_2T2R) {
+ /* Read HT 40 OFDM TX power */
+ ofdmPowerLevel[RF_PATH_A] =
+ pHalData->TxPwrLevelHT40_2S[RF_PATH_A][index];
+ ofdmPowerLevel[RF_PATH_B] =
+ pHalData->TxPwrLevelHT40_2S[RF_PATH_B][index];
+ }
rtl823a_phy_rf6052setccktxpower(Adapter, &cckPowerLevel[0]);
rtl8723a_PHY_RF6052SetOFDMTxPower(Adapter, &ofdmPowerLevel[0], channel);