Skip to contentSkip to conversation

staging: r8188eu: Remove mp, a.k.a. manufacturing process, code

PATCH In review Larry Finger 3 participants 3 messages Sep 20, 2021 – Sep 21, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: r8188eu: Remove mp, a.k.a. manufacturing process, code

The standard driver contains code used by the factory to evaluate chips that have just been manufactured. Such code is indicated by "mp" in the variable names, the routine names, and in file names. All of these can be deleted.

In addition to removing nearly 7,000 lines of code, the size of the driver is reduced by 63 KB:
text data bss dec hex

Before  573959   48582   14660  637201   9b911
After   513530   45894   14660  574084   8c284

---
Greg: This patch is based on staging-testing. If you want
me to break it up, I will do so.

---
 drivers/staging/r8188eu/Makefile              |    3 -
 drivers/staging/r8188eu/core/rtw_cmd.c        |   10 -
 drivers/staging/r8188eu/core/rtw_ioctl_set.c  |    5 -
 drivers/staging/r8188eu/core/rtw_mp.c         |  926 -------
 drivers/staging/r8188eu/core/rtw_mp_ioctl.c   | 1170 --------
 drivers/staging/r8188eu/core/rtw_pwrctrl.c    |    8 +-
 drivers/staging/r8188eu/core/rtw_recv.c       |   26 +-
 drivers/staging/r8188eu/hal/HalPhyRf_8188e.c  |   18 +-
 drivers/staging/r8188eu/hal/odm.c             |    5 -
 drivers/staging/r8188eu/hal/odm_RTL8188E.c    |   17 -
 drivers/staging/r8188eu/hal/rtl8188e_dm.c     |    6 -
 drivers/staging/r8188eu/hal/rtl8188e_mp.c     |  676 -----
 drivers/staging/r8188eu/hal/rtl8188eu_xmit.c  |   26 -
 drivers/staging/r8188eu/hal/usb_halinit.c     |   97 +-
 drivers/staging/r8188eu/include/drv_types.h   |    3 -
 .../staging/r8188eu/include/mp_custom_oid.h   |   65 -
 drivers/staging/r8188eu/include/odm.h         |    1 -
 drivers/staging/r8188eu/include/rtw_mp.h      |  472 ----
 .../staging/r8188eu/include/rtw_mp_ioctl.h    |  241 --
 .../r8188eu/include/rtw_mp_phy_regdef.h       | 1063 --------
 drivers/staging/r8188eu/os_dep/ioctl_linux.c  | 2365 +----------------
 drivers/staging/r8188eu/os_dep/mlme_linux.c   |    2 -
 drivers/staging/r8188eu/os_dep/os_intfs.c     |    7 -
 23 files changed, 178 insertions(+), 7034 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/core/rtw_mp.c
 delete mode 100644 drivers/staging/r8188eu/core/rtw_mp_ioctl.c
 delete mode 100644 drivers/staging/r8188eu/hal/rtl8188e_mp.c
 delete mode 100644 drivers/staging/r8188eu/include/mp_custom_oid.h
 delete mode 100644 drivers/staging/r8188eu/include/rtw_mp.h
 delete mode 100644 drivers/staging/r8188eu/include/rtw_mp_ioctl.h
 delete mode 100644 drivers/staging/r8188eu/include/rtw_mp_phy_regdef.h
drivers/staging/r8188eu/Makefile +0 -3
index 4ca48fe628fd..27826baef377 100644
@@ -26,7 +26,6 @@ OUTSRC_FILES :=				\
 		hal/rtl8188e_cmd.o	\
 		hal/rtl8188e_dm.o	\
 		hal/rtl8188e_hal_init.o	\
-		hal/rtl8188e_mp.o	\
 		hal/rtl8188e_phycfg.o	\
 		hal/rtl8188e_rf6052.o	\
 		hal/rtl8188e_rxdesc.o	\
@@ -83,8 +82,6 @@ rtk_core :=				\
 		core/rtw_led.o		\
 		core/rtw_mlme.o		\
 		core/rtw_mlme_ext.o	\
-		core/rtw_mp.o		\
-		core/rtw_mp_ioctl.o	\
 		core/rtw_pwrctrl.o	\
 		core/rtw_p2p.o		\
 		core/rtw_recv.o		\
drivers/staging/r8188eu/core/rtw_cmd.c +0 -10
index 85b2ce537f34..3a70776f3304 100644
@@ -689,22 +689,12 @@ void rtw_getbbrfreg_cmdrsp_callback(struct adapter *padapter,  struct cmd_obj *p
 
 	kfree(pcmd->parmbuf);
 	kfree(pcmd);
-
-	if (padapter->registrypriv.mp_mode == 1)
-		padapter->mppriv.workparam.bcompleted = true;
-
 }
 
 void rtw_readtssi_cmdrsp_callback(struct adapter *padapter,  struct cmd_obj *pcmd)
 {
-
-
 	kfree(pcmd->parmbuf);
 	kfree(pcmd);
-
-	if (padapter->registrypriv.mp_mode == 1)
-		padapter->mppriv.workparam.bcompleted = true;
-
 }
 
 u8 rtw_createbss_cmd(struct adapter  *padapter)
drivers/staging/r8188eu/core/rtw_ioctl_set.c +0 -5
index 8f5611d9d0d8..a0702bfaa549 100644
@@ -781,11 +781,6 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
 	u16	mcs_rate = 0;
 	u32	ht_ielen = 0;
 
-	if (adapter->registrypriv.mp_mode == 1) {
-		if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
-			return 0;
-	}
-
 	if ((!check_fwstate(pmlmepriv, _FW_LINKED)) &&
 	    (!check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)))
 		return 0;
drivers/staging/r8188eu/core/rtw_mp.c deleted +0 -926

926 lines not on this page · raw message

drivers/staging/r8188eu/core/rtw_mp_ioctl.c deleted +0 -1170

1,170 lines not on this page · raw message

drivers/staging/r8188eu/core/rtw_pwrctrl.c +1 -7
index d901ac7aea4d..ca983ec9f9cf 100644
@@ -13,9 +13,6 @@ void ips_enter(struct adapter *padapter)
 	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
 	struct xmit_priv *pxmit_priv = &padapter->xmitpriv;
 
-	if (padapter->registrypriv.mp_mode == 1)
-		return;
-
 	if (pxmit_priv->free_xmitbuf_cnt != NR_XMITBUFF ||
 	    pxmit_priv->free_xmit_extbuf_cnt != NR_XMIT_EXTBUFF) {
 		DBG_88E_LEVEL(_drv_info_, "There are some pkts to transmit\n");
@@ -356,10 +353,7 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
 	pwrctrlpriv->bkeepfwalive = false;
 
 	pwrctrlpriv->LpsIdleCount = 0;
-	if (padapter->registrypriv.mp_mode == 1)
-		pwrctrlpriv->power_mgnt = PS_MODE_ACTIVE;
-	else
-		pwrctrlpriv->power_mgnt = padapter->registrypriv.power_mgnt;/*  PS_MODE_MIN; */
+	pwrctrlpriv->power_mgnt = padapter->registrypriv.power_mgnt;/*  PS_MODE_MIN; */
 	pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt) ? true : false;
 
 	pwrctrlpriv->bFwCurrentInPSMode = false;
drivers/staging/r8188eu/core/rtw_recv.c +1 -25
index 9a41deda3dc6..983505aac213 100644
@@ -704,14 +704,8 @@ int sta2sta_data_frame(struct adapter *adapter, struct recv_frame *precv_frame,
 	else
 		*psta = rtw_get_stainfo(pstapriv, sta_addr); /*  get ap_info */
 
-	if (!*psta) {
-		if (adapter->registrypriv.mp_mode == 1) {
-			if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
-				adapter->mppriv.rx_pktloss++;
-		}
-		ret = _FAIL;
+	if (!*psta)
 		goto exit;
-	}
 
 exit:
 
@@ -1849,22 +1843,7 @@ static int process_recv_indicatepkts(struct adapter *padapter, struct recv_frame
 static int recv_func_prehandle(struct adapter *padapter, struct recv_frame *rframe)
 {
 	int ret = _SUCCESS;
-	struct rx_pkt_attrib *pattrib = &rframe->attrib;
 	struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
-	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-
-	if (padapter->registrypriv.mp_mode == 1) {
-		if (pattrib->crc_err == 1)
-			padapter->mppriv.rx_crcerrpktcount++;
-		else
-			padapter->mppriv.rx_pktcount++;
-
-		if (!check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE)) {
-			ret = _FAIL;
-			rtw_free_recvframe(rframe, pfree_recv_queue);/* free this recv_frame */
-			goto exit;
-		}
-	}
 
 	/* check the frame crtl field and decache */
 	ret = validate_recv_frame(padapter, rframe);
@@ -1987,9 +1966,6 @@ s32 rtw_recv_entry(struct recv_frame *precvframe)
 
 _recv_entry_drop:
 
-	if (padapter->registrypriv.mp_mode == 1)
-		padapter->mppriv.rx_pktloss = precvpriv->rx_drop;
-
 	return ret;
 }
 
drivers/staging/r8188eu/hal/HalPhyRf_8188e.c +1 -17
index d9693c8014ce..34ca1d0066e8 100644
@@ -880,12 +880,7 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t,
 							rFPGA0_XAB_RFInterfaceSW, rFPGA0_XA_RFInterfaceOE,
 							rFPGA0_XB_RFInterfaceOE, rFPGA0_RFMOD
 							};
-
-	u32 retryCount = 9;
-	if (*dm_odm->mp_mode == 1)
-		retryCount = 9;
-	else
-		retryCount = 2;
+	u32 retryCount = 2;
 	/*  Note: IQ calibration must be performed after loading */
 	/* 		PHY_REG.txt , and radio_a, radio_b.txt */
 
@@ -1064,7 +1059,6 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery)
 {
 	struct hal_data_8188e	*pHalData = GET_HAL_DATA(adapt);
 	struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
-	struct mpt_context *pMptCtx = &adapt->mppriv.MptCtx;
 	s32 result[4][8];	/* last is final result */
 	u8 i, final_candidate;
 	bool pathaok, pathbok;
@@ -1086,11 +1080,6 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery)
 	if (!(dm_odm->SupportAbility & ODM_RF_CALIBRATION))
 		return;
 
-	if (*dm_odm->mp_mode == 1) {
-		singletone = pMptCtx->bSingleTone;
-		carrier_sup = pMptCtx->bCarrierSuppression;
-	}
-
 	/*  20120213<Kordan> Turn on when continuous Tx to pass lab testing. (required by Edlu) */
 	if (singletone || carrier_sup)
 		return;
@@ -1195,12 +1184,7 @@ void PHY_LCCalibrate_8188E(struct adapter *adapt)
 	u32 timeout = 2000, timecount = 0;
 	struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
 	struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
-	struct mpt_context *pMptCtx = &adapt->mppriv.MptCtx;
 
-	if (*dm_odm->mp_mode == 1) {
-		singletone = pMptCtx->bSingleTone;
-		carrier_sup = pMptCtx->bCarrierSuppression;
-	}
 	if (!(dm_odm->SupportAbility & ODM_RF_CALIBRATION))
 		return;
 	/*  20120213<Kordan> Turn on when continuous Tx to pass lab testing. (required by Edlu) */
drivers/staging/r8188eu/hal/odm.c +0 -5
index e10aab8da05b..40eb1a938f8c 100644
@@ -358,9 +358,6 @@ void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def Cmn
 	case	ODM_CMNINFO_NET_CLOSED:
 		pDM_Odm->pbNet_closed = (bool *)pValue;
 		break;
-	case    ODM_CMNINFO_MP_MODE:
-		pDM_Odm->mp_mode = (u8 *)pValue;
-		break;
 	/* To remove the compiler warning, must add an empty default statement to handle the other values. */
 	default:
 		/* do nothing */
@@ -1358,8 +1355,6 @@ void odm_TXPowerTrackingThermalMeterInit(struct odm_dm_struct *pDM_Odm)
 	pDM_Odm->RFCalibrateInfo.bTXPowerTracking = true;
 	pDM_Odm->RFCalibrateInfo.TXPowercount = 0;
 	pDM_Odm->RFCalibrateInfo.bTXPowerTrackingInit = false;
-	if (*pDM_Odm->mp_mode != 1)
-		pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = true;
 	MSG_88E("pDM_Odm TxPowerTrackControl = %d\n", pDM_Odm->RFCalibrateInfo.TxPowerTrackControl);
 
 	pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = true;
drivers/staging/r8188eu/hal/odm_RTL8188E.c +0 -17
index 7270ce68cfd2..ed1db2716aa3 100644
@@ -7,13 +7,6 @@ static void odm_RX_HWAntDivInit(struct odm_dm_struct *dm_odm)
 {
 	u32	value32;
 
-	if (*dm_odm->mp_mode == 1) {
-		dm_odm->AntDivType = CGCS_RX_SW_ANTDIV;
-		ODM_SetBBReg(dm_odm, ODM_REG_IGI_A_11N, BIT(7), 0); /*  disable HW AntDiv */
-		ODM_SetBBReg(dm_odm, ODM_REG_LNA_SWITCH_11N, BIT(31), 1);  /*  1:CG, 0:CS */
-		return;
-	}
-
 	/* MAC Setting */
 	value32 = ODM_GetMACReg(dm_odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord);
 	ODM_SetMACReg(dm_odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32 | (BIT(23) | BIT(25))); /* Reg4C[25]=1, Reg4C[23]=1 for pin output */
@@ -35,13 +28,6 @@ static void odm_TRX_HWAntDivInit(struct odm_dm_struct *dm_odm)
 {
 	u32	value32;
 
-	if (*dm_odm->mp_mode == 1) {
-		dm_odm->AntDivType = CGCS_RX_SW_ANTDIV;
-		ODM_SetBBReg(dm_odm, ODM_REG_IGI_A_11N, BIT(7), 0); /*  disable HW AntDiv */
-		ODM_SetBBReg(dm_odm, ODM_REG_RX_ANT_CTRL_11N, BIT(5) | BIT(4) | BIT(3), 0); /* Default RX   (0/1) */
-		return;
-	}
-
 	/* MAC Setting */
 	value32 = ODM_GetMACReg(dm_odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord);
 	ODM_SetMACReg(dm_odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32 | (BIT(23) | BIT(25))); /* Reg4C[25]=1, Reg4C[23]=1 for pin output */
@@ -74,9 +60,6 @@ static void odm_FastAntTrainingInit(struct odm_dm_struct *dm_odm)
 	struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable;
 	u32	AntCombination = 2;
 
-	if (*dm_odm->mp_mode == 1)
-		return;
-
 	for (i = 0; i < 6; i++) {
 		dm_fat_tbl->Bssid[i] = 0;
 		dm_fat_tbl->antSumRSSI[i] = 0;
drivers/staging/r8188eu/hal/rtl8188e_dm.c +0 -6
index 78552303c990..21494adf2a19 100644
@@ -96,11 +96,6 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
 	if (hal_data->AntDivCfg)
 		pdmpriv->InitODMFlag |= ODM_BB_ANT_DIV;
 
-	if (Adapter->registrypriv.mp_mode == 1) {
-		pdmpriv->InitODMFlag =	ODM_RF_CALIBRATION |
-					ODM_RF_TX_PWR_TRACK;
-	}
-
 	ODM_CmnInfoUpdate(dm_odm, ODM_CMNINFO_ABILITY, pdmpriv->InitODMFlag);
 
 	ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_TX_UNI, &Adapter->xmitpriv.tx_bytes);
@@ -111,7 +106,6 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
 	ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_BW, &hal_data->CurrentChannelBW);
 	ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_CHNL, &hal_data->CurrentChannel);
 	ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_NET_CLOSED, &Adapter->net_closed);
-	ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_MP_MODE, &Adapter->registrypriv.mp_mode);
 	ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_SCAN, &pmlmepriv->bScanInProcess);
 	ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_POWER_SAVING, &pwrctrlpriv->bpower_saving);
 	ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_RF_ANTENNA_TYPE, hal_data->TRxAntDivType);
drivers/staging/r8188eu/hal/rtl8188e_mp.c deleted +0 -676

676 lines not on this page · raw message

drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +0 -26
index 3b870d0c72fd..b7feb4d8c8aa 100644
@@ -19,15 +19,6 @@ s32	rtl8188eu_init_xmit_priv(struct adapter *adapt)
 	return _SUCCESS;
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

drivers/staging/r8188eu/hal/usb_halinit.c +40 -57

97 lines not on this page · raw message

drivers/staging/r8188eu/include/drv_types.h +0 -3
index 626c6273be6f..c96a33c8c621 100644

Lines of this file are not shown. View the raw message.

drivers/staging/r8188eu/include/mp_custom_oid.h deleted +0 -65

65 lines not on this page · raw message

drivers/staging/r8188eu/include/odm.h +0 -1
index 373348831ddf..243ba0a14720 100644

Lines of this file are not shown. View the raw message.

drivers/staging/r8188eu/include/rtw_mp.h deleted +0 -472

472 lines not on this page · raw message

drivers/staging/r8188eu/include/rtw_mp_ioctl.h deleted +0 -241

241 lines not on this page · raw message

drivers/staging/r8188eu/include/rtw_mp_phy_regdef.h deleted +0 -1063

1,063 lines not on this page · raw message

drivers/staging/r8188eu/os_dep/ioctl_linux.c +135 -2230

2,365 lines not on this page · raw message

drivers/staging/r8188eu/os_dep/mlme_linux.c +0 -2
index cc33baf38da7..a9b6ffdbf31a 100644

Lines of this file are not shown. View the raw message.

drivers/staging/r8188eu/os_dep/os_intfs.c +0 -7
index 3367c7cfc033..23c087491255 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.33.0

Part of the diff is not shown here. View the raw message.

maintainer
#1 lore raw
Quoted 8 lines · Larry Finger

The standard driver contains code used by the factory to evaluate chips that have just been manufactured. Such code is indicated by "mp" in the variable names, the routine names, and in file names. All of these can be deleted.

In addition to removing nearly 7,000 lines of code, the size of the driver is reduced by 63 KB:
text data bss dec hex

Quoted 7 lines
Before  573959   48582   14660  637201   9b911
After   513530   45894   14660  574084   8c284

---
Greg: This patch is based on staging-testing. If you want
me to break it up, I will do so.

No need at all, thanks for this work!

now queued up.

greg k-h

#2 lore raw
In reply to Larry Finger
Quoted 5 lines · CEST Larry Finger

The standard driver contains code used by the factory to evaluate chips that have just been manufactured. Such code is indicated by "mp" in the variable names, the routine names, and in file names. All of these can be deleted.

Quoted 7 lines

In addition to removing nearly 7,000 lines of code, the size of the driver is reduced by 63 KB:
text data bss dec hex

Before  573959   48582   14660  637201   9b911
After   513530   45894   14660  574084   8c284

Dear Larry,

It's a great job, a heavyweight, impressive!

Congratulations,

Fabio