diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 66 |
1 files changed, 26 insertions, 40 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 43b70c6e4e9c..d9daa9c406fa 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -160,6 +160,7 @@ struct avg_val { | |||
160 | enum rt2x00_chip_intf { | 160 | enum rt2x00_chip_intf { |
161 | RT2X00_CHIP_INTF_PCI, | 161 | RT2X00_CHIP_INTF_PCI, |
162 | RT2X00_CHIP_INTF_USB, | 162 | RT2X00_CHIP_INTF_USB, |
163 | RT2X00_CHIP_INTF_SOC, | ||
163 | }; | 164 | }; |
164 | 165 | ||
165 | /* | 166 | /* |
@@ -169,25 +170,26 @@ enum rt2x00_chip_intf { | |||
169 | */ | 170 | */ |
170 | struct rt2x00_chip { | 171 | struct rt2x00_chip { |
171 | u16 rt; | 172 | u16 rt; |
172 | #define RT2460 0x0101 | 173 | #define RT2460 0x2460 |
173 | #define RT2560 0x0201 | 174 | #define RT2560 0x2560 |
174 | #define RT2570 0x1201 | 175 | #define RT2570 0x2570 |
175 | #define RT2561s 0x0301 /* Turbo */ | 176 | #define RT2661 0x2661 |
176 | #define RT2561 0x0302 | 177 | #define RT2573 0x2573 |
177 | #define RT2661 0x0401 | 178 | #define RT2860 0x2860 /* 2.4GHz PCI/CB */ |
178 | #define RT2571 0x1300 | 179 | #define RT2870 0x2870 |
179 | #define RT2860 0x0601 /* 2.4GHz PCI/CB */ | 180 | #define RT2872 0x2872 |
180 | #define RT2860D 0x0681 /* 2.4GHz, 5GHz PCI/CB */ | ||
181 | #define RT2890 0x0701 /* 2.4GHz PCIe */ | ||
182 | #define RT2890D 0x0781 /* 2.4GHz, 5GHz PCIe */ | ||
183 | #define RT2880 0x2880 /* WSOC */ | 181 | #define RT2880 0x2880 /* WSOC */ |
182 | #define RT2883 0x2883 /* WSOC */ | ||
183 | #define RT2890 0x2890 /* 2.4GHz PCIe */ | ||
184 | #define RT3052 0x3052 /* WSOC */ | 184 | #define RT3052 0x3052 /* WSOC */ |
185 | #define RT3070 0x3070 | ||
186 | #define RT3071 0x3071 | ||
185 | #define RT3090 0x3090 /* 2.4GHz PCIe */ | 187 | #define RT3090 0x3090 /* 2.4GHz PCIe */ |
186 | #define RT2870 0x1600 | 188 | #define RT3390 0x3390 |
187 | #define RT3070 0x1800 | 189 | #define RT3572 0x3572 |
188 | 190 | ||
189 | u16 rf; | 191 | u16 rf; |
190 | u32 rev; | 192 | u16 rev; |
191 | 193 | ||
192 | enum rt2x00_chip_intf intf; | 194 | enum rt2x00_chip_intf intf; |
193 | }; | 195 | }; |
@@ -917,29 +919,14 @@ static inline void rt2x00_eeprom_write(struct rt2x00_dev *rt2x00dev, | |||
917 | * Chipset handlers | 919 | * Chipset handlers |
918 | */ | 920 | */ |
919 | static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev, | 921 | static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev, |
920 | const u16 rt, const u16 rf, const u32 rev) | 922 | const u16 rt, const u16 rf, const u16 rev) |
921 | { | 923 | { |
922 | rt2x00dev->chip.rt = rt; | 924 | rt2x00dev->chip.rt = rt; |
923 | rt2x00dev->chip.rf = rf; | 925 | rt2x00dev->chip.rf = rf; |
924 | rt2x00dev->chip.rev = rev; | 926 | rt2x00dev->chip.rev = rev; |
925 | } | ||
926 | |||
927 | static inline void rt2x00_set_chip_rt(struct rt2x00_dev *rt2x00dev, | ||
928 | const u16 rt) | ||
929 | { | ||
930 | rt2x00dev->chip.rt = rt; | ||
931 | } | ||
932 | |||
933 | static inline void rt2x00_set_chip_rf(struct rt2x00_dev *rt2x00dev, | ||
934 | const u16 rf, const u32 rev) | ||
935 | { | ||
936 | rt2x00_set_chip(rt2x00dev, rt2x00dev->chip.rt, rf, rev); | ||
937 | } | ||
938 | 927 | ||
939 | static inline void rt2x00_print_chip(struct rt2x00_dev *rt2x00dev) | ||
940 | { | ||
941 | INFO(rt2x00dev, | 928 | INFO(rt2x00dev, |
942 | "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n", | 929 | "Chipset detected - rt: %04x, rf: %04x, rev: %04x.\n", |
943 | rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev); | 930 | rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev); |
944 | } | 931 | } |
945 | 932 | ||
@@ -953,17 +940,11 @@ static inline char rt2x00_rf(struct rt2x00_dev *rt2x00dev, const u16 rf) | |||
953 | return (rt2x00dev->chip.rf == rf); | 940 | return (rt2x00dev->chip.rf == rf); |
954 | } | 941 | } |
955 | 942 | ||
956 | static inline u32 rt2x00_rev(struct rt2x00_dev *rt2x00dev) | 943 | static inline u16 rt2x00_rev(struct rt2x00_dev *rt2x00dev) |
957 | { | 944 | { |
958 | return rt2x00dev->chip.rev; | 945 | return rt2x00dev->chip.rev; |
959 | } | 946 | } |
960 | 947 | ||
961 | static inline bool rt2x00_check_rev(struct rt2x00_dev *rt2x00dev, | ||
962 | const u32 mask, const u32 rev) | ||
963 | { | ||
964 | return ((rt2x00dev->chip.rev & mask) == rev); | ||
965 | } | ||
966 | |||
967 | static inline void rt2x00_set_chip_intf(struct rt2x00_dev *rt2x00dev, | 948 | static inline void rt2x00_set_chip_intf(struct rt2x00_dev *rt2x00dev, |
968 | enum rt2x00_chip_intf intf) | 949 | enum rt2x00_chip_intf intf) |
969 | { | 950 | { |
@@ -976,16 +957,21 @@ static inline bool rt2x00_intf(struct rt2x00_dev *rt2x00dev, | |||
976 | return (rt2x00dev->chip.intf == intf); | 957 | return (rt2x00dev->chip.intf == intf); |
977 | } | 958 | } |
978 | 959 | ||
979 | static inline bool rt2x00_intf_is_pci(struct rt2x00_dev *rt2x00dev) | 960 | static inline bool rt2x00_is_pci(struct rt2x00_dev *rt2x00dev) |
980 | { | 961 | { |
981 | return rt2x00_intf(rt2x00dev, RT2X00_CHIP_INTF_PCI); | 962 | return rt2x00_intf(rt2x00dev, RT2X00_CHIP_INTF_PCI); |
982 | } | 963 | } |
983 | 964 | ||
984 | static inline bool rt2x00_intf_is_usb(struct rt2x00_dev *rt2x00dev) | 965 | static inline bool rt2x00_is_usb(struct rt2x00_dev *rt2x00dev) |
985 | { | 966 | { |
986 | return rt2x00_intf(rt2x00dev, RT2X00_CHIP_INTF_USB); | 967 | return rt2x00_intf(rt2x00dev, RT2X00_CHIP_INTF_USB); |
987 | } | 968 | } |
988 | 969 | ||
970 | static inline bool rt2x00_is_soc(struct rt2x00_dev *rt2x00dev) | ||
971 | { | ||
972 | return rt2x00_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC); | ||
973 | } | ||
974 | |||
989 | /** | 975 | /** |
990 | * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes. | 976 | * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes. |
991 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | 977 | * @rt2x00dev: Pointer to &struct rt2x00_dev. |