Commit 4cabd425 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

b43: HT-PHY: implement radio ops

Every PHY has some specific bit used for reading radio regs. Analyze of
MMIO dumps from BCM4331 and ndiswrapper has shown it is 0x200 for HT.
 radio_read(0x037f) -> 0x0073
radio_write(0x017f) <- 0x0072
Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d816ab26
...@@ -90,6 +90,22 @@ static void b43_phy_ht_op_maskset(struct b43_wldev *dev, u16 reg, u16 mask, ...@@ -90,6 +90,22 @@ static void b43_phy_ht_op_maskset(struct b43_wldev *dev, u16 reg, u16 mask,
(b43_read16(dev, B43_MMIO_PHY_DATA) & mask) | set); (b43_read16(dev, B43_MMIO_PHY_DATA) & mask) | set);
} }
static u16 b43_phy_ht_op_radio_read(struct b43_wldev *dev, u16 reg)
{
/* HT-PHY needs 0x200 for read access */
reg |= 0x200;
b43_write16(dev, B43_MMIO_RADIO24_CONTROL, reg);
return b43_read16(dev, B43_MMIO_RADIO24_DATA);
}
static void b43_phy_ht_op_radio_write(struct b43_wldev *dev, u16 reg,
u16 value)
{
b43_write16(dev, B43_MMIO_RADIO24_CONTROL, reg);
b43_write16(dev, B43_MMIO_RADIO24_DATA, value);
}
/************************************************** /**************************************************
* PHY ops struct. * PHY ops struct.
**************************************************/ **************************************************/
...@@ -104,9 +120,9 @@ const struct b43_phy_operations b43_phyops_ht = { ...@@ -104,9 +120,9 @@ const struct b43_phy_operations b43_phyops_ht = {
.phy_read = b43_phy_ht_op_read, .phy_read = b43_phy_ht_op_read,
.phy_write = b43_phy_ht_op_write, .phy_write = b43_phy_ht_op_write,
.phy_maskset = b43_phy_ht_op_maskset, .phy_maskset = b43_phy_ht_op_maskset,
/*
.radio_read = b43_phy_ht_op_radio_read, .radio_read = b43_phy_ht_op_radio_read,
.radio_write = b43_phy_ht_op_radio_write, .radio_write = b43_phy_ht_op_radio_write,
/*
.software_rfkill = b43_phy_ht_op_software_rfkill, .software_rfkill = b43_phy_ht_op_software_rfkill,
.switch_analog = b43_phy_ht_op_switch_analog, .switch_analog = b43_phy_ht_op_switch_analog,
.switch_channel = b43_phy_ht_op_switch_channel, .switch_channel = b43_phy_ht_op_switch_channel,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment