diff options
-rw-r--r-- | drivers/net/wireless/b43/b43.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/b43/bus.c | 38 | ||||
-rw-r--r-- | drivers/net/wireless/b43/bus.h | 9 |
3 files changed, 53 insertions, 6 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index bb81ebcf512e..3378d93cc33d 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h | |||
@@ -883,34 +883,34 @@ static inline enum ieee80211_band b43_current_band(struct b43_wl *wl) | |||
883 | 883 | ||
884 | static inline u16 b43_read16(struct b43_wldev *dev, u16 offset) | 884 | static inline u16 b43_read16(struct b43_wldev *dev, u16 offset) |
885 | { | 885 | { |
886 | return ssb_read16(dev->sdev, offset); | 886 | return dev->dev->read16(dev->dev, offset); |
887 | } | 887 | } |
888 | 888 | ||
889 | static inline void b43_write16(struct b43_wldev *dev, u16 offset, u16 value) | 889 | static inline void b43_write16(struct b43_wldev *dev, u16 offset, u16 value) |
890 | { | 890 | { |
891 | ssb_write16(dev->sdev, offset, value); | 891 | dev->dev->write16(dev->dev, offset, value); |
892 | } | 892 | } |
893 | 893 | ||
894 | static inline u32 b43_read32(struct b43_wldev *dev, u16 offset) | 894 | static inline u32 b43_read32(struct b43_wldev *dev, u16 offset) |
895 | { | 895 | { |
896 | return ssb_read32(dev->sdev, offset); | 896 | return dev->dev->read32(dev->dev, offset); |
897 | } | 897 | } |
898 | 898 | ||
899 | static inline void b43_write32(struct b43_wldev *dev, u16 offset, u32 value) | 899 | static inline void b43_write32(struct b43_wldev *dev, u16 offset, u32 value) |
900 | { | 900 | { |
901 | ssb_write32(dev->sdev, offset, value); | 901 | dev->dev->write32(dev->dev, offset, value); |
902 | } | 902 | } |
903 | 903 | ||
904 | static inline void b43_block_read(struct b43_wldev *dev, void *buffer, | 904 | static inline void b43_block_read(struct b43_wldev *dev, void *buffer, |
905 | size_t count, u16 offset, u8 reg_width) | 905 | size_t count, u16 offset, u8 reg_width) |
906 | { | 906 | { |
907 | ssb_block_read(dev->sdev, buffer, count, offset, reg_width); | 907 | dev->dev->block_read(dev->dev, buffer, count, offset, reg_width); |
908 | } | 908 | } |
909 | 909 | ||
910 | static inline void b43_block_write(struct b43_wldev *dev, const void *buffer, | 910 | static inline void b43_block_write(struct b43_wldev *dev, const void *buffer, |
911 | size_t count, u16 offset, u8 reg_width) | 911 | size_t count, u16 offset, u8 reg_width) |
912 | { | 912 | { |
913 | ssb_block_write(dev->sdev, buffer, count, offset, reg_width); | 913 | dev->dev->block_write(dev->dev, buffer, count, offset, reg_width); |
914 | } | 914 | } |
915 | 915 | ||
916 | static inline bool b43_using_pio_transfers(struct b43_wldev *dev) | 916 | static inline bool b43_using_pio_transfers(struct b43_wldev *dev) |
diff --git a/drivers/net/wireless/b43/bus.c b/drivers/net/wireless/b43/bus.c index f8ccd2cea3f9..fe5fa267bc5b 100644 --- a/drivers/net/wireless/b43/bus.c +++ b/drivers/net/wireless/b43/bus.c | |||
@@ -25,6 +25,37 @@ | |||
25 | 25 | ||
26 | 26 | ||
27 | /* SSB */ | 27 | /* SSB */ |
28 | static inline u16 b43_bus_ssb_read16(struct b43_bus_dev *dev, u16 offset) | ||
29 | { | ||
30 | return ssb_read16(dev->sdev, offset); | ||
31 | } | ||
32 | static inline u32 b43_bus_ssb_read32(struct b43_bus_dev *dev, u16 offset) | ||
33 | { | ||
34 | return ssb_read32(dev->sdev, offset); | ||
35 | } | ||
36 | static inline | ||
37 | void b43_bus_ssb_write16(struct b43_bus_dev *dev, u16 offset, u16 value) | ||
38 | { | ||
39 | ssb_write16(dev->sdev, offset, value); | ||
40 | } | ||
41 | static inline | ||
42 | void b43_bus_ssb_write32(struct b43_bus_dev *dev, u16 offset, u32 value) | ||
43 | { | ||
44 | ssb_write32(dev->sdev, offset, value); | ||
45 | } | ||
46 | static inline | ||
47 | void b43_bus_ssb_block_read(struct b43_bus_dev *dev, void *buffer, | ||
48 | size_t count, u16 offset, u8 reg_width) | ||
49 | { | ||
50 | ssb_block_read(dev->sdev, buffer, count, offset, reg_width); | ||
51 | } | ||
52 | static inline | ||
53 | void b43_bus_ssb_block_write(struct b43_bus_dev *dev, const void *buffer, | ||
54 | size_t count, u16 offset, u8 reg_width) | ||
55 | { | ||
56 | ssb_block_write(dev->sdev, buffer, count, offset, reg_width); | ||
57 | } | ||
58 | |||
28 | struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev) | 59 | struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev) |
29 | { | 60 | { |
30 | struct b43_bus_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 61 | struct b43_bus_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
@@ -32,5 +63,12 @@ struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev) | |||
32 | dev->bus_type = B43_BUS_SSB; | 63 | dev->bus_type = B43_BUS_SSB; |
33 | dev->sdev = sdev; | 64 | dev->sdev = sdev; |
34 | 65 | ||
66 | dev->read16 = b43_bus_ssb_read16; | ||
67 | dev->read32 = b43_bus_ssb_read32; | ||
68 | dev->write16 = b43_bus_ssb_write16; | ||
69 | dev->write32 = b43_bus_ssb_write32; | ||
70 | dev->block_read = b43_bus_ssb_block_read; | ||
71 | dev->block_write = b43_bus_ssb_block_write; | ||
72 | |||
35 | return dev; | 73 | return dev; |
36 | } | 74 | } |
diff --git a/drivers/net/wireless/b43/bus.h b/drivers/net/wireless/b43/bus.h index 68bc00a7458e..9b390020fb52 100644 --- a/drivers/net/wireless/b43/bus.h +++ b/drivers/net/wireless/b43/bus.h | |||
@@ -10,6 +10,15 @@ struct b43_bus_dev { | |||
10 | union { | 10 | union { |
11 | struct ssb_device *sdev; | 11 | struct ssb_device *sdev; |
12 | }; | 12 | }; |
13 | |||
14 | u16 (*read16)(struct b43_bus_dev *dev, u16 offset); | ||
15 | u32 (*read32)(struct b43_bus_dev *dev, u16 offset); | ||
16 | void (*write16)(struct b43_bus_dev *dev, u16 offset, u16 value); | ||
17 | void (*write32)(struct b43_bus_dev *dev, u16 offset, u32 value); | ||
18 | void (*block_read)(struct b43_bus_dev *dev, void *buffer, | ||
19 | size_t count, u16 offset, u8 reg_width); | ||
20 | void (*block_write)(struct b43_bus_dev *dev, const void *buffer, | ||
21 | size_t count, u16 offset, u8 reg_width); | ||
13 | }; | 22 | }; |
14 | 23 | ||
15 | struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev); | 24 | struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev); |