aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00.h
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-11-04 12:36:10 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-06 16:48:57 -0500
commit5822e0701d9c29291f16cf170417071b702edeee (patch)
treec08cf43ae5b0a0057dfaaa638344a20ac6ffeea3 /drivers/net/wireless/rt2x00/rt2x00.h
parenta4385213883420f2f0f77e531fb96489ca001239 (diff)
rt2x00: add support for different chipset interfaces
Enhance rt2x00 infrastructure by adding explicit information about used chipset interface to struct rt2x00_chip. The new field will be used by rt2800 drivers for rt2800 library. Also add commonly used rt2x00_intf_is_pci() and rt2x00_intf_is_usb() helpers to make code easier to read (noticed by Ivo van Doorn). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index c14b0f505b7..1ddda729a48 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
147enum 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/*
@@ -937,6 +944,28 @@ static inline bool rt2x00_check_rev(const struct rt2x00_chip *chipset,
937 return ((chipset->rev & mask) == rev); 944 return ((chipset->rev & mask) == rev);
938} 945}
939 946
947static inline void rt2x00_set_chip_intf(struct rt2x00_dev *rt2x00dev,
948 enum rt2x00_chip_intf intf)
949{
950 rt2x00dev->chip.intf = intf;
951}
952
953static inline bool rt2x00_intf(const struct rt2x00_chip *chipset,
954 enum rt2x00_chip_intf intf)
955{
956 return (chipset->intf == intf);
957}
958
959static inline bool rt2x00_intf_is_pci(struct rt2x00_dev *rt2x00dev)
960{
961 return rt2x00_intf(&rt2x00dev->chip, RT2X00_CHIP_INTF_PCI);
962}
963
964static inline bool rt2x00_intf_is_usb(struct rt2x00_dev *rt2x00dev)
965{
966 return rt2x00_intf(&rt2x00dev->chip, RT2X00_CHIP_INTF_USB);
967}
968
940/** 969/**
941 * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes. 970 * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes.
942 * @rt2x00dev: Pointer to &struct rt2x00_dev. 971 * @rt2x00dev: Pointer to &struct rt2x00_dev.