aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/b43/b43.h12
-rw-r--r--drivers/net/wireless/b43/bus.c38
-rw-r--r--drivers/net/wireless/b43/bus.h9
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
884static inline u16 b43_read16(struct b43_wldev *dev, u16 offset) 884static 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
889static inline void b43_write16(struct b43_wldev *dev, u16 offset, u16 value) 889static 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
894static inline u32 b43_read32(struct b43_wldev *dev, u16 offset) 894static 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
899static inline void b43_write32(struct b43_wldev *dev, u16 offset, u32 value) 899static 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
904static inline void b43_block_read(struct b43_wldev *dev, void *buffer, 904static 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
910static inline void b43_block_write(struct b43_wldev *dev, const void *buffer, 910static 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
916static inline bool b43_using_pio_transfers(struct b43_wldev *dev) 916static 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 */
28static inline u16 b43_bus_ssb_read16(struct b43_bus_dev *dev, u16 offset)
29{
30 return ssb_read16(dev->sdev, offset);
31}
32static inline u32 b43_bus_ssb_read32(struct b43_bus_dev *dev, u16 offset)
33{
34 return ssb_read32(dev->sdev, offset);
35}
36static inline
37void b43_bus_ssb_write16(struct b43_bus_dev *dev, u16 offset, u16 value)
38{
39 ssb_write16(dev->sdev, offset, value);
40}
41static inline
42void b43_bus_ssb_write32(struct b43_bus_dev *dev, u16 offset, u32 value)
43{
44 ssb_write32(dev->sdev, offset, value);
45}
46static inline
47void 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}
52static inline
53void 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
28struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev) 59struct 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
15struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev); 24struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev);