2 Copyright (C) 2009 Bartlomiej Zolnierkiewicz
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the
16 Free Software Foundation, Inc.,
17 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 void (*register_read
)(struct rt2x00_dev
*rt2x00dev
,
25 const unsigned int offset
, u32
*value
);
26 void (*register_read_lock
)(struct rt2x00_dev
*rt2x00dev
,
27 const unsigned int offset
, u32
*value
);
28 void (*register_write
)(struct rt2x00_dev
*rt2x00dev
,
29 const unsigned int offset
, u32 value
);
30 void (*register_write_lock
)(struct rt2x00_dev
*rt2x00dev
,
31 const unsigned int offset
, u32 value
);
33 void (*register_multiread
)(struct rt2x00_dev
*rt2x00dev
,
34 const unsigned int offset
,
35 void *value
, const u32 length
);
36 void (*register_multiwrite
)(struct rt2x00_dev
*rt2x00dev
,
37 const unsigned int offset
,
38 const void *value
, const u32 length
);
40 int (*regbusy_read
)(struct rt2x00_dev
*rt2x00dev
,
41 const unsigned int offset
,
42 const struct rt2x00_field32 field
, u32
*reg
);
44 int (*drv_init_registers
)(struct rt2x00_dev
*rt2x00dev
);
47 static inline void rt2800_register_read(struct rt2x00_dev
*rt2x00dev
,
48 const unsigned int offset
,
51 const struct rt2800_ops
*rt2800ops
= rt2x00dev
->priv
;
53 rt2800ops
->register_read(rt2x00dev
, offset
, value
);
56 static inline void rt2800_register_read_lock(struct rt2x00_dev
*rt2x00dev
,
57 const unsigned int offset
,
60 const struct rt2800_ops
*rt2800ops
= rt2x00dev
->priv
;
62 rt2800ops
->register_read_lock(rt2x00dev
, offset
, value
);
65 static inline void rt2800_register_write(struct rt2x00_dev
*rt2x00dev
,
66 const unsigned int offset
,
69 const struct rt2800_ops
*rt2800ops
= rt2x00dev
->priv
;
71 rt2800ops
->register_write(rt2x00dev
, offset
, value
);
74 static inline void rt2800_register_write_lock(struct rt2x00_dev
*rt2x00dev
,
75 const unsigned int offset
,
78 const struct rt2800_ops
*rt2800ops
= rt2x00dev
->priv
;
80 rt2800ops
->register_write_lock(rt2x00dev
, offset
, value
);
83 static inline void rt2800_register_multiread(struct rt2x00_dev
*rt2x00dev
,
84 const unsigned int offset
,
85 void *value
, const u32 length
)
87 const struct rt2800_ops
*rt2800ops
= rt2x00dev
->priv
;
89 rt2800ops
->register_multiread(rt2x00dev
, offset
, value
, length
);
92 static inline void rt2800_register_multiwrite(struct rt2x00_dev
*rt2x00dev
,
93 const unsigned int offset
,
97 const struct rt2800_ops
*rt2800ops
= rt2x00dev
->priv
;
99 rt2800ops
->register_multiwrite(rt2x00dev
, offset
, value
, length
);
102 static inline int rt2800_regbusy_read(struct rt2x00_dev
*rt2x00dev
,
103 const unsigned int offset
,
104 const struct rt2x00_field32 field
,
107 const struct rt2800_ops
*rt2800ops
= rt2x00dev
->priv
;
109 return rt2800ops
->regbusy_read(rt2x00dev
, offset
, field
, reg
);
112 static inline int rt2800_drv_init_registers(struct rt2x00_dev
*rt2x00dev
)
114 const struct rt2800_ops
*rt2800ops
= rt2x00dev
->priv
;
116 return rt2800ops
->drv_init_registers(rt2x00dev
);
119 void rt2800_mcu_request(struct rt2x00_dev
*rt2x00dev
,
120 const u8 command
, const u8 token
,
121 const u8 arg0
, const u8 arg1
);
123 void rt2800_write_txwi(__le32
*txwi
, struct txentry_desc
*txdesc
);
124 void rt2800_process_rxwi(struct sk_buff
*skb
, struct rxdone_entry_desc
*txdesc
);
126 void rt2800_write_beacon(struct queue_entry
*entry
, struct txentry_desc
*txdesc
);
128 extern const struct rt2x00debug rt2800_rt2x00debug
;
130 int rt2800_rfkill_poll(struct rt2x00_dev
*rt2x00dev
);
131 int rt2800_config_shared_key(struct rt2x00_dev
*rt2x00dev
,
132 struct rt2x00lib_crypto
*crypto
,
133 struct ieee80211_key_conf
*key
);
134 int rt2800_config_pairwise_key(struct rt2x00_dev
*rt2x00dev
,
135 struct rt2x00lib_crypto
*crypto
,
136 struct ieee80211_key_conf
*key
);
137 void rt2800_config_filter(struct rt2x00_dev
*rt2x00dev
,
138 const unsigned int filter_flags
);
139 void rt2800_config_intf(struct rt2x00_dev
*rt2x00dev
, struct rt2x00_intf
*intf
,
140 struct rt2x00intf_conf
*conf
, const unsigned int flags
);
141 void rt2800_config_erp(struct rt2x00_dev
*rt2x00dev
, struct rt2x00lib_erp
*erp
);
142 void rt2800_config_ant(struct rt2x00_dev
*rt2x00dev
, struct antenna_setup
*ant
);
143 void rt2800_config(struct rt2x00_dev
*rt2x00dev
,
144 struct rt2x00lib_conf
*libconf
,
145 const unsigned int flags
);
146 void rt2800_link_stats(struct rt2x00_dev
*rt2x00dev
, struct link_qual
*qual
);
147 void rt2800_reset_tuner(struct rt2x00_dev
*rt2x00dev
, struct link_qual
*qual
);
148 void rt2800_link_tuner(struct rt2x00_dev
*rt2x00dev
, struct link_qual
*qual
,
151 int rt2800_init_registers(struct rt2x00_dev
*rt2x00dev
);
152 int rt2800_init_bbp(struct rt2x00_dev
*rt2x00dev
);
153 int rt2800_init_rfcsr(struct rt2x00_dev
*rt2x00dev
);
154 int rt2800_wait_wpdma_ready(struct rt2x00_dev
*rt2x00dev
);
156 int rt2800_efuse_detect(struct rt2x00_dev
*rt2x00dev
);
157 void rt2800_read_eeprom_efuse(struct rt2x00_dev
*rt2x00dev
);
158 int rt2800_validate_eeprom(struct rt2x00_dev
*rt2x00dev
);
159 int rt2800_init_eeprom(struct rt2x00_dev
*rt2x00dev
);
160 int rt2800_probe_hw_mode(struct rt2x00_dev
*rt2x00dev
);
162 extern const struct ieee80211_ops rt2800_mac80211_ops
;
164 #endif /* RT2800LIB_H */