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
= kzalloc(sizeof(*dev
), GFP_KERNEL
);
88 dev
->bus_type
= B43_BUS_SSB
;
91 dev
->bus_may_powerdown
= b43_bus_ssb_bus_may_powerdown
;
92 dev
->bus_powerup
= b43_bus_ssb_bus_powerup
;
93 dev
->device_is_enabled
= b43_bus_ssb_device_is_enabled
;
94 dev
->device_enable
= b43_bus_ssb_device_enable
;
95 dev
->device_disable
= b43_bus_ssb_device_disable
;
97 dev
->read16
= b43_bus_ssb_read16
;
98 dev
->read32
= b43_bus_ssb_read32
;
99 dev
->write16
= b43_bus_ssb_write16
;
100 dev
->write32
= b43_bus_ssb_write32
;
101 dev
->block_read
= b43_bus_ssb_block_read
;
102 dev
->block_write
= b43_bus_ssb_block_write
;
104 dev
->dev
= sdev
->dev
;
105 dev
->dma_dev
= sdev
->dma_dev
;
106 dev
->irq
= sdev
->irq
;
108 dev
->board_vendor
= sdev
->bus
->boardinfo
.vendor
;
109 dev
->board_type
= sdev
->bus
->boardinfo
.type
;
110 dev
->board_rev
= sdev
->bus
->boardinfo
.rev
;
112 dev
->chip_id
= sdev
->bus
->chip_id
;
113 dev
->chip_rev
= sdev
->bus
->chip_rev
;
114 dev
->chip_pkg
= sdev
->bus
->chip_package
;
116 dev
->bus_sprom
= &sdev
->bus
->sprom
;
118 dev
->core_id
= sdev
->id
.coreid
;
119 dev
->core_rev
= sdev
->id
.revision
;