diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 105 |
1 files changed, 32 insertions, 73 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index a74e1a5c56fd..07b03b3c7ef1 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -44,7 +44,7 @@ | |||
44 | /* | 44 | /* |
45 | * Module information. | 45 | * Module information. |
46 | */ | 46 | */ |
47 | #define DRV_VERSION "2.1.4" | 47 | #define DRV_VERSION "2.1.8" |
48 | #define DRV_PROJECT "http://rt2x00.serialmonkey.com" | 48 | #define DRV_PROJECT "http://rt2x00.serialmonkey.com" |
49 | 49 | ||
50 | /* | 50 | /* |
@@ -111,33 +111,6 @@ | |||
111 | #define EIFS ( SIFS + (8 * (IEEE80211_HEADER + ACK_SIZE)) ) | 111 | #define EIFS ( SIFS + (8 * (IEEE80211_HEADER + ACK_SIZE)) ) |
112 | 112 | ||
113 | /* | 113 | /* |
114 | * IEEE802.11 header defines | ||
115 | */ | ||
116 | static inline int is_rts_frame(u16 fc) | ||
117 | { | ||
118 | return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && | ||
119 | ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_RTS)); | ||
120 | } | ||
121 | |||
122 | static inline int is_cts_frame(u16 fc) | ||
123 | { | ||
124 | return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && | ||
125 | ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_CTS)); | ||
126 | } | ||
127 | |||
128 | static inline int is_probe_resp(u16 fc) | ||
129 | { | ||
130 | return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) && | ||
131 | ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP)); | ||
132 | } | ||
133 | |||
134 | static inline int is_beacon(u16 fc) | ||
135 | { | ||
136 | return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) && | ||
137 | ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON)); | ||
138 | } | ||
139 | |||
140 | /* | ||
141 | * Chipset identification | 114 | * Chipset identification |
142 | * The chipset on the device is composed of a RT and RF chip. | 115 | * The chipset on the device is composed of a RT and RF chip. |
143 | * The chipset combination is important for determining device capabilities. | 116 | * The chipset combination is important for determining device capabilities. |
@@ -391,6 +364,8 @@ struct rt2x00_intf { | |||
391 | #define DELAYED_UPDATE_BEACON 0x00000001 | 364 | #define DELAYED_UPDATE_BEACON 0x00000001 |
392 | #define DELAYED_CONFIG_ERP 0x00000002 | 365 | #define DELAYED_CONFIG_ERP 0x00000002 |
393 | #define DELAYED_LED_ASSOC 0x00000004 | 366 | #define DELAYED_LED_ASSOC 0x00000004 |
367 | |||
368 | u16 seqno; | ||
394 | }; | 369 | }; |
395 | 370 | ||
396 | static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif) | 371 | static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif) |
@@ -409,7 +384,7 @@ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif) | |||
409 | * @supported_rates: Rate types which are supported (CCK, OFDM). | 384 | * @supported_rates: Rate types which are supported (CCK, OFDM). |
410 | * @num_channels: Number of supported channels. This is used as array size | 385 | * @num_channels: Number of supported channels. This is used as array size |
411 | * for @tx_power_a, @tx_power_bg and @channels. | 386 | * for @tx_power_a, @tx_power_bg and @channels. |
412 | * channels: Device/chipset specific channel values (See &struct rf_channel). | 387 | * @channels: Device/chipset specific channel values (See &struct rf_channel). |
413 | * @tx_power_a: TX power values for all 5.2GHz channels (may be NULL). | 388 | * @tx_power_a: TX power values for all 5.2GHz channels (may be NULL). |
414 | * @tx_power_bg: TX power values for all 2.4GHz channels (may be NULL). | 389 | * @tx_power_bg: TX power values for all 2.4GHz channels (may be NULL). |
415 | * @tx_power_default: Default TX power value to use when either | 390 | * @tx_power_default: Default TX power value to use when either |
@@ -461,6 +436,7 @@ struct rt2x00lib_conf { | |||
461 | */ | 436 | */ |
462 | struct rt2x00lib_erp { | 437 | struct rt2x00lib_erp { |
463 | int short_preamble; | 438 | int short_preamble; |
439 | int cts_protection; | ||
464 | 440 | ||
465 | int ack_timeout; | 441 | int ack_timeout; |
466 | int ack_consume_time; | 442 | int ack_consume_time; |
@@ -545,15 +521,13 @@ struct rt2x00lib_ops { | |||
545 | */ | 521 | */ |
546 | void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev, | 522 | void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev, |
547 | struct sk_buff *skb, | 523 | struct sk_buff *skb, |
548 | struct txentry_desc *txdesc, | 524 | struct txentry_desc *txdesc); |
549 | struct ieee80211_tx_control *control); | 525 | int (*write_tx_data) (struct queue_entry *entry); |
550 | int (*write_tx_data) (struct rt2x00_dev *rt2x00dev, | 526 | void (*write_beacon) (struct queue_entry *entry); |
551 | struct data_queue *queue, struct sk_buff *skb, | ||
552 | struct ieee80211_tx_control *control); | ||
553 | int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev, | 527 | int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev, |
554 | struct sk_buff *skb); | 528 | struct sk_buff *skb); |
555 | void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev, | 529 | void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev, |
556 | const unsigned int queue); | 530 | const enum data_queue_qid queue); |
557 | 531 | ||
558 | /* | 532 | /* |
559 | * RX control handlers | 533 | * RX control handlers |
@@ -597,6 +571,7 @@ struct rt2x00_ops { | |||
597 | const unsigned int max_ap_intf; | 571 | const unsigned int max_ap_intf; |
598 | const unsigned int eeprom_size; | 572 | const unsigned int eeprom_size; |
599 | const unsigned int rf_size; | 573 | const unsigned int rf_size; |
574 | const unsigned int tx_queues; | ||
600 | const struct data_queue_desc *rx; | 575 | const struct data_queue_desc *rx; |
601 | const struct data_queue_desc *tx; | 576 | const struct data_queue_desc *tx; |
602 | const struct data_queue_desc *bcn; | 577 | const struct data_queue_desc *bcn; |
@@ -626,11 +601,11 @@ enum rt2x00_flags { | |||
626 | /* | 601 | /* |
627 | * Driver features | 602 | * Driver features |
628 | */ | 603 | */ |
629 | DRIVER_SUPPORT_MIXED_INTERFACES, | ||
630 | DRIVER_REQUIRE_FIRMWARE, | 604 | DRIVER_REQUIRE_FIRMWARE, |
631 | DRIVER_REQUIRE_BEACON_GUARD, | 605 | DRIVER_REQUIRE_BEACON_GUARD, |
632 | DRIVER_REQUIRE_ATIM_QUEUE, | 606 | DRIVER_REQUIRE_ATIM_QUEUE, |
633 | DRIVER_REQUIRE_SCHEDULED, | 607 | DRIVER_REQUIRE_SCHEDULED, |
608 | DRIVER_REQUIRE_DMA, | ||
634 | 609 | ||
635 | /* | 610 | /* |
636 | * Driver configuration | 611 | * Driver configuration |
@@ -655,11 +630,7 @@ struct rt2x00_dev { | |||
655 | * When accessing this variable, the rt2x00dev_{pci,usb} | 630 | * When accessing this variable, the rt2x00dev_{pci,usb} |
656 | * macro's should be used for correct typecasting. | 631 | * macro's should be used for correct typecasting. |
657 | */ | 632 | */ |
658 | void *dev; | 633 | struct device *dev; |
659 | #define rt2x00dev_pci(__dev) ( (struct pci_dev *)(__dev)->dev ) | ||
660 | #define rt2x00dev_usb(__dev) ( (struct usb_interface *)(__dev)->dev ) | ||
661 | #define rt2x00dev_usb_dev(__dev)\ | ||
662 | ( (struct usb_device *)interface_to_usbdev(rt2x00dev_usb(__dev)) ) | ||
663 | 634 | ||
664 | /* | 635 | /* |
665 | * Callback functions. | 636 | * Callback functions. |
@@ -682,7 +653,7 @@ struct rt2x00_dev { | |||
682 | #define RFKILL_STATE_ALLOCATED 1 | 653 | #define RFKILL_STATE_ALLOCATED 1 |
683 | #define RFKILL_STATE_REGISTERED 2 | 654 | #define RFKILL_STATE_REGISTERED 2 |
684 | struct rfkill *rfkill; | 655 | struct rfkill *rfkill; |
685 | struct input_polled_dev *poll_dev; | 656 | struct delayed_work rfkill_work; |
686 | #endif /* CONFIG_RT2X00_LIB_RFKILL */ | 657 | #endif /* CONFIG_RT2X00_LIB_RFKILL */ |
687 | 658 | ||
688 | /* | 659 | /* |
@@ -820,8 +791,10 @@ struct rt2x00_dev { | |||
820 | 791 | ||
821 | /* | 792 | /* |
822 | * Scheduled work. | 793 | * Scheduled work. |
794 | * NOTE: intf_work will use ieee80211_iterate_active_interfaces() | ||
795 | * which means it cannot be placed on the hw->workqueue | ||
796 | * due to RTNL locking requirements. | ||
823 | */ | 797 | */ |
824 | struct workqueue_struct *workqueue; | ||
825 | struct work_struct intf_work; | 798 | struct work_struct intf_work; |
826 | struct work_struct filter_work; | 799 | struct work_struct filter_work; |
827 | 800 | ||
@@ -830,7 +803,7 @@ struct rt2x00_dev { | |||
830 | * The Beacon array also contains the Atim queue | 803 | * The Beacon array also contains the Atim queue |
831 | * if that is supported by the device. | 804 | * if that is supported by the device. |
832 | */ | 805 | */ |
833 | int data_queues; | 806 | unsigned int data_queues; |
834 | struct data_queue *rx; | 807 | struct data_queue *rx; |
835 | struct data_queue *tx; | 808 | struct data_queue *tx; |
836 | struct data_queue *bcn; | 809 | struct data_queue *bcn; |
@@ -934,55 +907,41 @@ static inline u16 get_duration_res(const unsigned int size, const u8 rate) | |||
934 | } | 907 | } |
935 | 908 | ||
936 | /** | 909 | /** |
937 | * rt2x00queue_get_queue - Convert mac80211 queue index to rt2x00 queue | 910 | * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes. |
938 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | 911 | * @rt2x00dev: Pointer to &struct rt2x00_dev. |
939 | * @queue: mac80211/rt2x00 queue index | 912 | * @skb: The skb to map. |
940 | * (see &enum ieee80211_tx_queue and &enum rt2x00_bcn_queue). | 913 | */ |
914 | void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb); | ||
915 | |||
916 | /** | ||
917 | * rt2x00queue_get_queue - Convert queue index to queue pointer | ||
918 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | ||
919 | * @queue: rt2x00 queue index (see &enum data_queue_qid). | ||
941 | */ | 920 | */ |
942 | struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev, | 921 | struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev, |
943 | const unsigned int queue); | 922 | const enum data_queue_qid queue); |
944 | 923 | ||
945 | /** | 924 | /** |
946 | * rt2x00queue_get_entry - Get queue entry where the given index points to. | 925 | * rt2x00queue_get_entry - Get queue entry where the given index points to. |
947 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | 926 | * @queue: Pointer to &struct data_queue from where we obtain the entry. |
948 | * @index: Index identifier for obtaining the correct index. | 927 | * @index: Index identifier for obtaining the correct index. |
949 | */ | 928 | */ |
950 | struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue, | 929 | struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue, |
951 | enum queue_index index); | 930 | enum queue_index index); |
952 | 931 | ||
953 | /** | ||
954 | * rt2x00queue_index_inc - Index incrementation function | ||
955 | * @queue: Queue (&struct data_queue) to perform the action on. | ||
956 | * @action: Index type (&enum queue_index) to perform the action on. | ||
957 | * | ||
958 | * This function will increase the requested index on the queue, | ||
959 | * it will grab the appropriate locks and handle queue overflow events by | ||
960 | * resetting the index to the start of the queue. | ||
961 | */ | ||
962 | void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index); | ||
963 | |||
964 | |||
965 | /* | 932 | /* |
966 | * Interrupt context handlers. | 933 | * Interrupt context handlers. |
967 | */ | 934 | */ |
968 | void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev); | 935 | void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev); |
969 | void rt2x00lib_txdone(struct queue_entry *entry, | 936 | void rt2x00lib_txdone(struct queue_entry *entry, |
970 | struct txdone_entry_desc *txdesc); | 937 | struct txdone_entry_desc *txdesc); |
971 | void rt2x00lib_rxdone(struct queue_entry *entry, | 938 | void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev, |
972 | struct rxdone_entry_desc *rxdesc); | 939 | struct queue_entry *entry); |
973 | |||
974 | /* | ||
975 | * TX descriptor initializer | ||
976 | */ | ||
977 | void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev, | ||
978 | struct sk_buff *skb, | ||
979 | struct ieee80211_tx_control *control); | ||
980 | 940 | ||
981 | /* | 941 | /* |
982 | * mac80211 handlers. | 942 | * mac80211 handlers. |
983 | */ | 943 | */ |
984 | int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | 944 | int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb); |
985 | struct ieee80211_tx_control *control); | ||
986 | int rt2x00mac_start(struct ieee80211_hw *hw); | 945 | int rt2x00mac_start(struct ieee80211_hw *hw); |
987 | void rt2x00mac_stop(struct ieee80211_hw *hw); | 946 | void rt2x00mac_stop(struct ieee80211_hw *hw); |
988 | int rt2x00mac_add_interface(struct ieee80211_hw *hw, | 947 | int rt2x00mac_add_interface(struct ieee80211_hw *hw, |
@@ -1005,7 +964,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, | |||
1005 | struct ieee80211_vif *vif, | 964 | struct ieee80211_vif *vif, |
1006 | struct ieee80211_bss_conf *bss_conf, | 965 | struct ieee80211_bss_conf *bss_conf, |
1007 | u32 changes); | 966 | u32 changes); |
1008 | int rt2x00mac_conf_tx(struct ieee80211_hw *hw, int queue, | 967 | int rt2x00mac_conf_tx(struct ieee80211_hw *hw, u16 queue, |
1009 | const struct ieee80211_tx_queue_params *params); | 968 | const struct ieee80211_tx_queue_params *params); |
1010 | 969 | ||
1011 | /* | 970 | /* |