aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-16 20:24:53 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-16 20:24:53 -0400
commit492b057c426e4aa747484958e18e9da29003985d (patch)
tree34e08c24618688d8bcc190523028b5f94cce0c0b /drivers/net/wireless/rt2x00/rt2x00.h
parent313485175da221c388f6a8ecf4c30062ba9bea17 (diff)
parent300df7dc89cc276377fc020704e34875d5c473b6 (diff)
Merge commit 'origin/master' into next
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h57
1 files changed, 50 insertions, 7 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 84bd6f19acb0..a498dde024e1 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -103,6 +103,15 @@
103#define GET_DURATION_RES(__size, __rate)(((__size) * 8 * 10) % (__rate)) 103#define GET_DURATION_RES(__size, __rate)(((__size) * 8 * 10) % (__rate))
104 104
105/* 105/*
106 * Determine the alignment requirement,
107 * to make sure the 802.11 payload is padded to a 4-byte boundrary
108 * we must determine the address of the payload and calculate the
109 * amount of bytes needed to move the data.
110 */
111#define ALIGN_SIZE(__skb, __header) \
112 ( ((unsigned long)((__skb)->data + (__header))) & 3 )
113
114/*
106 * Standard timing and size defines. 115 * Standard timing and size defines.
107 * These values should follow the ieee80211 specifications. 116 * These values should follow the ieee80211 specifications.
108 */ 117 */
@@ -138,6 +147,7 @@ struct rt2x00_chip {
138#define RT2561 0x0302 147#define RT2561 0x0302
139#define RT2661 0x0401 148#define RT2661 0x0401
140#define RT2571 0x1300 149#define RT2571 0x1300
150#define RT2870 0x1600
141 151
142 u16 rf; 152 u16 rf;
143 u32 rev; 153 u32 rev;
@@ -357,6 +367,7 @@ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
357 * for @tx_power_a, @tx_power_bg and @channels. 367 * for @tx_power_a, @tx_power_bg and @channels.
358 * @channels: Device/chipset specific channel values (See &struct rf_channel). 368 * @channels: Device/chipset specific channel values (See &struct rf_channel).
359 * @channels_info: Additional information for channels (See &struct channel_info). 369 * @channels_info: Additional information for channels (See &struct channel_info).
370 * @ht: Driver HT Capabilities (See &ieee80211_sta_ht_cap).
360 */ 371 */
361struct hw_mode_spec { 372struct hw_mode_spec {
362 unsigned int supported_bands; 373 unsigned int supported_bands;
@@ -370,6 +381,8 @@ struct hw_mode_spec {
370 unsigned int num_channels; 381 unsigned int num_channels;
371 const struct rf_channel *channels; 382 const struct rf_channel *channels;
372 const struct channel_info *channels_info; 383 const struct channel_info *channels_info;
384
385 struct ieee80211_sta_ht_cap ht;
373}; 386};
374 387
375/* 388/*
@@ -404,6 +417,8 @@ struct rt2x00lib_erp {
404 short pifs; 417 short pifs;
405 short difs; 418 short difs;
406 short eifs; 419 short eifs;
420
421 u16 beacon_int;
407}; 422};
408 423
409/* 424/*
@@ -590,6 +605,7 @@ enum rt2x00_flags {
590 DRIVER_REQUIRE_SCHEDULED, 605 DRIVER_REQUIRE_SCHEDULED,
591 DRIVER_REQUIRE_DMA, 606 DRIVER_REQUIRE_DMA,
592 DRIVER_REQUIRE_COPY_IV, 607 DRIVER_REQUIRE_COPY_IV,
608 DRIVER_REQUIRE_L2PAD,
593 609
594 /* 610 /*
595 * Driver features 611 * Driver features
@@ -606,6 +622,7 @@ enum rt2x00_flags {
606 CONFIG_EXTERNAL_LNA_BG, 622 CONFIG_EXTERNAL_LNA_BG,
607 CONFIG_DOUBLE_ANTENNA, 623 CONFIG_DOUBLE_ANTENNA,
608 CONFIG_DISABLE_LINK_TUNING, 624 CONFIG_DISABLE_LINK_TUNING,
625 CONFIG_CHANNEL_HT40,
609}; 626};
610 627
611/* 628/*
@@ -672,6 +689,12 @@ struct rt2x00_dev {
672 unsigned long flags; 689 unsigned long flags;
673 690
674 /* 691 /*
692 * Device information, Bus IRQ and name (PCI, SoC)
693 */
694 int irq;
695 const char *name;
696
697 /*
675 * Chipset identification. 698 * Chipset identification.
676 */ 699 */
677 struct rt2x00_chip chip; 700 struct rt2x00_chip chip;
@@ -772,6 +795,18 @@ struct rt2x00_dev {
772 u8 freq_offset; 795 u8 freq_offset;
773 796
774 /* 797 /*
798 * Calibration information (for rt2800usb & rt2800pci).
799 * [0] -> BW20
800 * [1] -> BW40
801 */
802 u8 calibration[2];
803
804 /*
805 * Beacon interval.
806 */
807 u16 beacon_int;
808
809 /*
775 * Low level statistics which will have 810 * Low level statistics which will have
776 * to be kept up to date while device is running. 811 * to be kept up to date while device is running.
777 */ 812 */
@@ -860,6 +895,18 @@ static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev,
860 rt2x00dev->chip.rev = rev; 895 rt2x00dev->chip.rev = rev;
861} 896}
862 897
898static inline void rt2x00_set_chip_rt(struct rt2x00_dev *rt2x00dev,
899 const u16 rt)
900{
901 rt2x00dev->chip.rt = rt;
902}
903
904static inline void rt2x00_set_chip_rf(struct rt2x00_dev *rt2x00dev,
905 const u16 rf, const u32 rev)
906{
907 rt2x00_set_chip(rt2x00dev, rt2x00dev->chip.rt, rf, rev);
908}
909
863static inline char rt2x00_rt(const struct rt2x00_chip *chipset, const u16 chip) 910static inline char rt2x00_rt(const struct rt2x00_chip *chipset, const u16 chip)
864{ 911{
865 return (chipset->rt == chip); 912 return (chipset->rt == chip);
@@ -875,11 +922,10 @@ static inline u32 rt2x00_rev(const struct rt2x00_chip *chipset)
875 return chipset->rev; 922 return chipset->rev;
876} 923}
877 924
878static inline u16 rt2x00_check_rev(const struct rt2x00_chip *chipset, 925static inline bool rt2x00_check_rev(const struct rt2x00_chip *chipset,
879 const u32 rev) 926 const u32 mask, const u32 rev)
880{ 927{
881 return (((chipset->rev & 0xffff0) == rev) && 928 return ((chipset->rev & mask) == rev);
882 !!(chipset->rev & 0x0000f));
883} 929}
884 930
885/** 931/**
@@ -925,9 +971,6 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
925void rt2x00mac_remove_interface(struct ieee80211_hw *hw, 971void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
926 struct ieee80211_if_init_conf *conf); 972 struct ieee80211_if_init_conf *conf);
927int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed); 973int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed);
928int rt2x00mac_config_interface(struct ieee80211_hw *hw,
929 struct ieee80211_vif *vif,
930 struct ieee80211_if_conf *conf);
931void rt2x00mac_configure_filter(struct ieee80211_hw *hw, 974void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
932 unsigned int changed_flags, 975 unsigned int changed_flags,
933 unsigned int *total_flags, 976 unsigned int *total_flags,