3 Broadcom B43 wireless driver
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
19 Boston, MA 02110-1301, USA.
29 static inline int b43_bus_ssb_bus_may_powerdown(struct b43_bus_dev *dev)
31 return ssb_bus_may_powerdown(dev->sdev->bus);
33 static inline int b43_bus_ssb_bus_powerup(struct b43_bus_dev *dev,
36 return ssb_bus_powerup(dev->sdev->bus, dynamic_pctl);
38 static inline int b43_bus_ssb_device_is_enabled(struct b43_bus_dev *dev)
40 return ssb_device_is_enabled(dev->sdev);
42 static inline void b43_bus_ssb_device_enable(struct b43_bus_dev *dev,
43 u32 core_specific_flags)
45 ssb_device_enable(dev->sdev, core_specific_flags);
47 static inline void b43_bus_ssb_device_disable(struct b43_bus_dev *dev,
48 u32 core_specific_flags)
50 ssb_device_disable(dev->sdev, core_specific_flags);
53 static inline u16 b43_bus_ssb_read16(struct b43_bus_dev *dev, u16 offset)
55 return ssb_read16(dev->sdev, offset);
57 static inline u32 b43_bus_ssb_read32(struct b43_bus_dev *dev, u16 offset)
59 return ssb_read32(dev->sdev, offset);
62 void b43_bus_ssb_write16(struct b43_bus_dev *dev, u16 offset, u16 value)
64 ssb_write16(dev->sdev, offset, value);
67 void b43_bus_ssb_write32(struct b43_bus_dev *dev, u16 offset, u32 value)
69 ssb_write32(dev->sdev, offset, value);
72 void b43_bus_ssb_block_read(struct b43_bus_dev *dev, void *buffer,
73 size_t count, u16 offset, u8 reg_width)
75 ssb_block_read(dev->sdev, buffer, count, offset, reg_width);
78 void b43_bus_ssb_block_write(struct b43_bus_dev *dev, const void *buffer,
79 size_t count, u16 offset, u8 reg_width)
81 ssb_block_write(dev->sdev, buffer, count, offset, reg_width);
84 struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev)
86 struct b43_bus_dev *dev;
88 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
92 dev->bus_type = B43_BUS_SSB;
95 dev->bus_may_powerdown = b43_bus_ssb_bus_may_powerdown;
96 dev->bus_powerup = b43_bus_ssb_bus_powerup;
97 dev->device_is_enabled = b43_bus_ssb_device_is_enabled;
98 dev->device_enable = b43_bus_ssb_device_enable;
99 dev->device_disable = b43_bus_ssb_device_disable;
101 dev->read16 = b43_bus_ssb_read16;
102 dev->read32 = b43_bus_ssb_read32;
103 dev->write16 = b43_bus_ssb_write16;
104 dev->write32 = b43_bus_ssb_write32;
105 dev->block_read = b43_bus_ssb_block_read;
106 dev->block_write = b43_bus_ssb_block_write;
108 dev->dev = sdev->dev;
109 dev->dma_dev = sdev->dma_dev;
110 dev->irq = sdev->irq;
112 dev->board_vendor = sdev->bus->boardinfo.vendor;
113 dev->board_type = sdev->bus->boardinfo.type;
114 dev->board_rev = sdev->bus->boardinfo.rev;
116 dev->chip_id = sdev->bus->chip_id;
117 dev->chip_rev = sdev->bus->chip_rev;
118 dev->chip_pkg = sdev->bus->chip_package;
120 dev->bus_sprom = &sdev->bus->sprom;
122 dev->core_id = sdev->id.coreid;
123 dev->core_rev = sdev->id.revision;