rt2x00: Remove check for rf word 0
authorIvo van Doorn <ivdoorn@gmail.com>
Sun, 15 Feb 2009 16:42:48 +0000 (17:42 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 27 Feb 2009 19:52:35 +0000 (14:52 -0500)
The only way rf_write() can be called with word 0 is
when the user sends the wrong word index through debugfs.
However the values which are send through debugfs are
validated using the RF_BASE and RF_SIZE macro values,
the most logical solution is to increase RF_BASE with 4
and decrease RF_SIZE with 4 (RF_SIZE has always been
1 word too big)

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2400pci.h
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500pci.h
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2500usb.h
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt61pci.h
drivers/net/wireless/rt2x00/rt73usb.c
drivers/net/wireless/rt2x00/rt73usb.h

index b0848259b45553ab7d8aa132f6e51ef874b7858b..0f08773328c6b8f182936fbb9dc2e95f58401226 100644 (file)
@@ -114,9 +114,6 @@ static void rt2400pci_rf_write(struct rt2x00_dev *rt2x00dev,
 {
        u32 reg;
 
-       if (!word)
-               return;
-
        mutex_lock(&rt2x00dev->csr_mutex);
 
        /*
index 72ac31c3cb759db0672024cdbfec2248ceaa9db4..ec3b004ddc3c8a05637a2d65c77c32831f5612f1 100644 (file)
@@ -48,8 +48,8 @@
 #define EEPROM_SIZE                    0x0100
 #define BBP_BASE                       0x0000
 #define BBP_SIZE                       0x0020
-#define RF_BASE                                0x0000
-#define RF_SIZE                                0x0010
+#define RF_BASE                                0x0004
+#define RF_SIZE                                0x000c
 
 /*
  * Number of TX queues.
index eb82860c54f9e49a068c58af7c3cd22394c138d6..276a8232aaa084583a5b4b97897c4a8207b25f7b 100644 (file)
@@ -114,9 +114,6 @@ static void rt2500pci_rf_write(struct rt2x00_dev *rt2x00dev,
 {
        u32 reg;
 
-       if (!word)
-               return;
-
        mutex_lock(&rt2x00dev->csr_mutex);
 
        /*
index 17a0c9c8c18468e7592ed341ef9296e46db7711b..ce2f065c74868927a4935d9249683e5c5fd3ff1b 100644 (file)
@@ -59,8 +59,8 @@
 #define EEPROM_SIZE                    0x0200
 #define BBP_BASE                       0x0000
 #define BBP_SIZE                       0x0040
-#define RF_BASE                                0x0000
-#define RF_SIZE                                0x0014
+#define RF_BASE                                0x0004
+#define RF_SIZE                                0x0010
 
 /*
  * Number of TX queues.
index 270691ac23618295eca217ff1561b78b5e89bc5d..ca280674180e0632a279188c9973bf01f31e2777 100644 (file)
@@ -204,9 +204,6 @@ static void rt2500usb_rf_write(struct rt2x00_dev *rt2x00dev,
 {
        u16 reg;
 
-       if (!word)
-               return;
-
        mutex_lock(&rt2x00dev->csr_mutex);
 
        /*
index afce0e0322c3e5a74438c742ee319b683bccb7d5..5bc46fe72179302d38cb79cd767674aff0924037 100644 (file)
@@ -59,8 +59,8 @@
 #define EEPROM_SIZE                    0x006a
 #define BBP_BASE                       0x0000
 #define BBP_SIZE                       0x0060
-#define RF_BASE                                0x0000
-#define RF_SIZE                                0x0014
+#define RF_BASE                                0x0004
+#define RF_SIZE                                0x0010
 
 /*
  * Number of TX queues.
index 0be147f364e718271539b4f17adf03291a25d37a..2ca8b7a9722c96f8dfd6b7ad0689d1738d143145 100644 (file)
@@ -123,9 +123,6 @@ static void rt61pci_rf_write(struct rt2x00_dev *rt2x00dev,
 {
        u32 reg;
 
-       if (!word)
-               return;
-
        mutex_lock(&rt2x00dev->csr_mutex);
 
        /*
index 2f97fee7a8de84b4cbae8231452ac7220a8a5f44..41e8959919f6dd897dc49133ab51027e9f0192f6 100644 (file)
@@ -50,8 +50,8 @@
 #define EEPROM_SIZE                    0x0100
 #define BBP_BASE                       0x0000
 #define BBP_SIZE                       0x0080
-#define RF_BASE                                0x0000
-#define RF_SIZE                                0x0014
+#define RF_BASE                                0x0004
+#define RF_SIZE                                0x0010
 
 /*
  * Number of TX queues.
index 8f522342b16d314b589715475306800cea3240fa..846996c6330313af3af67860e8d215d4fd857bae 100644 (file)
@@ -122,9 +122,6 @@ static void rt73usb_rf_write(struct rt2x00_dev *rt2x00dev,
 {
        u32 reg;
 
-       if (!word)
-               return;
-
        mutex_lock(&rt2x00dev->csr_mutex);
 
        /*
index 834b28ce6cde569b8c93f7140b2a27e9ef7127d5..c8016f65b4bd2c6d52e5a740b2bdc7a039a4c846 100644 (file)
@@ -50,8 +50,8 @@
 #define EEPROM_SIZE                    0x0100
 #define BBP_BASE                       0x0000
 #define BBP_SIZE                       0x0080
-#define RF_BASE                                0x0000
-#define RF_SIZE                                0x0014
+#define RF_BASE                                0x0004
+#define RF_SIZE                                0x0010
 
 /*
  * Number of TX queues.