b43: Split PHY alloc and init
This splits the PHY allocation from the PHY init. This is needed in order to properly support Analog handling. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
7cb770729b
commit
fb11137af8
@@ -499,35 +499,31 @@ static int b43_nphy_op_allocate(struct b43_wldev *dev)
|
||||
return -ENOMEM;
|
||||
dev->phy.n = nphy;
|
||||
|
||||
//TODO init struct b43_phy_n
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void b43_nphy_op_prepare_structs(struct b43_wldev *dev)
|
||||
{
|
||||
struct b43_phy *phy = &dev->phy;
|
||||
struct b43_phy_n *nphy = phy->n;
|
||||
|
||||
memset(nphy, 0, sizeof(*nphy));
|
||||
|
||||
//TODO init struct b43_phy_n
|
||||
}
|
||||
|
||||
static void b43_nphy_op_free(struct b43_wldev *dev)
|
||||
{
|
||||
struct b43_phy *phy = &dev->phy;
|
||||
struct b43_phy_n *nphy = phy->n;
|
||||
|
||||
kfree(nphy);
|
||||
phy->n = NULL;
|
||||
}
|
||||
|
||||
static int b43_nphy_op_init(struct b43_wldev *dev)
|
||||
{
|
||||
struct b43_phy_n *nphy = dev->phy.n;
|
||||
int err;
|
||||
|
||||
err = b43_phy_initn(dev);
|
||||
if (err)
|
||||
return err;
|
||||
nphy->initialised = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void b43_nphy_op_exit(struct b43_wldev *dev)
|
||||
{
|
||||
struct b43_phy_n *nphy = dev->phy.n;
|
||||
|
||||
if (nphy->initialised) {
|
||||
//TODO
|
||||
nphy->initialised = 0;
|
||||
}
|
||||
//TODO
|
||||
kfree(nphy);
|
||||
dev->phy.n = NULL;
|
||||
return b43_phy_initn(dev);
|
||||
}
|
||||
|
||||
static inline void check_phyreg(struct b43_wldev *dev, u16 offset)
|
||||
@@ -610,8 +606,9 @@ static unsigned int b43_nphy_op_get_default_chan(struct b43_wldev *dev)
|
||||
|
||||
const struct b43_phy_operations b43_phyops_n = {
|
||||
.allocate = b43_nphy_op_allocate,
|
||||
.free = b43_nphy_op_free,
|
||||
.prepare_structs = b43_nphy_op_prepare_structs,
|
||||
.init = b43_nphy_op_init,
|
||||
.exit = b43_nphy_op_exit,
|
||||
.phy_read = b43_nphy_op_read,
|
||||
.phy_write = b43_nphy_op_write,
|
||||
.radio_read = b43_nphy_op_radio_read,
|
||||
|
Reference in New Issue
Block a user