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 01/33] Staging: rtxxxx: unify AsicRxAntEvalTimeout()
Date: Sun, 23 Aug 2009 15:28:52 +0200 [thread overview]
Message-ID: <20090823132852.17784.9175.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090823132846.17784.13359.sendpatchset@localhost.localdomain>
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] Staging: rtxxxx: unify AsicRxAntEvalTimeout()
Unify RT30xx and !RT30xx code in AsicRxAntEvalTimeout().
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/staging/rt2860/common/mlme.c | 79 +++--------------------------------
1 file changed, 7 insertions(+), 72 deletions(-)
Index: b/drivers/staging/rt2860/common/mlme.c
===================================================================
--- a/drivers/staging/rt2860/common/mlme.c
+++ b/drivers/staging/rt2860/common/mlme.c
@@ -8233,85 +8233,19 @@ VOID AsicRxAntEvalTimeout(
UCHAR BBPR3 = 0;
CHAR larger = -127, rssi0, rssi1, rssi2;
-#ifndef RT30xx
- {
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- if (pAd->StaCfg.Psm == PWR_SAVE)
- return;
-
-
- // if the traffic is low, use average rssi as the criteria
- if (pAd->Mlme.bLowThroughput == TRUE)
- {
- rssi0 = pAd->StaCfg.RssiSample.LastRssi0;
- rssi1 = pAd->StaCfg.RssiSample.LastRssi1;
- rssi2 = pAd->StaCfg.RssiSample.LastRssi2;
- }
- else
- {
- rssi0 = pAd->StaCfg.RssiSample.AvgRssi0;
- rssi1 = pAd->StaCfg.RssiSample.AvgRssi1;
- rssi2 = pAd->StaCfg.RssiSample.AvgRssi2;
- }
-
- if(pAd->Antenna.field.RxPath == 3)
- {
- larger = max(rssi0, rssi1);
-
- if (larger > (rssi2 + 20))
- pAd->Mlme.RealRxPath = 2;
- else
- pAd->Mlme.RealRxPath = 3;
- }
- else if(pAd->Antenna.field.RxPath == 2)
- {
- if (rssi0 > (rssi1 + 20))
- pAd->Mlme.RealRxPath = 1;
- else
- pAd->Mlme.RealRxPath = 2;
- }
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPR3);
- BBPR3 &= (~0x18);
- if(pAd->Mlme.RealRxPath == 3)
- {
- BBPR3 |= (0x10);
- }
- else if(pAd->Mlme.RealRxPath == 2)
- {
- BBPR3 |= (0x8);
- }
- else if(pAd->Mlme.RealRxPath == 1)
- {
- BBPR3 |= (0x0);
- }
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3);
-#ifdef RT2860
- pAd->StaCfg.BBPR3 = BBPR3;
-#endif
- }
-#endif /* RT30xx */
-#ifdef RT30xx
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS |
fRTMP_ADAPTER_HALT_IN_PROGRESS |
fRTMP_ADAPTER_RADIO_OFF |
- fRTMP_ADAPTER_NIC_NOT_EXIST) ||
- OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
+ fRTMP_ADAPTER_NIC_NOT_EXIST)
#ifdef RT30xx
+ || OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
|| (pAd->EepromAccess)
#endif // RT30xx //
)
return;
{
- //if (pAd->StaCfg.Psm == PWR_SAVE)
- // return;
-
+#ifdef RT30xx
if (pAd->NicConfig2.field.AntDiversity)
{
if ((pAd->RxAnt.RcvPktNumWhenEvaluate != 0) && (pAd->RxAnt.Pair1AvgRssi[pAd->RxAnt.Pair1SecondaryRxAnt] >= pAd->RxAnt.Pair1AvgRssi[pAd->RxAnt.Pair1PrimaryRxAnt]))
@@ -8343,6 +8277,7 @@ VOID AsicRxAntEvalTimeout(
pAd->RxAnt.Pair1PrimaryRxAnt, (pAd->RxAnt.Pair1AvgRssi[0] >> 3), (pAd->RxAnt.Pair1AvgRssi[1] >> 3), pAd->RxAnt.RcvPktNumWhenEvaluate));
}
else
+#endif
{
if (pAd->StaCfg.Psm == PWR_SAVE)
return;
@@ -8393,13 +8328,13 @@ VOID AsicRxAntEvalTimeout(
BBPR3 |= (0x0);
}
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3);
+#ifdef RT2860
+ pAd->StaCfg.BBPR3 = BBPR3;
+#endif
}
}
-#endif /* RT30xx */
}
-
-
VOID APSDPeriodicExec(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
next prev parent reply other threads:[~2009-08-23 13:28 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 ` Bartlomiej Zolnierkiewicz [this message]
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 ` [PATCH 30/33] Staging: rt2870: add Antenna Diversity support Bartlomiej Zolnierkiewicz
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=20090823132852.17784.9175.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox