1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef RT2X00MMIO_H
14#define RT2X00MMIO_H
15
16#include <linux/io.h>
17
18
19
20
21static inline u32 rt2x00mmio_register_read(struct rt2x00_dev *rt2x00dev,
22 const unsigned int offset)
23{
24 return readl(rt2x00dev->csr.base + offset);
25}
26
27static inline void rt2x00mmio_register_multiread(struct rt2x00_dev *rt2x00dev,
28 const unsigned int offset,
29 void *value, const u32 length)
30{
31 memcpy_fromio(value, rt2x00dev->csr.base + offset, length);
32}
33
34static inline void rt2x00mmio_register_write(struct rt2x00_dev *rt2x00dev,
35 const unsigned int offset,
36 u32 value)
37{
38 writel(value, rt2x00dev->csr.base + offset);
39}
40
41static inline void rt2x00mmio_register_multiwrite(struct rt2x00_dev *rt2x00dev,
42 const unsigned int offset,
43 const void *value,
44 const u32 length)
45{
46 __iowrite32_copy(rt2x00dev->csr.base + offset, value, length >> 2);
47}
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62int rt2x00mmio_regbusy_read(struct rt2x00_dev *rt2x00dev,
63 const unsigned int offset,
64 const struct rt2x00_field32 field,
65 u32 *reg);
66
67
68
69
70
71
72
73struct queue_entry_priv_mmio {
74 __le32 *desc;
75 dma_addr_t desc_dma;
76};
77
78
79
80
81
82
83
84
85bool rt2x00mmio_rxdone(struct rt2x00_dev *rt2x00dev);
86
87
88
89
90
91
92
93
94
95void rt2x00mmio_flush_queue(struct data_queue *queue, bool drop);
96
97
98
99
100int rt2x00mmio_initialize(struct rt2x00_dev *rt2x00dev);
101void rt2x00mmio_uninitialize(struct rt2x00_dev *rt2x00dev);
102
103#endif
104