aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00pci.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.h27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h
index 15a12487e04b..8149ff68410a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.h
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.h
@@ -1,5 +1,5 @@
1/* 1/*
2 Copyright (C) 2004 - 2009 rt2x00 SourceForge Project 2 Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
3 <http://rt2x00.serialmonkey.com> 3 <http://rt2x00.serialmonkey.com>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
@@ -27,6 +27,7 @@
27#define RT2X00PCI_H 27#define RT2X00PCI_H
28 28
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/pci.h>
30 31
31/* 32/*
32 * This variable should be used with the 33 * This variable should be used with the
@@ -35,15 +36,6 @@
35#define PCI_DEVICE_DATA(__ops) .driver_data = (kernel_ulong_t)(__ops) 36#define PCI_DEVICE_DATA(__ops) .driver_data = (kernel_ulong_t)(__ops)
36 37
37/* 38/*
38 * Register defines.
39 * Some registers require multiple attempts before success,
40 * in those cases REGISTER_BUSY_COUNT attempts should be
41 * taken with a REGISTER_BUSY_DELAY interval.
42 */
43#define REGISTER_BUSY_COUNT 5
44#define REGISTER_BUSY_DELAY 100
45
46/*
47 * Register access. 39 * Register access.
48 */ 40 */
49static inline void rt2x00pci_register_read(struct rt2x00_dev *rt2x00dev, 41static inline void rt2x00pci_register_read(struct rt2x00_dev *rt2x00dev,
@@ -53,10 +45,9 @@ static inline void rt2x00pci_register_read(struct rt2x00_dev *rt2x00dev,
53 *value = readl(rt2x00dev->csr.base + offset); 45 *value = readl(rt2x00dev->csr.base + offset);
54} 46}
55 47
56static inline void 48static inline void rt2x00pci_register_multiread(struct rt2x00_dev *rt2x00dev,
57rt2x00pci_register_multiread(struct rt2x00_dev *rt2x00dev, 49 const unsigned int offset,
58 const unsigned int offset, 50 void *value, const u32 length)
59 void *value, const u16 length)
60{ 51{
61 memcpy_fromio(value, rt2x00dev->csr.base + offset, length); 52 memcpy_fromio(value, rt2x00dev->csr.base + offset, length);
62} 53}
@@ -68,10 +59,10 @@ static inline void rt2x00pci_register_write(struct rt2x00_dev *rt2x00dev,
68 writel(value, rt2x00dev->csr.base + offset); 59 writel(value, rt2x00dev->csr.base + offset);
69} 60}
70 61
71static inline void 62static inline void rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev,
72rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev, 63 const unsigned int offset,
73 const unsigned int offset, 64 const void *value,
74 const void *value, const u16 length) 65 const u32 length)
75{ 66{
76 memcpy_toio(rt2x00dev->csr.base + offset, value, length); 67 memcpy_toio(rt2x00dev->csr.base + offset, value, length);
77} 68}