aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/bus.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/b43/bus.h')
-rw-r--r--drivers/net/wireless/b43/bus.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/bus.h b/drivers/net/wireless/b43/bus.h
new file mode 100644
index 000000000000..79a5ab4270c3
--- /dev/null
+++ b/drivers/net/wireless/b43/bus.h
@@ -0,0 +1,62 @@
1#ifndef B43_BUS_H_
2#define B43_BUS_H_
3
4enum b43_bus_type {
5 B43_BUS_SSB,
6};
7
8struct b43_bus_dev {
9 enum b43_bus_type bus_type;
10 union {
11 struct ssb_device *sdev;
12 };
13
14 int (*bus_may_powerdown)(struct b43_bus_dev *dev);
15 int (*bus_powerup)(struct b43_bus_dev *dev, bool dynamic_pctl);
16 int (*device_is_enabled)(struct b43_bus_dev *dev);
17 void (*device_enable)(struct b43_bus_dev *dev,
18 u32 core_specific_flags);
19 void (*device_disable)(struct b43_bus_dev *dev,
20 u32 core_specific_flags);
21
22 u16 (*read16)(struct b43_bus_dev *dev, u16 offset);
23 u32 (*read32)(struct b43_bus_dev *dev, u16 offset);
24 void (*write16)(struct b43_bus_dev *dev, u16 offset, u16 value);
25 void (*write32)(struct b43_bus_dev *dev, u16 offset, u32 value);
26 void (*block_read)(struct b43_bus_dev *dev, void *buffer,
27 size_t count, u16 offset, u8 reg_width);
28 void (*block_write)(struct b43_bus_dev *dev, const void *buffer,
29 size_t count, u16 offset, u8 reg_width);
30
31 struct device *dev;
32 struct device *dma_dev;
33 unsigned int irq;
34
35 u16 board_vendor;
36 u16 board_type;
37 u16 board_rev;
38
39 u16 chip_id;
40 u8 chip_rev;
41 u8 chip_pkg;
42
43 struct ssb_sprom *bus_sprom;
44
45 u16 core_id;
46 u8 core_rev;
47};
48
49static inline bool b43_bus_host_is_pcmcia(struct b43_bus_dev *dev)
50{
51 return (dev->bus_type == B43_BUS_SSB &&
52 dev->sdev->bus->bustype == SSB_BUSTYPE_PCMCIA);
53}
54static inline bool b43_bus_host_is_sdio(struct b43_bus_dev *dev)
55{
56 return (dev->bus_type == B43_BUS_SSB &&
57 dev->sdev->bus->bustype == SSB_BUSTYPE_SDIO);
58}
59
60struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev);
61
62#endif /* B43_BUS_H_ */