1 From 14aaed532a6d18af35466d8f440e96597a8d203a Mon Sep 17 00:00:00 2001
2 From: Ivo van Doorn <IvDoorn@gmail.com>
3 Date: Sun, 8 Feb 2009 17:05:01 +0100
4 Subject: [PATCH] rt2x00: Remove check for rf word 0
6 The only way rf_write() can be called with word 0 is
7 when the user sends the wrong word index through debugfs.
8 However the values which are send through debugfs are
9 validated using the RF_BASE and RF_SIZE macro values,
10 the most logical solution is to increase RF_BASE with 4
11 and decrease RF_SIZE with 4 (RF_SIZE has always been
14 Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
16 drivers/net/wireless/rt2x00/rt2400pci.c | 3 ---
17 drivers/net/wireless/rt2x00/rt2400pci.h | 4 ++--
18 drivers/net/wireless/rt2x00/rt2500pci.c | 3 ---
19 drivers/net/wireless/rt2x00/rt2500pci.h | 4 ++--
20 drivers/net/wireless/rt2x00/rt2500usb.c | 3 ---
21 drivers/net/wireless/rt2x00/rt2500usb.h | 4 ++--
22 drivers/net/wireless/rt2x00/rt61pci.c | 3 ---
23 drivers/net/wireless/rt2x00/rt61pci.h | 4 ++--
24 drivers/net/wireless/rt2x00/rt73usb.c | 3 ---
25 drivers/net/wireless/rt2x00/rt73usb.h | 4 ++--
26 10 files changed, 10 insertions(+), 25 deletions(-)
28 --- a/drivers/net/wireless/rt2x00/rt2400pci.c
29 +++ b/drivers/net/wireless/rt2x00/rt2400pci.c
30 @@ -114,9 +114,6 @@ static void rt2400pci_rf_write(struct rt
37 mutex_lock(&rt2x00dev->csr_mutex);
40 --- a/drivers/net/wireless/rt2x00/rt2400pci.h
41 +++ b/drivers/net/wireless/rt2x00/rt2400pci.h
43 #define EEPROM_SIZE 0x0100
44 #define BBP_BASE 0x0000
45 #define BBP_SIZE 0x0020
46 -#define RF_BASE 0x0000
47 -#define RF_SIZE 0x0010
48 +#define RF_BASE 0x0004
49 +#define RF_SIZE 0x000c
52 * Number of TX queues.
53 --- a/drivers/net/wireless/rt2x00/rt2500pci.c
54 +++ b/drivers/net/wireless/rt2x00/rt2500pci.c
55 @@ -114,9 +114,6 @@ static void rt2500pci_rf_write(struct rt
62 mutex_lock(&rt2x00dev->csr_mutex);
65 --- a/drivers/net/wireless/rt2x00/rt2500pci.h
66 +++ b/drivers/net/wireless/rt2x00/rt2500pci.h
68 #define EEPROM_SIZE 0x0200
69 #define BBP_BASE 0x0000
70 #define BBP_SIZE 0x0040
71 -#define RF_BASE 0x0000
72 -#define RF_SIZE 0x0014
73 +#define RF_BASE 0x0004
74 +#define RF_SIZE 0x0010
77 * Number of TX queues.
78 --- a/drivers/net/wireless/rt2x00/rt2500usb.c
79 +++ b/drivers/net/wireless/rt2x00/rt2500usb.c
80 @@ -204,9 +204,6 @@ static void rt2500usb_rf_write(struct rt
87 mutex_lock(&rt2x00dev->csr_mutex);
90 --- a/drivers/net/wireless/rt2x00/rt2500usb.h
91 +++ b/drivers/net/wireless/rt2x00/rt2500usb.h
93 #define EEPROM_SIZE 0x006a
94 #define BBP_BASE 0x0000
95 #define BBP_SIZE 0x0060
96 -#define RF_BASE 0x0000
97 -#define RF_SIZE 0x0014
98 +#define RF_BASE 0x0004
99 +#define RF_SIZE 0x0010
102 * Number of TX queues.
103 --- a/drivers/net/wireless/rt2x00/rt61pci.c
104 +++ b/drivers/net/wireless/rt2x00/rt61pci.c
105 @@ -123,9 +123,6 @@ static void rt61pci_rf_write(struct rt2x
112 mutex_lock(&rt2x00dev->csr_mutex);
115 --- a/drivers/net/wireless/rt2x00/rt61pci.h
116 +++ b/drivers/net/wireless/rt2x00/rt61pci.h
118 #define EEPROM_SIZE 0x0100
119 #define BBP_BASE 0x0000
120 #define BBP_SIZE 0x0080
121 -#define RF_BASE 0x0000
122 -#define RF_SIZE 0x0014
123 +#define RF_BASE 0x0004
124 +#define RF_SIZE 0x0010
127 * Number of TX queues.
128 --- a/drivers/net/wireless/rt2x00/rt73usb.c
129 +++ b/drivers/net/wireless/rt2x00/rt73usb.c
130 @@ -122,9 +122,6 @@ static void rt73usb_rf_write(struct rt2x
137 mutex_lock(&rt2x00dev->csr_mutex);
140 --- a/drivers/net/wireless/rt2x00/rt73usb.h
141 +++ b/drivers/net/wireless/rt2x00/rt73usb.h
143 #define EEPROM_SIZE 0x0100
144 #define BBP_BASE 0x0000
145 #define BBP_SIZE 0x0080
146 -#define RF_BASE 0x0000
147 -#define RF_SIZE 0x0014
148 +#define RF_BASE 0x0004
149 +#define RF_SIZE 0x0010
152 * Number of TX queues.