OSDN Git Service

staging: r8188eu: remove unused PHY_GetTxPowerLevel8188E()
authorMichael Straube <straube.linux@gmail.com>
Wed, 8 Sep 2021 22:39:00 +0000 (00:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Sep 2021 06:49:54 +0000 (08:49 +0200)
Function PHY_GetTxPowerLevel8188E() is unused and it is the only user
of function phy_TxPwrIdxToDbm(), remove both.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210908223903.10516-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
drivers/staging/r8188eu/include/Hal8188EPhyCfg.h

index 1c19061..7542a83 100644 (file)
@@ -670,85 +670,6 @@ static     u8 phy_DbmToTxPwrIdx(struct adapter *Adapter, enum wireless_mode Wireless
        return TxPwrIdx;
 }
 
-/*  */
-/*     Description: */
-/*             Map Tx power index into dBm according to */
-/*             current HW model, for example, RF and PA, and */
-/*             current wireless mode. */
-/*     By Bruce, 2008-01-29. */
-/*  */
-static int phy_TxPwrIdxToDbm(struct adapter *Adapter, enum wireless_mode WirelessMode, u8 TxPwrIdx)
-{
-       int                             Offset = 0;
-       int                             PwrOutDbm = 0;
-
-       /*  */
-       /*  Tested by MP, we found that CCK Index 0 equals to -7dbm, OFDM legacy equals to -8dbm. */
-       /*  Note: */
-       /*      The mapping may be different by different NICs. Do not use this formula for what needs accurate result. */
-       /*  By Bruce, 2008-01-29. */
-       /*  */
-       switch (WirelessMode) {
-       case WIRELESS_MODE_B:
-               Offset = -7;
-               break;
-       case WIRELESS_MODE_G:
-       case WIRELESS_MODE_N_24G:
-       default:
-               Offset = -8;
-               break;
-       }
-
-       PwrOutDbm = TxPwrIdx / 2 + Offset; /*  Discard the decimal part. */
-
-       return PwrOutDbm;
-}
-
-/*-----------------------------------------------------------------------------
- * Function:    GetTxPowerLevel8190()
- *
- * Overview:    This function is export to "common" moudule
- *
- * Input:       struct adapter *Adapter
- *                     psByte                  Power Level
- *
- * Output:      NONE
- *
- * Return:      NONE
- *
- *---------------------------------------------------------------------------*/
-void PHY_GetTxPowerLevel8188E(struct adapter *Adapter, u32 *powerlevel)
-{
-       struct hal_data_8188e   *pHalData = GET_HAL_DATA(Adapter);
-       u8 TxPwrLevel = 0;
-       int                     TxPwrDbm;
-
-       /*  */
-       /*  Because the Tx power indexes are different, we report the maximum of them to */
-       /*  meet the CCX TPC request. By Bruce, 2008-01-31. */
-       /*  */
-
-       /*  CCK */
-       TxPwrLevel = pHalData->CurrentCckTxPwrIdx;
-       TxPwrDbm = phy_TxPwrIdxToDbm(Adapter, WIRELESS_MODE_B, TxPwrLevel);
-
-       /*  Legacy OFDM */
-       TxPwrLevel = pHalData->CurrentOfdm24GTxPwrIdx + pHalData->LegacyHTTxPowerDiff;
-
-       /*  Compare with Legacy OFDM Tx power. */
-       if (phy_TxPwrIdxToDbm(Adapter, WIRELESS_MODE_G, TxPwrLevel) > TxPwrDbm)
-               TxPwrDbm = phy_TxPwrIdxToDbm(Adapter, WIRELESS_MODE_G, TxPwrLevel);
-
-       /*  HT OFDM */
-       TxPwrLevel = pHalData->CurrentOfdm24GTxPwrIdx;
-
-       /*  Compare with HT OFDM Tx power. */
-       if (phy_TxPwrIdxToDbm(Adapter, WIRELESS_MODE_N_24G, TxPwrLevel) > TxPwrDbm)
-               TxPwrDbm = phy_TxPwrIdxToDbm(Adapter, WIRELESS_MODE_N_24G, TxPwrLevel);
-
-       *powerlevel = TxPwrDbm;
-}
-
 static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPowerLevel,
                               u8 *ofdmPowerLevel, u8 *BW20PowerLevel,
                               u8 *BW40PowerLevel)
index ea83c2e..df3d3f5 100644 (file)
@@ -189,7 +189,6 @@ int PHY_RFConfig8188E(struct adapter *adapter);
 void rtl8192c_PHY_GetHWRegOriginalValue(struct adapter *adapter);
 
 /*  BB TX Power R/W */
-void PHY_GetTxPowerLevel8188E(struct adapter *adapter, u32 *powerlevel);
 void PHY_SetTxPowerLevel8188E(struct adapter *adapter, u8 channel);
 bool PHY_UpdateTxPowerDbm8188E(struct adapter *adapter, int power);