* [PATCH] b43: Add LP PHY Analog Switch Support
@ 2009-09-14 21:01 Thomas Ilnseher
2009-09-14 21:07 ` Michael Buesch
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Ilnseher @ 2009-09-14 21:01 UTC (permalink / raw)
To: John Linville; +Cc: Broadcom Wireless, linux-wireless
The current verison of b43 uses "b43_phyop_switch_analog_generic" for A,
G and LP phys.
According to the spec, this is the wrong behaviour for the LP PHY
(see: http://bcm-v4.sipsolutions.net/802.11/PHY/Anacore )
While no problems on the x86 plattform where seen, this leads to a crash
on the BCM5354 SoC (MIPS 32 LE plattform).
This patch implements the analog switch for LP PHYs according to the
specs. It fixes the crash
signed-off-by: Thomas Ilnseher <illth@gmx.de>
---
diff -uNr b/drivers/net/wireless/b43/phy_lp.c
a/drivers/net/wireless/b43/phy_lp.c
--- b/drivers/net/wireless/b43/phy_lp.c 2009-09-14 06:14:18.000000000 +0200
+++ a/drivers/net/wireless/b43/phy_lp.c 2009-09-14 21:03:15.158507573 +0200
@@ -2228,6 +2228,16 @@
return B43_TXPWR_RES_DONE;
}
+void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on)
+{
+ if (on) {
+ b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVR, 0xfff8);
+ } else {
+ b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0x0007);
+ b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVR, 0x0007);
+ }
+}
+
const struct b43_phy_operations b43_phyops_lp = {
.allocate = b43_lpphy_op_allocate,
.free = b43_lpphy_op_free,
@@ -2239,7 +2249,7 @@
.radio_read = b43_lpphy_op_radio_read,
.radio_write = b43_lpphy_op_radio_write,
.software_rfkill = b43_lpphy_op_software_rfkill,
- .switch_analog = b43_phyop_switch_analog_generic,
+ .switch_analog = b43_lpphy_op_switch_analog,
.switch_channel = b43_lpphy_op_switch_channel,
.get_default_chan = b43_lpphy_op_get_default_chan,
.set_rx_antenna = b43_lpphy_op_set_rx_antenna,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] b43: Add LP PHY Analog Switch Support
2009-09-14 21:01 [PATCH] b43: Add LP PHY Analog Switch Support Thomas Ilnseher
@ 2009-09-14 21:07 ` Michael Buesch
0 siblings, 0 replies; 2+ messages in thread
From: Michael Buesch @ 2009-09-14 21:07 UTC (permalink / raw)
To: bcm43xx-dev; +Cc: Thomas Ilnseher, John Linville, linux-wireless
On Monday 14 September 2009 23:01:33 Thomas Ilnseher wrote:
> The current verison of b43 uses "b43_phyop_switch_analog_generic" for A,
> G and LP phys.
>
> According to the spec, this is the wrong behaviour for the LP PHY
> (see: http://bcm-v4.sipsolutions.net/802.11/PHY/Anacore )
>
> While no problems on the x86 plattform where seen, this leads to a crash
> on the BCM5354 SoC (MIPS 32 LE plattform).
> This patch implements the analog switch for LP PHYs according to the
> specs. It fixes the crash
>
> signed-off-by: Thomas Ilnseher <illth@gmx.de>
> ---
> diff -uNr b/drivers/net/wireless/b43/phy_lp.c
> a/drivers/net/wireless/b43/phy_lp.c
> --- b/drivers/net/wireless/b43/phy_lp.c 2009-09-14 06:14:18.000000000 +0200
> +++ a/drivers/net/wireless/b43/phy_lp.c 2009-09-14 21:03:15.158507573 +0200
> @@ -2228,6 +2228,16 @@
> return B43_TXPWR_RES_DONE;
> }
>
> +void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on)
> +{
> + if (on) {
> + b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVR, 0xfff8);
> + } else {
> + b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0x0007);
> + b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVR, 0x0007);
> + }
> +}
> +
> const struct b43_phy_operations b43_phyops_lp = {
> .allocate = b43_lpphy_op_allocate,
> .free = b43_lpphy_op_free,
> @@ -2239,7 +2249,7 @@
> .radio_read = b43_lpphy_op_radio_read,
> .radio_write = b43_lpphy_op_radio_write,
> .software_rfkill = b43_lpphy_op_software_rfkill,
> - .switch_analog = b43_phyop_switch_analog_generic,
> + .switch_analog = b43_lpphy_op_switch_analog,
> .switch_channel = b43_lpphy_op_switch_channel,
> .get_default_chan = b43_lpphy_op_get_default_chan,
> .set_rx_antenna = b43_lpphy_op_set_rx_antenna,
>
ack
--
Greetings, Michael.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-14 21:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-14 21:01 [PATCH] b43: Add LP PHY Analog Switch Support Thomas Ilnseher
2009-09-14 21:07 ` Michael Buesch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).