rt2x00: Correctly handle RF 0 writing
PATCH 11/24 rt2x00: Correctly handle RF 0 writing
Quoted 1 line
From
9b7ee86485d789df2a1e6006a073d0847f54a5b7Mon Sep 17 00:00:00 2001
From: Ivo van Doorn <[email protected]>
Date: Sat, 28 Jul 2007 12:15:56 +0200
Subject: [PATCH 11/24] rt2x00: Correctly handle RF 0 writing
When attempting to write to RF 0 the rf handler should exit immediately.
This also removes the requirement to do index - 1 when reading and writing to the RF buffer since the size is big enough to keep word 0 unused.
Signed-off-by Ivo van Doorn <[email protected]>
--- drivers/net/wireless/rt2400pci.c | 3 +++ drivers/net/wireless/rt2500pci.c | 3 +++ drivers/net/wireless/rt2500usb.c | 3 +++ drivers/net/wireless/rt2x00.h | 6 ++---- drivers/net/wireless/rt61pci.c | 3 +++ drivers/net/wireless/rt73usb.c | 3 +++ 6 files changed, 17 insertions(+), 4 deletions(-)
drivers/net/wireless/rt2400pci.c +3 -0
@@ -142,6 +142,9 @@ static void rt2400pci_rf_write(const struct rt2x00_dev *rt2x00dev,u32 reg;unsigned int i; +if (!word) +return ; +for (i =0 ; i <REGISTER_BUSY_COUNT ; i++) {rt2x00pci_register_read (rt2x00dev,RFCSR , ®);if (!rt2x00_get_field32 (reg,RFCSR_BUSY ))
drivers/net/wireless/rt2500pci.c +3 -0
@@ -142,6 +142,9 @@ static void rt2500pci_rf_write(const struct rt2x00_dev *rt2x00dev,u32 reg;unsigned int i; +if (!word) +return ; +for (i =0 ; i <REGISTER_BUSY_COUNT ; i++) {rt2x00pci_register_read (rt2x00dev,RFCSR , ®);if (!rt2x00_get_field32 (reg,RFCSR_BUSY ))
drivers/net/wireless/rt2500usb.c +3 -0
@@ -178,6 +178,9 @@ static void rt2500usb_rf_write(const struct rt2x00_dev *rt2x00dev,u16 reg;unsigned int i; +if (!word) +return ; +for (i =0 ; i <REGISTER_BUSY_COUNT ; i++) {rt2500usb_register_read (rt2x00dev,PHY_CSR10 , ®);if (!rt2x00_get_field16 (reg,PHY_CSR10_RF_BUSY ))
drivers/net/wireless/rt2x00.h +2 -4
@@ -961,15 +961,13 @@ static inline struct data_ring* rt2x00_get_ring(static inline void rt2x00_rf_read (const struct rt2x00_dev *rt2x00dev,const unsigned int word,u32 *data) { -if (word) - *data = rt2x00dev->rf[word -1 ]; + *data = rt2x00dev->rf[word]; }static inline void rt2x00_rf_write (const struct rt2x00_dev *rt2x00dev,const unsigned int word,u32 data) { -if (word) - rt2x00dev->rf[word -1 ] = data; + rt2x00dev->rf[word] = data; }/*
drivers/net/wireless/rt61pci.c +3 -0
@@ -140,6 +140,9 @@ static void rt61pci_rf_write(const struct rt2x00_dev *rt2x00dev,u32 reg;unsigned int i; +if (!word) +return ; +for (i =0 ; i <REGISTER_BUSY_COUNT ; i++) {rt2x00pci_register_read (rt2x00dev,PHY_CSR4 , ®);if (!rt2x00_get_field32 (reg,PHY_CSR4_BUSY ))
drivers/net/wireless/rt73usb.c +3 -0
@@ -179,6 +179,9 @@ static void rt73usb_rf_write(const struct rt2x00_dev *rt2x00dev,u32 reg;unsigned int i; +if (!word) +return ; +for (i =0 ; i <REGISTER_BUSY_COUNT ; i++) {rt73usb_register_read (rt2x00dev,PHY_CSR4 , ®);if (!rt2x00_get_field32 (reg,PHY_CSR4_BUSY ))
Signature · 1 line
1.5.2.4