diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 196de8ab815..c83dbaefd57 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -144,6 +144,11 @@ struct avg_val { | |||
144 | int avg_weight; | 144 | int avg_weight; |
145 | }; | 145 | }; |
146 | 146 | ||
147 | enum rt2x00_chip_intf { | ||
148 | RT2X00_CHIP_INTF_PCI, | ||
149 | RT2X00_CHIP_INTF_USB, | ||
150 | }; | ||
151 | |||
147 | /* | 152 | /* |
148 | * Chipset identification | 153 | * Chipset identification |
149 | * The chipset on the device is composed of a RT and RF chip. | 154 | * The chipset on the device is composed of a RT and RF chip. |
@@ -169,6 +174,8 @@ struct rt2x00_chip { | |||
169 | 174 | ||
170 | u16 rf; | 175 | u16 rf; |
171 | u32 rev; | 176 | u32 rev; |
177 | |||
178 | enum rt2x00_chip_intf intf; | ||
172 | }; | 179 | }; |
173 | 180 | ||
174 | /* | 181 | /* |
@@ -842,9 +849,23 @@ struct rt2x00_dev { | |||
842 | * Firmware image. | 849 | * Firmware image. |
843 | */ | 850 | */ |
844 | const struct firmware *fw; | 851 | const struct firmware *fw; |
852 | |||
853 | /* | ||
854 | * Driver specific data. | ||
855 | */ | ||
856 | void *priv; | ||
845 | }; | 857 | }; |
846 | 858 | ||
847 | /* | 859 | /* |
860 | * Register defines. | ||
861 | * Some registers require multiple attempts before success, | ||
862 | * in those cases REGISTER_BUSY_COUNT attempts should be | ||
863 | * taken with a REGISTER_BUSY_DELAY interval. | ||
864 | */ | ||
865 | #define REGISTER_BUSY_COUNT 5 | ||
866 | #define REGISTER_BUSY_DELAY 100 | ||
867 | |||
868 | /* | ||
848 | * Generic RF access. | 869 | * Generic RF access. |
849 | * The RF is being accessed by word index. | 870 | * The RF is being accessed by word index. |
850 | */ | 871 | */ |
@@ -932,6 +953,28 @@ static inline bool rt2x00_check_rev(const struct rt2x00_chip *chipset, | |||
932 | return ((chipset->rev & mask) == rev); | 953 | return ((chipset->rev & mask) == rev); |
933 | } | 954 | } |
934 | 955 | ||
956 | static inline void rt2x00_set_chip_intf(struct rt2x00_dev *rt2x00dev, | ||
957 | enum rt2x00_chip_intf intf) | ||
958 | { | ||
959 | rt2x00dev->chip.intf = intf; | ||
960 | } | ||
961 | |||
962 | static inline bool rt2x00_intf(const struct rt2x00_chip *chipset, | ||
963 | enum rt2x00_chip_intf intf) | ||
964 | { | ||
965 | return (chipset->intf == intf); | ||
966 | } | ||
967 | |||
968 | static inline bool rt2x00_intf_is_pci(struct rt2x00_dev *rt2x00dev) | ||
969 | { | ||
970 | return rt2x00_intf(&rt2x00dev->chip, RT2X00_CHIP_INTF_PCI); | ||
971 | } | ||
972 | |||
973 | static inline bool rt2x00_intf_is_usb(struct rt2x00_dev *rt2x00dev) | ||
974 | { | ||
975 | return rt2x00_intf(&rt2x00dev->chip, RT2X00_CHIP_INTF_USB); | ||
976 | } | ||
977 | |||
935 | /** | 978 | /** |
936 | * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes. | 979 | * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes. |
937 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | 980 | * @rt2x00dev: Pointer to &struct rt2x00_dev. |