2 Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
3 <http://rt2x00.serialmonkey.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the
17 Free Software Foundation, Inc.,
18 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 Abstract: rt2x00 global information.
29 #include <linux/bitops.h>
30 #include <linux/prefetch.h>
31 #include <linux/skbuff.h>
32 #include <linux/workqueue.h>
33 #include <linux/firmware.h>
34 #include <linux/mutex.h>
35 #include <linux/etherdevice.h>
37 #include <net/mac80211.h>
39 #include "rt2x00debug.h"
40 #include "rt2x00reg.h"
41 #include "rt2x00ring.h"
46 #define DRV_VERSION "2.0.14"
47 #define DRV_PROJECT "http://rt2x00.serialmonkey.com"
51 * Debug output has to be enabled during compile time.
53 #define DEBUG_PRINTK_MSG(__dev, __kernlvl, __lvl, __msg, __args...) \
54 printk(__kernlvl "%s -> %s: %s - " __msg, \
55 wiphy_name((__dev)->hw->wiphy), __FUNCTION__, __lvl, ##__args)
57 #define DEBUG_PRINTK_PROBE(__kernlvl, __lvl, __msg, __args...) \
58 printk(__kernlvl "%s -> %s: %s - " __msg, \
59 KBUILD_MODNAME, __FUNCTION__, __lvl, ##__args)
61 #ifdef CONFIG_RT2X00_DEBUG
62 #define DEBUG_PRINTK(__dev, __kernlvl, __lvl, __msg, __args...) \
63 DEBUG_PRINTK_MSG(__dev, __kernlvl, __lvl, __msg, ##__args);
65 #define DEBUG_PRINTK(__dev, __kernlvl, __lvl, __msg, __args...) \
67 #endif /* CONFIG_RT2X00_DEBUG */
70 * Various debug levels.
71 * The debug levels PANIC and ERROR both indicate serious problems,
72 * for this reason they should never be ignored.
73 * The special ERROR_PROBE message is for messages that are generated
74 * when the rt2x00_dev is not yet initialized.
76 #define PANIC(__dev, __msg, __args...) \
77 DEBUG_PRINTK_MSG(__dev, KERN_CRIT, "Panic", __msg, ##__args)
78 #define ERROR(__dev, __msg, __args...) \
79 DEBUG_PRINTK_MSG(__dev, KERN_ERR, "Error", __msg, ##__args)
80 #define ERROR_PROBE(__msg, __args...) \
81 DEBUG_PRINTK_PROBE(KERN_ERR, "Error", __msg, ##__args)
82 #define WARNING(__dev, __msg, __args...) \
83 DEBUG_PRINTK(__dev, KERN_WARNING, "Warning", __msg, ##__args)
84 #define NOTICE(__dev, __msg, __args...) \
85 DEBUG_PRINTK(__dev, KERN_NOTICE, "Notice", __msg, ##__args)
86 #define INFO(__dev, __msg, __args...) \
87 DEBUG_PRINTK(__dev, KERN_INFO, "Info", __msg, ##__args)
88 #define DEBUG(__dev, __msg, __args...) \
89 DEBUG_PRINTK(__dev, KERN_DEBUG, "Debug", __msg, ##__args)
90 #define EEPROM(__dev, __msg, __args...) \
91 DEBUG_PRINTK(__dev, KERN_DEBUG, "EEPROM recovery", __msg, ##__args)
95 * Ralink PCI devices demand the Frame size to be a multiple of 128 bytes.
96 * DATA_FRAME_SIZE is used for TX, RX, ATIM and PRIO rings.
97 * MGMT_FRAME_SIZE is used for the BEACON ring.
99 #define DATA_FRAME_SIZE 2432
100 #define MGMT_FRAME_SIZE 256
103 * Number of entries in a packet ring.
104 * PCI devices only need 1 Beacon entry,
105 * but USB devices require a second because they
106 * have to send a Guardian byte first.
108 #define RX_ENTRIES 12
109 #define TX_ENTRIES 12
110 #define ATIM_ENTRIES 1
111 #define BEACON_ENTRIES 2
114 * Standard timing and size defines.
115 * These values should follow the ieee80211 specifications.
118 #define IEEE80211_HEADER 24
122 #define SHORT_PREAMBLE 72
124 #define SHORT_SLOT_TIME 9
126 #define PIFS ( SIFS + SLOT_TIME )
127 #define SHORT_PIFS ( SIFS + SHORT_SLOT_TIME )
128 #define DIFS ( PIFS + SLOT_TIME )
129 #define SHORT_DIFS ( SHORT_PIFS + SHORT_SLOT_TIME )
130 #define EIFS ( SIFS + (8 * (IEEE80211_HEADER + ACK_SIZE)) )
133 * IEEE802.11 header defines
135 static inline int is_rts_frame(u16 fc)
137 return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) &&
138 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_RTS));
141 static inline int is_cts_frame(u16 fc)
143 return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) &&
144 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_CTS));
147 static inline int is_probe_resp(u16 fc)
149 return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
150 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP));
153 static inline int is_beacon(u16 fc)
155 return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
156 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON));
160 * Chipset identification
161 * The chipset on the device is composed of a RT and RF chip.
162 * The chipset combination is important for determining device capabilities.
166 #define RT2460 0x0101
167 #define RT2560 0x0201
168 #define RT2570 0x1201
169 #define RT2561s 0x0301 /* Turbo */
170 #define RT2561 0x0302
171 #define RT2661 0x0401
172 #define RT2571 0x1300
179 * RF register values that belong to a particular channel.
190 * Antenna setup values.
192 struct antenna_setup {
198 * Quality statistics about the currently active link.
202 * Statistics required for Link tuning.
203 * For the average RSSI value we use the "Walking average" approach.
204 * When adding RSSI to the average value the following calculation
207 * avg_rssi = ((avg_rssi * 7) + rssi) / 8;
209 * The advantage of this approach is that we only need 1 variable
210 * to store the average in (No need for a count and a total).
211 * But more importantly, normal average values will over time
212 * move less and less towards newly added values this results
213 * that with link tuning, the device can have a very good RSSI
214 * for a few minutes but when the device is moved away from the AP
215 * the average will not decrease fast enough to compensate.
216 * The walking average compensates this and will move towards
217 * the new values correctly allowing a effective link tuning.
223 * Statistics required for Signal quality calculation.
224 * For calculating the Signal quality we have to determine
225 * the total number of success and failed RX and TX frames.
226 * After that we also use the average RSSI value to help
227 * determining the signal quality.
228 * For the calculation we will use the following algorithm:
230 * rssi_percentage = (avg_rssi * 100) / rssi_offset
231 * rx_percentage = (rx_success * 100) / rx_total
232 * tx_percentage = (tx_success * 100) / tx_total
233 * avg_signal = ((WEIGHT_RSSI * avg_rssi) +
234 * (WEIGHT_TX * tx_percentage) +
235 * (WEIGHT_RX * rx_percentage)) / 100
237 * This value should then be checked to not be greated then 100.
245 #define WEIGHT_RSSI 20
251 * Antenna settings about the currently active link.
258 #define ANTENNA_RX_DIVERSITY 0x00000001
259 #define ANTENNA_TX_DIVERSITY 0x00000002
260 #define ANTENNA_MODE_SAMPLE 0x00000004
263 * Currently active TX/RX antenna setup.
264 * When software diversity is used, this will indicate
265 * which antenna is actually used at this time.
267 struct antenna_setup active;
270 * RSSI information for the different antenna's.
271 * These statistics are used to determine when
272 * to switch antenna when using software diversity.
274 * rssi[0] -> Antenna A RSSI
275 * rssi[1] -> Antenna B RSSI
280 * Current RSSI average of the currently active antenna.
281 * Similar to the avg_rssi in the link_qual structure
282 * this value is updated by using the walking average.
288 * To optimize the quality of the link we need to store
289 * the quality of received frames and periodically
295 * The number of times the link has been tuned
296 * since the radio has been switched on.
301 * Quality measurement values.
303 struct link_qual qual;
306 * TX/RX antenna setup.
316 * Work structure for scheduling periodic link tuning.
318 struct delayed_work work;
322 * Small helper macro to work with moving/walking averages.
324 #define MOVING_AVERAGE(__avg, __val, __samples) \
325 ( (((__avg) * ((__samples) - 1)) + (__val)) / (__samples) )
328 * When we lack RSSI information return something less then -80 to
329 * tell the driver to tune the device to maximum sensitivity.
331 #define DEFAULT_RSSI ( -128 )
334 * Link quality access functions.
336 static inline int rt2x00_get_link_rssi(struct link *link)
338 if (link->qual.avg_rssi && link->qual.rx_success)
339 return link->qual.avg_rssi;
343 static inline int rt2x00_get_link_ant_rssi(struct link *link)
345 if (link->ant.rssi_ant && link->qual.rx_success)
346 return link->ant.rssi_ant;
350 static inline int rt2x00_get_link_ant_rssi_history(struct link *link,
353 if (link->ant.rssi_history[ant - ANTENNA_A])
354 return link->ant.rssi_history[ant - ANTENNA_A];
358 static inline int rt2x00_update_ant_rssi(struct link *link, int rssi)
360 int old_rssi = link->ant.rssi_history[link->ant.active.rx - ANTENNA_A];
361 link->ant.rssi_history[link->ant.active.rx - ANTENNA_A] = rssi;
366 * Interface structure
367 * Configuration details about the current interface.
371 * Interface identification. The value is assigned
372 * to us by the 80211 stack, and is used to request
375 struct ieee80211_vif *id;
378 * Current working type (IEEE80211_IF_TYPE_*).
388 * BBSID of the AP to associate with.
393 static inline int is_interface_present(struct interface *intf)
398 static inline int is_interface_type(struct interface *intf, int type)
400 return intf->type == type;
404 * Details about the supported modes, rates and channels
405 * of a particular chipset. This is used by rt2x00lib
406 * to build the ieee80211_hw_mode array for mac80211.
408 struct hw_mode_spec {
410 * Number of modes, rates and channels.
419 const u8 *tx_power_a;
420 const u8 *tx_power_bg;
424 * Device/chipset specific value.
426 const struct rf_channel *channels;
430 * Configuration structure wrapper around the
431 * mac80211 configuration structure.
432 * When mac80211 configures the driver, rt2x00lib
433 * can precalculate values which are equal for all
434 * rt2x00 drivers. Those values can be stored in here.
436 struct rt2x00lib_conf {
437 struct ieee80211_conf *conf;
438 struct rf_channel rf;
440 struct antenna_setup ant;
454 * rt2x00lib callback functions.
456 struct rt2x00lib_ops {
458 * Interrupt handlers.
460 irq_handler_t irq_handler;
463 * Device init handlers.
465 int (*probe_hw) (struct rt2x00_dev *rt2x00dev);
466 char *(*get_firmware_name) (struct rt2x00_dev *rt2x00dev);
467 int (*load_firmware) (struct rt2x00_dev *rt2x00dev, void *data,
471 * Device initialization/deinitialization handlers.
473 int (*initialize) (struct rt2x00_dev *rt2x00dev);
474 void (*uninitialize) (struct rt2x00_dev *rt2x00dev);
477 * Ring initialization handlers
479 void (*init_rxentry) (struct rt2x00_dev *rt2x00dev,
480 struct data_entry *entry);
481 void (*init_txentry) (struct rt2x00_dev *rt2x00dev,
482 struct data_entry *entry);
485 * Radio control handlers.
487 int (*set_device_state) (struct rt2x00_dev *rt2x00dev,
488 enum dev_state state);
489 int (*rfkill_poll) (struct rt2x00_dev *rt2x00dev);
490 void (*link_stats) (struct rt2x00_dev *rt2x00dev,
491 struct link_qual *qual);
492 void (*reset_tuner) (struct rt2x00_dev *rt2x00dev);
493 void (*link_tuner) (struct rt2x00_dev *rt2x00dev);
496 * TX control handlers
498 void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev,
500 struct txdata_entry_desc *desc,
501 struct ieee80211_tx_control *control);
502 int (*write_tx_data) (struct rt2x00_dev *rt2x00dev,
503 struct data_ring *ring, struct sk_buff *skb,
504 struct ieee80211_tx_control *control);
505 int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev,
506 struct sk_buff *skb);
507 void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev,
511 * RX control handlers
513 void (*fill_rxdone) (struct data_entry *entry,
514 struct rxdata_entry_desc *desc);
517 * Configuration handlers.
519 void (*config_mac_addr) (struct rt2x00_dev *rt2x00dev, __le32 *mac);
520 void (*config_bssid) (struct rt2x00_dev *rt2x00dev, __le32 *bssid);
521 void (*config_type) (struct rt2x00_dev *rt2x00dev, const int type,
523 void (*config_preamble) (struct rt2x00_dev *rt2x00dev,
524 const int short_preamble,
525 const int ack_timeout,
526 const int ack_consume_time);
527 void (*config) (struct rt2x00_dev *rt2x00dev, const unsigned int flags,
528 struct rt2x00lib_conf *libconf);
529 #define CONFIG_UPDATE_PHYMODE ( 1 << 1 )
530 #define CONFIG_UPDATE_CHANNEL ( 1 << 2 )
531 #define CONFIG_UPDATE_TXPOWER ( 1 << 3 )
532 #define CONFIG_UPDATE_ANTENNA ( 1 << 4 )
533 #define CONFIG_UPDATE_SLOT_TIME ( 1 << 5 )
534 #define CONFIG_UPDATE_BEACON_INT ( 1 << 6 )
535 #define CONFIG_UPDATE_ALL 0xffff
539 * rt2x00 driver callback operation structure.
543 const unsigned int rxd_size;
544 const unsigned int txd_size;
545 const unsigned int eeprom_size;
546 const unsigned int rf_size;
547 const struct rt2x00lib_ops *lib;
548 const struct ieee80211_ops *hw;
549 #ifdef CONFIG_RT2X00_LIB_DEBUGFS
550 const struct rt2x00debug *debugfs;
551 #endif /* CONFIG_RT2X00_LIB_DEBUGFS */
555 * rt2x00 device flags
562 DEVICE_REGISTERED_HW,
565 DEVICE_STARTED_SUSPEND,
566 DEVICE_ENABLED_RADIO,
567 DEVICE_DISABLED_RADIO_HW,
572 DRIVER_REQUIRE_FIRMWARE,
573 DRIVER_REQUIRE_BEACON_RING,
576 * Driver configuration
578 CONFIG_SUPPORT_HW_BUTTON,
581 CONFIG_EXTERNAL_LNA_A,
582 CONFIG_EXTERNAL_LNA_BG,
583 CONFIG_DOUBLE_ANTENNA,
584 CONFIG_DISABLE_LINK_TUNING,
585 CONFIG_SHORT_PREAMBLE,
589 * rt2x00 device structure.
594 * The structure stored in here depends on the
595 * system bus (PCI or USB).
596 * When accessing this variable, the rt2x00dev_{pci,usb}
597 * macro's should be used for correct typecasting.
600 #define rt2x00dev_pci(__dev) ( (struct pci_dev*)(__dev)->dev )
601 #define rt2x00dev_usb(__dev) ( (struct usb_interface*)(__dev)->dev )
604 * Callback functions.
606 const struct rt2x00_ops *ops;
609 * IEEE80211 control structure.
611 struct ieee80211_hw *hw;
612 struct ieee80211_hw_mode *hwmodes;
613 unsigned int curr_hwmode;
619 * rfkill structure for RF state switching support.
620 * This will only be compiled in when required.
622 #ifdef CONFIG_RT2X00_LIB_RFKILL
623 unsigned long rfkill_state;
624 #define RFKILL_STATE_ALLOCATED 1
625 #define RFKILL_STATE_REGISTERED 2
626 struct rfkill *rfkill;
627 struct input_polled_dev *poll_dev;
628 #endif /* CONFIG_RT2X00_LIB_RFKILL */
631 * If enabled, the debugfs interface structures
632 * required for deregistration of debugfs.
634 #ifdef CONFIG_RT2X00_LIB_DEBUGFS
635 struct rt2x00debug_intf *debugfs_intf;
636 #endif /* CONFIG_RT2X00_LIB_DEBUGFS */
640 * In these flags the current status and some
641 * of the device capabilities are stored.
646 * Chipset identification.
648 struct rt2x00_chip chip;
651 * hw capability specifications.
653 struct hw_mode_spec spec;
656 * This is the default TX/RX antenna setup as indicated
657 * by the device's EEPROM. When mac80211 sets its
658 * antenna value to 0 we should be using these values.
660 struct antenna_setup default_ant;
664 * csr_addr: Base register address. (PCI)
665 * csr_cache: CSR cache for usb_control_msg. (USB)
667 void __iomem *csr_addr;
671 * Mutex to protect register accesses on USB devices.
672 * There are 2 reasons this is needed, one is to ensure
673 * use of the csr_cache (for USB devices) by one thread
674 * isn't corrupted by another thread trying to access it.
675 * The other is that access to BBP and RF registers
676 * require multiple BUS transactions and if another thread
677 * attempted to access one of those registers at the same
678 * time one of the writes could silently fail.
680 struct mutex usb_cache_mutex;
683 * Current packet filter configuration for the device.
684 * This contains all currently active FIF_* flags send
685 * to us by mac80211 during configure_filter().
687 unsigned int packet_filter;
690 * Interface configuration.
692 struct interface interface;
705 * Active RF register values.
706 * These are stored here so we don't need
707 * to read the rf registers and can directly
708 * use this value instead.
709 * This field should be accessed by using
710 * rt2x00_rf_read() and rt2x00_rf_write().
715 * USB Max frame size (for rt2500usb & rt73usb).
720 * Current TX power value.
725 * LED register (for rt61pci & rt73usb).
730 * Led mode (LED_MODE_*)
735 * Rssi <-> Dbm offset
740 * Frequency offset (for rt61pci & rt73usb).
745 * Low level statistics which will have
746 * to be kept up to date while device is running.
748 struct ieee80211_low_level_stats low_level_stats;
751 * RX configuration information.
753 struct ieee80211_rx_status rx_status;
758 struct work_struct beacon_work;
759 struct work_struct filter_work;
760 struct work_struct config_work;
763 * Data ring arrays for RX, TX and Beacon.
764 * The Beacon array also contains the Atim ring
765 * if that is supported by the device.
768 struct data_ring *rx;
769 struct data_ring *tx;
770 struct data_ring *bcn;
775 const struct firmware *fw;
779 * For-each loop for the ring array.
780 * All rings have been allocated as a single array,
781 * this means we can create a very simply loop macro
782 * that is capable of looping through all rings.
783 * ring_end(), txring_end() and ring_loop() are helper macro's which
784 * should not be used directly. Instead the following should be used:
785 * ring_for_each() - Loops through all rings (RX, TX, Beacon & Atim)
786 * txring_for_each() - Loops through TX data rings (TX only)
787 * txringall_for_each() - Loops through all TX rings (TX, Beacon & Atim)
789 #define ring_end(__dev) \
790 &(__dev)->rx[(__dev)->data_rings]
792 #define txring_end(__dev) \
793 &(__dev)->tx[(__dev)->hw->queues]
795 #define ring_loop(__entry, __start, __end) \
796 for ((__entry) = (__start); \
797 prefetch(&(__entry)[1]), (__entry) != (__end); \
798 (__entry) = &(__entry)[1])
800 #define ring_for_each(__dev, __entry) \
801 ring_loop(__entry, (__dev)->rx, ring_end(__dev))
803 #define txring_for_each(__dev, __entry) \
804 ring_loop(__entry, (__dev)->tx, txring_end(__dev))
806 #define txringall_for_each(__dev, __entry) \
807 ring_loop(__entry, (__dev)->tx, ring_end(__dev))
811 * The RF is being accessed by word index.
813 static inline void rt2x00_rf_read(struct rt2x00_dev *rt2x00dev,
814 const unsigned int word, u32 *data)
816 *data = rt2x00dev->rf[word];
819 static inline void rt2x00_rf_write(struct rt2x00_dev *rt2x00dev,
820 const unsigned int word, u32 data)
822 rt2x00dev->rf[word] = data;
826 * Generic EEPROM access.
827 * The EEPROM is being accessed by word index.
829 static inline void *rt2x00_eeprom_addr(struct rt2x00_dev *rt2x00dev,
830 const unsigned int word)
832 return (void *)&rt2x00dev->eeprom[word];
835 static inline void rt2x00_eeprom_read(struct rt2x00_dev *rt2x00dev,
836 const unsigned int word, u16 *data)
838 *data = le16_to_cpu(rt2x00dev->eeprom[word]);
841 static inline void rt2x00_eeprom_write(struct rt2x00_dev *rt2x00dev,
842 const unsigned int word, u16 data)
844 rt2x00dev->eeprom[word] = cpu_to_le16(data);
850 static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev,
851 const u16 rt, const u16 rf, const u32 rev)
854 "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n",
857 rt2x00dev->chip.rt = rt;
858 rt2x00dev->chip.rf = rf;
859 rt2x00dev->chip.rev = rev;
862 static inline char rt2x00_rt(const struct rt2x00_chip *chipset, const u16 chip)
864 return (chipset->rt == chip);
867 static inline char rt2x00_rf(const struct rt2x00_chip *chipset, const u16 chip)
869 return (chipset->rf == chip);
872 static inline u16 rt2x00_rev(const struct rt2x00_chip *chipset)
877 static inline u16 rt2x00_check_rev(const struct rt2x00_chip *chipset,
880 return (((chipset->rev & 0xffff0) == rev) &&
881 !!(chipset->rev & 0x0000f));
885 * Duration calculations
886 * The rate variable passed is: 100kbs.
887 * To convert from bytes to bits we multiply size with 8,
888 * then the size is multiplied with 10 to make the
889 * real rate -> rate argument correction.
891 static inline u16 get_duration(const unsigned int size, const u8 rate)
893 return ((size * 8 * 10) / rate);
896 static inline u16 get_duration_res(const unsigned int size, const u8 rate)
898 return ((size * 8 * 10) % rate);
904 struct data_ring *rt2x00lib_get_ring(struct rt2x00_dev *rt2x00dev,
905 const unsigned int queue);
908 * Interrupt context handlers.
910 void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev);
911 void rt2x00lib_txdone(struct data_entry *entry,
912 const int status, const int retry);
913 void rt2x00lib_rxdone(struct data_entry *entry, struct sk_buff *skb,
914 struct rxdata_entry_desc *desc);
917 * TX descriptor initializer
919 void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
921 struct ieee80211_tx_control *control);
926 int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
927 struct ieee80211_tx_control *control);
928 int rt2x00mac_start(struct ieee80211_hw *hw);
929 void rt2x00mac_stop(struct ieee80211_hw *hw);
930 int rt2x00mac_add_interface(struct ieee80211_hw *hw,
931 struct ieee80211_if_init_conf *conf);
932 void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
933 struct ieee80211_if_init_conf *conf);
934 int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
935 int rt2x00mac_config_interface(struct ieee80211_hw *hw,
936 struct ieee80211_vif *vif,
937 struct ieee80211_if_conf *conf);
938 int rt2x00mac_get_stats(struct ieee80211_hw *hw,
939 struct ieee80211_low_level_stats *stats);
940 int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw,
941 struct ieee80211_tx_queue_stats *stats);
942 void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
943 struct ieee80211_vif *vif,
944 struct ieee80211_bss_conf *bss_conf,
946 int rt2x00mac_conf_tx(struct ieee80211_hw *hw, int queue,
947 const struct ieee80211_tx_queue_params *params);
950 * Driver allocation handlers.
952 int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev);
953 void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev);
955 int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev, pm_message_t state);
956 int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev);
957 #endif /* CONFIG_PM */
959 #endif /* RT2X00_H */