Skip to contentSkip to conversation

staging: r8188eu: odm cleanups

PATCH In review Michael Straube 3 participants 18 messages Oct 15, 2021 – Oct 16, 2021 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: r8188eu: odm cleanups

This series removes:
- empty / unused functions from odm.c
- two never set / unused fields from odm_dm_struct
- the function ODM_CmnInfoPtrArrayHook()

Tested on x86_64 with Inter-Tech DMG-02.

Michael Straube (7):
staging: r8188eu: remove empty functions from odm.c
staging: r8188eu: remove ODM_SingleDualAntennaDefaultSetting()
staging: r8188eu: remove GetPSDData()
staging: r8188eu: remove ODM_AntselStatistics_88C()
staging: r8188eu: pBandType is never set
staging: r8188eu: pMacPhyMode is not used
staging: r8188eu: remove ODM_CmnInfoPtrArrayHook()

 drivers/staging/r8188eu/hal/HalPhyRf_8188e.c  |   2 +-
 drivers/staging/r8188eu/hal/odm.c             | 144 ------------------
 drivers/staging/r8188eu/hal/odm_HWConfig.c    |   7 +-
 drivers/staging/r8188eu/hal/odm_interface.c   |   5 -
 drivers/staging/r8188eu/hal/rtl8188e_dm.c     |   2 +-
 .../staging/r8188eu/hal/rtl8188e_hal_init.c   |   5 +-
 drivers/staging/r8188eu/include/odm.h         |  38 -----
 .../staging/r8188eu/include/odm_interface.h   |   2 -
 drivers/staging/r8188eu/include/odm_precomp.h |   2 -
 9 files changed, 6 insertions(+), 201 deletions(-)
Signature · 1 line
2.33.0
#1 lore raw

PATCH 1/7 staging: r8188eu: remove empty functions from odm.c

Remove empty functions from odm.c.

---
 drivers/staging/r8188eu/hal/odm.c             | 32 -------------------
 drivers/staging/r8188eu/hal/odm_HWConfig.c    |  7 +---
 drivers/staging/r8188eu/include/odm.h         |  7 ----
 drivers/staging/r8188eu/include/odm_precomp.h |  2 --
 4 files changed, 1 insertion(+), 47 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -32
index 2178ffe41bb3..627213392795 100644
@@ -196,13 +196,9 @@ void ODM_DMWatchdog(struct odm_dm_struct *pDM_Odm)
 	    (pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV)	||
 	    (pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV))
 		odm_HwAntDiv(pDM_Odm);
-	else if (pDM_Odm->AntDivType == CGCS_RX_SW_ANTDIV)
-		odm_SwAntDivChkAntSwitch(pDM_Odm, SWAW_STEP_PEAK);
 
 	ODM_TXPowerTrackingCheck(pDM_Odm);
 	odm_EdcaTurboCheck(pDM_Odm);
-
-	odm_dtc(pDM_Odm);
 }
 
 /*  Init /.. Fixed HW value. Only init time. */
@@ -1023,29 +1019,6 @@ void ODM_TXPowerTrackingCheck(struct odm_dm_struct *pDM_Odm)
 /*  We select left antenna as default antenna in initial process, modify it as needed */
 /*  */
 
-/* 3============================================================ */
-/* 3 SW Antenna Diversity */
-/* 3============================================================ */
-void ODM_SwAntDivChkPerPktRssi(struct odm_dm_struct *pDM_Odm, u8 StationID, struct odm_phy_status_info *pPhyInfo)
-{
-}
-
-void odm_SwAntDivChkAntSwitch(struct odm_dm_struct *pDM_Odm, u8 Step)
-{
-}
-
-void ODM_SwAntDivRestAfterLink(struct odm_dm_struct *pDM_Odm)
-{
-}
-
-void odm_SwAntDivChkAntSwitchCallback(struct timer_list *t)
-{
-}
-
-/* 3============================================================ */
-/* 3 SW Antenna Diversity */
-/* 3============================================================ */
-
 void odm_InitHybridAntDiv(struct odm_dm_struct *pDM_Odm)
 {
 	if (!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV))
@@ -1228,8 +1201,3 @@ void ODM_SingleDualAntennaDefaultSetting(struct odm_dm_struct *pDM_Odm)
 	pDM_SWAT_Table->ANTA_ON = true;
 	pDM_SWAT_Table->ANTB_ON = true;
 }
-
-/* Justin: According to the current RRSI to adjust Response Frame TX power, 2012/11/05 */
-void odm_dtc(struct odm_dm_struct *pDM_Odm)
-{
-}
drivers/staging/r8188eu/hal/odm_HWConfig.c +1 -6
index b76aa93573dc..3d639b2720b2 100644
@@ -376,13 +376,8 @@ static void ODM_PhyStatusQuery_92CSeries(struct odm_dm_struct *dm_odm,
 {
 	odm_RxPhyStatus92CSeries_Parsing(dm_odm, pPhyInfo, pPhyStatus,
 					 pPktinfo, adapt);
-	if (dm_odm->RSSI_test) {
-		/*  Select the packets to do RSSI checking for antenna switching. */
-		if (pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon)
-				ODM_SwAntDivChkPerPktRssi(dm_odm, pPktinfo->StationID, pPhyInfo);
-	} else {
+	if (!dm_odm->RSSI_test)
 		odm_Process_RSSIForDM(dm_odm, pPhyInfo, pPktinfo);
-	}
 }
 
 void ODM_PhyStatusQuery(struct odm_dm_struct *dm_odm,
drivers/staging/r8188eu/include/odm.h +0 -7
index 187f872d09b5..435626f05fd2 100644
@@ -875,16 +875,11 @@ void ODM_SetAntenna(struct odm_dm_struct *pDM_Odm, u8 Antenna);
 
 void ODM_RF_Saving(struct odm_dm_struct *pDM_Odm, u8 bForceInNormal);
 
-void ODM_SwAntDivRestAfterLink(struct odm_dm_struct *pDM_Odm);
-
 void ODM_TXPowerTrackingCheck(struct odm_dm_struct *pDM_Odm);
 
 bool ODM_RAStateCheck(struct odm_dm_struct *pDM_Odm, s32 RSSI,
 		      bool bForceUpdate, u8 *pRATRState);
 
-void ODM_SwAntDivChkPerPktRssi(struct odm_dm_struct *pDM_Odm, u8 StationID,
-			       struct odm_phy_status_info *pPhyInfo);
-
 u32 ConvertTo_dB(u32 Value);
 
 u32 GetPSDData(struct odm_dm_struct *pDM_Odm, unsigned int point,
@@ -914,6 +909,4 @@ void ODM_AntselStatistics_88C(struct odm_dm_struct *pDM_Odm, u8 MacId,
 
 void ODM_SingleDualAntennaDefaultSetting(struct odm_dm_struct *pDM_Odm);
 
-void odm_dtc(struct odm_dm_struct *pDM_Odm);
-
 #endif
drivers/staging/r8188eu/include/odm_precomp.h +0 -2
index 892a2501f05a..22299f167af8 100644
@@ -43,13 +43,11 @@ void odm_CommonInfoSelfUpdate(struct odm_dm_struct *pDM_Odm);
 void odm_FalseAlarmCounterStatistics(struct odm_dm_struct *pDM_Odm);
 void odm_DIG(struct odm_dm_struct *pDM_Odm);
 void odm_CCKPacketDetectionThresh(struct odm_dm_struct *pDM_Odm);
-void odm_SwAntDivChkAntSwitch(struct odm_dm_struct *pDM_Odm, u8 Step);
 void odm_EdcaTurboCheck(struct odm_dm_struct *pDM_Odm);
 void odm_CommonInfoSelfInit(struct odm_dm_struct *pDM_Odm);
 void odm_RSSIMonitorCheck(struct odm_dm_struct *pDM_Odm);
 void odm_RefreshRateAdaptiveMask(struct odm_dm_struct *pDM_Odm);
 void odm_TXPowerTrackingThermalMeterInit(struct odm_dm_struct *pDM_Odm);
-void odm_SwAntDivChkAntSwitchCallback(struct timer_list *t);
 void odm_InitHybridAntDiv(struct odm_dm_struct *pDM_Odm);
 void odm_HwAntDiv(struct odm_dm_struct *pDM_Odm);
 
Signature · 1 line
2.33.0
#4 lore raw

PATCH 2/7 staging: r8188eu: remove ODM_SingleDualAntennaDefaultSetting()

In reply to Michael Straube

Function ODM_SingleDualAntennaDefaultSetting() is not used, remove it.

---
 drivers/staging/r8188eu/hal/odm.c     | 11 -----------
 drivers/staging/r8188eu/include/odm.h |  2 --
 2 files changed, 13 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -11
index 627213392795..030bc7bd9905 100644
@@ -1190,14 +1190,3 @@ u32 ConvertTo_dB(u32 Value)
 
 	return dB;
 }
-
-/*  Description: */
-/* 	Set Single/Dual Antenna default setting for products that do not do detection in advance. */
-/*  Added by Joseph, 2012.03.22 */
-void ODM_SingleDualAntennaDefaultSetting(struct odm_dm_struct *pDM_Odm)
-{
-	struct sw_ant_switch *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
-
-	pDM_SWAT_Table->ANTA_ON = true;
-	pDM_SWAT_Table->ANTB_ON = true;
-}
drivers/staging/r8188eu/include/odm.h +0 -2
index 435626f05fd2..21e08a9f8bf8 100644
@@ -907,6 +907,4 @@ void ODM_CmnInfoUpdate(struct odm_dm_struct *pDM_Odm, u32 CmnInfo, u64 Value);
 void ODM_AntselStatistics_88C(struct odm_dm_struct *pDM_Odm, u8 MacId,
 			      u32 PWDBAll, bool isCCKrate);
 
-void ODM_SingleDualAntennaDefaultSetting(struct odm_dm_struct *pDM_Odm);
-
 #endif
Signature · 1 line
2.33.0
#6 lore raw

PATCH 3/7 staging: r8188eu: remove GetPSDData()

In reply to Michael Straube

Function GetPSDData() is not used, remove it. It is the only user of ConvertTo_dB() and ODM_StallExecution(), remove these two functions and the now unused dB_Invert_Table as well.

---
 drivers/staging/r8188eu/hal/odm.c             | 59 -------------------
 drivers/staging/r8188eu/hal/odm_interface.c   |  5 --
 drivers/staging/r8188eu/include/odm.h         |  5 --
 .../staging/r8188eu/include/odm_interface.h   |  2 -
 4 files changed, 71 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -59
index 030bc7bd9905..28bd6f36cddd 100644
@@ -5,17 +5,6 @@
 
 #include "../include/odm_precomp.h"
 
-static const u16 dB_Invert_Table[8][12] = {
-	{1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4},
-	{4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14, 16},
-	{18, 20, 22, 25, 28, 32, 35, 40, 45, 50, 56, 63},
-	{71, 79, 89, 100, 112, 126, 141, 158, 178, 200, 224, 251},
-	{282, 316, 355, 398, 447, 501, 562, 631, 708, 794, 891, 1000},
-	{1122, 1259, 1413, 1585, 1778, 1995, 2239, 2512, 2818, 3162, 3548, 3981},
-	{4467, 5012, 5623, 6310, 7079, 7943, 8913, 10000, 11220, 12589, 14125, 15849},
-	{17783, 19953, 22387, 25119, 28184, 31623, 35481, 39811, 44668, 50119, 56234, 65535}
-};
-
 /* avoid to warn in FreeBSD ==> To DO modify */
 static u32 EDCAParam[HT_IOT_PEER_MAX][3] = {
 	/*  UL			DL */
@@ -1142,51 +1131,3 @@ void odm_EdcaTurboCheck(struct odm_dm_struct *pDM_Odm)
 	pxmitpriv->last_tx_bytes = pxmitpriv->tx_bytes;
 	precvpriv->last_rx_bytes = precvpriv->rx_bytes;
 }
-
-/*  need to ODM CE Platform */
-/* move to here for ANT detection mechanism using */
-
-u32 GetPSDData(struct odm_dm_struct *pDM_Odm, unsigned int point, u8 initial_gain_psd)
-{
-	u32 psd_report;
-
-	/* Set DCO frequency index, offset=(40MHz/SamplePts)*point */
-	ODM_SetBBReg(pDM_Odm, 0x808, 0x3FF, point);
-
-	/* Start PSD calculation, Reg808[22]=0->1 */
-	ODM_SetBBReg(pDM_Odm, 0x808, BIT(22), 1);
-	/* Need to wait for HW PSD report */
-	ODM_StallExecution(30);
-	ODM_SetBBReg(pDM_Odm, 0x808, BIT(22), 0);
-	/* Read PSD report, Reg8B4[15:0] */
-	psd_report = ODM_GetBBReg(pDM_Odm, 0x8B4, bMaskDWord) & 0x0000FFFF;
-
-	psd_report = (u32)(ConvertTo_dB(psd_report)) + (u32)(initial_gain_psd - 0x1c);
-
-	return psd_report;
-}
-
-u32 ConvertTo_dB(u32 Value)
-{
-	u8 i;
-	u8 j;
-	u32 dB;
-
-	Value = Value & 0xFFFF;
-	for (i = 0; i < 8; i++) {
-		if (Value <= dB_Invert_Table[i][11])
-			break;
-	}
-
-	if (i >= 8)
-		return 96;	/*  maximum 96 dB */
-
-	for (j = 0; j < 12; j++) {
-		if (Value <= dB_Invert_Table[i][j])
-			break;
-	}
-
-	dB = i * 12 + j + 1;
-
-	return dB;
-}
drivers/staging/r8188eu/hal/odm_interface.c +0 -5
index c97104c3682f..7ddba39a0f4b 100644
@@ -77,11 +77,6 @@ s32 ODM_CompareMemory(struct odm_dm_struct *pDM_Odm, void *pBuf1, void *pBuf2, u
 }
 
 /*  ODM Timer relative API. */
-void ODM_StallExecution(u32 usDelay)
-{
-	udelay(usDelay);
-}
-
 void ODM_delay_ms(u32 ms)
 {
 	mdelay(ms);
drivers/staging/r8188eu/include/odm.h +0 -5
index 21e08a9f8bf8..db24678eb0bc 100644
@@ -880,11 +880,6 @@ void ODM_TXPowerTrackingCheck(struct odm_dm_struct *pDM_Odm);
 bool ODM_RAStateCheck(struct odm_dm_struct *pDM_Odm, s32 RSSI,
 		      bool bForceUpdate, u8 *pRATRState);
 
-u32 ConvertTo_dB(u32 Value);
-
-u32 GetPSDData(struct odm_dm_struct *pDM_Odm, unsigned int point,
-	       u8 initial_gain_psd);
-
 u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid,
 			u32 ra_mask, u8 rssi_level);
 
drivers/staging/r8188eu/include/odm_interface.h +0 -2
index 3af58e853828..17a315d19a50 100644
@@ -50,8 +50,6 @@ s32 ODM_CompareMemory(struct odm_dm_struct *pDM_Odm, void *pBuf1, void *pBuf2,
 		      u32 length);
 
 /*  ODM Timer relative API. */
-void ODM_StallExecution(u32 usDelay);
-
 void ODM_delay_ms(u32 ms);
 
 void ODM_delay_us(u32 us);
Signature · 1 line
2.33.0
#8 lore raw

PATCH 4/7 staging: r8188eu: remove ODM_AntselStatistics_88C()

In reply to Michael Straube

Function ODM_AntselStatistics_88C() is not used, remove it.

---
 drivers/staging/r8188eu/hal/odm.c     | 21 ---------------------
 drivers/staging/r8188eu/include/odm.h |  3 ---
 2 files changed, 24 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -21
index 28bd6f36cddd..d3d13164ca8f 100644
@@ -1016,27 +1016,6 @@ void odm_InitHybridAntDiv(struct odm_dm_struct *pDM_Odm)
 	ODM_AntennaDiversityInit_88E(pDM_Odm);
 }
 
-void ODM_AntselStatistics_88C(struct odm_dm_struct *pDM_Odm, u8 MacId, u32 PWDBAll, bool isCCKrate)
-{
-	struct sw_ant_switch *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
-
-	if (pDM_SWAT_Table->antsel == 1) {
-		if (isCCKrate) {
-			pDM_SWAT_Table->CCK_Ant1_Cnt[MacId]++;
-		} else {
-			pDM_SWAT_Table->OFDM_Ant1_Cnt[MacId]++;
-			pDM_SWAT_Table->RSSI_Ant1_Sum[MacId] += PWDBAll;
-		}
-	} else {
-		if (isCCKrate) {
-			pDM_SWAT_Table->CCK_Ant2_Cnt[MacId]++;
-		} else {
-			pDM_SWAT_Table->OFDM_Ant2_Cnt[MacId]++;
-			pDM_SWAT_Table->RSSI_Ant2_Sum[MacId] += PWDBAll;
-		}
-	}
-}
-
 void odm_HwAntDiv(struct odm_dm_struct *pDM_Odm)
 {
 	if (!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV))
drivers/staging/r8188eu/include/odm.h +0 -3
index db24678eb0bc..a8e9089433ba 100644
@@ -899,7 +899,4 @@ void ODM_CmnInfoPtrArrayHook(struct odm_dm_struct *pDM_Odm,
 
 void ODM_CmnInfoUpdate(struct odm_dm_struct *pDM_Odm, u32 CmnInfo, u64 Value);
 
-void ODM_AntselStatistics_88C(struct odm_dm_struct *pDM_Odm, u8 MacId,
-			      u32 PWDBAll, bool isCCKrate);
-
 #endif
Signature · 1 line
2.33.0
#10 lore raw

PATCH 5/7 staging: r8188eu: pBandType is never set

In reply to Michael Straube

pBandType is never set, it stays at the default value 0. Remove it from odm_dm_struct and remove related unneeded code.

---
 drivers/staging/r8188eu/hal/HalPhyRf_8188e.c | 2 +-
 drivers/staging/r8188eu/hal/odm.c            | 3 ---
 drivers/staging/r8188eu/include/odm.h        | 8 --------
 3 files changed, 1 insertion(+), 12 deletions(-)
drivers/staging/r8188eu/hal/HalPhyRf_8188e.c +1 -1
index f01ee3cd8795..8e9fbc9cf84d 100644
@@ -317,7 +317,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
 					X = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][4];
 					Y = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][5];
 
-					if ((X != 0) && (*dm_odm->pBandType == ODM_BAND_2_4G)) {
+					if (X != 0) {
 						if ((X & 0x00000200) != 0)	/* consider minus */
 							X = X | 0xFFFFFC00;
 						ele_A = ((X * ele_D) >> 8) & 0x000003FF;
drivers/staging/r8188eu/hal/odm.c +0 -3
index d3d13164ca8f..85bc5050cda5 100644
@@ -243,9 +243,6 @@ void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def Cmn
 	case	ODM_CMNINFO_WM_MODE:
 		pDM_Odm->pWirelessMode = (u8 *)pValue;
 		break;
-	case	ODM_CMNINFO_BAND:
-		pDM_Odm->pBandType = (u8 *)pValue;
-		break;
 	case	ODM_CMNINFO_SEC_CHNL_OFFSET:
 		pDM_Odm->pSecChOffset = (u8 *)pValue;
 		break;
drivers/staging/r8188eu/include/odm.h +0 -8
index a8e9089433ba..9745069060d7 100644
@@ -273,7 +273,6 @@ enum odm_common_info_def {
 	ODM_CMNINFO_TX_UNI,
 	ODM_CMNINFO_RX_UNI,
 	ODM_CMNINFO_WM_MODE,		/*  ODM_WIRELESS_MODE_E */
-	ODM_CMNINFO_BAND,		/*  ODM_BAND_TYPE_E */
 	ODM_CMNINFO_SEC_CHNL_OFFSET,	/*  ODM_SEC_CHNL_OFFSET_E */
 	ODM_CMNINFO_SEC_MODE,		/*  ODM_SECURITY_E */
 	ODM_CMNINFO_BW,			/*  ODM_BW_E */
@@ -405,11 +404,6 @@ enum odm_wireless_mode {
 	ODM_WM_AUTO	= BIT(5),
 };
 
-/*  ODM_CMNINFO_BAND */
-enum odm_band_type {
-	ODM_BAND_2_4G	= BIT(0),
-};
-
 /*  ODM_CMNINFO_SEC_CHNL_OFFSET */
 enum odm_sec_chnl_offset {
 	ODM_DONT_CARE	= 0,
@@ -635,8 +629,6 @@ struct odm_dm_struct {
 	u64	*pNumRxBytesUnicast;
 	/*  Wireless mode B/G/A/N = BIT(0)/BIT(1)/BIT(2)/BIT(3) */
 	u8	*pWirelessMode; /* ODM_WIRELESS_MODE_E */
-	/*  Frequence band 2.4G/5G = 0/1 */
-	u8	*pBandType;
 	/*  Secondary channel offset don't_care/below/above = 0/1/2 */
 	u8	*pSecChOffset;
 	/*  Security mode Open/WEP/AES/TKIP = 0/1/2/3 */
Signature · 1 line
2.33.0
#12 lore raw

PATCH 6/7 staging: r8188eu: pMacPhyMode is not used

In reply to Michael Straube

pMacPhyMode is not used. Remove it from odm_dm_struct and remove related dead code.

---
 drivers/staging/r8188eu/hal/odm.c     | 3 ---
 drivers/staging/r8188eu/include/odm.h | 3 ---
 2 files changed, 6 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -3
index 85bc5050cda5..a2cbe727f6e0 100644
@@ -231,9 +231,6 @@ void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def Cmn
 	/*  */
 	switch	(CmnInfo) {
 	/*  Dynamic call by reference pointer. */
-	case	ODM_CMNINFO_MAC_PHY_MODE:
-		pDM_Odm->pMacPhyMode = (u8 *)pValue;
-		break;
 	case	ODM_CMNINFO_TX_UNI:
 		pDM_Odm->pNumTxBytesUnicast = (u64 *)pValue;
 		break;
drivers/staging/r8188eu/include/odm.h +0 -3
index 9745069060d7..6cbf64df9be7 100644
@@ -269,7 +269,6 @@ enum odm_common_info_def {
 
 	/*  Dynamic value: */
 /*  POINTER REFERENCE-----------  */
-	ODM_CMNINFO_MAC_PHY_MODE,	/*  ODM_MAC_PHY_MODE_E */
 	ODM_CMNINFO_TX_UNI,
 	ODM_CMNINFO_RX_UNI,
 	ODM_CMNINFO_WM_MODE,		/*  ODM_WIRELESS_MODE_E */
@@ -621,8 +620,6 @@ struct odm_dm_struct {
 	bool	bool_temp;
 	struct adapter *adapter_temp;
 
-	/*  MAC PHY Mode SMSP/DMSP/DMDP = 0/1/2 */
-	u8	*pMacPhyMode;
 	/* TX Unicast byte count */
 	u64	*pNumTxBytesUnicast;
 	/* RX Unicast byte count */
Signature · 1 line
2.33.0
#14 lore raw

PATCH 7/7 staging: r8188eu: remove ODM_CmnInfoPtrArrayHook()

In reply to Michael Straube

In ODM_CmnInfoPtrArrayHook() there is only the case ODM_CMNINFO_STA_STATUS and the function is called only with this value. Remove ODM_CmnInfoPtrArrayHook() and fix the three places where it is called.

---
 drivers/staging/r8188eu/hal/odm.c               | 15 ---------------
 drivers/staging/r8188eu/hal/rtl8188e_dm.c       |  2 +-
 drivers/staging/r8188eu/hal/rtl8188e_hal_init.c |  5 +++--
 drivers/staging/r8188eu/include/odm.h           | 10 ----------
 4 files changed, 4 insertions(+), 28 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -15
index a2cbe727f6e0..0987ff3e382a 100644
@@ -292,21 +292,6 @@ void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def Cmn
 	}
 }
 
-void ODM_CmnInfoPtrArrayHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def CmnInfo, u16 Index, void *pValue)
-{
-	/*  Hook call by reference pointer. */
-	switch	(CmnInfo) {
-	/*  Dynamic call by reference pointer. */
-	case	ODM_CMNINFO_STA_STATUS:
-		pDM_Odm->pODM_StaInfo[Index] = (struct sta_info *)pValue;
-		break;
-	/* To remove the compiler warning, must add an empty default statement to handle the other values. */
-	default:
-		/* do nothing */
-		break;
-	}
-}
-
 /*  Update Band/CHannel/.. The values are dynamic but non-per-packet. */
 void ODM_CmnInfoUpdate(struct odm_dm_struct *pDM_Odm, u32 CmnInfo, u64 Value)
 {
drivers/staging/r8188eu/hal/rtl8188e_dm.c +1 -1
index 1ca24a507d6d..f1a1015eedfb 100644
@@ -90,7 +90,7 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
 	ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_RF_ANTENNA_TYPE, hal_data->TRxAntDivType);
 
 	for (i = 0; i < NUM_STA; i++)
-		ODM_CmnInfoPtrArrayHook(dm_odm, ODM_CMNINFO_STA_STATUS, i, NULL);
+		dm_odm->pODM_StaInfo[i] = NULL;
 }
 
 void rtl8188e_InitHalDm(struct adapter *Adapter)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +3 -2
index dd8d6b4a9d48..8c00f2dd67da 100644
@@ -1671,13 +1671,14 @@ void rtl8188e_SetHalODMVar(struct adapter *Adapter, enum hal_odm_variable eVaria
 	case HAL_ODM_STA_INFO:
 		{
 			struct sta_info *psta = (struct sta_info *)pValue1;
+
 			if (bSet) {
 				DBG_88E("### Set STA_(%d) info\n", psta->mac_id);
-				ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, psta);
+				podmpriv->pODM_StaInfo[psta->mac_id] = psta;
 				ODM_RAInfo_Init(podmpriv, psta->mac_id);
 			} else {
 				DBG_88E("### Clean STA_(%d) info\n", psta->mac_id);
-				ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, NULL);
+				podmpriv->pODM_StaInfo[psta->mac_id] = NULL;
 		       }
 		}
 		break;
drivers/staging/r8188eu/include/odm.h +0 -10
index 6cbf64df9be7..841603b341bd 100644
@@ -305,12 +305,6 @@ enum odm_common_info_def {
 	ODM_CMNINFO_BT_BUSY,			/* Check Bt is using or not */
 	ODM_CMNINFO_BT_DISABLE_EDCA,
 /* CALL BY VALUE-------------*/
-
-	/*  Dynamic ptr array hook itms. */
-	ODM_CMNINFO_STA_STATUS,
-	ODM_CMNINFO_PHY_STATUS,
-	ODM_CMNINFO_MAC_STATUS,
-	ODM_CMNINFO_MAX,
 };
 
 /*  2011/10/20 MH Define ODM support ability.  ODM_CMNINFO_ABILITY */
@@ -882,10 +876,6 @@ void ODM_CmnInfoInit(struct odm_dm_struct *pDM_Odm,
 void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm,
 		     enum odm_common_info_def CmnInfo, void *pValue);
 
-void ODM_CmnInfoPtrArrayHook(struct odm_dm_struct *pDM_Odm,
-			     enum odm_common_info_def CmnInfo,
-			     u16 Index, void *pValue);
-
 void ODM_CmnInfoUpdate(struct odm_dm_struct *pDM_Odm, u32 CmnInfo, u64 Value);
 
 #endif
Signature · 1 line
2.33.0
Acked-by on the v1 series
#16 lore raw
In reply to Michael Straube
Quoted 16 lines · Michael Straube

This series removes:
- empty / unused functions from odm.c
- two never set / unused fields from odm_dm_struct
- the function ODM_CmnInfoPtrArrayHook()

Tested on x86_64 with Inter-Tech DMG-02.

Michael Straube (7):
staging: r8188eu: remove empty functions from odm.c
staging: r8188eu: remove ODM_SingleDualAntennaDefaultSetting()
staging: r8188eu: remove GetPSDData()
staging: r8188eu: remove ODM_AntselStatistics_88C()
staging: r8188eu: pBandType is never set
staging: r8188eu: pMacPhyMode is not used
staging: r8188eu: remove ODM_CmnInfoPtrArrayHook()

Quoted 14 lines
 drivers/staging/r8188eu/hal/HalPhyRf_8188e.c  |   2 +-
 drivers/staging/r8188eu/hal/odm.c             | 144 ------------------
 drivers/staging/r8188eu/hal/odm_HWConfig.c    |   7 +-
 drivers/staging/r8188eu/hal/odm_interface.c   |   5 -
 drivers/staging/r8188eu/hal/rtl8188e_dm.c     |   2 +-
 .../staging/r8188eu/hal/rtl8188e_hal_init.c   |   5 +-
 drivers/staging/r8188eu/include/odm.h         |  38 -----
 .../staging/r8188eu/include/odm_interface.h   |   2 -
 drivers/staging/r8188eu/include/odm_precomp.h |   2 -
 9 files changed, 6 insertions(+), 201 deletions(-)
Signature · 1 line
2.33.0

Dear Michael,

Looks good to me. Built and tested on my USB-N10 Nano, works well. Many thanks.

For whole series:

Regards,
Phil

#17 lore raw
Quoted 34 lines · Phillip Potter
Quoted 16 lines · Michael Straube

This series removes:
- empty / unused functions from odm.c
- two never set / unused fields from odm_dm_struct
- the function ODM_CmnInfoPtrArrayHook()

Tested on x86_64 with Inter-Tech DMG-02.

Michael Straube (7):
staging: r8188eu: remove empty functions from odm.c
staging: r8188eu: remove ODM_SingleDualAntennaDefaultSetting()
staging: r8188eu: remove GetPSDData()
staging: r8188eu: remove ODM_AntselStatistics_88C()
staging: r8188eu: pBandType is never set
staging: r8188eu: pMacPhyMode is not used
staging: r8188eu: remove ODM_CmnInfoPtrArrayHook()

Quoted 14 lines
  drivers/staging/r8188eu/hal/HalPhyRf_8188e.c  |   2 +-
  drivers/staging/r8188eu/hal/odm.c             | 144 ------------------
  drivers/staging/r8188eu/hal/odm_HWConfig.c    |   7 +-
  drivers/staging/r8188eu/hal/odm_interface.c   |   5 -
  drivers/staging/r8188eu/hal/rtl8188e_dm.c     |   2 +-
  .../staging/r8188eu/hal/rtl8188e_hal_init.c   |   5 +-
  drivers/staging/r8188eu/include/odm.h         |  38 -----
  .../staging/r8188eu/include/odm_interface.h   |   2 -
  drivers/staging/r8188eu/include/odm_precomp.h |   2 -
  9 files changed, 6 insertions(+), 201 deletions(-)
Signature · 1 line
2.33.0

Dear Michael,

Quoted 9 lines

Looks good to me. Built and tested on my USB-N10 Nano, works well. Many thanks.

For whole series:

Regards,
Phil

Thank you for testing and your ack Phillip.

Regards,
Michael

Acked-by on v1 1/7
#2 lore raw

Re: [PATCH 1/7] staging: r8188eu: remove empty functions from odm.c

In reply to Michael Straube

Thus wrote Michael Straube ([email protected]):

Quoted 15 lines

Remove empty functions from odm.c.

---
 drivers/staging/r8188eu/hal/odm.c             | 32 -------------------
 drivers/staging/r8188eu/hal/odm_HWConfig.c    |  7 +---
 drivers/staging/r8188eu/include/odm.h         |  7 ----
 drivers/staging/r8188eu/include/odm_precomp.h |  2 --
 4 files changed, 1 insertion(+), 47 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -0
index 2178ffe41bb3..627213392795 100644

drivers/staging/r8188eu/hal/odm.c void ODM_DMWatchdog(struct odm_dm_struct *pDM_Odm) · line 200

Quoted 5 lines
drivers/staging/r8188eu/hal/odm.c +0 -2
@@ -196,13 +196,9 @@ void ODM_DMWatchdog(struct odm_dm_struct *pDM_Odm)
 	    (pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV)	||
 	    (pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV))
 		odm_HwAntDiv(pDM_Odm);
-	else if (pDM_Odm->AntDivType == CGCS_RX_SW_ANTDIV)
-		odm_SwAntDivChkAntSwitch(pDM_Odm, SWAW_STEP_PEAK);

This was the last user of SWAW_STEP_PEAK. The define can be removed now (maybe in a follow-up patch).

#5 lore raw

Re: [PATCH 2/7] staging: r8188eu: remove ODM_SingleDualAntennaDefaultSetting()

In reply to Michael Straube

Thus wrote Michael Straube ([email protected]):

Quoted 17 lines

Function ODM_SingleDualAntennaDefaultSetting() is not used, remove it.

---
 drivers/staging/r8188eu/hal/odm.c     | 11 -----------
 drivers/staging/r8188eu/include/odm.h |  2 --
 2 files changed, 13 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -0
index 627213392795..030bc7bd9905 100644
@@ -1190,14 +1190,3 @@ u32 ConvertTo_dB(u32 Value)
 
 	return dB;
 }

drivers/staging/r8188eu/hal/odm.c u32 ConvertTo_dB(u32 Value) · line 1202

Quoted 10 lines
drivers/staging/r8188eu/hal/odm.c +0 -10
-
-/*  Description: */
-/* 	Set Single/Dual Antenna default setting for products that do not do detection in advance. */
-/*  Added by Joseph, 2012.03.22 */
-void ODM_SingleDualAntennaDefaultSetting(struct odm_dm_struct *pDM_Odm)
-{
-	struct sw_ant_switch *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
-
-	pDM_SWAT_Table->ANTA_ON = true;
-	pDM_SWAT_Table->ANTB_ON = true;

ANTA_ON and ANTB_ON can now be removed from struct sw_ant_switch.

Acked-by on v1 3/7
#7 lore raw

Re: [PATCH 3/7] staging: r8188eu: remove GetPSDData()

In reply to Michael Straube

Thus wrote Michael Straube ([email protected]):

Quoted 133 lines

Function GetPSDData() is not used, remove it. It is the only user of ConvertTo_dB() and ODM_StallExecution(), remove these two functions and the now unused dB_Invert_Table as well.

---
 drivers/staging/r8188eu/hal/odm.c             | 59 -------------------
 drivers/staging/r8188eu/hal/odm_interface.c   |  5 --
 drivers/staging/r8188eu/include/odm.h         |  5 --
 .../staging/r8188eu/include/odm_interface.h   |  2 -
 4 files changed, 71 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -59
index 030bc7bd9905..28bd6f36cddd 100644
@@ -5,17 +5,6 @@
 
 #include "../include/odm_precomp.h"
 
-static const u16 dB_Invert_Table[8][12] = {
-	{1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4},
-	{4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14, 16},
-	{18, 20, 22, 25, 28, 32, 35, 40, 45, 50, 56, 63},
-	{71, 79, 89, 100, 112, 126, 141, 158, 178, 200, 224, 251},
-	{282, 316, 355, 398, 447, 501, 562, 631, 708, 794, 891, 1000},
-	{1122, 1259, 1413, 1585, 1778, 1995, 2239, 2512, 2818, 3162, 3548, 3981},
-	{4467, 5012, 5623, 6310, 7079, 7943, 8913, 10000, 11220, 12589, 14125, 15849},
-	{17783, 19953, 22387, 25119, 28184, 31623, 35481, 39811, 44668, 50119, 56234, 65535}
-};
-
 /* avoid to warn in FreeBSD ==> To DO modify */
 static u32 EDCAParam[HT_IOT_PEER_MAX][3] = {
 	/*  UL			DL */
@@ -1142,51 +1131,3 @@ void odm_EdcaTurboCheck(struct odm_dm_struct *pDM_Odm)
 	pxmitpriv->last_tx_bytes = pxmitpriv->tx_bytes;
 	precvpriv->last_rx_bytes = precvpriv->rx_bytes;
 }
-
-/*  need to ODM CE Platform */
-/* move to here for ANT detection mechanism using */
-
-u32 GetPSDData(struct odm_dm_struct *pDM_Odm, unsigned int point, u8 initial_gain_psd)
-{
-	u32 psd_report;
-
-	/* Set DCO frequency index, offset=(40MHz/SamplePts)*point */
-	ODM_SetBBReg(pDM_Odm, 0x808, 0x3FF, point);
-
-	/* Start PSD calculation, Reg808[22]=0->1 */
-	ODM_SetBBReg(pDM_Odm, 0x808, BIT(22), 1);
-	/* Need to wait for HW PSD report */
-	ODM_StallExecution(30);
-	ODM_SetBBReg(pDM_Odm, 0x808, BIT(22), 0);
-	/* Read PSD report, Reg8B4[15:0] */
-	psd_report = ODM_GetBBReg(pDM_Odm, 0x8B4, bMaskDWord) & 0x0000FFFF;
-
-	psd_report = (u32)(ConvertTo_dB(psd_report)) + (u32)(initial_gain_psd - 0x1c);
-
-	return psd_report;
-}
-
-u32 ConvertTo_dB(u32 Value)
-{
-	u8 i;
-	u8 j;
-	u32 dB;
-
-	Value = Value & 0xFFFF;
-	for (i = 0; i < 8; i++) {
-		if (Value <= dB_Invert_Table[i][11])
-			break;
-	}
-
-	if (i >= 8)
-		return 96;	/*  maximum 96 dB */
-
-	for (j = 0; j < 12; j++) {
-		if (Value <= dB_Invert_Table[i][j])
-			break;
-	}
-
-	dB = i * 12 + j + 1;
-
-	return dB;
-}
drivers/staging/r8188eu/hal/odm_interface.c +0 -5
index c97104c3682f..7ddba39a0f4b 100644
@@ -77,11 +77,6 @@ s32 ODM_CompareMemory(struct odm_dm_struct *pDM_Odm, void *pBuf1, void *pBuf2, u
 }
 
 /*  ODM Timer relative API. */
-void ODM_StallExecution(u32 usDelay)
-{
-	udelay(usDelay);
-}
-
 void ODM_delay_ms(u32 ms)
 {
 	mdelay(ms);
drivers/staging/r8188eu/include/odm.h +0 -5
index 21e08a9f8bf8..db24678eb0bc 100644
@@ -880,11 +880,6 @@ void ODM_TXPowerTrackingCheck(struct odm_dm_struct *pDM_Odm);
 bool ODM_RAStateCheck(struct odm_dm_struct *pDM_Odm, s32 RSSI,
 		      bool bForceUpdate, u8 *pRATRState);
 
-u32 ConvertTo_dB(u32 Value);
-
-u32 GetPSDData(struct odm_dm_struct *pDM_Odm, unsigned int point,
-	       u8 initial_gain_psd);
-
 u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid,
 			u32 ra_mask, u8 rssi_level);
 
drivers/staging/r8188eu/include/odm_interface.h +0 -2
index 3af58e853828..17a315d19a50 100644
@@ -50,8 +50,6 @@ s32 ODM_CompareMemory(struct odm_dm_struct *pDM_Odm, void *pBuf1, void *pBuf2,
 		      u32 length);
 
 /*  ODM Timer relative API. */
-void ODM_StallExecution(u32 usDelay);
-
 void ODM_delay_ms(u32 ms);
 
 void ODM_delay_us(u32 us);
Signature · 1 line
2.33.0
#9 lore raw

Re: [PATCH 4/7] staging: r8188eu: remove ODM_AntselStatistics_88C()

In reply to Michael Straube

Thus wrote Michael Straube ([email protected]):

Quoted 27 lines

Function ODM_AntselStatistics_88C() is not used, remove it.

---
 drivers/staging/r8188eu/hal/odm.c     | 21 ---------------------
 drivers/staging/r8188eu/include/odm.h |  3 ---
 2 files changed, 24 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -11
index 28bd6f36cddd..d3d13164ca8f 100644
@@ -1016,27 +1016,6 @@ void odm_InitHybridAntDiv(struct odm_dm_struct *pDM_Odm)
 	ODM_AntennaDiversityInit_88E(pDM_Odm);
 }
 
-void ODM_AntselStatistics_88C(struct odm_dm_struct *pDM_Odm, u8 MacId, u32 PWDBAll, bool isCCKrate)
-{
-	struct sw_ant_switch *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
-
-	if (pDM_SWAT_Table->antsel == 1) {
-		if (isCCKrate) {
-			pDM_SWAT_Table->CCK_Ant1_Cnt[MacId]++;
-		} else {
-			pDM_SWAT_Table->OFDM_Ant1_Cnt[MacId]++;
-			pDM_SWAT_Table->RSSI_Ant1_Sum[MacId] += PWDBAll;
-		}

drivers/staging/r8188eu/hal/odm.c void odm_InitHybridAntDiv(struct odm_dm_struct *pDM_Odm) · line 1039

Quoted 10 lines
drivers/staging/r8188eu/hal/odm.c +0 -10
-	} else {
-		if (isCCKrate) {
-			pDM_SWAT_Table->CCK_Ant2_Cnt[MacId]++;
-		} else {
-			pDM_SWAT_Table->OFDM_Ant2_Cnt[MacId]++;
-			pDM_SWAT_Table->RSSI_Ant2_Sum[MacId] += PWDBAll;
-		}
-	}
-}
-

Yet again, that seems to make a bunch of variables unused.
I guess that antsel, CCK_Ant1_Cnt, OFDM_Ant1_Cnt, RSSI_Ant1_Sum and their Ant2 versions can be removed (haven't tried it yet, though).

I'm really curious to see what's left when we're done with all these removals...

Best regards,
Martin

Acked-by on v1 5/7
#11 lore raw

Re: [PATCH 5/7] staging: r8188eu: pBandType is never set

In reply to Michael Straube

Thus wrote Michael Straube ([email protected]):

Quoted 72 lines

pBandType is never set, it stays at the default value 0. Remove it from odm_dm_struct and remove related unneeded code.

---
 drivers/staging/r8188eu/hal/HalPhyRf_8188e.c | 2 +-
 drivers/staging/r8188eu/hal/odm.c            | 3 ---
 drivers/staging/r8188eu/include/odm.h        | 8 --------
 3 files changed, 1 insertion(+), 12 deletions(-)
drivers/staging/r8188eu/hal/HalPhyRf_8188e.c +1 -1
index f01ee3cd8795..8e9fbc9cf84d 100644
@@ -317,7 +317,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
 					X = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][4];
 					Y = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][5];
 
-					if ((X != 0) && (*dm_odm->pBandType == ODM_BAND_2_4G)) {
+					if (X != 0) {
 						if ((X & 0x00000200) != 0)	/* consider minus */
 							X = X | 0xFFFFFC00;
 						ele_A = ((X * ele_D) >> 8) & 0x000003FF;
drivers/staging/r8188eu/hal/odm.c +0 -3
index d3d13164ca8f..85bc5050cda5 100644
@@ -243,9 +243,6 @@ void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def Cmn
 	case	ODM_CMNINFO_WM_MODE:
 		pDM_Odm->pWirelessMode = (u8 *)pValue;
 		break;
-	case	ODM_CMNINFO_BAND:
-		pDM_Odm->pBandType = (u8 *)pValue;
-		break;
 	case	ODM_CMNINFO_SEC_CHNL_OFFSET:
 		pDM_Odm->pSecChOffset = (u8 *)pValue;
 		break;
drivers/staging/r8188eu/include/odm.h +0 -8
index a8e9089433ba..9745069060d7 100644
@@ -273,7 +273,6 @@ enum odm_common_info_def {
 	ODM_CMNINFO_TX_UNI,
 	ODM_CMNINFO_RX_UNI,
 	ODM_CMNINFO_WM_MODE,		/*  ODM_WIRELESS_MODE_E */
-	ODM_CMNINFO_BAND,		/*  ODM_BAND_TYPE_E */
 	ODM_CMNINFO_SEC_CHNL_OFFSET,	/*  ODM_SEC_CHNL_OFFSET_E */
 	ODM_CMNINFO_SEC_MODE,		/*  ODM_SECURITY_E */
 	ODM_CMNINFO_BW,			/*  ODM_BW_E */
@@ -405,11 +404,6 @@ enum odm_wireless_mode {
 	ODM_WM_AUTO	= BIT(5),
 };
 
-/*  ODM_CMNINFO_BAND */
-enum odm_band_type {
-	ODM_BAND_2_4G	= BIT(0),
-};
-
 /*  ODM_CMNINFO_SEC_CHNL_OFFSET */
 enum odm_sec_chnl_offset {
 	ODM_DONT_CARE	= 0,
@@ -635,8 +629,6 @@ struct odm_dm_struct {
 	u64	*pNumRxBytesUnicast;
 	/*  Wireless mode B/G/A/N = BIT(0)/BIT(1)/BIT(2)/BIT(3) */
 	u8	*pWirelessMode; /* ODM_WIRELESS_MODE_E */
-	/*  Frequence band 2.4G/5G = 0/1 */
-	u8	*pBandType;
 	/*  Secondary channel offset don't_care/below/above = 0/1/2 */
 	u8	*pSecChOffset;
 	/*  Security mode Open/WEP/AES/TKIP = 0/1/2/3 */
Signature · 1 line
2.33.0
Acked-by on v1 6/7
#13 lore raw

Re: [PATCH 6/7] staging: r8188eu: pMacPhyMode is not used

In reply to Michael Straube

Thus wrote Michael Straube ([email protected]):

Quoted 46 lines

pMacPhyMode is not used. Remove it from odm_dm_struct and remove related dead code.

---
 drivers/staging/r8188eu/hal/odm.c     | 3 ---
 drivers/staging/r8188eu/include/odm.h | 3 ---
 2 files changed, 6 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -3
index 85bc5050cda5..a2cbe727f6e0 100644
@@ -231,9 +231,6 @@ void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def Cmn
 	/*  */
 	switch	(CmnInfo) {
 	/*  Dynamic call by reference pointer. */
-	case	ODM_CMNINFO_MAC_PHY_MODE:
-		pDM_Odm->pMacPhyMode = (u8 *)pValue;
-		break;
 	case	ODM_CMNINFO_TX_UNI:
 		pDM_Odm->pNumTxBytesUnicast = (u64 *)pValue;
 		break;
drivers/staging/r8188eu/include/odm.h +0 -3
index 9745069060d7..6cbf64df9be7 100644
@@ -269,7 +269,6 @@ enum odm_common_info_def {
 
 	/*  Dynamic value: */
 /*  POINTER REFERENCE-----------  */
-	ODM_CMNINFO_MAC_PHY_MODE,	/*  ODM_MAC_PHY_MODE_E */
 	ODM_CMNINFO_TX_UNI,
 	ODM_CMNINFO_RX_UNI,
 	ODM_CMNINFO_WM_MODE,		/*  ODM_WIRELESS_MODE_E */
@@ -621,8 +620,6 @@ struct odm_dm_struct {
 	bool	bool_temp;
 	struct adapter *adapter_temp;
 
-	/*  MAC PHY Mode SMSP/DMSP/DMDP = 0/1/2 */
-	u8	*pMacPhyMode;
 	/* TX Unicast byte count */
 	u64	*pNumTxBytesUnicast;
 	/* RX Unicast byte count */
Signature · 1 line
2.33.0
Acked-by on v1 7/7
#15 lore raw

Re: [PATCH 7/7] staging: r8188eu: remove ODM_CmnInfoPtrArrayHook()

In reply to Michael Straube

Thus wrote Michael Straube ([email protected]):

Quoted 103 lines

In ODM_CmnInfoPtrArrayHook() there is only the case ODM_CMNINFO_STA_STATUS and the function is called only with this value. Remove ODM_CmnInfoPtrArrayHook() and fix the three places where it is called.

---
 drivers/staging/r8188eu/hal/odm.c               | 15 ---------------
 drivers/staging/r8188eu/hal/rtl8188e_dm.c       |  2 +-
 drivers/staging/r8188eu/hal/rtl8188e_hal_init.c |  5 +++--
 drivers/staging/r8188eu/include/odm.h           | 10 ----------
 4 files changed, 4 insertions(+), 28 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -15
index a2cbe727f6e0..0987ff3e382a 100644
@@ -292,21 +292,6 @@ void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def Cmn
 	}
 }
 
-void ODM_CmnInfoPtrArrayHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def CmnInfo, u16 Index, void *pValue)
-{
-	/*  Hook call by reference pointer. */
-	switch	(CmnInfo) {
-	/*  Dynamic call by reference pointer. */
-	case	ODM_CMNINFO_STA_STATUS:
-		pDM_Odm->pODM_StaInfo[Index] = (struct sta_info *)pValue;
-		break;
-	/* To remove the compiler warning, must add an empty default statement to handle the other values. */
-	default:
-		/* do nothing */
-		break;
-	}
-}
-
 /*  Update Band/CHannel/.. The values are dynamic but non-per-packet. */
 void ODM_CmnInfoUpdate(struct odm_dm_struct *pDM_Odm, u32 CmnInfo, u64 Value)
 {
drivers/staging/r8188eu/hal/rtl8188e_dm.c +1 -1
index 1ca24a507d6d..f1a1015eedfb 100644
@@ -90,7 +90,7 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
 	ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_RF_ANTENNA_TYPE, hal_data->TRxAntDivType);
 
 	for (i = 0; i < NUM_STA; i++)
-		ODM_CmnInfoPtrArrayHook(dm_odm, ODM_CMNINFO_STA_STATUS, i, NULL);
+		dm_odm->pODM_StaInfo[i] = NULL;
 }
 
 void rtl8188e_InitHalDm(struct adapter *Adapter)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +3 -2
index dd8d6b4a9d48..8c00f2dd67da 100644
@@ -1671,13 +1671,14 @@ void rtl8188e_SetHalODMVar(struct adapter *Adapter, enum hal_odm_variable eVaria
 	case HAL_ODM_STA_INFO:
 		{
 			struct sta_info *psta = (struct sta_info *)pValue1;
+
 			if (bSet) {
 				DBG_88E("### Set STA_(%d) info\n", psta->mac_id);
-				ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, psta);
+				podmpriv->pODM_StaInfo[psta->mac_id] = psta;
 				ODM_RAInfo_Init(podmpriv, psta->mac_id);
 			} else {
 				DBG_88E("### Clean STA_(%d) info\n", psta->mac_id);
-				ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, NULL);
+				podmpriv->pODM_StaInfo[psta->mac_id] = NULL;
 		       }
 		}
 		break;
drivers/staging/r8188eu/include/odm.h +0 -10
index 6cbf64df9be7..841603b341bd 100644
@@ -305,12 +305,6 @@ enum odm_common_info_def {
 	ODM_CMNINFO_BT_BUSY,			/* Check Bt is using or not */
 	ODM_CMNINFO_BT_DISABLE_EDCA,
 /* CALL BY VALUE-------------*/
-
-	/*  Dynamic ptr array hook itms. */
-	ODM_CMNINFO_STA_STATUS,
-	ODM_CMNINFO_PHY_STATUS,
-	ODM_CMNINFO_MAC_STATUS,
-	ODM_CMNINFO_MAX,
 };
 
 /*  2011/10/20 MH Define ODM support ability.  ODM_CMNINFO_ABILITY */
@@ -882,10 +876,6 @@ void ODM_CmnInfoInit(struct odm_dm_struct *pDM_Odm,
 void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm,
 		     enum odm_common_info_def CmnInfo, void *pValue);
 
-void ODM_CmnInfoPtrArrayHook(struct odm_dm_struct *pDM_Odm,
-			     enum odm_common_info_def CmnInfo,
-			     u16 Index, void *pValue);
-
 void ODM_CmnInfoUpdate(struct odm_dm_struct *pDM_Odm, u32 CmnInfo, u64 Value);
 
 #endif
Signature · 1 line
2.33.0
#3 lore raw

Re: [PATCH 1/7] staging: r8188eu: remove empty functions from odm.c

In reply to Martin Kaiser
Quoted 26 lines · Martin Kaiser

Thus wrote Michael Straube ([email protected]):

Quoted 15 lines

Remove empty functions from odm.c.

---
  drivers/staging/r8188eu/hal/odm.c             | 32 -------------------
  drivers/staging/r8188eu/hal/odm_HWConfig.c    |  7 +---
  drivers/staging/r8188eu/include/odm.h         |  7 ----
  drivers/staging/r8188eu/include/odm_precomp.h |  2 --
  4 files changed, 1 insertion(+), 47 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -0
index 2178ffe41bb3..627213392795 100644

drivers/staging/r8188eu/hal/odm.c void ODM_DMWatchdog(struct odm_dm_struct *pDM_Odm) · line 200

Quoted 5 lines
drivers/staging/r8188eu/hal/odm.c +0 -2
@@ -196,13 +196,9 @@ void ODM_DMWatchdog(struct odm_dm_struct *pDM_Odm)
  	    (pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV)	||
  	    (pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV))
  		odm_HwAntDiv(pDM_Odm);
-	else if (pDM_Odm->AntDivType == CGCS_RX_SW_ANTDIV)
-		odm_SwAntDivChkAntSwitch(pDM_Odm, SWAW_STEP_PEAK);

This was the last user of SWAW_STEP_PEAK. The define can be removed now (maybe in a follow-up patch).

Quoted 2 lines

Thank you for your review Martin. I'll send follow up patches to remove this and other now unused variables I missed.

Thanks again,
Michael