staging: rtl8723au: Eliminate ugly ODM_CMNINFO_SEC_CHNL_OFFSET usage
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 21 Jul 2014 09:24:56 +0000 (11:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jul 2014 19:09:27 +0000 (12:09 -0700)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/hal/odm.c
drivers/staging/rtl8723au/hal/rtl8723a_dm.c
drivers/staging/rtl8723au/include/odm.h

index e4a922519125eec931d518b1dd3f414b212d2c0d..aa310a32987b788664a58052c2434d6633ffb96b 100644 (file)
@@ -166,7 +166,7 @@ u8 CCKSwingTable_Ch1423A[CCK_TABLE_SIZE][8] = {
 /* START------------COMMON INFO RELATED--------------- */
 void odm_CommonInfoSelfInit23a(struct dm_odm_t *pDM_Odm);
 
-void odm_CommonInfoSelfUpdate23a(struct dm_odm_t *pDM_Odm);
+static void odm_CommonInfoSelfUpdate(struct hal_data_8723a *pHalData);
 
 void odm_CmnInfoInit_Debug23a(struct dm_odm_t *pDM_Odm);
 
@@ -294,7 +294,7 @@ void ODM_DMWatchdog23a(struct hal_data_8723a *pHalData)
        /* 2012.05.03 Luke: For all IC series */
        odm_CmnInfoHook_Debug23a(pDM_Odm);
        odm_CmnInfoUpdate_Debug23a(pDM_Odm);
-       odm_CommonInfoSelfUpdate23a(pDM_Odm);
+       odm_CommonInfoSelfUpdate(pHalData);
        odm_FalseAlarmCounterStatistics23a(pDM_Odm);
        odm_RSSIMonitorCheck23a(pDM_Odm);
 
@@ -417,9 +417,6 @@ void ODM23a_CmnInfoHook(struct dm_odm_t *pDM_Odm,
        /*  Hook call by reference pointer. */
        switch  (CmnInfo) {
        /*  Dynamic call by reference pointer. */
-       case    ODM_CMNINFO_SEC_CHNL_OFFSET:
-               pDM_Odm->pSecChOffset = (u8 *)pValue;
-               break;
        case    ODM_CMNINFO_BW:
                pDM_Odm->pBandWidth = (u8 *)pValue;
                break;
@@ -502,16 +499,17 @@ void odm_CommonInfoSelfInit23a(struct dm_odm_t *pDM_Odm
        ODM_InitDebugSetting23a(pDM_Odm);
 }
 
-void odm_CommonInfoSelfUpdate23a(struct dm_odm_t *pDM_Odm)
+static void odm_CommonInfoSelfUpdate(struct hal_data_8723a *pHalData)
 {
+       struct dm_odm_t *pDM_Odm = &pHalData->odmpriv;
+       struct sta_info *pEntry;
        u8 EntryCnt = 0;
        u8 i;
-       struct sta_info *pEntry;
 
        if (*(pDM_Odm->pBandWidth) == ODM_BW40M) {
-               if (*(pDM_Odm->pSecChOffset) == 1)
+               if (pHalData->nCur40MhzPrimeSC == 1)
                        pDM_Odm->ControlChannel = *(pDM_Odm->pChannel) - 2;
-               else if (*(pDM_Odm->pSecChOffset) == 2)
+               else if (pHalData->nCur40MhzPrimeSC == 2)
                        pDM_Odm->ControlChannel = *(pDM_Odm->pChannel) + 2;
        } else {
                pDM_Odm->ControlChannel = *(pDM_Odm->pChannel);
@@ -551,7 +549,6 @@ void odm_CmnInfoInit_Debug23a(struct dm_odm_t *pDM_Odm)
 void odm_CmnInfoHook_Debug23a(struct dm_odm_t *pDM_Odm)
 {
        ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_CmnInfoHook_Debug23a ==>\n"));
-       ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("pSecChOffset =%d\n", *(pDM_Odm->pSecChOffset)));
        ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("pBandWidth =%d\n", *(pDM_Odm->pBandWidth)));
        ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("pChannel =%d\n", *(pDM_Odm->pChannel)));
 
index 272c1e7ed75658a1761ad281563f55488695f385..89ae2f27f2c2fdd4d51c2481114a6f2817e5f82b 100644 (file)
@@ -152,8 +152,6 @@ static void Update_ODM_ComInfo_8723a(struct rtw_adapter *Adapter)
        /*  Pointer reference */
        rtl8723a_odm_support_ability_set(Adapter, DYNAMIC_ALL_FUNC_ENABLE);
 
-       ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SEC_CHNL_OFFSET,
-                          &pHalData->nCur40MhzPrimeSC);
        ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_BW,
                           &pHalData->CurrentChannelBW);
        ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_CHNL,
index b2d89836e6858f384b16cb2f1a8a4021d09eaba5..e361c45e2b8f86bc3d5eadb9c0201980e816455f 100644 (file)
@@ -319,7 +319,6 @@ enum odm_cmninfo {
        /*  */
        /*  Dynamic value: */
        /*  */
-       ODM_CMNINFO_SEC_CHNL_OFFSET,            /*  enum odm_sec_chnl_offset */
        ODM_CMNINFO_BW,                         /*  enum odm_band_width */
        ODM_CMNINFO_CHNL,
 
@@ -697,8 +696,6 @@ struct dm_odm_t {
        bool                    bool_temp;
        struct rtw_adapter      *PADAPTER_temp;
 
-       /*  Secondary channel offset don't_care/below/above = 0/1/2 */
-       u8                      *pSecChOffset;
        /*  BW info 20M/40M/80M = 0/1/2 */
        u8                      *pBandWidth;
        /*  Central channel location Ch1/Ch2/.... */