* [PATCH] b43: LP-PHY: Fix analog core switching
@ 2009-09-14 19:10 Gábor Stefanik
2009-09-14 19:24 ` Thomas Ilnseher
2009-09-14 19:40 ` Michael Buesch
0 siblings, 2 replies; 3+ messages in thread
From: Gábor Stefanik @ 2009-09-14 19:10 UTC (permalink / raw)
To: John Linville, Michael Buesch, Larry Finger
Cc: Broadcom Wireless, linux-wireless
The generic analog switch routine is not correct for LP-PHY according
to the latest specs. Implement the proper analog core switch routine.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 80da9c7..b0e127a 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -2160,6 +2160,16 @@ static int lpphy_b2063_tune(struct b43_w
return 0;
}
+static void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on)
+{
+ if (on) {
+ b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0x7);
+ b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVR, 0x7);
+ } else {
+ b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVR, 0xFFF8);
+ }
+}
+
static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
unsigned int new_channel)
{
@@ -2239,7 +2249,7 @@ const struct b43_phy_operations b43_phyo
.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 related [flat|nested] 3+ messages in thread
* Re: [PATCH] b43: LP-PHY: Fix analog core switching
2009-09-14 19:10 [PATCH] b43: LP-PHY: Fix analog core switching Gábor Stefanik
@ 2009-09-14 19:24 ` Thomas Ilnseher
2009-09-14 19:40 ` Michael Buesch
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Ilnseher @ 2009-09-14 19:24 UTC (permalink / raw)
To: Gábor Stefanik
Cc: John Linville, Michael Buesch, Larry Finger, linux-wireless,
Broadcom Wireless
On Mo, 2009-09-14 at 21:10 +0200, Gábor Stefanik wrote:
> The generic analog switch routine is not correct for LP-PHY according
> to the latest specs. Implement the proper analog core switch routine.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
> index 80da9c7..b0e127a 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -2160,6 +2160,16 @@ static int lpphy_b2063_tune(struct b43_w
> return 0;
> }
>
> +static void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on)
> +{
The spec says:
Else if this in an LP PHY
a. If argument "on" is zero
1. OR PHY Register 0x43C with 7
2. OR PHY Register 0x43B with 7
> + if (on) {
This stuff is executed when on is true (ie. anything else than zero)
> + b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0x7);
> + b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVR, 0x7);
> + } else {
> + b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVR, 0xFFF8);
> + }
> +}
> +
> static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
> unsigned int new_channel)
> {
> @@ -2239,7 +2249,7 @@ const struct b43_phy_operations b43_phyo
> .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,
>
> _______________________________________________
> Bcm43xx-dev mailing list
> Bcm43xx-dev@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] b43: LP-PHY: Fix analog core switching
2009-09-14 19:10 [PATCH] b43: LP-PHY: Fix analog core switching Gábor Stefanik
2009-09-14 19:24 ` Thomas Ilnseher
@ 2009-09-14 19:40 ` Michael Buesch
1 sibling, 0 replies; 3+ messages in thread
From: Michael Buesch @ 2009-09-14 19:40 UTC (permalink / raw)
To: Gábor Stefanik
Cc: John Linville, Larry Finger, Broadcom Wireless, linux-wireless
On Monday 14 September 2009 21:10:04 Gábor Stefanik wrote:
> The generic analog switch routine is not correct for LP-PHY according
> to the latest specs. Implement the proper analog core switch routine.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
> index 80da9c7..b0e127a 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -2160,6 +2160,16 @@ static int lpphy_b2063_tune(struct b43_w
> return 0;
> }
>
> +static void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on)
> +{
> + if (on) {
> + b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0x7);
> + b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVR, 0x7);
> + } else {
> + b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVR, 0xFFF8);
> + }
> +}
You have the if branches swapped. (Don't add a ! in front of the on. Swap the branches).
--
Greetings, Michael.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-09-14 19:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-14 19:10 [PATCH] b43: LP-PHY: Fix analog core switching Gábor Stefanik
2009-09-14 19:24 ` Thomas Ilnseher
2009-09-14 19:40 ` 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).