aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-08-30 05:49:45 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-05 16:17:44 -0400
commit0888707f1aade9325f121a21314d57400fb779aa (patch)
tree3242349b7a9e8d2bef69db672770ec6b8924bfe3 /drivers
parente63e436326919dcc36e2bb242bc570257de70521 (diff)
b43: Add LP-PHY read/write phyops
This adds read/write phyops for the LP-PHY and LP-PHY radios. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/phy_lp.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index be2a5191f480..e769ca0b29a2 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -66,19 +66,29 @@ static void b43_lpphy_op_exit(struct b43_wldev *dev)
66 66
67static u16 b43_lpphy_op_read(struct b43_wldev *dev, u16 reg) 67static u16 b43_lpphy_op_read(struct b43_wldev *dev, u16 reg)
68{ 68{
69 //TODO 69 b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
70 return 0; 70 return b43_read16(dev, B43_MMIO_PHY_DATA);
71} 71}
72 72
73static void b43_lpphy_op_write(struct b43_wldev *dev, u16 reg, u16 value) 73static void b43_lpphy_op_write(struct b43_wldev *dev, u16 reg, u16 value)
74{ 74{
75 //TODO 75 b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
76 b43_write16(dev, B43_MMIO_PHY_DATA, value);
76} 77}
77 78
78static u16 b43_lpphy_op_radio_read(struct b43_wldev *dev, u16 reg) 79static u16 b43_lpphy_op_radio_read(struct b43_wldev *dev, u16 reg)
79{ 80{
80 //TODO 81 /* Register 1 is a 32-bit register. */
81 return 0; 82 B43_WARN_ON(reg == 1);
83 /* LP-PHY needs a special bit set for read access */
84 if (dev->phy.rev < 2) {
85 if (reg != 0x4001)
86 reg |= 0x100;
87 } else
88 reg |= 0x200;
89
90 b43_write16(dev, B43_MMIO_RADIO_CONTROL, reg);
91 return b43_read16(dev, B43_MMIO_RADIO_DATA_LOW);
82} 92}
83 93
84static void b43_lpphy_op_radio_write(struct b43_wldev *dev, u16 reg, u16 value) 94static void b43_lpphy_op_radio_write(struct b43_wldev *dev, u16 reg, u16 value)
@@ -86,7 +96,8 @@ static void b43_lpphy_op_radio_write(struct b43_wldev *dev, u16 reg, u16 value)
86 /* Register 1 is a 32-bit register. */ 96 /* Register 1 is a 32-bit register. */
87 B43_WARN_ON(reg == 1); 97 B43_WARN_ON(reg == 1);
88 98
89 //TODO 99 b43_write16(dev, B43_MMIO_RADIO_CONTROL, reg);
100 b43_write16(dev, B43_MMIO_RADIO_DATA_LOW, value);
90} 101}
91 102
92static void b43_lpphy_op_software_rfkill(struct b43_wldev *dev, 103static void b43_lpphy_op_software_rfkill(struct b43_wldev *dev,