aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c23
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c23
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c25
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00debug.c22
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00debug.h13
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.h8
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c23
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c23
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.h2
13 files changed, 86 insertions, 84 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index e1891ebe5e5c..42bd38ac7a1d 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -188,43 +188,34 @@ static void rt2400pci_eepromregister_write(struct eeprom_93cx6 *eeprom)
188} 188}
189 189
190#ifdef CONFIG_RT2X00_LIB_DEBUGFS 190#ifdef CONFIG_RT2X00_LIB_DEBUGFS
191#define CSR_OFFSET(__word) ( CSR_REG_BASE + ((__word) * sizeof(u32)) )
192
193static void rt2400pci_read_csr(struct rt2x00_dev *rt2x00dev,
194 const unsigned int word, u32 *data)
195{
196 rt2x00pci_register_read(rt2x00dev, CSR_OFFSET(word), data);
197}
198
199static void rt2400pci_write_csr(struct rt2x00_dev *rt2x00dev,
200 const unsigned int word, u32 data)
201{
202 rt2x00pci_register_write(rt2x00dev, CSR_OFFSET(word), data);
203}
204
205static const struct rt2x00debug rt2400pci_rt2x00debug = { 191static const struct rt2x00debug rt2400pci_rt2x00debug = {
206 .owner = THIS_MODULE, 192 .owner = THIS_MODULE,
207 .csr = { 193 .csr = {
208 .read = rt2400pci_read_csr, 194 .read = rt2x00pci_register_read,
209 .write = rt2400pci_write_csr, 195 .write = rt2x00pci_register_write,
196 .flags = RT2X00DEBUGFS_OFFSET,
197 .word_base = CSR_REG_BASE,
210 .word_size = sizeof(u32), 198 .word_size = sizeof(u32),
211 .word_count = CSR_REG_SIZE / sizeof(u32), 199 .word_count = CSR_REG_SIZE / sizeof(u32),
212 }, 200 },
213 .eeprom = { 201 .eeprom = {
214 .read = rt2x00_eeprom_read, 202 .read = rt2x00_eeprom_read,
215 .write = rt2x00_eeprom_write, 203 .write = rt2x00_eeprom_write,
204 .word_base = EEPROM_BASE,
216 .word_size = sizeof(u16), 205 .word_size = sizeof(u16),
217 .word_count = EEPROM_SIZE / sizeof(u16), 206 .word_count = EEPROM_SIZE / sizeof(u16),
218 }, 207 },
219 .bbp = { 208 .bbp = {
220 .read = rt2400pci_bbp_read, 209 .read = rt2400pci_bbp_read,
221 .write = rt2400pci_bbp_write, 210 .write = rt2400pci_bbp_write,
211 .word_base = BBP_BASE,
222 .word_size = sizeof(u8), 212 .word_size = sizeof(u8),
223 .word_count = BBP_SIZE / sizeof(u8), 213 .word_count = BBP_SIZE / sizeof(u8),
224 }, 214 },
225 .rf = { 215 .rf = {
226 .read = rt2x00_rf_read, 216 .read = rt2x00_rf_read,
227 .write = rt2400pci_rf_write, 217 .write = rt2400pci_rf_write,
218 .word_base = RF_BASE,
228 .word_size = sizeof(u32), 219 .word_size = sizeof(u32),
229 .word_count = RF_SIZE / sizeof(u32), 220 .word_count = RF_SIZE / sizeof(u32),
230 }, 221 },
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.h b/drivers/net/wireless/rt2x00/rt2400pci.h
index bbff381ce396..9aefda4ab3c2 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.h
+++ b/drivers/net/wireless/rt2x00/rt2400pci.h
@@ -46,7 +46,9 @@
46#define CSR_REG_SIZE 0x014c 46#define CSR_REG_SIZE 0x014c
47#define EEPROM_BASE 0x0000 47#define EEPROM_BASE 0x0000
48#define EEPROM_SIZE 0x0100 48#define EEPROM_SIZE 0x0100
49#define BBP_BASE 0x0000
49#define BBP_SIZE 0x0020 50#define BBP_SIZE 0x0020
51#define RF_BASE 0x0000
50#define RF_SIZE 0x0010 52#define RF_SIZE 0x0010
51 53
52/* 54/*
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 66a94c2f1b3c..928452f30c25 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -188,43 +188,34 @@ static void rt2500pci_eepromregister_write(struct eeprom_93cx6 *eeprom)
188} 188}
189 189
190#ifdef CONFIG_RT2X00_LIB_DEBUGFS 190#ifdef CONFIG_RT2X00_LIB_DEBUGFS
191#define CSR_OFFSET(__word) ( CSR_REG_BASE + ((__word) * sizeof(u32)) )
192
193static void rt2500pci_read_csr(struct rt2x00_dev *rt2x00dev,
194 const unsigned int word, u32 *data)
195{
196 rt2x00pci_register_read(rt2x00dev, CSR_OFFSET(word), data);
197}
198
199static void rt2500pci_write_csr(struct rt2x00_dev *rt2x00dev,
200 const unsigned int word, u32 data)
201{
202 rt2x00pci_register_write(rt2x00dev, CSR_OFFSET(word), data);
203}
204
205static const struct rt2x00debug rt2500pci_rt2x00debug = { 191static const struct rt2x00debug rt2500pci_rt2x00debug = {
206 .owner = THIS_MODULE, 192 .owner = THIS_MODULE,
207 .csr = { 193 .csr = {
208 .read = rt2500pci_read_csr, 194 .read = rt2x00pci_register_read,
209 .write = rt2500pci_write_csr, 195 .write = rt2x00pci_register_write,
196 .flags = RT2X00DEBUGFS_OFFSET,
197 .word_base = CSR_REG_BASE,
210 .word_size = sizeof(u32), 198 .word_size = sizeof(u32),
211 .word_count = CSR_REG_SIZE / sizeof(u32), 199 .word_count = CSR_REG_SIZE / sizeof(u32),
212 }, 200 },
213 .eeprom = { 201 .eeprom = {
214 .read = rt2x00_eeprom_read, 202 .read = rt2x00_eeprom_read,
215 .write = rt2x00_eeprom_write, 203 .write = rt2x00_eeprom_write,
204 .word_base = EEPROM_BASE,
216 .word_size = sizeof(u16), 205 .word_size = sizeof(u16),
217 .word_count = EEPROM_SIZE / sizeof(u16), 206 .word_count = EEPROM_SIZE / sizeof(u16),
218 }, 207 },
219 .bbp = { 208 .bbp = {
220 .read = rt2500pci_bbp_read, 209 .read = rt2500pci_bbp_read,
221 .write = rt2500pci_bbp_write, 210 .write = rt2500pci_bbp_write,
211 .word_base = BBP_BASE,
222 .word_size = sizeof(u8), 212 .word_size = sizeof(u8),
223 .word_count = BBP_SIZE / sizeof(u8), 213 .word_count = BBP_SIZE / sizeof(u8),
224 }, 214 },
225 .rf = { 215 .rf = {
226 .read = rt2x00_rf_read, 216 .read = rt2x00_rf_read,
227 .write = rt2500pci_rf_write, 217 .write = rt2500pci_rf_write,
218 .word_base = RF_BASE,
228 .word_size = sizeof(u32), 219 .word_size = sizeof(u32),
229 .word_count = RF_SIZE / sizeof(u32), 220 .word_count = RF_SIZE / sizeof(u32),
230 }, 221 },
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.h b/drivers/net/wireless/rt2x00/rt2500pci.h
index 8c26bef6cf49..e135247f7f89 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.h
+++ b/drivers/net/wireless/rt2x00/rt2500pci.h
@@ -57,7 +57,9 @@
57#define CSR_REG_SIZE 0x0174 57#define CSR_REG_SIZE 0x0174
58#define EEPROM_BASE 0x0000 58#define EEPROM_BASE 0x0000
59#define EEPROM_SIZE 0x0200 59#define EEPROM_SIZE 0x0200
60#define BBP_BASE 0x0000
60#define BBP_SIZE 0x0040 61#define BBP_SIZE 0x0040
62#define RF_BASE 0x0000
61#define RF_SIZE 0x0014 63#define RF_SIZE 0x0014
62 64
63/* 65/*
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 19970de94639..639d5a2f84e2 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -245,43 +245,48 @@ rf_write:
245} 245}
246 246
247#ifdef CONFIG_RT2X00_LIB_DEBUGFS 247#ifdef CONFIG_RT2X00_LIB_DEBUGFS
248#define CSR_OFFSET(__word) ( CSR_REG_BASE + ((__word) * sizeof(u16)) ) 248static void _rt2500usb_register_read(struct rt2x00_dev *rt2x00dev,
249 249 const unsigned int offset,
250static void rt2500usb_read_csr(struct rt2x00_dev *rt2x00dev, 250 u32 *value)
251 const unsigned int word, u32 *data)
252{ 251{
253 rt2500usb_register_read(rt2x00dev, CSR_OFFSET(word), (u16 *) data); 252 rt2500usb_register_read(rt2x00dev, offset, (u16 *)value);
254} 253}
255 254
256static void rt2500usb_write_csr(struct rt2x00_dev *rt2x00dev, 255static void _rt2500usb_register_write(struct rt2x00_dev *rt2x00dev,
257 const unsigned int word, u32 data) 256 const unsigned int offset,
257 u32 value)
258{ 258{
259 rt2500usb_register_write(rt2x00dev, CSR_OFFSET(word), data); 259 rt2500usb_register_write(rt2x00dev, offset, value);
260} 260}
261 261
262static const struct rt2x00debug rt2500usb_rt2x00debug = { 262static const struct rt2x00debug rt2500usb_rt2x00debug = {
263 .owner = THIS_MODULE, 263 .owner = THIS_MODULE,
264 .csr = { 264 .csr = {
265 .read = rt2500usb_read_csr, 265 .read = _rt2500usb_register_read,
266 .write = rt2500usb_write_csr, 266 .write = _rt2500usb_register_write,
267 .flags = RT2X00DEBUGFS_OFFSET,
268 .word_base = CSR_REG_BASE,
267 .word_size = sizeof(u16), 269 .word_size = sizeof(u16),
268 .word_count = CSR_REG_SIZE / sizeof(u16), 270 .word_count = CSR_REG_SIZE / sizeof(u16),
269 }, 271 },
270 .eeprom = { 272 .eeprom = {
271 .read = rt2x00_eeprom_read, 273 .read = rt2x00_eeprom_read,
272 .write = rt2x00_eeprom_write, 274 .write = rt2x00_eeprom_write,
275 .word_base = EEPROM_BASE,
273 .word_size = sizeof(u16), 276 .word_size = sizeof(u16),
274 .word_count = EEPROM_SIZE / sizeof(u16), 277 .word_count = EEPROM_SIZE / sizeof(u16),
275 }, 278 },
276 .bbp = { 279 .bbp = {
277 .read = rt2500usb_bbp_read, 280 .read = rt2500usb_bbp_read,
278 .write = rt2500usb_bbp_write, 281 .write = rt2500usb_bbp_write,
282 .word_base = BBP_BASE,
279 .word_size = sizeof(u8), 283 .word_size = sizeof(u8),
280 .word_count = BBP_SIZE / sizeof(u8), 284 .word_count = BBP_SIZE / sizeof(u8),
281 }, 285 },
282 .rf = { 286 .rf = {
283 .read = rt2x00_rf_read, 287 .read = rt2x00_rf_read,
284 .write = rt2500usb_rf_write, 288 .write = rt2500usb_rf_write,
289 .word_base = RF_BASE,
285 .word_size = sizeof(u32), 290 .word_size = sizeof(u32),
286 .word_count = RF_SIZE / sizeof(u32), 291 .word_count = RF_SIZE / sizeof(u32),
287 }, 292 },
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.h b/drivers/net/wireless/rt2x00/rt2500usb.h
index 89e5ed24e4f7..dbb5d689e23d 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.h
+++ b/drivers/net/wireless/rt2x00/rt2500usb.h
@@ -57,7 +57,9 @@
57#define CSR_REG_SIZE 0x0100 57#define CSR_REG_SIZE 0x0100
58#define EEPROM_BASE 0x0000 58#define EEPROM_BASE 0x0000
59#define EEPROM_SIZE 0x006a 59#define EEPROM_SIZE 0x006a
60#define BBP_BASE 0x0000
60#define BBP_SIZE 0x0060 61#define BBP_SIZE 0x0060
62#define RF_BASE 0x0000
61#define RF_SIZE 0x0014 63#define RF_SIZE 0x0014
62 64
63/* 65/*
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index a31418a700c1..54dd10060bf1 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -424,16 +424,21 @@ static ssize_t rt2x00debug_read_##__name(struct file *file, \
424 const struct rt2x00debug *debug = intf->debug; \ 424 const struct rt2x00debug *debug = intf->debug; \
425 char line[16]; \ 425 char line[16]; \
426 size_t size; \ 426 size_t size; \
427 unsigned int index = intf->offset_##__name; \
427 __type value; \ 428 __type value; \
428 \ 429 \
429 if (*offset) \ 430 if (*offset) \
430 return 0; \ 431 return 0; \
431 \ 432 \
432 if (intf->offset_##__name >= debug->__name.word_count) \ 433 if (index >= debug->__name.word_count) \
433 return -EINVAL; \ 434 return -EINVAL; \
434 \ 435 \
435 debug->__name.read(intf->rt2x00dev, \ 436 if (debug->__name.flags & RT2X00DEBUGFS_OFFSET) \
436 intf->offset_##__name, &value); \ 437 index *= debug->__name.word_size; \
438 \
439 index += debug->__name.word_base; \
440 \
441 debug->__name.read(intf->rt2x00dev, index, &value); \
437 \ 442 \
438 size = sprintf(line, __format, value); \ 443 size = sprintf(line, __format, value); \
439 \ 444 \
@@ -454,12 +459,13 @@ static ssize_t rt2x00debug_write_##__name(struct file *file, \
454 const struct rt2x00debug *debug = intf->debug; \ 459 const struct rt2x00debug *debug = intf->debug; \
455 char line[16]; \ 460 char line[16]; \
456 size_t size; \ 461 size_t size; \
462 unsigned int index = intf->offset_##__name; \
457 __type value; \ 463 __type value; \
458 \ 464 \
459 if (*offset) \ 465 if (*offset) \
460 return 0; \ 466 return 0; \
461 \ 467 \
462 if (intf->offset_##__name >= debug->__name.word_count) \ 468 if (index >= debug->__name.word_count) \
463 return -EINVAL; \ 469 return -EINVAL; \
464 \ 470 \
465 if (copy_from_user(line, buf, length)) \ 471 if (copy_from_user(line, buf, length)) \
@@ -468,8 +474,12 @@ static ssize_t rt2x00debug_write_##__name(struct file *file, \
468 size = strlen(line); \ 474 size = strlen(line); \
469 value = simple_strtoul(line, NULL, 0); \ 475 value = simple_strtoul(line, NULL, 0); \
470 \ 476 \
471 debug->__name.write(intf->rt2x00dev, \ 477 if (debug->__name.flags & RT2X00DEBUGFS_OFFSET) \
472 intf->offset_##__name, value); \ 478 index *= debug->__name.word_size; \
479 \
480 index += debug->__name.word_base; \
481 \
482 debug->__name.write(intf->rt2x00dev, index, value); \
473 \ 483 \
474 *offset += size; \ 484 *offset += size; \
475 return size; \ 485 return size; \
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.h b/drivers/net/wireless/rt2x00/rt2x00debug.h
index c4ce895aa1c7..a92104dfee9a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.h
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.h
@@ -28,6 +28,16 @@
28 28
29struct rt2x00_dev; 29struct rt2x00_dev;
30 30
31/**
32 * enum rt2x00debugfs_entry_flags: Flags for debugfs registry entry
33 *
34 * @RT2X00DEBUGFS_OFFSET: rt2x00lib should pass the register offset
35 * as argument when using the callback function read()/write()
36 */
37enum rt2x00debugfs_entry_flags {
38 RT2X00DEBUGFS_OFFSET = (1 << 0),
39};
40
31#define RT2X00DEBUGFS_REGISTER_ENTRY(__name, __type) \ 41#define RT2X00DEBUGFS_REGISTER_ENTRY(__name, __type) \
32struct reg##__name { \ 42struct reg##__name { \
33 void (*read)(struct rt2x00_dev *rt2x00dev, \ 43 void (*read)(struct rt2x00_dev *rt2x00dev, \
@@ -35,6 +45,9 @@ struct reg##__name { \
35 void (*write)(struct rt2x00_dev *rt2x00dev, \ 45 void (*write)(struct rt2x00_dev *rt2x00dev, \
36 const unsigned int word, __type data); \ 46 const unsigned int word, __type data); \
37 \ 47 \
48 unsigned int flags; \
49 \
50 unsigned int word_base; \
38 unsigned int word_size; \ 51 unsigned int word_size; \
39 unsigned int word_count; \ 52 unsigned int word_count; \
40} __name 53} __name
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h
index 80bf97c03e2d..a83f45f784f2 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.h
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.h
@@ -58,7 +58,7 @@
58 * Register access. 58 * Register access.
59 */ 59 */
60static inline void rt2x00pci_register_read(struct rt2x00_dev *rt2x00dev, 60static inline void rt2x00pci_register_read(struct rt2x00_dev *rt2x00dev,
61 const unsigned long offset, 61 const unsigned int offset,
62 u32 *value) 62 u32 *value)
63{ 63{
64 *value = readl(rt2x00dev->csr.base + offset); 64 *value = readl(rt2x00dev->csr.base + offset);
@@ -66,14 +66,14 @@ static inline void rt2x00pci_register_read(struct rt2x00_dev *rt2x00dev,
66 66
67static inline void 67static inline void
68rt2x00pci_register_multiread(struct rt2x00_dev *rt2x00dev, 68rt2x00pci_register_multiread(struct rt2x00_dev *rt2x00dev,
69 const unsigned long offset, 69 const unsigned int offset,
70 void *value, const u16 length) 70 void *value, const u16 length)
71{ 71{
72 memcpy_fromio(value, rt2x00dev->csr.base + offset, length); 72 memcpy_fromio(value, rt2x00dev->csr.base + offset, length);
73} 73}
74 74
75static inline void rt2x00pci_register_write(struct rt2x00_dev *rt2x00dev, 75static inline void rt2x00pci_register_write(struct rt2x00_dev *rt2x00dev,
76 const unsigned long offset, 76 const unsigned int offset,
77 u32 value) 77 u32 value)
78{ 78{
79 writel(value, rt2x00dev->csr.base + offset); 79 writel(value, rt2x00dev->csr.base + offset);
@@ -81,7 +81,7 @@ static inline void rt2x00pci_register_write(struct rt2x00_dev *rt2x00dev,
81 81
82static inline void 82static inline void
83rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev, 83rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev,
84 const unsigned long offset, 84 const unsigned int offset,
85 const void *value, const u16 length) 85 const void *value, const u16 length)
86{ 86{
87 memcpy_toio(rt2x00dev->csr.base + offset, value, length); 87 memcpy_toio(rt2x00dev->csr.base + offset, value, length);
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index bd4a6e1ec9dd..3f272793412a 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -228,43 +228,34 @@ static void rt61pci_eepromregister_write(struct eeprom_93cx6 *eeprom)
228} 228}
229 229
230#ifdef CONFIG_RT2X00_LIB_DEBUGFS 230#ifdef CONFIG_RT2X00_LIB_DEBUGFS
231#define CSR_OFFSET(__word) ( CSR_REG_BASE + ((__word) * sizeof(u32)) )
232
233static void rt61pci_read_csr(struct rt2x00_dev *rt2x00dev,
234 const unsigned int word, u32 *data)
235{
236 rt2x00pci_register_read(rt2x00dev, CSR_OFFSET(word), data);
237}
238
239static void rt61pci_write_csr(struct rt2x00_dev *rt2x00dev,
240 const unsigned int word, u32 data)
241{
242 rt2x00pci_register_write(rt2x00dev, CSR_OFFSET(word), data);
243}
244
245static const struct rt2x00debug rt61pci_rt2x00debug = { 231static const struct rt2x00debug rt61pci_rt2x00debug = {
246 .owner = THIS_MODULE, 232 .owner = THIS_MODULE,
247 .csr = { 233 .csr = {
248 .read = rt61pci_read_csr, 234 .read = rt2x00pci_register_read,
249 .write = rt61pci_write_csr, 235 .write = rt2x00pci_register_write,
236 .flags = RT2X00DEBUGFS_OFFSET,
237 .word_base = CSR_REG_BASE,
250 .word_size = sizeof(u32), 238 .word_size = sizeof(u32),
251 .word_count = CSR_REG_SIZE / sizeof(u32), 239 .word_count = CSR_REG_SIZE / sizeof(u32),
252 }, 240 },
253 .eeprom = { 241 .eeprom = {
254 .read = rt2x00_eeprom_read, 242 .read = rt2x00_eeprom_read,
255 .write = rt2x00_eeprom_write, 243 .write = rt2x00_eeprom_write,
244 .word_base = EEPROM_BASE,
256 .word_size = sizeof(u16), 245 .word_size = sizeof(u16),
257 .word_count = EEPROM_SIZE / sizeof(u16), 246 .word_count = EEPROM_SIZE / sizeof(u16),
258 }, 247 },
259 .bbp = { 248 .bbp = {
260 .read = rt61pci_bbp_read, 249 .read = rt61pci_bbp_read,
261 .write = rt61pci_bbp_write, 250 .write = rt61pci_bbp_write,
251 .word_base = BBP_BASE,
262 .word_size = sizeof(u8), 252 .word_size = sizeof(u8),
263 .word_count = BBP_SIZE / sizeof(u8), 253 .word_count = BBP_SIZE / sizeof(u8),
264 }, 254 },
265 .rf = { 255 .rf = {
266 .read = rt2x00_rf_read, 256 .read = rt2x00_rf_read,
267 .write = rt61pci_rf_write, 257 .write = rt61pci_rf_write,
258 .word_base = RF_BASE,
268 .word_size = sizeof(u32), 259 .word_size = sizeof(u32),
269 .word_count = RF_SIZE / sizeof(u32), 260 .word_count = RF_SIZE / sizeof(u32),
270 }, 261 },
diff --git a/drivers/net/wireless/rt2x00/rt61pci.h b/drivers/net/wireless/rt2x00/rt61pci.h
index 8ec1451308cc..65fe3332364a 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.h
+++ b/drivers/net/wireless/rt2x00/rt61pci.h
@@ -48,7 +48,9 @@
48#define CSR_REG_SIZE 0x04b0 48#define CSR_REG_SIZE 0x04b0
49#define EEPROM_BASE 0x0000 49#define EEPROM_BASE 0x0000
50#define EEPROM_SIZE 0x0100 50#define EEPROM_SIZE 0x0100
51#define BBP_BASE 0x0000
51#define BBP_SIZE 0x0080 52#define BBP_SIZE 0x0080
53#define RF_BASE 0x0000
52#define RF_SIZE 0x0014 54#define RF_SIZE 0x0014
53 55
54/* 56/*
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 5be49ed4ecf9..767e3c98184c 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -249,43 +249,34 @@ rf_write:
249} 249}
250 250
251#ifdef CONFIG_RT2X00_LIB_DEBUGFS 251#ifdef CONFIG_RT2X00_LIB_DEBUGFS
252#define CSR_OFFSET(__word) ( CSR_REG_BASE + ((__word) * sizeof(u32)) )
253
254static void rt73usb_read_csr(struct rt2x00_dev *rt2x00dev,
255 const unsigned int word, u32 *data)
256{
257 rt73usb_register_read(rt2x00dev, CSR_OFFSET(word), data);
258}
259
260static void rt73usb_write_csr(struct rt2x00_dev *rt2x00dev,
261 const unsigned int word, u32 data)
262{
263 rt73usb_register_write(rt2x00dev, CSR_OFFSET(word), data);
264}
265
266static const struct rt2x00debug rt73usb_rt2x00debug = { 252static const struct rt2x00debug rt73usb_rt2x00debug = {
267 .owner = THIS_MODULE, 253 .owner = THIS_MODULE,
268 .csr = { 254 .csr = {
269 .read = rt73usb_read_csr, 255 .read = rt73usb_register_read,
270 .write = rt73usb_write_csr, 256 .write = rt73usb_register_write,
257 .flags = RT2X00DEBUGFS_OFFSET,
258 .word_base = CSR_REG_BASE,
271 .word_size = sizeof(u32), 259 .word_size = sizeof(u32),
272 .word_count = CSR_REG_SIZE / sizeof(u32), 260 .word_count = CSR_REG_SIZE / sizeof(u32),
273 }, 261 },
274 .eeprom = { 262 .eeprom = {
275 .read = rt2x00_eeprom_read, 263 .read = rt2x00_eeprom_read,
276 .write = rt2x00_eeprom_write, 264 .write = rt2x00_eeprom_write,
265 .word_base = EEPROM_BASE,
277 .word_size = sizeof(u16), 266 .word_size = sizeof(u16),
278 .word_count = EEPROM_SIZE / sizeof(u16), 267 .word_count = EEPROM_SIZE / sizeof(u16),
279 }, 268 },
280 .bbp = { 269 .bbp = {
281 .read = rt73usb_bbp_read, 270 .read = rt73usb_bbp_read,
282 .write = rt73usb_bbp_write, 271 .write = rt73usb_bbp_write,
272 .word_base = BBP_BASE,
283 .word_size = sizeof(u8), 273 .word_size = sizeof(u8),
284 .word_count = BBP_SIZE / sizeof(u8), 274 .word_count = BBP_SIZE / sizeof(u8),
285 }, 275 },
286 .rf = { 276 .rf = {
287 .read = rt2x00_rf_read, 277 .read = rt2x00_rf_read,
288 .write = rt73usb_rf_write, 278 .write = rt73usb_rf_write,
279 .word_base = RF_BASE,
289 .word_size = sizeof(u32), 280 .word_size = sizeof(u32),
290 .word_count = RF_SIZE / sizeof(u32), 281 .word_count = RF_SIZE / sizeof(u32),
291 }, 282 },
diff --git a/drivers/net/wireless/rt2x00/rt73usb.h b/drivers/net/wireless/rt2x00/rt73usb.h
index 868386c457f6..46e1405eb0e2 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.h
+++ b/drivers/net/wireless/rt2x00/rt73usb.h
@@ -48,7 +48,9 @@
48#define CSR_REG_SIZE 0x04b0 48#define CSR_REG_SIZE 0x04b0
49#define EEPROM_BASE 0x0000 49#define EEPROM_BASE 0x0000
50#define EEPROM_SIZE 0x0100 50#define EEPROM_SIZE 0x0100
51#define BBP_BASE 0x0000
51#define BBP_SIZE 0x0080 52#define BBP_SIZE 0x0080
53#define RF_BASE 0x0000
52#define RF_SIZE 0x0014 54#define RF_SIZE 0x0014
53 55
54/* 56/*