diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-08-16 21:30:38 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 12:02:18 -0700 |
commit | bf5f6ca4a855f85e2c01ca9ca7761a466db64ed5 (patch) | |
tree | 3bd0b0775b0eb487033ea8c8a9e0211fca1d08f1 /drivers/staging/rt2870 | |
parent | ca3d0a5ce9d744e78755142bfa3709ec3ee7f85a (diff) |
Staging: rtxxx0: unify different RT30xx{Read,Write}RFRegister() flavors
RTMP_IO_{READ,WRITE}32 equals RTUSB{Read,Write}MACRegister
in case of USB chipsets so unify RT30xx and !RT30xx code.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rt2870')
-rw-r--r-- | drivers/staging/rt2870/common/rtusb_io.c | 25 | ||||
-rw-r--r-- | drivers/staging/rt2870/rt2870.h | 3 |
2 files changed, 12 insertions, 16 deletions
diff --git a/drivers/staging/rt2870/common/rtusb_io.c b/drivers/staging/rt2870/common/rtusb_io.c index a689e60fed48..ef545af2af93 100644 --- a/drivers/staging/rt2870/common/rtusb_io.c +++ b/drivers/staging/rt2870/common/rtusb_io.c @@ -671,11 +671,10 @@ NTSTATUS RTUSBWriteRFRegister( return STATUS_SUCCESS; } -#ifndef RT30xx /* ======================================================================== - Routine Description: Write RT3070 RF register through MAC + Routine Description: Write RT30xx RF register through MAC Arguments: @@ -687,7 +686,7 @@ NTSTATUS RTUSBWriteRFRegister( ======================================================================== */ -NTSTATUS RT30xxWriteRFRegister( +NTSTATUS RT30xxWriteRFRegister( IN PRTMP_ADAPTER pAd, IN UCHAR RegID, IN UCHAR Value) @@ -697,7 +696,7 @@ NTSTATUS RT30xxWriteRFRegister( do { - RTUSBReadMACRegister(pAd, RF_CSR_CFG, &rfcsr.word); + RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word); if (!rfcsr.field.RF_CSR_KICK) break; @@ -716,15 +715,16 @@ NTSTATUS RT30xxWriteRFRegister( rfcsr.field.TESTCSR_RFACC_REGNUM = RegID; rfcsr.field.RF_CSR_DATA = Value; - RTUSBWriteMACRegister(pAd, RF_CSR_CFG, rfcsr.word); + RTMP_IO_WRITE32(pAd, RF_CSR_CFG, rfcsr.word); return STATUS_SUCCESS; } + /* ======================================================================== - Routine Description: Read RT3070 RF register through MAC + Routine Description: Read RT30xx RF register through MAC Arguments: @@ -736,17 +736,17 @@ NTSTATUS RT30xxWriteRFRegister( ======================================================================== */ -NTSTATUS RT30xxReadRFRegister( +NTSTATUS RT30xxReadRFRegister( IN PRTMP_ADAPTER pAd, IN UCHAR RegID, IN PUCHAR pValue) { RF_CSR_CFG_STRUC rfcsr; - UINT i=0, k; + UINT i=0, k=0; for (i=0; i<MAX_BUSY_COUNT; i++) { - RTUSBReadMACRegister(pAd, RF_CSR_CFG, &rfcsr.word); + RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word); if (rfcsr.field.RF_CSR_KICK == BUSY) { @@ -756,10 +756,10 @@ NTSTATUS RT30xxReadRFRegister( rfcsr.field.RF_CSR_WR = 0; rfcsr.field.RF_CSR_KICK = 1; rfcsr.field.TESTCSR_RFACC_REGNUM = RegID; - RTUSBWriteMACRegister(pAd, RF_CSR_CFG, rfcsr.word); + RTMP_IO_WRITE32(pAd, RF_CSR_CFG, rfcsr.word); for (k=0; k<MAX_BUSY_COUNT; k++) { - RTUSBReadMACRegister(pAd, RF_CSR_CFG, &rfcsr.word); + RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word); if (rfcsr.field.RF_CSR_KICK == IDLE) break; @@ -773,13 +773,12 @@ NTSTATUS RT30xxReadRFRegister( } if (rfcsr.field.RF_CSR_KICK == BUSY) { - DBGPRINT_ERR(("RF read R%d=0x%x fail\n", RegID, rfcsr.word)); + DBGPRINT_ERR(("RF read R%d=0x%x fail, i[%d], k[%d]\n", RegID, rfcsr.word,i,k)); return STATUS_UNSUCCESSFUL; } return STATUS_SUCCESS; } -#endif /* RT30xx */ /* ======================================================================== diff --git a/drivers/staging/rt2870/rt2870.h b/drivers/staging/rt2870/rt2870.h index 0ca544028c88..a555f166f517 100644 --- a/drivers/staging/rt2870/rt2870.h +++ b/drivers/staging/rt2870/rt2870.h @@ -411,9 +411,6 @@ extern UCHAR EpToQueue[6]; //#undef MlmeAllocateMemory //#undef MlmeFreeMemory -#ifndef RT30xx -typedef int NTSTATUS; -#endif typedef struct usb_device * PUSB_DEV; /* MACRO for linux usb */ |