All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: "Greg Kroah-Hartman" <gregkh@suse.de>
Cc: devel@driverdev.osuosl.org,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Marcin Slusarz <marcin.slusarz@gmail.com>,
	Mike Galbraith <efault@gmx.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 30/33] Staging: rt2870: add Antenna Diversity support
Date: Sun, 23 Aug 2009 15:32:00 +0200	[thread overview]
Message-ID: <20090823133200.17784.16394.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090823132846.17784.13359.sendpatchset@localhost.localdomain>

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] Staging: rt2870: add Antenna Diversity support

rt3070:
* remove non-working AntDiversity config parameter
* remove unused bRxAntDiversity field from COMMON_CONFIG

rt2870:
* propagate Antenna Diversity support from rt3070

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/staging/rt2860/common/eeprom.c    |   16 ++++------------
 drivers/staging/rt2860/common/mlme.c      |   10 +++++-----
 drivers/staging/rt2860/common/rtmp_init.c |    2 +-
 drivers/staging/rt2860/rt_profile.c       |   17 -----------------
 drivers/staging/rt2860/rtmp.h             |    7 ++-----
 drivers/staging/rt2860/sta/rtmp_data.c    |    9 +++------
 6 files changed, 15 insertions(+), 46 deletions(-)

Index: b/drivers/staging/rt2860/common/eeprom.c
===================================================================
--- a/drivers/staging/rt2860/common/eeprom.c
+++ b/drivers/staging/rt2860/common/eeprom.c
@@ -181,14 +181,11 @@ USHORT RTMP_EEPROM_READ16(
     UINT32		x;
     USHORT		data;
 
-#ifdef RT30xx
+#ifdef RT2870
 	if (pAd->NicConfig2.field.AntDiversity)
     {
     	pAd->EepromAccess = TRUE;
     }
-//2008/09/11:KH add to support efuse<--
-//2008/09/11:KH add to support efuse-->
-{
 #endif
     Offset /= 2;
     // reset bits and set EECS
@@ -214,7 +211,7 @@ USHORT RTMP_EEPROM_READ16(
 
     EEpromCleanup(pAd);
 
-#ifdef RT30xx
+#ifdef RT2870
 	// Antenna and EEPROM access are both using EESK pin,
     // Therefor we should avoid accessing EESK at the same time
     // Then restore antenna after EEPROM access
@@ -223,7 +220,6 @@ USHORT RTMP_EEPROM_READ16(
 	    pAd->EepromAccess = FALSE;
 	    AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
     }
-}
 #endif
     return data;
 }	//ReadEEprom
@@ -235,14 +231,11 @@ VOID RTMP_EEPROM_WRITE16(
 {
     UINT32 x;
 
-#ifdef RT30xx
+#ifdef RT2870
 	if (pAd->NicConfig2.field.AntDiversity)
     {
     	pAd->EepromAccess = TRUE;
     }
-	//2008/09/11:KH add to support efuse<--
-//2008/09/11:KH add to support efuse-->
-	{
 #endif
 	Offset /= 2;
 
@@ -278,7 +271,7 @@ VOID RTMP_EEPROM_WRITE16(
 
     EEpromCleanup(pAd);
 
-#ifdef RT30xx
+#ifdef RT2870
 	// Antenna and EEPROM access are both using EESK pin,
     // Therefor we should avoid accessing EESK at the same time
     // Then restore antenna after EEPROM access
@@ -287,7 +280,6 @@ VOID RTMP_EEPROM_WRITE16(
 	    pAd->EepromAccess = FALSE;
 	    AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
     }
-}
 #endif
 }
 
Index: b/drivers/staging/rt2860/common/mlme.c
===================================================================
--- a/drivers/staging/rt2860/common/mlme.c
+++ b/drivers/staging/rt2860/common/mlme.c
@@ -8004,7 +8004,7 @@ CHAR RTMPMaxRssi(
 	return larger;
 }
 
-#ifdef RT30xx
+#ifdef RT2870
 // Antenna divesity use GPIO3 and EESK pin for control
 // Antenna and EEPROM access are both using EESK pin,
 // Therefor we should avoid accessing EESK at the same time
@@ -8052,7 +8052,7 @@ VOID AsicSetRxAnt(
 		DBGPRINT_RAW(RT_DEBUG_TRACE, ("AsicSetRxAnt, switch to aux antenna\n"));
 	}
 }
-#endif /* RT30xx */
+#endif
 
 /*
     ========================================================================
@@ -8078,7 +8078,7 @@ VOID AsicEvaluateRxAnt(
 				fRTMP_ADAPTER_NIC_NOT_EXIST |
 				fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)
 				|| OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
-#ifdef RT30xx
+#ifdef RT2870
 				|| (pAd->EepromAccess)
 #endif
 				)
@@ -8182,9 +8182,9 @@ VOID AsicRxAntEvalTimeout(
 							fRTMP_ADAPTER_RADIO_OFF			|
 							fRTMP_ADAPTER_NIC_NOT_EXIST)
 							|| OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
-#ifdef RT30xx
+#ifdef RT2870
 							|| (pAd->EepromAccess)
-#endif // RT30xx //
+#endif
 							)
 		return;
 
Index: b/drivers/staging/rt2860/common/rtmp_init.c
===================================================================
--- a/drivers/staging/rt2860/common/rtmp_init.c
+++ b/drivers/staging/rt2860/common/rtmp_init.c
@@ -3415,7 +3415,7 @@ VOID	UserCfgInit(
 		}
 	}
 
-#ifdef RT30xx
+#ifdef RT2870
 	pAd->EepromAccess = FALSE;
 #endif
 	pAd->Antenna.word = 0;
Index: b/drivers/staging/rt2860/rt_profile.c
===================================================================
--- a/drivers/staging/rt2860/rt_profile.c
+++ b/drivers/staging/rt2860/rt_profile.c
@@ -1429,23 +1429,6 @@ NDIS_STATUS	RTMPReadParametersHook(
 								DBGPRINT(RT_DEBUG_TRACE, ("TGnWifiTest=%d\n", pAd->StaCfg.bTGnWifiTest));
 						}
 					}
-
-#ifdef RT30xx
-						{
-							if(RTMPGetKeyParameter("AntDiversity", tmpbuf, 10, buffer))
-							{
-								for (i = 0, macptr = rstrtok(tmpbuf,";"); macptr; macptr = rstrtok(NULL,";"), i++)
-								{
-									if(simple_strtol(macptr, 0, 10) != 0)  //Enable
-										pAd->CommonCfg.bRxAntDiversity = TRUE;
-									else //Disable
-										pAd->CommonCfg.bRxAntDiversity = FALSE;
-
-									DBGPRINT(RT_DEBUG_ERROR, ("AntDiversity=%d\n", pAd->CommonCfg.bRxAntDiversity));
-								}
-							}
-						}
-#endif // RT30xx //
 				}
 			}
 			else
Index: b/drivers/staging/rt2860/rtmp.h
===================================================================
--- a/drivers/staging/rt2860/rtmp.h
+++ b/drivers/staging/rt2860/rtmp.h
@@ -1295,7 +1295,7 @@ typedef struct _BBP_TUNING_STRUCT {
 
 typedef struct _SOFT_RX_ANT_DIVERSITY_STRUCT {
 	UCHAR     EvaluatePeriod;		 // 0:not evalute status, 1: evaluate status, 2: switching status
-#ifdef RT30xx
+#ifdef RT2870
 	UCHAR     EvaluateStableCnt;
 #endif
 	UCHAR     Pair1PrimaryRxAnt;     // 0:Ant-E1, 1:Ant-E2
@@ -1899,9 +1899,6 @@ typedef struct _COMMON_CONFIG {
 
 	BOOLEAN				NdisRadioStateOff; //For HCT 12.0, set this flag to TRUE instead of called MlmeRadioOff.
 	ABGBAND_STATE		BandState;		// For setting BBP used on B/G or A mode.
-#ifdef RT30xx
-	BOOLEAN				bRxAntDiversity; // 0:disable, 1:enable Software Rx Antenna Diversity.
-#endif
 
 	// IEEE802.11H--DFS.
 	RADAR_DETECT_STRUCT	RadarDetect;
@@ -2667,7 +2664,7 @@ typedef struct _RTMP_ADAPTER
 	ULONG                   EepromVersion;          // byte 0: version, byte 1: revision, byte 2~3: unused
 	UCHAR                   EEPROMAddressNum;       // 93c46=6  93c66=8
 	USHORT                  EEPROMDefaultValue[NUM_EEPROM_BBP_PARMS];
-#ifdef RT30xx
+#ifdef RT2870
 	BOOLEAN                 EepromAccess;
 #endif
 	ULONG                   FirmwareVersion;        // byte 0: Minor version, byte 1: Major version, otherwise unused.
Index: b/drivers/staging/rt2860/sta/rtmp_data.c
===================================================================
--- a/drivers/staging/rt2860/sta/rtmp_data.c
+++ b/drivers/staging/rt2860/sta/rtmp_data.c
@@ -575,10 +575,7 @@ VOID STAHandleRxMgmtFrame(
 	{
 
 		// We should collect RSSI not only U2M data but also my beacon
-		if (
-#ifdef RT30xx
-		    pAd->RxAnt.EvaluatePeriod == 0 &&
-#endif
+		if (pAd->RxAnt.EvaluatePeriod == 0 &&
 		    pHeader->FC.SubType == SUBTYPE_BEACON &&
 		    MAC_ADDR_EQUAL(&pAd->CommonCfg.Bssid, &pHeader->Addr2)) {
 			Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, pRxWI);
@@ -587,7 +584,7 @@ VOID STAHandleRxMgmtFrame(
 			pAd->StaCfg.LastSNR1 = (UCHAR)(pRxWI->SNR1);
 		}
 
-#ifdef RT30xx
+#ifdef RT2870
 		// collect rssi information for antenna diversity
 		if (pAd->NicConfig2.field.AntDiversity)
 		{
@@ -597,7 +594,7 @@ VOID STAHandleRxMgmtFrame(
 					pAd->StaCfg.NumOfAvgRssiSample ++;
 			}
 		}
-#endif // RT30xx //
+#endif
 
 		// First check the size, it MUST not exceed the mlme queue size
 		if (pRxWI->MPDUtotalByteCount > MGMT_DMA_BUFFER_SIZE)

  parent reply	other threads:[~2009-08-23 13:31 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-23 13:28 [PATCH 00/33] Staging: rt{286,287,307}0: merge rt3070 with rt2870 Bartlomiej Zolnierkiewicz
2009-08-23 13:28 ` [PATCH 01/33] Staging: rtxxxx: unify AsicRxAntEvalTimeout() Bartlomiej Zolnierkiewicz
2009-08-23 13:28 ` [PATCH 02/33] Staging: rtxxxx: unify AsicSwitchChannel() Bartlomiej Zolnierkiewicz
2009-08-23 13:29 ` [PATCH 03/33] Staging: rtxx70: unify NICInitRT30xxRFRegisters() Bartlomiej Zolnierkiewicz
2009-08-23 13:29 ` [PATCH 04/33] Staging: rtxxxx: RTMPGetRalinkAuthModeStr() fixes Bartlomiej Zolnierkiewicz
2009-08-23 13:29 ` [PATCH 05/33] Staging: rt3070: update allowed channels list for Japan Bartlomiej Zolnierkiewicz
2009-08-23 13:29 ` [PATCH 06/33] Staging: rt3070: fix PID checking in RTUSBEnqueueCmdFromNdis() Bartlomiej Zolnierkiewicz
2009-08-23 13:29 ` [PATCH 07/33] Staging: rt3070: WEP fixes Bartlomiej Zolnierkiewicz
2009-08-23 13:29 ` [PATCH 08/33] Staging: rt3070: AsicSetSlotTime() fix Bartlomiej Zolnierkiewicz
2009-08-23 13:29 ` [PATCH 09/33] Staging: rt3070: remove needless EFUSE_TAG register read Bartlomiej Zolnierkiewicz
2009-08-23 13:29 ` [PATCH 10/33] Staging: rt3070: add remaining rt2870 device ids Bartlomiej Zolnierkiewicz
2009-08-23 13:29 ` [PATCH 11/33] Staging: rt2870: use internal command for AsicUpdateProtect() Bartlomiej Zolnierkiewicz
2009-08-23 13:30 ` [PATCH 12/33] Staging: rt2870: add fRTUSB_BULK_OUT_DATA_NORMAL_5 quirk Bartlomiej Zolnierkiewicz
2009-08-23 13:30 ` [PATCH 13/33] Staging: rt28x0: add SIOCGIWNAME support to rt_ioctl_giwscan() Bartlomiej Zolnierkiewicz
2009-08-23 13:30 ` [PATCH 14/33] Staging: rt28x0: fix GTK length check in ParseKeyData() Bartlomiej Zolnierkiewicz
2009-08-23 13:30 ` [PATCH 15/33] Staging: rt28x0: fix BPP_R66 register handling Bartlomiej Zolnierkiewicz
2009-08-23 13:30 ` [PATCH 16/33] Staging: rt28x0: fix fOP_STATUS_DOZE flag handling Bartlomiej Zolnierkiewicz
2009-08-23 13:30 ` [PATCH 17/33] Staging: rt28x0 fix BACapability policy handling Bartlomiej Zolnierkiewicz
2009-08-23 13:30 ` [PATCH 18/33] Staging: rt28x0: AsicSwitchChannel() fix Bartlomiej Zolnierkiewicz
2009-08-23 13:30 ` [PATCH 19/33] Staging: rt28x0: BssTableSetEntry() fix Bartlomiej Zolnierkiewicz
2009-08-23 13:30 ` [PATCH 20/33] Staging: rt28x0: MlmeSelectTxRateTable() fix Bartlomiej Zolnierkiewicz
2009-08-23 13:31 ` [PATCH 21/33] Staging: rt28x0: MlmeCheckPsmChange() fix Bartlomiej Zolnierkiewicz
2009-08-23 13:31 ` [PATCH 22/33] Staging: rt28x0: MlmeAssocReqAction() fixes for wpa_supplicant support Bartlomiej Zolnierkiewicz
2009-08-23 13:31 ` [PATCH 23/33] Staging: rt28x0: rt_ioctl_siwencode() fixes Bartlomiej Zolnierkiewicz
2009-08-23 13:31 ` [PATCH 24/33] Staging: rt28x0: LinkUp() fixes Bartlomiej Zolnierkiewicz
2009-08-23 13:31 ` [PATCH 25/33] Staging: rt3070: remove unused MiniportDataMMRequest() Bartlomiej Zolnierkiewicz
2009-08-23 13:31 ` [PATCH 26/33] Staging: rt3070: remove unused RT_CMD_SET_* internal commands Bartlomiej Zolnierkiewicz
2009-08-23 13:31 ` [PATCH 27/33] Staging: rt2870: remove SHOW_ADHOC_ENTRY_INFO support Bartlomiej Zolnierkiewicz
2009-08-23 13:31 ` [PATCH 28/33] Staging: rtxxxx: remove unused AsicAntenna{Select,Setting}() Bartlomiej Zolnierkiewicz
2009-08-23 13:31 ` [PATCH 29/33] Staging: rt2870: add eFuse support Bartlomiej Zolnierkiewicz
2009-08-23 13:32 ` Bartlomiej Zolnierkiewicz [this message]
2009-08-23 13:32 ` [PATCH 31/33] Staging: rtxx70: merge rt3070 with rt2870 Bartlomiej Zolnierkiewicz
2009-08-23 13:32 ` [PATCH 32/33] Staging: rt2870: remove old firmware Bartlomiej Zolnierkiewicz
2009-08-23 13:32 ` [PATCH 33/33] Staging: remove no longer needed rt3070 driver Bartlomiej Zolnierkiewicz
2009-08-23 16:49 ` [PATCH 00/33] Staging: rt{286,287,307}0: merge rt3070 with rt2870 Greg KH
2009-08-23 17:33 ` Marcin Slusarz
2009-08-30 12:28   ` Bartlomiej Zolnierkiewicz
2009-08-24  5:54 ` Mike Galbraith
2009-08-30 12:28   ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090823133200.17784.16394.sendpatchset@localhost.localdomain \
    --to=bzolnier@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=efault@gmx.de \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.slusarz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.