Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26472590 authored by Quytelda Kahja's avatar Quytelda Kahja Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723bs: Clean up whitespace in 'PHY_GetTxPowerLimit()'.



Wrap lines longer than 80 characters where possible, delete double
newlines, and fix alignment per the kernel coding style guidelines.

Signed-off-by: default avatarQuytelda Kahja <quytelda@tamalin.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e8b8fc8a
Loading
Loading
Loading
Loading
+59 −51
Original line number Diff line number Diff line
@@ -1612,22 +1612,21 @@ static s8 phy_GetChannelIndexOfTxPowerLimit(u8 Band, u8 Channel)
	return channelIndex;
}

s8 PHY_GetTxPowerLimit(
	struct adapter *Adapter,
	u32 RegPwrTblSel,
	enum BAND_TYPE Band,
	enum CHANNEL_WIDTH Bandwidth,
	u8 RfPath,
	u8 DataRate,
	u8 Channel
)
s8 PHY_GetTxPowerLimit(struct adapter *Adapter, u32 RegPwrTblSel,
		       enum BAND_TYPE Band, enum CHANNEL_WIDTH Bandwidth,
		       u8 RfPath, u8 DataRate, u8 Channel)
{
	struct hal_com_data	*pHalData = GET_HAL_DATA(Adapter);
	s16	band = -1, regulation = -1, bandwidth = -1, rateSection = -1, channel = -1;
	s16 band        = -1;
	s16 regulation  = -1;
	s16 bandwidth   = -1;
	s16 rateSection = -1;
	s16 channel     = -1;
	s8 powerLimit = MAX_POWER_INDEX;
	struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);

	if ((Adapter->registrypriv.RegEnableTxPowerLimit == 2 && pHalData->EEPROMRegulatory != 1) ||
		   Adapter->registrypriv.RegEnableTxPowerLimit == 0)
	if (((Adapter->registrypriv.RegEnableTxPowerLimit == 2) &&
	     (pHalData->EEPROMRegulatory != 1)) ||
	    (Adapter->registrypriv.RegEnableTxPowerLimit == 0))
		return MAX_POWER_INDEX;

	switch (Adapter->registrypriv.RegPwrTblSel) {
@@ -1640,18 +1639,18 @@ s8 PHY_GetTxPowerLimit(
	case 3:
		regulation = TXPWR_LMT_FCC;
		break;

	case 4:
		regulation = TXPWR_LMT_WW;
		break;

	default:
			regulation = (Band == BAND_ON_2_4G) ? pHalData->Regulation2_4G : pHalData->Regulation5G;
		regulation = (Band == BAND_ON_2_4G) ?
			pHalData->Regulation2_4G :
			pHalData->Regulation5G;
		break;
	}

	/* DBG_871X("pMgntInfo->RegPwrTblSel %d, final regulation %d\n", Adapter->registrypriv.RegPwrTblSel, regulation); */

	/* DBG_871X("pMgntInfo->RegPwrTblSel %d, final regulation %d\n", */
	/*         Adapter->registrypriv.RegPwrTblSel, regulation); */

	if (Band == BAND_ON_2_4G)
		band = 0;
@@ -1745,14 +1744,17 @@ s8 PHY_GetTxPowerLimit(

	/*  workaround for wrong indxe combination to obtain tx power limit, */
	/*  HT on 80M will reference to HT on 40M */
	if ((rateSection == 2 || rateSection == 3) && Band == BAND_ON_5G && bandwidth == 2) {
	if ((rateSection == 2 || rateSection == 3) &&
	    Band == BAND_ON_5G && bandwidth == 2) {
		bandwidth = 1;
	}

	if (Band == BAND_ON_2_4G)
		channel = phy_GetChannelIndexOfTxPowerLimit(BAND_ON_2_4G, Channel);
		channel = phy_GetChannelIndexOfTxPowerLimit(BAND_ON_2_4G,
							    Channel);
	else if (Band == BAND_ON_5G)
		channel = phy_GetChannelIndexOfTxPowerLimit(BAND_ON_5G, Channel);
		channel = phy_GetChannelIndexOfTxPowerLimit(BAND_ON_5G,
							    Channel);
	else if (Band == BAND_ON_BOTH) {
		/*  BAND_ON_BOTH don't care temporarily */
	}
@@ -1760,7 +1762,8 @@ s8 PHY_GetTxPowerLimit(
	if (band == -1 || regulation == -1 || bandwidth == -1 ||
	    rateSection == -1 || channel == -1) {
		/* DBG_871X("Wrong index value to access power limit table [band %d][regulation %d][bandwidth %d][rf_path %d][rate_section %d][chnlGroup %d]\n", */
		/*	  band, regulation, bandwidth, RfPath, rateSection, channelGroup); */
		/*         band, regulation, bandwidth, RfPath, */
		/*         rateSection, channelGroup); */

		return MAX_POWER_INDEX;
	}
@@ -1768,18 +1771,26 @@ s8 PHY_GetTxPowerLimit(
	if (Band == BAND_ON_2_4G) {
		s8 limits[10] = {0}; u8 i = 0;
		for (i = 0; i < MAX_REGULATION_NUM; i++)
			limits[i] = pHalData->TxPwrLimit_2_4G[i][bandwidth][rateSection][channel][RfPath];
			limits[i] = pHalData->TxPwrLimit_2_4G[i][bandwidth]
							     [rateSection]
							     [channel][RfPath];

		powerLimit = (regulation == TXPWR_LMT_WW) ? phy_GetWorldWideLimit(limits) :
			pHalData->TxPwrLimit_2_4G[regulation][bandwidth][rateSection][channel][RfPath];
		powerLimit = (regulation == TXPWR_LMT_WW) ?
			phy_GetWorldWideLimit(limits) :
			pHalData->TxPwrLimit_2_4G[regulation][bandwidth]
						 [rateSection][channel][RfPath];

	} else if (Band == BAND_ON_5G) {
		s8 limits[10] = {0}; u8 i = 0;
		for (i = 0; i < MAX_REGULATION_NUM; ++i)
			limits[i] = pHalData->TxPwrLimit_5G[i][bandwidth][rateSection][channel][RfPath];

		powerLimit = (regulation == TXPWR_LMT_WW) ? phy_GetWorldWideLimit(limits) :
			pHalData->TxPwrLimit_5G[regulation][bandwidth][rateSection][channel][RfPath];
			limits[i] = pHalData->TxPwrLimit_5G[i][bandwidth]
							   [rateSection]
							   [channel][RfPath];

		powerLimit = (regulation == TXPWR_LMT_WW) ?
			phy_GetWorldWideLimit(limits) :
			pHalData->TxPwrLimit_5G[regulation][bandwidth]
					       [rateSection][channel][RfPath];
	} else
		DBG_871X("No power limit table of the specified band\n");

@@ -1789,22 +1800,20 @@ s8 PHY_GetTxPowerLimit(
	if (Band == BAND_ON_5G && powerLimit == MAX_POWER_INDEX) {
		if (bandwidth == 0 || bandwidth == 1) {
			RT_TRACE(COMP_INIT, DBG_LOUD, ("No power limit table of the specified band %d, bandwidth %d, ratesection %d, rf path %d\n",
					  band, bandwidth, rateSection, RfPath));
				 band, bandwidth,
				 rateSection, RfPath));
			if (rateSection == 2)
				powerLimit = pHalData->TxPwrLimit_5G[regulation]
										[bandwidth][4][channelGroup][RfPath];
				powerLimit = pHalData->TxPwrLimit_5G[regulation][bandwidth][4][channelGroup][RfPath];
			else if (rateSection == 4)
				powerLimit = pHalData->TxPwrLimit_5G[regulation]
										[bandwidth][2][channelGroup][RfPath];
				powerLimit = pHalData->TxPwrLimit_5G[regulation][bandwidth][2][channelGroup][RfPath];
			else if (rateSection == 3)
				powerLimit = pHalData->TxPwrLimit_5G[regulation]
										[bandwidth][5][channelGroup][RfPath];
				powerLimit = pHalData->TxPwrLimit_5G[regulation][bandwidth][5][channelGroup][RfPath];
			else if (rateSection == 5)
				powerLimit = pHalData->TxPwrLimit_5G[regulation]
										[bandwidth][3][channelGroup][RfPath];
				powerLimit = pHalData->TxPwrLimit_5G[regulation][bandwidth][3][channelGroup][RfPath];
		}
	}
	*/

	/* DBG_871X("TxPwrLmt[Regulation %d][Band %d][BW %d][RFPath %d][Rate 0x%x][Chnl %d] = %d\n", */
	/*		regulation, pHalData->CurrentBandType, Bandwidth, RfPath, DataRate, Channel, powerLimit); */
	return powerLimit;
@@ -3294,4 +3303,3 @@ void phy_free_filebuf(struct adapter *padapter)
		vfree(pHalData->rf_tx_pwr_lmt);

}