Commit 37843390 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman
Browse files

Staging: rtxxx0: remove superfluous RT30xx ifdefs



* add !RT30xx version of IS_RT3090() macro
* remove superfluous RT30xx ifdefs
* unify RT30xx and !RT30xx code where possible
* kill RT28XX_UPDATE_PROTECT() macro
* remove needless variable initializations
* kill some needless function prototypes

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bf5f6ca4
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -528,15 +528,8 @@ VOID SendRefreshBAR(
							  sizeof(FRAME_BAR),	  &FrameBar,
							  END_OF_ARGS);

			if (1)	// Now we always send BAR.
			{
#ifndef RT30xx
				MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
#endif
#ifdef RT30xx
			MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
#endif
			}

			MlmeFreeMemory(pAd, pOutBuffer);
		}
	}
+0 −8
Original line number Diff line number Diff line
@@ -1391,10 +1391,8 @@ VOID SendPSMPAction(
	//ULONG           Idx;
	FRAME_PSMP_ACTION   Frame;
	ULONG           FrameLen;
#ifdef RT30xx
	UCHAR			bbpdata=0;
	UINT32			macdata;
#endif // RT30xx //

	NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);	 //Get an unused nonpaged memory
	if (NStatus != NDIS_STATUS_SUCCESS)
@@ -1410,7 +1408,6 @@ VOID SendPSMPAction(
	switch (Psmp)
	{
		case MMPS_ENABLE:
#ifdef RT30xx
			if (IS_RT3090(pAd))
			{
				// disable MMPS BBP control register
@@ -1423,11 +1420,9 @@ VOID SendPSMPAction(
				macdata &= ~(0x09);	//bit 0, 3
				RTMP_IO_WRITE32(pAd, 0x1210, macdata);
			}
#endif // RT30xx //
			Frame.Psmp = 0;
			break;
		case MMPS_DYNAMIC:
#ifdef RT30xx
			if (IS_RT3090(pAd))
			{
				// enable MMPS BBP control register
@@ -1440,11 +1435,9 @@ VOID SendPSMPAction(
				macdata |= 0x09;	//bit 0, 3
				RTMP_IO_WRITE32(pAd, 0x1210, macdata);
			}
#endif // RT30xx //
			Frame.Psmp = 3;
			break;
		case MMPS_STATIC:
#ifdef RT30xx
			if (IS_RT3090(pAd))
			{
				// enable MMPS BBP control register
@@ -1457,7 +1450,6 @@ VOID SendPSMPAction(
				macdata |= 0x09;	//bit 0, 3
				RTMP_IO_WRITE32(pAd, 0x1210, macdata);
			}
#endif // RT30xx //
			Frame.Psmp = 1;
			break;
	}
+3 −1
Original line number Diff line number Diff line
@@ -2616,7 +2616,9 @@ BOOLEAN MacTableDeleteEntry(
		AsicUpdateProtect(pAd, 0 /*pAd->CommonCfg.AddHTInfo.AddHtInfo2.OperaionMode*/, (ALLN_SETPROTECT), TRUE, 0 /*pAd->MacTab.fAnyStationNonGF*/);
#endif
#ifdef RT30xx
		RT28XX_UPDATE_PROTECT(pAd);  // edit by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet
		// edit by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet
		// Set MAC register value according operation mode
		RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_UPDATE_PROTECT, NULL, 0);
#endif
	}

+3 −15
Original line number Diff line number Diff line
@@ -73,16 +73,12 @@ USHORT ShiftInBits(
        RaiseClock(pAd, &x);

        RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
#ifdef RT30xx
		LowerClock(pAd, &x); //prevent read failed
#endif

	LowerClock(pAd, &x); /* prevent read failed */

        x &= ~(EEDI);
        if(x & EEDO)
            data |= 1;

#ifndef RT30xx
        LowerClock(pAd, &x);
#endif
    }

    return data;
@@ -201,17 +197,13 @@ USHORT RTMP_EEPROM_READ16(
    x |= EECS;
    RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);

#ifdef RT30xx
	// patch can not access e-Fuse issue
    if (!IS_RT3090(pAd))
    {
#endif
	// kick a pulse
	RaiseClock(pAd, &x);
	LowerClock(pAd, &x);
#ifdef RT30xx
    }
#endif

    // output the read_opcode and register number in that order
    ShiftOutBits(pAd, EEPROM_READ_OPCODE, 3);
@@ -262,17 +254,13 @@ VOID RTMP_EEPROM_WRITE16(
    x |= EECS;
    RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);

#ifdef RT30xx
	// patch can not access e-Fuse issue
    if (!IS_RT3090(pAd))
    {
#endif
	// kick a pulse
	RaiseClock(pAd, &x);
	LowerClock(pAd, &x);
#ifdef RT30xx
    }
#endif

    // output the read_opcode ,register number and data in that order
    ShiftOutBits(pAd, EEPROM_WRITE_OPCODE, 3);
+12 −53
Original line number Diff line number Diff line
@@ -449,13 +449,7 @@ FREQUENCY_ITEM FreqItems3020[] =
	{13,   247,	 2,  2},
	{14,   248,	 2,  4},
};
#ifndef RT30xx
#define	NUM_OF_3020_CHNL	(sizeof(FreqItems3020) / sizeof(FREQUENCY_ITEM))
#endif
#ifdef RT30xx
//2008/07/10:KH Modified to share this variable
UCHAR	NUM_OF_3020_CHNL=(sizeof(FreqItems3020) / sizeof(FREQUENCY_ITEM));
#endif

/*
	==========================================================================
@@ -3949,14 +3943,12 @@ VOID BssTableSsidSort(
							continue;

					// check group cipher
					if (
#ifndef RT30xx
					if ((pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) &&
						(pInBss->WPA.GroupCipher != Ndis802_11GroupWEP40Enabled) &&
						(pInBss->WPA.GroupCipher != Ndis802_11GroupWEP104Enabled))
#endif
#ifdef RT30xx
					if (pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher)
					    pInBss->WPA.GroupCipher != Ndis802_11GroupWEP40Enabled &&
					    pInBss->WPA.GroupCipher != Ndis802_11GroupWEP104Enabled &&
#endif
					    pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher)
						continue;

					// check pairwise cipher, skip if none matched
@@ -3975,14 +3967,12 @@ VOID BssTableSsidSort(
							continue;

					// check group cipher
					if (
#ifndef RT30xx
					if ((pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) &&
						(pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP40Enabled) &&
						(pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP104Enabled))
#endif
#ifdef RT30xx
					if (pAd->StaCfg.WepStatus < pInBss->WPA2.GroupCipher)
					    pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP40Enabled &&
					    pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP104Enabled &&
#endif
					    pAd->StaCfg.WepStatus < pInBss->WPA2.GroupCipher)
						continue;

					// check pairwise cipher, skip if none matched
@@ -8229,7 +8219,6 @@ VOID AsicSetRxAnt(
	IN PRTMP_ADAPTER	pAd,
	IN UCHAR			Ant)
{
#ifdef RT30xx
	UINT32	Value;
	UINT32	x;

@@ -8268,7 +8257,6 @@ VOID AsicSetRxAnt(
		RTMP_IO_WRITE32(pAd, GPIO_CTRL_CFG, Value);
		DBGPRINT_RAW(RT_DEBUG_TRACE, ("AsicSetRxAnt, switch to aux antenna\n"));
	}
#endif // RT30xx //
}
#endif /* RT30xx */

@@ -8330,9 +8318,7 @@ VOID AsicEvaluateRxAnt(
							fRTMP_ADAPTER_NIC_NOT_EXIST		|
							fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS) ||
							OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
#ifdef RT30xx
							|| (pAd->EepromAccess)
#endif // RT30xx //
							)
		return;

@@ -8822,27 +8808,13 @@ VOID AsicStaBbpTuning(
				{
					R66 = 0x1C + 2*GET_LNA_GAIN(pAd) + 0x20;
					if (OrigR66Value != R66)
					{
#ifndef RT30xx
						RTUSBWriteBBPRegister(pAd, BBP_R66, R66);
#endif
#ifdef RT30xx
						RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
#endif
					}
				}
				else
				{
					R66 = 0x1C + 2*GET_LNA_GAIN(pAd);
					if (OrigR66Value != R66)
					{
#ifndef RT30xx
						RTUSBWriteBBPRegister(pAd, BBP_R66, R66);
#endif
#ifdef RT30xx
						RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
#endif
					}
				}
			}
			else
@@ -9051,15 +9023,13 @@ VOID AsicTurnOffRFClk(
	UCHAR			index;
	RTMP_RF_REGS	*RFRegTable;

#ifdef RT30xx
	// The RF programming sequence is difference between 3xxx and 2xxx
	if (IS_RT3090(pAd))
	{
		RT30xxLoadRFSleepModeSetup(pAd);  // add by johnli,  RF power sequence setup, load RF sleep-mode setup
		return;
	}
	else
	{
#endif // RT30xx //

	RFRegTable = RF2850RegTable;

	switch (pAd->RfIcType)
@@ -9101,10 +9071,6 @@ VOID AsicTurnOffRFClk(
		default:
			break;
	}
#ifdef RT30xx
	}
#endif // RT30xx //

}


@@ -9118,14 +9084,10 @@ VOID AsicTurnOnRFClk(
	UCHAR			index;
	RTMP_RF_REGS	*RFRegTable;

#ifdef RT30xx
	// The RF programming sequence is difference between 3xxx and 2xxx
	if (IS_RT3090(pAd))
	{
	}
	else
	{
#endif // RT30xx //
		return;

	RFRegTable = RF2850RegTable;

	switch (pAd->RfIcType)
@@ -9178,8 +9140,5 @@ VOID AsicTurnOnRFClk(
		pAd->RfIcType,
		R2));
#endif
#ifdef RT30xx
	}
#endif // RT30xx //
}
Loading