OSDN Git Service

staging: rtl8188eu: reuse Hal_GetChnlGroup88E()
authorMichael Straube <straube.linux@gmail.com>
Fri, 7 Dec 2018 20:55:15 +0000 (21:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Dec 2018 10:37:58 +0000 (11:37 +0100)
Use Hal_GetChnlGroup88E() instead of duplicating it's code
in get_rx_power_val_by_reg().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/rf.c
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
drivers/staging/rtl8188eu/include/rtl8188e_hal.h

index 81e30a1..6fe4dae 100644 (file)
@@ -164,20 +164,9 @@ static void get_rx_power_val_by_reg(struct adapter *adapt, u8 channel,
                        /*  increase power diff defined by Realtek for regulatory */
                        if (hal_data->pwrGroupCnt == 1)
                                chnlGroup = 0;
-                       if (hal_data->pwrGroupCnt >= hal_data->PGMaxGroup) {
-                               if (channel < 3)
-                                       chnlGroup = 0;
-                               else if (channel < 6)
-                                       chnlGroup = 1;
-                               else if (channel < 9)
-                                       chnlGroup = 2;
-                               else if (channel < 12)
-                                       chnlGroup = 3;
-                               else if (channel < 14)
-                                       chnlGroup = 4;
-                               else if (channel == 14)
-                                       chnlGroup = 5;
-                       }
+                       if (hal_data->pwrGroupCnt >= hal_data->PGMaxGroup)
+                               Hal_GetChnlGroup88E(channel, &chnlGroup);
+
                        write_val = hal_data->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf ? 8 : 0)] +
                                        ((index < 2) ? powerbase0[rf] : powerbase1[rf]);
                        break;
index 31e80d6..d5a1cf9 100644 (file)
@@ -373,7 +373,7 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
        }
 }
 
-static void Hal_GetChnlGroup88E(u8 chnl, u8 *group)
+void Hal_GetChnlGroup88E(u8 chnl, u8 *group)
 {
        if (chnl < 3)                   /*  Channel 1-2 */
                *group = 0;
index a86b07d..eb4655e 100644 (file)
@@ -329,6 +329,8 @@ struct hal_data_8188e {
        u8      UsbRxAggPageTimeout;
 };
 
+void Hal_GetChnlGroup88E(u8 chnl, u8 *group);
+
 /*  rtl8188e_hal_init.c */
 void _8051Reset88E(struct adapter *padapter);
 void rtl8188e_InitializeFirmwareVars(struct adapter *padapter);