staging: rtl8723au: Eliminate ODM_CMNINFO_BW usage
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 21 Jul 2014 09:24:57 +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_cmd.c
drivers/staging/rtl8723au/hal/rtl8723a_dm.c
drivers/staging/rtl8723au/hal/usb_halinit.c
drivers/staging/rtl8723au/include/odm.h

index aa310a32987b788664a58052c2434d6633ffb96b..a15a8cba489d05307f3f1340899b825f50da981c 100644 (file)
@@ -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_BW:
-               pDM_Odm->pBandWidth = (u8 *)pValue;
-               break;
        case    ODM_CMNINFO_CHNL:
                pDM_Odm->pChannel = (u8 *)pValue;
                break;
@@ -506,7 +503,7 @@ static void odm_CommonInfoSelfUpdate(struct hal_data_8723a *pHalData)
        u8 EntryCnt = 0;
        u8 i;
 
-       if (*(pDM_Odm->pBandWidth) == ODM_BW40M) {
+       if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_40) {
                if (pHalData->nCur40MhzPrimeSC == 1)
                        pDM_Odm->ControlChannel = *(pDM_Odm->pChannel) - 2;
                else if (pHalData->nCur40MhzPrimeSC == 2)
@@ -549,7 +546,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, ("pBandWidth =%d\n", *(pDM_Odm->pBandWidth)));
        ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("pChannel =%d\n", *(pDM_Odm->pChannel)));
 
        ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("pbScanInProcess =%d\n", *(pDM_Odm->pbScanInProcess)));
@@ -1137,11 +1133,10 @@ void odm_RateAdaptiveMaskInit23a(struct dm_odm_t *pDM_Odm)
        pOdmRA->LowRSSIThresh = 20;
 }
 
-u32 ODM_Get_Rate_Bitmap23a(struct dm_odm_t *pDM_Odm,
-       u32 macid,
-       u32 ra_mask,
-       u8 rssi_level)
+u32 ODM_Get_Rate_Bitmap23a(struct hal_data_8723a *pHalData, u32 macid,
+                          u32 ra_mask, u8 rssi_level)
 {
+       struct dm_odm_t *pDM_Odm = &pHalData->odmpriv;
        struct sta_info *pEntry;
        u32 rate_bitmap = 0x0fffffff;
        u8 WirelessMode;
@@ -1181,7 +1176,8 @@ u32 ODM_Get_Rate_Bitmap23a(struct dm_odm_t *pDM_Odm,
                        } else if (rssi_level == DM_RATR_STA_MIDDLE) {
                                rate_bitmap = 0x000ff000;
                        } else {
-                               if (*(pDM_Odm->pBandWidth) == ODM_BW40M)
+                               if (pHalData->CurrentChannelBW ==
+                                   HT_CHANNEL_WIDTH_40)
                                        rate_bitmap = 0x000ff015;
                                else
                                        rate_bitmap = 0x000ff005;
@@ -1192,7 +1188,8 @@ u32 ODM_Get_Rate_Bitmap23a(struct dm_odm_t *pDM_Odm,
                        } else if (rssi_level == DM_RATR_STA_MIDDLE) {
                                rate_bitmap = 0x0f8ff000;
                        } else {
-                               if (*(pDM_Odm->pBandWidth) == ODM_BW40M)
+                               if (pHalData->CurrentChannelBW ==
+                                   HT_CHANNEL_WIDTH_40)
                                        rate_bitmap = 0x0f8ff015;
                                else
                                        rate_bitmap = 0x0f8ff005;
index 7dd62b3dec8c718ce548bdb26b5835b4e84972de..271c33d6ca5af87c901dc1e88e43e63950c58742 100644 (file)
@@ -151,7 +151,8 @@ void rtl8723a_add_rateatid(struct rtw_adapter *pAdapter, u32 bitmap, u8 arg, u8
 
        bitmap &= 0x0fffffff;
        if (rssi_level != DM_RATR_STA_INIT)
-               bitmap = ODM_Get_Rate_Bitmap23a(&pHalData->odmpriv, macid, bitmap, rssi_level);
+               bitmap = ODM_Get_Rate_Bitmap23a(pHalData, macid, bitmap,
+                                               rssi_level);
 
        bitmap |= ((raid<<28)&0xf0000000);
 
index 89ae2f27f2c2fdd4d51c2481114a6f2817e5f82b..dfed57e0786de11ba622a5f4f77cbf3b111bf313 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_BW,
-                          &pHalData->CurrentChannelBW);
        ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_CHNL,
                           &pHalData->CurrentChannel);
        ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SCAN, &pmlmepriv->bScanInProcess);
index e09329bb1f8d69e31ef316ad8f8a1080ede43895..b51762a10d78c9ada7e5409dac39996c617582c5 100644 (file)
@@ -1500,8 +1500,8 @@ void rtl8723a_update_ramask(struct rtw_adapter *padapter,
 
        /* mask &= 0x0fffffff; */
        rate_bitmap = 0x0fffffff;
-       rate_bitmap = ODM_Get_Rate_Bitmap23a(&pHalData->odmpriv,
-                                         mac_id, mask, rssi_level);
+       rate_bitmap = ODM_Get_Rate_Bitmap23a(pHalData, mac_id, mask,
+                                            rssi_level);
        DBG_8723A("%s => mac_id:%d, networkType:0x%02x, "
                  "mask:0x%08x\n\t ==> rssi_level:%d, rate_bitmap:0x%08x\n",
                  __func__, mac_id, networkType, mask, rssi_level, rate_bitmap);
index e361c45e2b8f86bc3d5eadb9c0201980e816455f..be0b84f6220c37be9e9ea2c6829a6a2ee02697cb 100644 (file)
@@ -319,7 +319,6 @@ enum odm_cmninfo {
        /*  */
        /*  Dynamic value: */
        /*  */
-       ODM_CMNINFO_BW,                         /*  enum odm_band_width */
        ODM_CMNINFO_CHNL,
 
        ODM_CMNINFO_SCAN,
@@ -495,15 +494,6 @@ enum odm_sec_chnl_offset {
        ODM_ABOVE               = 2
 };
 
-/*  ODM_CMNINFO_BW */
-enum odm_band_width {
-       ODM_BW20M               = 0,
-       ODM_BW40M               = 1,
-       ODM_BW80M               = 2,
-       ODM_BW160M              = 3,
-       ODM_BW10M               = 4,
-};
-
 /*  ODM_CMNINFO_CHNL */
 
 /*  ODM_CMNINFO_BOARD_TYPE */
@@ -696,8 +686,6 @@ struct dm_odm_t {
        bool                    bool_temp;
        struct rtw_adapter      *PADAPTER_temp;
 
-       /*  BW info 20M/40M/80M = 0/1/2 */
-       u8                      *pBandWidth;
        /*  Central channel location Ch1/Ch2/.... */
        u8                      *pChannel;      /* central channel number */
        /*  Common info for Status */
@@ -962,6 +950,8 @@ extern      u8 CCKSwingTable_Ch1423A [CCK_TABLE_SIZE][8];
 #define SWAW_STEP_PEAK         0
 #define SWAW_STEP_DETERMINE    1
 
+struct hal_data_8723a;
+
 void ODM_Write_DIG23a(struct dm_odm_t *pDM_Odm,        u8      CurrentIGI);
 void ODM_Write_CCK_CCA_Thres23a(struct dm_odm_t *pDM_Odm, u8   CurCCK_CCAThres);
 
@@ -991,12 +981,11 @@ u32 GetPSDData(struct dm_odm_t *pDM_Odm, unsigned int point, u8 initial_gain_psd
 
 void odm_DIG23abyRSSI_LPS(struct dm_odm_t *pDM_Odm);
 
-u32 ODM_Get_Rate_Bitmap23a(struct dm_odm_t *pDM_Odm, u32 macid, u32 ra_mask, u8 rssi_level);
+u32 ODM_Get_Rate_Bitmap23a(struct hal_data_8723a *pHalData, u32 macid, u32 ra_mask, u8 rssi_level);
 
 
 void ODM23a_DMInit(struct dm_odm_t *pDM_Odm);
 
-struct hal_data_8723a;
 void ODM_DMWatchdog23a(struct hal_data_8723a *pHalData);
 
 void ODM_CmnInfoInit23a(struct dm_odm_t *pDM_Odm, enum odm_cmninfo     CmnInfo, u32 Value);