[package] mac80211: add more patches from the rt2x00 git repository
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 316-rt2x00-Remove-check-for-rf-word-0.patch
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
5
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
12 1 word too big)
13
14 Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
15 ---
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(-)
27
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
31 {
32 u32 reg;
33
34 - if (!word)
35 - return;
36 -
37 mutex_lock(&rt2x00dev->csr_mutex);
38
39 /*
40 --- a/drivers/net/wireless/rt2x00/rt2400pci.h
41 +++ b/drivers/net/wireless/rt2x00/rt2400pci.h
42 @@ -48,8 +48,8 @@
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
50
51 /*
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
56 {
57 u32 reg;
58
59 - if (!word)
60 - return;
61 -
62 mutex_lock(&rt2x00dev->csr_mutex);
63
64 /*
65 --- a/drivers/net/wireless/rt2x00/rt2500pci.h
66 +++ b/drivers/net/wireless/rt2x00/rt2500pci.h
67 @@ -59,8 +59,8 @@
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
75
76 /*
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
81 {
82 u16 reg;
83
84 - if (!word)
85 - return;
86 -
87 mutex_lock(&rt2x00dev->csr_mutex);
88
89 /*
90 --- a/drivers/net/wireless/rt2x00/rt2500usb.h
91 +++ b/drivers/net/wireless/rt2x00/rt2500usb.h
92 @@ -59,8 +59,8 @@
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
100
101 /*
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
106 {
107 u32 reg;
108
109 - if (!word)
110 - return;
111 -
112 mutex_lock(&rt2x00dev->csr_mutex);
113
114 /*
115 --- a/drivers/net/wireless/rt2x00/rt61pci.h
116 +++ b/drivers/net/wireless/rt2x00/rt61pci.h
117 @@ -50,8 +50,8 @@
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
125
126 /*
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
131 {
132 u32 reg;
133
134 - if (!word)
135 - return;
136 -
137 mutex_lock(&rt2x00dev->csr_mutex);
138
139 /*
140 --- a/drivers/net/wireless/rt2x00/rt73usb.h
141 +++ b/drivers/net/wireless/rt2x00/rt73usb.h
142 @@ -50,8 +50,8 @@
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
150
151 /*
152 * Number of TX queues.