2 Copyright (C) 2004 - 2008 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/skbuff.h>
31 #include <linux/workqueue.h>
32 #include <linux/firmware.h>
33 #include <linux/leds.h>
34 #include <linux/mutex.h>
35 #include <linux/etherdevice.h>
37 #include <net/mac80211.h>
39 #include "rt2x00debug.h"
40 #include "rt2x00leds.h"
41 #include "rt2x00reg.h"
42 #include "rt2x00queue.h"
47 #define DRV_VERSION "2.2.2"
48 #define DRV_PROJECT "http://rt2x00.serialmonkey.com"
52 * Debug output has to be enabled during compile time.
54 #define DEBUG_PRINTK_MSG(__dev, __kernlvl, __lvl, __msg, __args...) \
55 printk(__kernlvl "%s -> %s: %s - " __msg, \
56 wiphy_name((__dev)->hw->wiphy), __func__, __lvl, ##__args)
58 #define DEBUG_PRINTK_PROBE(__kernlvl, __lvl, __msg, __args...) \
59 printk(__kernlvl "%s -> %s: %s - " __msg, \
60 KBUILD_MODNAME, __func__, __lvl, ##__args)
62 #ifdef CONFIG_RT2X00_DEBUG
63 #define DEBUG_PRINTK(__dev, __kernlvl, __lvl, __msg, __args...) \
64 DEBUG_PRINTK_MSG(__dev, __kernlvl, __lvl, __msg, ##__args);
66 #define DEBUG_PRINTK(__dev, __kernlvl, __lvl, __msg, __args...) \
68 #endif /* CONFIG_RT2X00_DEBUG */
71 * Various debug levels.
72 * The debug levels PANIC and ERROR both indicate serious problems,
73 * for this reason they should never be ignored.
74 * The special ERROR_PROBE message is for messages that are generated
75 * when the rt2x00_dev is not yet initialized.
77 #define PANIC(__dev, __msg, __args...) \
78 DEBUG_PRINTK_MSG(__dev, KERN_CRIT, "Panic", __msg, ##__args)
79 #define ERROR(__dev, __msg, __args...) \
80 DEBUG_PRINTK_MSG(__dev, KERN_ERR, "Error", __msg, ##__args)
81 #define ERROR_PROBE(__msg, __args...) \
82 DEBUG_PRINTK_PROBE(KERN_ERR, "Error", __msg, ##__args)
83 #define WARNING(__dev, __msg, __args...) \
84 DEBUG_PRINTK(__dev, KERN_WARNING, "Warning", __msg, ##__args)
85 #define NOTICE(__dev, __msg, __args...) \
86 DEBUG_PRINTK(__dev, KERN_NOTICE, "Notice", __msg, ##__args)
87 #define INFO(__dev, __msg, __args...) \
88 DEBUG_PRINTK(__dev, KERN_INFO, "Info", __msg, ##__args)
89 #define DEBUG(__dev, __msg, __args...) \
90 DEBUG_PRINTK(__dev, KERN_DEBUG, "Debug", __msg, ##__args)
91 #define EEPROM(__dev, __msg, __args...) \
92 DEBUG_PRINTK(__dev, KERN_DEBUG, "EEPROM recovery", __msg, ##__args)
95 * Standard timing and size defines.
96 * These values should follow the ieee80211 specifications.
99 #define IEEE80211_HEADER 24
103 #define SHORT_PREAMBLE 72
105 #define SHORT_SLOT_TIME 9
107 #define PIFS ( SIFS + SLOT_TIME )
108 #define SHORT_PIFS ( SIFS + SHORT_SLOT_TIME )
109 #define DIFS ( PIFS + SLOT_TIME )
110 #define SHORT_DIFS ( SHORT_PIFS + SHORT_SLOT_TIME )
111 #define EIFS ( SIFS + DIFS + \
112 (8 * (IEEE80211_HEADER + ACK_SIZE)) )
113 #define SHORT_EIFS ( SIFS + SHORT_DIFS + \
114 (8 * (IEEE80211_HEADER + ACK_SIZE)) )
117 * Chipset identification
118 * The chipset on the device is composed of a RT and RF chip.
119 * The chipset combination is important for determining device capabilities.
123 #define RT2460 0x0101
124 #define RT2560 0x0201
125 #define RT2570 0x1201
126 #define RT2561s 0x0301 /* Turbo */
127 #define RT2561 0x0302
128 #define RT2661 0x0401
129 #define RT2571 0x1300
136 * RF register values that belong to a particular channel.
147 * Channel information structure
149 struct channel_info {
151 #define GEOGRAPHY_ALLOWED 0x00000001
158 * Antenna setup values.
160 struct antenna_setup {
166 * Quality statistics about the currently active link.
170 * Statistics required for Link tuning.
171 * For the average RSSI value we use the "Walking average" approach.
172 * When adding RSSI to the average value the following calculation
175 * avg_rssi = ((avg_rssi * 7) + rssi) / 8;
177 * The advantage of this approach is that we only need 1 variable
178 * to store the average in (No need for a count and a total).
179 * But more importantly, normal average values will over time
180 * move less and less towards newly added values this results
181 * that with link tuning, the device can have a very good RSSI
182 * for a few minutes but when the device is moved away from the AP
183 * the average will not decrease fast enough to compensate.
184 * The walking average compensates this and will move towards
185 * the new values correctly allowing a effective link tuning.
191 * Statistics required for Signal quality calculation.
192 * For calculating the Signal quality we have to determine
193 * the total number of success and failed RX and TX frames.
194 * After that we also use the average RSSI value to help
195 * determining the signal quality.
196 * For the calculation we will use the following algorithm:
198 * rssi_percentage = (avg_rssi * 100) / rssi_offset
199 * rx_percentage = (rx_success * 100) / rx_total
200 * tx_percentage = (tx_success * 100) / tx_total
201 * avg_signal = ((WEIGHT_RSSI * avg_rssi) +
202 * (WEIGHT_TX * tx_percentage) +
203 * (WEIGHT_RX * rx_percentage)) / 100
205 * This value should then be checked to not be greated then 100.
213 #define WEIGHT_RSSI 20
219 * Antenna settings about the currently active link.
226 #define ANTENNA_RX_DIVERSITY 0x00000001
227 #define ANTENNA_TX_DIVERSITY 0x00000002
228 #define ANTENNA_MODE_SAMPLE 0x00000004
231 * Currently active TX/RX antenna setup.
232 * When software diversity is used, this will indicate
233 * which antenna is actually used at this time.
235 struct antenna_setup active;
238 * RSSI information for the different antenna's.
239 * These statistics are used to determine when
240 * to switch antenna when using software diversity.
242 * rssi[0] -> Antenna A RSSI
243 * rssi[1] -> Antenna B RSSI
248 * Current RSSI average of the currently active antenna.
249 * Similar to the avg_rssi in the link_qual structure
250 * this value is updated by using the walking average.
256 * To optimize the quality of the link we need to store
257 * the quality of received frames and periodically
263 * The number of times the link has been tuned
264 * since the radio has been switched on.
269 * Quality measurement values.
271 struct link_qual qual;
274 * TX/RX antenna setup.
284 * Work structure for scheduling periodic link tuning.
286 struct delayed_work work;
290 * Small helper macro to work with moving/walking averages.
292 #define MOVING_AVERAGE(__avg, __val, __samples) \
293 ( (((__avg) * ((__samples) - 1)) + (__val)) / (__samples) )
296 * When we lack RSSI information return something less then -80 to
297 * tell the driver to tune the device to maximum sensitivity.
299 #define DEFAULT_RSSI ( -128 )
302 * Link quality access functions.
304 static inline int rt2x00_get_link_rssi(struct link *link)
306 if (link->qual.avg_rssi && link->qual.rx_success)
307 return link->qual.avg_rssi;
311 static inline int rt2x00_get_link_ant_rssi(struct link *link)
313 if (link->ant.rssi_ant && link->qual.rx_success)
314 return link->ant.rssi_ant;
318 static inline void rt2x00_reset_link_ant_rssi(struct link *link)
320 link->ant.rssi_ant = 0;
323 static inline int rt2x00_get_link_ant_rssi_history(struct link *link,
326 if (link->ant.rssi_history[ant - ANTENNA_A])
327 return link->ant.rssi_history[ant - ANTENNA_A];
331 static inline int rt2x00_update_ant_rssi(struct link *link, int rssi)
333 int old_rssi = link->ant.rssi_history[link->ant.active.rx - ANTENNA_A];
334 link->ant.rssi_history[link->ant.active.rx - ANTENNA_A] = rssi;
339 * Interface structure
340 * Per interface configuration details, this structure
341 * is allocated as the private data for ieee80211_vif.
345 * All fields within the rt2x00_intf structure
346 * must be protected with a spinlock.
356 * BBSID of the AP to associate with.
361 * Entry in the beacon queue which belongs to
362 * this interface. Each interface has its own
363 * dedicated beacon entry.
365 struct queue_entry *beacon;
368 * Actions that needed rescheduling.
370 unsigned int delayed_flags;
371 #define DELAYED_UPDATE_BEACON 0x00000001
372 #define DELAYED_CONFIG_ERP 0x00000002
373 #define DELAYED_LED_ASSOC 0x00000004
376 * Software sequence counter, this is only required
377 * for hardware which doesn't support hardware
384 static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
386 return (struct rt2x00_intf *)vif->drv_priv;
390 * struct hw_mode_spec: Hardware specifications structure
392 * Details about the supported modes, rates and channels
393 * of a particular chipset. This is used by rt2x00lib
394 * to build the ieee80211_hw_mode array for mac80211.
396 * @supported_bands: Bitmask contained the supported bands (2.4GHz, 5.2GHz).
397 * @supported_rates: Rate types which are supported (CCK, OFDM).
398 * @num_channels: Number of supported channels. This is used as array size
399 * for @tx_power_a, @tx_power_bg and @channels.
400 * @channels: Device/chipset specific channel values (See &struct rf_channel).
401 * @channels_info: Additional information for channels (See &struct channel_info).
403 struct hw_mode_spec {
404 unsigned int supported_bands;
405 #define SUPPORT_BAND_2GHZ 0x00000001
406 #define SUPPORT_BAND_5GHZ 0x00000002
408 unsigned int supported_rates;
409 #define SUPPORT_RATE_CCK 0x00000001
410 #define SUPPORT_RATE_OFDM 0x00000002
412 unsigned int num_channels;
413 const struct rf_channel *channels;
414 const struct channel_info *channels_info;
418 * Configuration structure wrapper around the
419 * mac80211 configuration structure.
420 * When mac80211 configures the driver, rt2x00lib
421 * can precalculate values which are equal for all
422 * rt2x00 drivers. Those values can be stored in here.
424 struct rt2x00lib_conf {
425 struct ieee80211_conf *conf;
427 struct rf_channel rf;
428 struct channel_info channel;
432 * Configuration structure for erp settings.
434 struct rt2x00lib_erp {
439 int ack_consume_time;
452 * Configuration structure for hardware encryption.
454 struct rt2x00lib_crypto {
457 enum set_key_cmd cmd;
469 * Configuration structure wrapper around the
470 * rt2x00 interface configuration handler.
472 struct rt2x00intf_conf {
476 enum nl80211_iftype type;
479 * TSF sync value, this is dependant on the operation type.
484 * The MAC and BSSID addressess are simple array of bytes,
485 * these arrays are little endian, so when sending the addressess
486 * to the drivers, copy the it into a endian-signed variable.
488 * Note that all devices (except rt2500usb) have 32 bits
489 * register word sizes. This means that whatever variable we
490 * pass _must_ be a multiple of 32 bits. Otherwise the device
491 * might not accept what we are sending to it.
492 * This will also make it easier for the driver to write
493 * the data to the device.
500 * rt2x00lib callback functions.
502 struct rt2x00lib_ops {
504 * Interrupt handlers.
506 irq_handler_t irq_handler;
509 * Device init handlers.
511 int (*probe_hw) (struct rt2x00_dev *rt2x00dev);
512 char *(*get_firmware_name) (struct rt2x00_dev *rt2x00dev);
513 u16 (*get_firmware_crc) (const void *data, const size_t len);
514 int (*load_firmware) (struct rt2x00_dev *rt2x00dev, const void *data,
518 * Device initialization/deinitialization handlers.
520 int (*initialize) (struct rt2x00_dev *rt2x00dev);
521 void (*uninitialize) (struct rt2x00_dev *rt2x00dev);
524 * queue initialization handlers
526 void (*init_rxentry) (struct rt2x00_dev *rt2x00dev,
527 struct queue_entry *entry);
528 void (*init_txentry) (struct rt2x00_dev *rt2x00dev,
529 struct queue_entry *entry);
532 * Radio control handlers.
534 int (*set_device_state) (struct rt2x00_dev *rt2x00dev,
535 enum dev_state state);
536 int (*rfkill_poll) (struct rt2x00_dev *rt2x00dev);
537 void (*link_stats) (struct rt2x00_dev *rt2x00dev,
538 struct link_qual *qual);
539 void (*reset_tuner) (struct rt2x00_dev *rt2x00dev);
540 void (*link_tuner) (struct rt2x00_dev *rt2x00dev);
543 * TX control handlers
545 void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev,
547 struct txentry_desc *txdesc);
548 int (*write_tx_data) (struct queue_entry *entry);
549 void (*write_beacon) (struct queue_entry *entry);
550 int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev,
551 struct sk_buff *skb);
552 void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev,
553 const enum data_queue_qid queue);
556 * RX control handlers
558 void (*fill_rxdone) (struct queue_entry *entry,
559 struct rxdone_entry_desc *rxdesc);
562 * Configuration handlers.
564 int (*config_shared_key) (struct rt2x00_dev *rt2x00dev,
565 struct rt2x00lib_crypto *crypto,
566 struct ieee80211_key_conf *key);
567 int (*config_pairwise_key) (struct rt2x00_dev *rt2x00dev,
568 struct rt2x00lib_crypto *crypto,
569 struct ieee80211_key_conf *key);
570 void (*config_filter) (struct rt2x00_dev *rt2x00dev,
571 const unsigned int filter_flags);
572 void (*config_intf) (struct rt2x00_dev *rt2x00dev,
573 struct rt2x00_intf *intf,
574 struct rt2x00intf_conf *conf,
575 const unsigned int flags);
576 #define CONFIG_UPDATE_TYPE ( 1 << 1 )
577 #define CONFIG_UPDATE_MAC ( 1 << 2 )
578 #define CONFIG_UPDATE_BSSID ( 1 << 3 )
580 void (*config_erp) (struct rt2x00_dev *rt2x00dev,
581 struct rt2x00lib_erp *erp);
582 void (*config_ant) (struct rt2x00_dev *rt2x00dev,
583 struct antenna_setup *ant);
584 void (*config) (struct rt2x00_dev *rt2x00dev,
585 struct rt2x00lib_conf *libconf,
586 const unsigned int changed_flags);
590 * rt2x00 driver callback operation structure.
594 const unsigned int max_sta_intf;
595 const unsigned int max_ap_intf;
596 const unsigned int eeprom_size;
597 const unsigned int rf_size;
598 const unsigned int tx_queues;
599 const struct data_queue_desc *rx;
600 const struct data_queue_desc *tx;
601 const struct data_queue_desc *bcn;
602 const struct data_queue_desc *atim;
603 const struct rt2x00lib_ops *lib;
604 const struct ieee80211_ops *hw;
605 #ifdef CONFIG_RT2X00_LIB_DEBUGFS
606 const struct rt2x00debug *debugfs;
607 #endif /* CONFIG_RT2X00_LIB_DEBUGFS */
611 * rt2x00 device flags
617 DEVICE_STATE_PRESENT,
618 DEVICE_STATE_REGISTERED_HW,
619 DEVICE_STATE_INITIALIZED,
620 DEVICE_STATE_STARTED,
621 DEVICE_STATE_STARTED_SUSPEND,
622 DEVICE_STATE_ENABLED_RADIO,
623 DEVICE_STATE_DISABLED_RADIO_HW,
626 * Driver requirements
628 DRIVER_REQUIRE_FIRMWARE,
629 DRIVER_REQUIRE_BEACON_GUARD,
630 DRIVER_REQUIRE_ATIM_QUEUE,
631 DRIVER_REQUIRE_SCHEDULED,
637 CONFIG_SUPPORT_HW_BUTTON,
638 CONFIG_SUPPORT_HW_CRYPTO,
641 * Driver configuration
645 CONFIG_EXTERNAL_LNA_A,
646 CONFIG_EXTERNAL_LNA_BG,
647 CONFIG_DOUBLE_ANTENNA,
648 CONFIG_DISABLE_LINK_TUNING,
652 * rt2x00 device structure.
657 * The structure stored in here depends on the
658 * system bus (PCI or USB).
659 * When accessing this variable, the rt2x00dev_{pci,usb}
660 * macro's should be used for correct typecasting.
665 * Callback functions.
667 const struct rt2x00_ops *ops;
670 * IEEE80211 control structure.
672 struct ieee80211_hw *hw;
673 struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
674 enum ieee80211_band curr_band;
677 * rfkill structure for RF state switching support.
678 * This will only be compiled in when required.
680 #ifdef CONFIG_RT2X00_LIB_RFKILL
681 unsigned long rfkill_state;
682 #define RFKILL_STATE_ALLOCATED 1
683 #define RFKILL_STATE_REGISTERED 2
684 struct rfkill *rfkill;
685 struct delayed_work rfkill_work;
686 #endif /* CONFIG_RT2X00_LIB_RFKILL */
689 * If enabled, the debugfs interface structures
690 * required for deregistration of debugfs.
692 #ifdef CONFIG_RT2X00_LIB_DEBUGFS
693 struct rt2x00debug_intf *debugfs_intf;
694 #endif /* CONFIG_RT2X00_LIB_DEBUGFS */
697 * LED structure for changing the LED status
698 * by mac8011 or the kernel.
700 #ifdef CONFIG_RT2X00_LIB_LEDS
701 struct rt2x00_led led_radio;
702 struct rt2x00_led led_assoc;
703 struct rt2x00_led led_qual;
705 #endif /* CONFIG_RT2X00_LIB_LEDS */
709 * In these flags the current status and some
710 * of the device capabilities are stored.
715 * Chipset identification.
717 struct rt2x00_chip chip;
720 * hw capability specifications.
722 struct hw_mode_spec spec;
725 * This is the default TX/RX antenna setup as indicated
726 * by the device's EEPROM. When mac80211 sets its
727 * antenna value to 0 we should be using these values.
729 struct antenna_setup default_ant;
733 * csr.base: CSR base register address. (PCI)
734 * csr.cache: CSR cache for usb_control_msg. (USB)
742 * Mutex to protect register accesses on USB devices.
743 * There are 2 reasons this is needed, one is to ensure
744 * use of the csr_cache (for USB devices) by one thread
745 * isn't corrupted by another thread trying to access it.
746 * The other is that access to BBP and RF registers
747 * require multiple BUS transactions and if another thread
748 * attempted to access one of those registers at the same
749 * time one of the writes could silently fail.
751 struct mutex usb_cache_mutex;
754 * Current packet filter configuration for the device.
755 * This contains all currently active FIF_* flags send
756 * to us by mac80211 during configure_filter().
758 unsigned int packet_filter;
762 * - Open ap interface count.
763 * - Open sta interface count.
764 * - Association count.
766 unsigned int intf_ap_count;
767 unsigned int intf_sta_count;
768 unsigned int intf_associated;
781 * Active RF register values.
782 * These are stored here so we don't need
783 * to read the rf registers and can directly
784 * use this value instead.
785 * This field should be accessed by using
786 * rt2x00_rf_read() and rt2x00_rf_write().
796 * USB Max frame size (for rt2500usb & rt73usb).
801 * Current TX power value.
806 * Rssi <-> Dbm offset
811 * Frequency offset (for rt61pci & rt73usb).
816 * Low level statistics which will have
817 * to be kept up to date while device is running.
819 struct ieee80211_low_level_stats low_level_stats;
822 * RX configuration information.
824 struct ieee80211_rx_status rx_status;
828 * NOTE: intf_work will use ieee80211_iterate_active_interfaces()
829 * which means it cannot be placed on the hw->workqueue
830 * due to RTNL locking requirements.
832 struct work_struct intf_work;
833 struct work_struct filter_work;
836 * Data queue arrays for RX, TX and Beacon.
837 * The Beacon array also contains the Atim queue
838 * if that is supported by the device.
840 unsigned int data_queues;
841 struct data_queue *rx;
842 struct data_queue *tx;
843 struct data_queue *bcn;
848 const struct firmware *fw;
853 * The RF is being accessed by word index.
855 static inline void rt2x00_rf_read(struct rt2x00_dev *rt2x00dev,
856 const unsigned int word, u32 *data)
858 *data = rt2x00dev->rf[word];
861 static inline void rt2x00_rf_write(struct rt2x00_dev *rt2x00dev,
862 const unsigned int word, u32 data)
864 rt2x00dev->rf[word] = data;
868 * Generic EEPROM access.
869 * The EEPROM is being accessed by word index.
871 static inline void *rt2x00_eeprom_addr(struct rt2x00_dev *rt2x00dev,
872 const unsigned int word)
874 return (void *)&rt2x00dev->eeprom[word];
877 static inline void rt2x00_eeprom_read(struct rt2x00_dev *rt2x00dev,
878 const unsigned int word, u16 *data)
880 *data = le16_to_cpu(rt2x00dev->eeprom[word]);
883 static inline void rt2x00_eeprom_write(struct rt2x00_dev *rt2x00dev,
884 const unsigned int word, u16 data)
886 rt2x00dev->eeprom[word] = cpu_to_le16(data);
892 static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev,
893 const u16 rt, const u16 rf, const u32 rev)
896 "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n",
899 rt2x00dev->chip.rt = rt;
900 rt2x00dev->chip.rf = rf;
901 rt2x00dev->chip.rev = rev;
904 static inline char rt2x00_rt(const struct rt2x00_chip *chipset, const u16 chip)
906 return (chipset->rt == chip);
909 static inline char rt2x00_rf(const struct rt2x00_chip *chipset, const u16 chip)
911 return (chipset->rf == chip);
914 static inline u16 rt2x00_rev(const struct rt2x00_chip *chipset)
919 static inline u16 rt2x00_check_rev(const struct rt2x00_chip *chipset,
922 return (((chipset->rev & 0xffff0) == rev) &&
923 !!(chipset->rev & 0x0000f));
927 * Duration calculations
928 * The rate variable passed is: 100kbs.
929 * To convert from bytes to bits we multiply size with 8,
930 * then the size is multiplied with 10 to make the
931 * real rate -> rate argument correction.
933 static inline u16 get_duration(const unsigned int size, const u8 rate)
935 return ((size * 8 * 10) / rate);
938 static inline u16 get_duration_res(const unsigned int size, const u8 rate)
940 return ((size * 8 * 10) % rate);
944 * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes.
945 * @rt2x00dev: Pointer to &struct rt2x00_dev.
946 * @skb: The skb to map.
948 void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);
951 * rt2x00queue_get_queue - Convert queue index to queue pointer
952 * @rt2x00dev: Pointer to &struct rt2x00_dev.
953 * @queue: rt2x00 queue index (see &enum data_queue_qid).
955 struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,
956 const enum data_queue_qid queue);
959 * rt2x00queue_get_entry - Get queue entry where the given index points to.
960 * @queue: Pointer to &struct data_queue from where we obtain the entry.
961 * @index: Index identifier for obtaining the correct index.
963 struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue,
964 enum queue_index index);
967 * Interrupt context handlers.
969 void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev);
970 void rt2x00lib_txdone(struct queue_entry *entry,
971 struct txdone_entry_desc *txdesc);
972 void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,
973 struct queue_entry *entry);
978 int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
979 int rt2x00mac_start(struct ieee80211_hw *hw);
980 void rt2x00mac_stop(struct ieee80211_hw *hw);
981 int rt2x00mac_add_interface(struct ieee80211_hw *hw,
982 struct ieee80211_if_init_conf *conf);
983 void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
984 struct ieee80211_if_init_conf *conf);
985 int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed);
986 int rt2x00mac_config_interface(struct ieee80211_hw *hw,
987 struct ieee80211_vif *vif,
988 struct ieee80211_if_conf *conf);
989 void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
990 unsigned int changed_flags,
991 unsigned int *total_flags,
992 int mc_count, struct dev_addr_list *mc_list);
993 #ifdef CONFIG_RT2X00_LIB_CRYPTO
994 int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
995 const u8 *local_address, const u8 *address,
996 struct ieee80211_key_conf *key);
998 #define rt2x00mac_set_key NULL
999 #endif /* CONFIG_RT2X00_LIB_CRYPTO */
1000 int rt2x00mac_get_stats(struct ieee80211_hw *hw,
1001 struct ieee80211_low_level_stats *stats);
1002 int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw,
1003 struct ieee80211_tx_queue_stats *stats);
1004 void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
1005 struct ieee80211_vif *vif,
1006 struct ieee80211_bss_conf *bss_conf,
1008 int rt2x00mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
1009 const struct ieee80211_tx_queue_params *params);
1012 * Driver allocation handlers.
1014 int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev);
1015 void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev);
1017 int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev, pm_message_t state);
1018 int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev);
1019 #endif /* CONFIG_PM */
1021 #endif /* RT2X00_H */