spi-topcliff-pch: supports a spi mode setup and bit order setup by IO control
[zen-stable.git] / drivers / net / wireless / b43 / bus.h
blob184c95659279070f2a64edfa6628f109ded51f22
1 #ifndef B43_BUS_H_
2 #define B43_BUS_H_
4 enum b43_bus_type {
5 #ifdef CONFIG_B43_BCMA
6 B43_BUS_BCMA,
7 #endif
8 B43_BUS_SSB,
9 };
11 struct b43_bus_dev {
12 enum b43_bus_type bus_type;
13 union {
14 struct bcma_device *bdev;
15 struct ssb_device *sdev;
18 int (*bus_may_powerdown)(struct b43_bus_dev *dev);
19 int (*bus_powerup)(struct b43_bus_dev *dev, bool dynamic_pctl);
20 int (*device_is_enabled)(struct b43_bus_dev *dev);
21 void (*device_enable)(struct b43_bus_dev *dev,
22 u32 core_specific_flags);
23 void (*device_disable)(struct b43_bus_dev *dev,
24 u32 core_specific_flags);
26 u16 (*read16)(struct b43_bus_dev *dev, u16 offset);
27 u32 (*read32)(struct b43_bus_dev *dev, u16 offset);
28 void (*write16)(struct b43_bus_dev *dev, u16 offset, u16 value);
29 void (*write32)(struct b43_bus_dev *dev, u16 offset, u32 value);
30 void (*block_read)(struct b43_bus_dev *dev, void *buffer,
31 size_t count, u16 offset, u8 reg_width);
32 void (*block_write)(struct b43_bus_dev *dev, const void *buffer,
33 size_t count, u16 offset, u8 reg_width);
35 struct device *dev;
36 struct device *dma_dev;
37 unsigned int irq;
39 u16 board_vendor;
40 u16 board_type;
41 u16 board_rev;
43 u16 chip_id;
44 u8 chip_rev;
45 u8 chip_pkg;
47 struct ssb_sprom *bus_sprom;
49 u16 core_id;
50 u8 core_rev;
53 static inline bool b43_bus_host_is_pcmcia(struct b43_bus_dev *dev)
55 return (dev->bus_type == B43_BUS_SSB &&
56 dev->sdev->bus->bustype == SSB_BUSTYPE_PCMCIA);
58 static inline bool b43_bus_host_is_sdio(struct b43_bus_dev *dev)
60 return (dev->bus_type == B43_BUS_SSB &&
61 dev->sdev->bus->bustype == SSB_BUSTYPE_SDIO);
64 struct b43_bus_dev *b43_bus_dev_bcma_init(struct bcma_device *core);
65 struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev);
67 void *b43_bus_get_wldev(struct b43_bus_dev *dev);
68 void b43_bus_set_wldev(struct b43_bus_dev *dev, void *data);
70 #endif /* B43_BUS_H_ */