All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bcm43xx-mac80211: Set antenna gains if not in sprom
@ 2007-08-03 21:26 Larry Finger
  2007-08-03 21:38 ` Michael Buesch
  0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2007-08-03 21:26 UTC (permalink / raw)
  To: John Linville; +Cc: Bcm43xx-dev, linux-wireless

In the sprom for bcm43xx devices, any unprogrammed values are set to all ones.
In the case of antenna gains, the specs indicate that a gain of 2 dBm should
be set if no value is stored. This patch implements that provision.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

Index: wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_main.c
+++ wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_main.c
@@ -3805,6 +3805,12 @@ static void bcm43xx_sprom_fixup(struct s
 	    bus->boardinfo.rev > 0x40)
 		bus->sprom.r1.boardflags_lo |= BCM43xx_BFL_PACTRL;
 
+	/* Handle case when gain is not set in sprom */
+	if (bus->sprom.r1.antenna_gain_a == 0xFF)
+		bus->sprom.r1.antenna_gain_a = 2;
+	if (bus->sprom.r1.antenna_gain_bg == 0xFF)
+		bus->sprom.r1.antenna_gain_bg = 2;
+
 	/* Convert Antennagain values to Q5.2 */
 	bus->sprom.r1.antenna_gain_a <<= 2;
 	bus->sprom.r1.antenna_gain_bg <<= 2;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] bcm43xx-mac80211: Set antenna gains if not in sprom
  2007-08-03 21:26 [PATCH] bcm43xx-mac80211: Set antenna gains if not in sprom Larry Finger
@ 2007-08-03 21:38 ` Michael Buesch
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Buesch @ 2007-08-03 21:38 UTC (permalink / raw)
  To: Larry Finger; +Cc: John Linville, Bcm43xx-dev, linux-wireless

On Friday 03 August 2007 23:26:21 Larry Finger wrote:
> In the sprom for bcm43xx devices, any unprogrammed values are set to all ones.
> In the case of antenna gains, the specs indicate that a gain of 2 dBm should
> be set if no value is stored. This patch implements that provision.
> 
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
> 
> Index: wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_main.c
> ===================================================================
> --- wireless-dev.orig/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_main.c
> +++ wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_main.c
> @@ -3805,6 +3805,12 @@ static void bcm43xx_sprom_fixup(struct s
>  	    bus->boardinfo.rev > 0x40)
>  		bus->sprom.r1.boardflags_lo |= BCM43xx_BFL_PACTRL;
>  
> +	/* Handle case when gain is not set in sprom */
> +	if (bus->sprom.r1.antenna_gain_a == 0xFF)
> +		bus->sprom.r1.antenna_gain_a = 2;
> +	if (bus->sprom.r1.antenna_gain_bg == 0xFF)
> +		bus->sprom.r1.antenna_gain_bg = 2;
> +
>  	/* Convert Antennagain values to Q5.2 */
>  	bus->sprom.r1.antenna_gain_a <<= 2;
>  	bus->sprom.r1.antenna_gain_bg <<= 2;
> -
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

Queued, thanks!

-- 
Greetings Michael.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-03 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-03 21:26 [PATCH] bcm43xx-mac80211: Set antenna gains if not in sprom Larry Finger
2007-08-03 21:38 ` Michael Buesch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.