From 91a2916a82f326c9836bc2d3e2dad5f3b5405836 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Mon, 21 Jul 2014 11:24:56 +0200 Subject: [PATCH] staging: rtl8723au: Eliminate ugly ODM_CMNINFO_SEC_CHNL_OFFSET usage Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723au/hal/odm.c | 17 +++++++---------- drivers/staging/rtl8723au/hal/rtl8723a_dm.c | 2 -- drivers/staging/rtl8723au/include/odm.h | 3 --- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index e4a922519125..aa310a32987b 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -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))); diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c index 272c1e7ed756..89ae2f27f2c2 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c @@ -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, diff --git a/drivers/staging/rtl8723au/include/odm.h b/drivers/staging/rtl8723au/include/odm.h index b2d89836e685..e361c45e2b8f 100644 --- a/drivers/staging/rtl8723au/include/odm.h +++ b/drivers/staging/rtl8723au/include/odm.h @@ -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/.... */ -- 2.30.2