aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt61pci.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-10-29 14:41:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-11-10 15:17:35 -0500
commit743b97caf98036ec8ee4bfc6fc6f85ad94e04783 (patch)
treef972a7da6d83c163c37fb006089956b3319bf1dd /drivers/net/wireless/rt2x00/rt61pci.c
parentf161796700ed89b07dff2ad4ba3a932bc721af7e (diff)
rt2x00: Remove debugfs CSR access wrappers
Move calculation of CSR register offset into rt2x00debug.c and remove the wrapper functions from each individual driver. (Except rt2500usb, which still needs to wrap for the different value type argument). Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt61pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c23
1 files changed, 7 insertions, 16 deletions
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 },