aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c25
1 files changed, 15 insertions, 10 deletions
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 },