Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH v4 32/34] wireless: make mac80211 select cfg80211
From: Johannes Berg @ 2009-08-15 12:15 UTC (permalink / raw)
  To: Gábor Stefanik
  Cc: Luis R. Rodriguez, linville, linux-wireless, Larry.Finger
In-Reply-To: <69e28c910908150512o68c51875j2dc644e9c5ce3359@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

[please trim your quotes]

On Sat, 2009-08-15 at 14:12 +0200, Gábor Stefanik wrote:

> > NAK this change, because with it, it's possible to select
> > mac80211 = Y
> > -> cfg80211 = Y
> > while rfkill = M

> Why not make cfg80211 select rfkill?

Because it doesn't require it. See net/wireless/Kconfig.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [PATCH] p54: disable PS by default
From: Larry Finger @ 2009-08-15 19:59 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: wireless, John W. Linville, Johannes Berg
In-Reply-To: <200908141323.05936.chunkeey@web.de>

Christian Lamparter wrote:
> Johannes kindly pointed out that I completely missed a hunk in
> his patch: "[PATCH] cfg80211: allow driver to override PS default".
> 
> The driver must explicitly set ps_default to false,
> as the setting is pre-filled with the kconfig default.
> 
> Signed-off-by: Christian Lamparter <chunkeey@web.de>
> ---

With this patch, I no longer see the disconnects. ACK.

Larry


^ permalink raw reply

* Re: [PATCH v4 10/34] wireless: group Broadcom drivers on kconfig
From: Luis R. Rodriguez @ 2009-08-15 22:05 UTC (permalink / raw)
  To: Gábor Stefanik
  Cc: linville, linux-wireless, Larry.Finger, Michael Buesch,
	Johannes Berg
In-Reply-To: <69e28c910908150509i158bf2a6r33de5899cdc8bd13@mail.gmail.com>

2009/8/15 Gábor Stefanik <netrolller.3d@gmail.com>:
> On Fri, Aug 14, 2009 at 10:25 PM, Luis R.
> Rodriguez<lrodriguez@atheros.com> wrote:
>> This moves Broadcom wireless drivers into their own menu.
>> There are only 2 Broadcom specific drivers so we group
>> them into a menu which can expand. Although rndis_wlan
>> also supports Broadcom devices, RNDIS is a spec and other
>> vendors could technically implement solutions with it
>> as well so we keep that separate as users most likely
>> won't look for those devices under a Broadcom tag.
>>
>> Cc: Michael Buesch <mb@bu3sch.de>
>> Cc: Gábor Stefanik <netrolller.3d@gmail.com>
>> Cc: Johannes Berg <johannes@sipsolutions.net>
>> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
>> ---
>>  drivers/net/wireless/Kconfig |   13 +++++++++++++
>>  1 files changed, 13 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
>> index c2e88dc..150565d 100644
>> --- a/drivers/net/wireless/Kconfig
>> +++ b/drivers/net/wireless/Kconfig
>> @@ -561,8 +561,21 @@ source "drivers/net/wireless/iwmc3200wifi/Kconfig"
>>  endif # INTEL_80211
>>
>>  source "drivers/net/wireless/hostap/Kconfig"
>> +
>> +config BROADCOM_80211
>> +       bool "Broadcom"
>> +       depends on WLAN_80211
>> +       ---help---
>> +         This will enable the support for Broadcom wireless drivers. This
>> +         includes b43 driver, b43legacy driver and the rndis_wlan driver.
>
> NAK. Again, rndis_wlan is Microsoft, not Broadcom.

Yes, the patch does not group rndis with broadcom, please re-read the patch.

  Luis

^ permalink raw reply

* Re: [PATCH v4 23/34] wireless: downgrade TI driver from menuconfig to config
From: Luis R. Rodriguez @ 2009-08-15 22:07 UTC (permalink / raw)
  To: Gábor Stefanik; +Cc: linville, linux-wireless, Larry.Finger, Kalle Valo
In-Reply-To: <69e28c910908150513v10a4ad8dh8f40fe8fbff2a533@mail.gmail.com>

2009/8/15 Gábor Stefanik <netrolller.3d@gmail.com>:
> On Fri, Aug 14, 2009 at 10:25 PM, Luis R.
> Rodriguez<lrodriguez@atheros.com> wrote:
>> There's only a few options here so let this expand upon
>> selection.
>>
>> Cc: Kalle Valo <kalle.valo@nokia.com>
>> Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
>> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
>> ---
>>  drivers/net/wireless/wl12xx/Kconfig |    6 +++++-
>>  1 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/wireless/wl12xx/Kconfig b/drivers/net/wireless/wl12xx/Kconfig
>> index 1818e45..78029fd 100644
>> --- a/drivers/net/wireless/wl12xx/Kconfig
>> +++ b/drivers/net/wireless/wl12xx/Kconfig
>> @@ -1,10 +1,12 @@
>> -menuconfig WL12XX
>> +config WL12XX
>>        boolean "TI wl12xx driver support"
>>        depends on MAC80211 && EXPERIMENTAL
>>        ---help---
>>          This will enable TI wl12xx driver support. The drivers make
>>          use of the mac80211 stack.
>>
>> +if WL12XX
>> +
>>  config WL1251
>>        tristate "TI wl1251 support"
>>        depends on WL12XX && GENERIC_HARDIRQS
>
> If "if WL12XX", then no need to depend on WL12XX.

True!

  Luis

^ permalink raw reply

* [PATCH] b43: LP-PHY: Update baseband init for recent spec changes
From: Gábor Stefanik @ 2009-08-15 22:57 UTC (permalink / raw)
  To: John Linville, Michael Buesch, Larry Finger
  Cc: Mark Huijgen, Broadcom Wireless, linux-wireless

The spec had some nasty typos, and a large part of the rev0/1 BB
init procedure was also missing. Fix these.

Also make the init-time channel switch debuggable.

(The change from -EINVAL to -EIO is simply to make it possible
to distinguish the PLL charge pump error from a channel-not-found
error.)

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
 drivers/net/wireless/b43/phy_lp.c |   71 ++++++++++++++++++++++++++++++++++---
 1 files changed, 66 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 3872a31..72e1d8c 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -204,8 +204,61 @@ static void lpphy_table_init(struct b43_wldev *dev)
 static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
 {
 	struct ssb_bus *bus = dev->dev->bus;
+	struct b43_phy_lp *lpphy = dev->phy.lp;
 	u16 tmp, tmp2;
 
+	b43_phy_mask(dev, B43_LPPHY_AFE_DAC_CTL, 0xF7FF);
+	b43_phy_write(dev, B43_LPPHY_AFE_CTL, 0);
+	b43_phy_write(dev, B43_LPPHY_AFE_CTL_OVR, 0);
+	b43_phy_write(dev, B43_LPPHY_RF_OVERRIDE_0, 0);
+	b43_phy_write(dev, B43_LPPHY_RF_OVERRIDE_2, 0);
+	b43_phy_set(dev, B43_LPPHY_AFE_DAC_CTL, 0x0004);
+	b43_phy_maskset(dev, B43_LPPHY_OFDMSYNCTHRESH0, 0xFF00, 0x0078);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0x83FF, 0x5800);
+	b43_phy_write(dev, B43_LPPHY_ADC_COMPENSATION_CTL, 0x0016);
+	b43_phy_maskset(dev, B43_LPPHY_AFE_ADC_CTL_0, 0xFFF8, 0x0004);
+	b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0x00FF, 0x5400);
+	b43_phy_maskset(dev, B43_LPPHY_HIGAINDB, 0x00FF, 0x2400);
+	b43_phy_maskset(dev, B43_LPPHY_LOWGAINDB, 0x00FF, 0x2100);
+	b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0xFF00, 0x0006);
+	b43_phy_mask(dev, B43_LPPHY_RX_RADIO_CTL, 0xFFFE);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFFE0, 0x0005);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFC10, 0x0180);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0x83FF, 0x3800);
+	b43_phy_maskset(dev, B43_LPPHY_GAINDIRECTMISMATCH, 0xFFF0, 0x0005);
+	b43_phy_maskset(dev, B43_LPPHY_GAIN_MISMATCH_LIMIT, 0xFFC0, 0x001A);
+	b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0xFF00, 0x00B3);
+	b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0x00FF, 0xAD00);
+	b43_phy_maskset(dev, B43_LPPHY_INPUT_PWRDB,
+			0xFF00, lpphy->rx_pwr_offset);
+	if ((bus->sprom.boardflags_lo & B43_BFL_FEM) &&
+	   ((b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) ||
+	   (bus->sprom.boardflags_hi & B43_BFH_PAREF))) {
+		/* TODO:
+		 * Set the LDO voltage to 0x0028 - FIXME: What is this?
+		 * Call sb_pmu_set_ldo_voltage with 4 and the LDO voltage
+		 * 	as arguments
+		 * Call sb_pmu_paref_ldo_enable with argument TRUE
+		 */
+		if (dev->phy.rev == 0)
+		       	b43_phy_maskset(dev, B43_LPPHY_LP_RF_SIGNAL_LUT,
+					0xFFCF, 0x0010);
+		b43_lptab_write(dev, B43_LPTAB16(11, 7), 60);
+	} else {
+		//TODO: Call ssb_pmu_paref_ldo_enable with argument FALSE
+		b43_phy_maskset(dev, B43_LPPHY_LP_RF_SIGNAL_LUT,
+				0xFFCF, 0x0020);
+		b43_lptab_write(dev, B43_LPTAB16(11, 7), 100);
+	}
+	tmp = lpphy->rssi_vf | lpphy->rssi_vc << 4 | 0xA000;
+	b43_phy_write(dev, B43_LPPHY_AFE_RSSI_CTL_0, tmp);
+	if (bus->sprom.boardflags_hi & B43_BFH_RSSIINV)
+		b43_phy_maskset(dev, B43_LPPHY_AFE_RSSI_CTL_1, 0xF000, 0x0AAA);
+	else
+		b43_phy_maskset(dev, B43_LPPHY_AFE_RSSI_CTL_1, 0xF000, 0x02AA);
+	b43_lptab_write(dev, B43_LPTAB16(11, 1), 24);
+	b43_phy_maskset(dev, B43_LPPHY_RX_RADIO_CTL,
+			0xFFF9, (lpphy->bx_arch << 1));
 	if (dev->phy.rev == 1 &&
 	   (bus->sprom.boardflags_hi & B43_BFH_FEM_BT)) {
 		b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xFFC0, 0x000A);
@@ -255,7 +308,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
 		b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xFFC0, 0x0006);
 		b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xC0FF, 0x0700);
 	}
-	if (dev->phy.rev == 1) {
+	if (dev->phy.rev == 1 && (bus->sprom.boardflags_hi & B43_BFH_PAREF)) {
 		b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_5, B43_LPPHY_TR_LOOKUP_1);
 		b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_6, B43_LPPHY_TR_LOOKUP_2);
 		b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_7, B43_LPPHY_TR_LOOKUP_3);
@@ -267,6 +320,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
 		b43_phy_set(dev, B43_LPPHY_CRSGAIN_CTL, 0x0006);
 		b43_phy_write(dev, B43_LPPHY_GPIO_SELECT, 0x0005);
 		b43_phy_write(dev, B43_LPPHY_GPIO_OUTEN, 0xFFFF);
+		//FIXME the Broadcom driver caches & delays this HF write!
 		b43_hf_write(dev, b43_hf_read(dev) | B43_HF_PR45960W);
 	}
 	if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
@@ -384,7 +438,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
 	b43_phy_maskset(dev, B43_LPPHY_PWR_THRESH1, 0xFFF0, 0x9);
 	b43_phy_mask(dev, B43_LPPHY_GAINDIRECTMISMATCH, ~0xF);
 	b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0x00FF, 0x5500);
-	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xF81F, 0xA0);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFC1F, 0xA0);
 	b43_phy_maskset(dev, B43_LPPHY_GAINDIRECTMISMATCH, 0xE0FF, 0x300);
 	b43_phy_maskset(dev, B43_LPPHY_HIGAINDB, 0x00FF, 0x2A00);
 	if ((bus->chip_id == 0x4325) && (bus->chip_rev == 0)) {
@@ -405,7 +459,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
 	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFFE0, 0x12);
 	b43_phy_maskset(dev, B43_LPPHY_GAINMISMATCH, 0x0FFF, 0x9000);
 
-	if ((bus->chip_id == 0x4325) && (bus->chip_rev == 1)) {
+	if ((bus->chip_id == 0x4325) && (bus->chip_rev == 0)) {
 		b43_lptab_write(dev, B43_LPTAB16(0x08, 0x14), 0);
 		b43_lptab_write(dev, B43_LPTAB16(0x08, 0x12), 0x40);
 	}
@@ -416,6 +470,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
 		b43_phy_maskset(dev, B43_LPPHY_SYNCPEAKCNT, 0xFFF8, 0x6);
 		b43_phy_maskset(dev, B43_LPPHY_MINPWR_LEVEL, 0x00FF, 0x9D00);
 		b43_phy_maskset(dev, B43_LPPHY_MINPWR_LEVEL, 0xFF00, 0xA1);
+		b43_phy_mask(dev, B43_LPPHY_IDLEAFTERPKTRXTO, 0x00FF);
 	} else /* 5GHz */
 		b43_phy_mask(dev, B43_LPPHY_CRSGAIN_CTL, ~0x40);
 
@@ -1883,7 +1938,7 @@ static int lpphy_b2062_tune(struct b43_wldev *dev,
 		lpphy_b2062_reset_pll_bias(dev);
 		lpphy_b2062_vco_calib(dev);
 		if (b43_radio_read(dev, B2062_S_RFPLL_CTL3) & 0x10)
-			err = -EINVAL;
+			err = -EIO;
 	}
 
 	b43_radio_mask(dev, B2062_S_RFPLL_CTL14, ~0x04);
@@ -2068,11 +2123,17 @@ static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
 
 static int b43_lpphy_op_init(struct b43_wldev *dev)
 {
+	int err;
+	
 	lpphy_read_band_sprom(dev); //FIXME should this be in prepare_structs?
 	lpphy_baseband_init(dev);
 	lpphy_radio_init(dev);
 	lpphy_calibrate_rc(dev);
-	b43_lpphy_op_switch_channel(dev, b43_lpphy_op_get_default_chan(dev));
+	err = b43_lpphy_op_switch_channel(dev,
+				b43_lpphy_op_get_default_chan(dev));
+	if (err)
+		b43dbg(dev->wl, "Switch to init channel failed, error = %d.\n",
+		       err);
 	lpphy_tx_pctl_init(dev);
 	lpphy_calibration(dev);
 	//TODO ACI init
-- 
1.6.2.4




^ permalink raw reply related

* [PATCH v2] b43: LP-PHY: Update baseband init for recent spec changes
From: Gábor Stefanik @ 2009-08-15 23:05 UTC (permalink / raw)
  To: John Linville, Michael Buesch, Larry Finger
  Cc: Mark Huijgen, Broadcom Wireless, linux-wireless

The spec had some nasty typos, and a large part of the rev0/1 BB
init procedure was also missing. Fix these.

Also make the init-time channel switch debuggable.

(The change from -EINVAL to -EIO is simply to make it possible
to distinguish the PLL charge pump error from a channel-not-found
error.)

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
V2: Coding style fix suggested by Michael on IRC.

 drivers/net/wireless/b43/phy_lp.c |   72 ++++++++++++++++++++++++++++++++++---
 1 files changed, 67 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 3872a31..c7f6c75 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -204,8 +204,62 @@ static void lpphy_table_init(struct b43_wldev *dev)
 static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
 {
 	struct ssb_bus *bus = dev->dev->bus;
+	struct b43_phy_lp *lpphy = dev->phy.lp;
 	u16 tmp, tmp2;
 
+	b43_phy_mask(dev, B43_LPPHY_AFE_DAC_CTL, 0xF7FF);
+	b43_phy_write(dev, B43_LPPHY_AFE_CTL, 0);
+	b43_phy_write(dev, B43_LPPHY_AFE_CTL_OVR, 0);
+	b43_phy_write(dev, B43_LPPHY_RF_OVERRIDE_0, 0);
+	b43_phy_write(dev, B43_LPPHY_RF_OVERRIDE_2, 0);
+	b43_phy_set(dev, B43_LPPHY_AFE_DAC_CTL, 0x0004);
+	b43_phy_maskset(dev, B43_LPPHY_OFDMSYNCTHRESH0, 0xFF00, 0x0078);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0x83FF, 0x5800);
+	b43_phy_write(dev, B43_LPPHY_ADC_COMPENSATION_CTL, 0x0016);
+	b43_phy_maskset(dev, B43_LPPHY_AFE_ADC_CTL_0, 0xFFF8, 0x0004);
+	b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0x00FF, 0x5400);
+	b43_phy_maskset(dev, B43_LPPHY_HIGAINDB, 0x00FF, 0x2400);
+	b43_phy_maskset(dev, B43_LPPHY_LOWGAINDB, 0x00FF, 0x2100);
+	b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0xFF00, 0x0006);
+	b43_phy_mask(dev, B43_LPPHY_RX_RADIO_CTL, 0xFFFE);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFFE0, 0x0005);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFC10, 0x0180);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0x83FF, 0x3800);
+	b43_phy_maskset(dev, B43_LPPHY_GAINDIRECTMISMATCH, 0xFFF0, 0x0005);
+	b43_phy_maskset(dev, B43_LPPHY_GAIN_MISMATCH_LIMIT, 0xFFC0, 0x001A);
+	b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0xFF00, 0x00B3);
+	b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0x00FF, 0xAD00);
+	b43_phy_maskset(dev, B43_LPPHY_INPUT_PWRDB,
+			0xFF00, lpphy->rx_pwr_offset);
+	if ((bus->sprom.boardflags_lo & B43_BFL_FEM) &&
+	   ((b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) ||
+	   (bus->sprom.boardflags_hi & B43_BFH_PAREF))) {
+		/* TODO:
+		 * Set the LDO voltage to 0x0028 - FIXME: What is this?
+		 * Call sb_pmu_set_ldo_voltage with 4 and the LDO voltage
+		 * 	as arguments
+		 * Call sb_pmu_paref_ldo_enable with argument TRUE
+		 */
+		if (dev->phy.rev == 0) {
+		       	b43_phy_maskset(dev, B43_LPPHY_LP_RF_SIGNAL_LUT,
+					0xFFCF, 0x0010);
+		}
+		b43_lptab_write(dev, B43_LPTAB16(11, 7), 60);
+	} else {
+		//TODO: Call ssb_pmu_paref_ldo_enable with argument FALSE
+		b43_phy_maskset(dev, B43_LPPHY_LP_RF_SIGNAL_LUT,
+				0xFFCF, 0x0020);
+		b43_lptab_write(dev, B43_LPTAB16(11, 7), 100);
+	}
+	tmp = lpphy->rssi_vf | lpphy->rssi_vc << 4 | 0xA000;
+	b43_phy_write(dev, B43_LPPHY_AFE_RSSI_CTL_0, tmp);
+	if (bus->sprom.boardflags_hi & B43_BFH_RSSIINV)
+		b43_phy_maskset(dev, B43_LPPHY_AFE_RSSI_CTL_1, 0xF000, 0x0AAA);
+	else
+		b43_phy_maskset(dev, B43_LPPHY_AFE_RSSI_CTL_1, 0xF000, 0x02AA);
+	b43_lptab_write(dev, B43_LPTAB16(11, 1), 24);
+	b43_phy_maskset(dev, B43_LPPHY_RX_RADIO_CTL,
+			0xFFF9, (lpphy->bx_arch << 1));
 	if (dev->phy.rev == 1 &&
 	   (bus->sprom.boardflags_hi & B43_BFH_FEM_BT)) {
 		b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xFFC0, 0x000A);
@@ -255,7 +309,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
 		b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xFFC0, 0x0006);
 		b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xC0FF, 0x0700);
 	}
-	if (dev->phy.rev == 1) {
+	if (dev->phy.rev == 1 && (bus->sprom.boardflags_hi & B43_BFH_PAREF)) {
 		b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_5, B43_LPPHY_TR_LOOKUP_1);
 		b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_6, B43_LPPHY_TR_LOOKUP_2);
 		b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_7, B43_LPPHY_TR_LOOKUP_3);
@@ -267,6 +321,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
 		b43_phy_set(dev, B43_LPPHY_CRSGAIN_CTL, 0x0006);
 		b43_phy_write(dev, B43_LPPHY_GPIO_SELECT, 0x0005);
 		b43_phy_write(dev, B43_LPPHY_GPIO_OUTEN, 0xFFFF);
+		//FIXME the Broadcom driver caches & delays this HF write!
 		b43_hf_write(dev, b43_hf_read(dev) | B43_HF_PR45960W);
 	}
 	if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
@@ -384,7 +439,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
 	b43_phy_maskset(dev, B43_LPPHY_PWR_THRESH1, 0xFFF0, 0x9);
 	b43_phy_mask(dev, B43_LPPHY_GAINDIRECTMISMATCH, ~0xF);
 	b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0x00FF, 0x5500);
-	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xF81F, 0xA0);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFC1F, 0xA0);
 	b43_phy_maskset(dev, B43_LPPHY_GAINDIRECTMISMATCH, 0xE0FF, 0x300);
 	b43_phy_maskset(dev, B43_LPPHY_HIGAINDB, 0x00FF, 0x2A00);
 	if ((bus->chip_id == 0x4325) && (bus->chip_rev == 0)) {
@@ -405,7 +460,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
 	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFFE0, 0x12);
 	b43_phy_maskset(dev, B43_LPPHY_GAINMISMATCH, 0x0FFF, 0x9000);
 
-	if ((bus->chip_id == 0x4325) && (bus->chip_rev == 1)) {
+	if ((bus->chip_id == 0x4325) && (bus->chip_rev == 0)) {
 		b43_lptab_write(dev, B43_LPTAB16(0x08, 0x14), 0);
 		b43_lptab_write(dev, B43_LPTAB16(0x08, 0x12), 0x40);
 	}
@@ -416,6 +471,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
 		b43_phy_maskset(dev, B43_LPPHY_SYNCPEAKCNT, 0xFFF8, 0x6);
 		b43_phy_maskset(dev, B43_LPPHY_MINPWR_LEVEL, 0x00FF, 0x9D00);
 		b43_phy_maskset(dev, B43_LPPHY_MINPWR_LEVEL, 0xFF00, 0xA1);
+		b43_phy_mask(dev, B43_LPPHY_IDLEAFTERPKTRXTO, 0x00FF);
 	} else /* 5GHz */
 		b43_phy_mask(dev, B43_LPPHY_CRSGAIN_CTL, ~0x40);
 
@@ -1883,7 +1939,7 @@ static int lpphy_b2062_tune(struct b43_wldev *dev,
 		lpphy_b2062_reset_pll_bias(dev);
 		lpphy_b2062_vco_calib(dev);
 		if (b43_radio_read(dev, B2062_S_RFPLL_CTL3) & 0x10)
-			err = -EINVAL;
+			err = -EIO;
 	}
 
 	b43_radio_mask(dev, B2062_S_RFPLL_CTL14, ~0x04);
@@ -2068,11 +2124,17 @@ static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
 
 static int b43_lpphy_op_init(struct b43_wldev *dev)
 {
+	int err;
+	
 	lpphy_read_band_sprom(dev); //FIXME should this be in prepare_structs?
 	lpphy_baseband_init(dev);
 	lpphy_radio_init(dev);
 	lpphy_calibrate_rc(dev);
-	b43_lpphy_op_switch_channel(dev, b43_lpphy_op_get_default_chan(dev));
+	err = b43_lpphy_op_switch_channel(dev,
+				b43_lpphy_op_get_default_chan(dev));
+	if (err)
+		b43dbg(dev->wl, "Switch to init channel failed, error = %d.\n",
+		       err);
 	lpphy_tx_pctl_init(dev);
 	lpphy_calibration(dev);
 	//TODO ACI init
-- 
1.6.2.4




^ permalink raw reply related

* Re: [PATCH v2] b43: LP-PHY: Update baseband init for recent spec changes
From: Michael Buesch @ 2009-08-15 23:07 UTC (permalink / raw)
  To: Gábor Stefanik
  Cc: John Linville, Larry Finger, Mark Huijgen, Broadcom Wireless,
	linux-wireless
In-Reply-To: <4A873F20.4020705@gmail.com>

On Sunday 16 August 2009 01:05:04 Gábor Stefanik wrote:
> The spec had some nasty typos, and a large part of the rev0/1 BB
> init procedure was also missing. Fix these.
> 
> Also make the init-time channel switch debuggable.
> 
> (The change from -EINVAL to -EIO is simply to make it possible
> to distinguish the PLL charge pump error from a channel-not-found
> error.)
> 
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> V2: Coding style fix suggested by Michael on IRC.

> +	if (err)
> +		b43dbg(dev->wl, "Switch to init channel failed, error = %d.\n",
> +		       err);

Here's still one, but otherwise acked.

-- 
Greetings, Michael.

^ permalink raw reply

* [PATCH v3] b43: LP-PHY: Update baseband init for recent spec changes
From: Gábor Stefanik @ 2009-08-15 23:15 UTC (permalink / raw)
  To: John Linville, Michael Buesch, Larry Finger
  Cc: Mark Huijgen, Broadcom Wireless, linux-wireless

The spec had some nasty typos, and a large part of the rev0/1 BB
init procedure was also missing. Fix these.

Also make the init-time channel switch debuggable.

(The change from -EINVAL to -EIO is simply to make it possible
to distinguish the PLL charge pump error from a channel-not-found
error.)

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
V2: Coding style fix suggested by Michael on IRC.
V3: Another coding style fix.

 drivers/net/wireless/b43/phy_lp.c |   73 ++++++++++++++++++++++++++++++++++---
 1 files changed, 68 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 3872a31..e4a040b 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -204,8 +204,62 @@ static void lpphy_table_init(struct b43_wldev *dev)
 static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
 {
 	struct ssb_bus *bus = dev->dev->bus;
+	struct b43_phy_lp *lpphy = dev->phy.lp;
 	u16 tmp, tmp2;
 
+	b43_phy_mask(dev, B43_LPPHY_AFE_DAC_CTL, 0xF7FF);
+	b43_phy_write(dev, B43_LPPHY_AFE_CTL, 0);
+	b43_phy_write(dev, B43_LPPHY_AFE_CTL_OVR, 0);
+	b43_phy_write(dev, B43_LPPHY_RF_OVERRIDE_0, 0);
+	b43_phy_write(dev, B43_LPPHY_RF_OVERRIDE_2, 0);
+	b43_phy_set(dev, B43_LPPHY_AFE_DAC_CTL, 0x0004);
+	b43_phy_maskset(dev, B43_LPPHY_OFDMSYNCTHRESH0, 0xFF00, 0x0078);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0x83FF, 0x5800);
+	b43_phy_write(dev, B43_LPPHY_ADC_COMPENSATION_CTL, 0x0016);
+	b43_phy_maskset(dev, B43_LPPHY_AFE_ADC_CTL_0, 0xFFF8, 0x0004);
+	b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0x00FF, 0x5400);
+	b43_phy_maskset(dev, B43_LPPHY_HIGAINDB, 0x00FF, 0x2400);
+	b43_phy_maskset(dev, B43_LPPHY_LOWGAINDB, 0x00FF, 0x2100);
+	b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0xFF00, 0x0006);
+	b43_phy_mask(dev, B43_LPPHY_RX_RADIO_CTL, 0xFFFE);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFFE0, 0x0005);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFC10, 0x0180);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0x83FF, 0x3800);
+	b43_phy_maskset(dev, B43_LPPHY_GAINDIRECTMISMATCH, 0xFFF0, 0x0005);
+	b43_phy_maskset(dev, B43_LPPHY_GAIN_MISMATCH_LIMIT, 0xFFC0, 0x001A);
+	b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0xFF00, 0x00B3);
+	b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0x00FF, 0xAD00);
+	b43_phy_maskset(dev, B43_LPPHY_INPUT_PWRDB,
+			0xFF00, lpphy->rx_pwr_offset);
+	if ((bus->sprom.boardflags_lo & B43_BFL_FEM) &&
+	   ((b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) ||
+	   (bus->sprom.boardflags_hi & B43_BFH_PAREF))) {
+		/* TODO:
+		 * Set the LDO voltage to 0x0028 - FIXME: What is this?
+		 * Call sb_pmu_set_ldo_voltage with 4 and the LDO voltage
+		 * 	as arguments
+		 * Call sb_pmu_paref_ldo_enable with argument TRUE
+		 */
+		if (dev->phy.rev == 0) {
+		       	b43_phy_maskset(dev, B43_LPPHY_LP_RF_SIGNAL_LUT,
+					0xFFCF, 0x0010);
+		}
+		b43_lptab_write(dev, B43_LPTAB16(11, 7), 60);
+	} else {
+		//TODO: Call ssb_pmu_paref_ldo_enable with argument FALSE
+		b43_phy_maskset(dev, B43_LPPHY_LP_RF_SIGNAL_LUT,
+				0xFFCF, 0x0020);
+		b43_lptab_write(dev, B43_LPTAB16(11, 7), 100);
+	}
+	tmp = lpphy->rssi_vf | lpphy->rssi_vc << 4 | 0xA000;
+	b43_phy_write(dev, B43_LPPHY_AFE_RSSI_CTL_0, tmp);
+	if (bus->sprom.boardflags_hi & B43_BFH_RSSIINV)
+		b43_phy_maskset(dev, B43_LPPHY_AFE_RSSI_CTL_1, 0xF000, 0x0AAA);
+	else
+		b43_phy_maskset(dev, B43_LPPHY_AFE_RSSI_CTL_1, 0xF000, 0x02AA);
+	b43_lptab_write(dev, B43_LPTAB16(11, 1), 24);
+	b43_phy_maskset(dev, B43_LPPHY_RX_RADIO_CTL,
+			0xFFF9, (lpphy->bx_arch << 1));
 	if (dev->phy.rev == 1 &&
 	   (bus->sprom.boardflags_hi & B43_BFH_FEM_BT)) {
 		b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xFFC0, 0x000A);
@@ -255,7 +309,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
 		b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xFFC0, 0x0006);
 		b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xC0FF, 0x0700);
 	}
-	if (dev->phy.rev == 1) {
+	if (dev->phy.rev == 1 && (bus->sprom.boardflags_hi & B43_BFH_PAREF)) {
 		b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_5, B43_LPPHY_TR_LOOKUP_1);
 		b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_6, B43_LPPHY_TR_LOOKUP_2);
 		b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_7, B43_LPPHY_TR_LOOKUP_3);
@@ -267,6 +321,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
 		b43_phy_set(dev, B43_LPPHY_CRSGAIN_CTL, 0x0006);
 		b43_phy_write(dev, B43_LPPHY_GPIO_SELECT, 0x0005);
 		b43_phy_write(dev, B43_LPPHY_GPIO_OUTEN, 0xFFFF);
+		//FIXME the Broadcom driver caches & delays this HF write!
 		b43_hf_write(dev, b43_hf_read(dev) | B43_HF_PR45960W);
 	}
 	if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
@@ -384,7 +439,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
 	b43_phy_maskset(dev, B43_LPPHY_PWR_THRESH1, 0xFFF0, 0x9);
 	b43_phy_mask(dev, B43_LPPHY_GAINDIRECTMISMATCH, ~0xF);
 	b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0x00FF, 0x5500);
-	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xF81F, 0xA0);
+	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFC1F, 0xA0);
 	b43_phy_maskset(dev, B43_LPPHY_GAINDIRECTMISMATCH, 0xE0FF, 0x300);
 	b43_phy_maskset(dev, B43_LPPHY_HIGAINDB, 0x00FF, 0x2A00);
 	if ((bus->chip_id == 0x4325) && (bus->chip_rev == 0)) {
@@ -405,7 +460,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
 	b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFFE0, 0x12);
 	b43_phy_maskset(dev, B43_LPPHY_GAINMISMATCH, 0x0FFF, 0x9000);
 
-	if ((bus->chip_id == 0x4325) && (bus->chip_rev == 1)) {
+	if ((bus->chip_id == 0x4325) && (bus->chip_rev == 0)) {
 		b43_lptab_write(dev, B43_LPTAB16(0x08, 0x14), 0);
 		b43_lptab_write(dev, B43_LPTAB16(0x08, 0x12), 0x40);
 	}
@@ -416,6 +471,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
 		b43_phy_maskset(dev, B43_LPPHY_SYNCPEAKCNT, 0xFFF8, 0x6);
 		b43_phy_maskset(dev, B43_LPPHY_MINPWR_LEVEL, 0x00FF, 0x9D00);
 		b43_phy_maskset(dev, B43_LPPHY_MINPWR_LEVEL, 0xFF00, 0xA1);
+		b43_phy_mask(dev, B43_LPPHY_IDLEAFTERPKTRXTO, 0x00FF);
 	} else /* 5GHz */
 		b43_phy_mask(dev, B43_LPPHY_CRSGAIN_CTL, ~0x40);
 
@@ -1883,7 +1939,7 @@ static int lpphy_b2062_tune(struct b43_wldev *dev,
 		lpphy_b2062_reset_pll_bias(dev);
 		lpphy_b2062_vco_calib(dev);
 		if (b43_radio_read(dev, B2062_S_RFPLL_CTL3) & 0x10)
-			err = -EINVAL;
+			err = -EIO;
 	}
 
 	b43_radio_mask(dev, B2062_S_RFPLL_CTL14, ~0x04);
@@ -2068,11 +2124,18 @@ static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
 
 static int b43_lpphy_op_init(struct b43_wldev *dev)
 {
+	int err;
+	
 	lpphy_read_band_sprom(dev); //FIXME should this be in prepare_structs?
 	lpphy_baseband_init(dev);
 	lpphy_radio_init(dev);
 	lpphy_calibrate_rc(dev);
-	b43_lpphy_op_switch_channel(dev, b43_lpphy_op_get_default_chan(dev));
+	err = b43_lpphy_op_switch_channel(dev,
+				b43_lpphy_op_get_default_chan(dev));
+	if (err) {
+		b43dbg(dev->wl, "Switch to init channel failed, error = %d.\n",
+		       err);
+	}
 	lpphy_tx_pctl_init(dev);
 	lpphy_calibration(dev);
 	//TODO ACI init
-- 
1.6.2.4




^ permalink raw reply related

* [PATCH] cfg80211: fix deadlock
From: Johannes Berg @ 2009-08-16 11:32 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Christian Lamparter

When removing an interface with nl80211, cfg80211 will
deadlock in the netdev notifier because we're already
holding rdev->mtx and try to acquire it again to verify
the scan has been done.

This bug was introduced by my patch
"cfg80211: check for and abort dangling scan requests".

To fix this, move the dangling scan request check into
wiphy_unregister(). This will not be able to catch all
cases right away, but if the scan problem happens with
a manual ifdown or so it will be possible to remedy it
by removing the module/device.

Additionally, add comments about the deadlock scenario.

Reported-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/wireless/core.c |   32 +++++++++++++++++++-------------
 1 file changed, 19 insertions(+), 13 deletions(-)

--- wireless-testing.orig/net/wireless/core.c	2009-08-16 13:22:52.000000000 +0200
+++ wireless-testing/net/wireless/core.c	2009-08-16 13:28:12.000000000 +0200
@@ -586,9 +586,15 @@ void wiphy_unregister(struct wiphy *wiph
 	 * get to lock contention here if userspace issues a command
 	 * that identified the hardware by wiphy index.
 	 */
-	mutex_lock(&rdev->mtx);
-	/* unlock again before freeing */
-	mutex_unlock(&rdev->mtx);
+	cfg80211_lock_rdev(rdev);
+
+	if (WARN_ON(rdev->scan_req)) {
+		rdev->scan_req->aborted = true;
+		___cfg80211_scan_done(rdev);
+	}
+
+	cfg80211_unlock_rdev(rdev);
+	flush_work(&rdev->scan_done_wk);
 
 	cfg80211_debugfs_rdev_del(rdev);
 
@@ -603,9 +609,7 @@ void wiphy_unregister(struct wiphy *wiph
 
 	mutex_unlock(&cfg80211_mutex);
 
-	flush_work(&rdev->scan_done_wk);
 	cancel_work_sync(&rdev->conn_work);
-	kfree(rdev->scan_req);
 	flush_work(&rdev->event_work);
 }
 EXPORT_SYMBOL(wiphy_unregister);
@@ -653,6 +657,11 @@ static int cfg80211_netdev_notifier_call
 
 	switch (state) {
 	case NETDEV_REGISTER:
+		/*
+		 * NB: cannot take rdev->mtx here because this may be
+		 * called within code protected by it when interfaces
+		 * are added with nl80211.
+		 */
 		mutex_init(&wdev->mtx);
 		INIT_LIST_HEAD(&wdev->event_list);
 		spin_lock_init(&wdev->event_lock);
@@ -730,13 +739,11 @@ static int cfg80211_netdev_notifier_call
 #endif
 		break;
 	case NETDEV_UNREGISTER:
-		cfg80211_lock_rdev(rdev);
-
-		if (WARN_ON(rdev->scan_req && rdev->scan_req->dev == dev)) {
-			rdev->scan_req->aborted = true;
-			___cfg80211_scan_done(rdev);
-		}
-
+		/*
+		 * NB: cannot take rdev->mtx here because this may be
+		 * called within code protected by it when interfaces
+		 * are removed with nl80211.
+		 */
 		mutex_lock(&rdev->devlist_mtx);
 		/*
 		 * It is possible to get NETDEV_UNREGISTER
@@ -755,7 +762,6 @@ static int cfg80211_netdev_notifier_call
 #endif
 		}
 		mutex_unlock(&rdev->devlist_mtx);
-		cfg80211_unlock_rdev(rdev);
 		break;
 	case NETDEV_PRE_UP:
 		if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))



^ permalink raw reply

* Re: [PATCH] cfg80211: fix deadlock
From: Christian Lamparter @ 2009-08-16 11:59 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John Linville, linux-wireless
In-Reply-To: <1250422358.17522.0.camel@johannes.local>

On Sunday 16 August 2009 13:32:38 Johannes Berg wrote:
> When removing an interface with nl80211, cfg80211 will
> deadlock in the netdev notifier because we're already
> holding rdev->mtx and try to acquire it again to verify
> the scan has been done.
> 
> This bug was introduced by my patch
> "cfg80211: check for and abort dangling scan requests".
> 
> To fix this, move the dangling scan request check into
> wiphy_unregister(). This will not be able to catch all
> cases right away, but if the scan problem happens with
> a manual ifdown or so it will be possible to remedy it
> by removing the module/device.
> 
> Additionally, add comments about the deadlock scenario.
> 
> Reported-by: Christian Lamparter <chunkeey@web.de>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Christian Lamparter <chunkeey@web.de>
> ---
>  net/wireless/core.c |   32 +++++++++++++++++++-------------
>  1 file changed, 19 insertions(+), 13 deletions(-)
> 
> --- wireless-testing.orig/net/wireless/core.c	2009-08-16 13:22:52.000000000 +0200
> +++ wireless-testing/net/wireless/core.c	2009-08-16 13:28:12.000000000 +0200
> @@ -586,9 +586,15 @@ void wiphy_unregister(struct wiphy *wiph
>  	 * get to lock contention here if userspace issues a command
>  	 * that identified the hardware by wiphy index.
>  	 */
> -	mutex_lock(&rdev->mtx);
> -	/* unlock again before freeing */
> -	mutex_unlock(&rdev->mtx);
> +	cfg80211_lock_rdev(rdev);
> +
> +	if (WARN_ON(rdev->scan_req)) {
> +		rdev->scan_req->aborted = true;
> +		___cfg80211_scan_done(rdev);
> +	}
> +
> +	cfg80211_unlock_rdev(rdev);
> +	flush_work(&rdev->scan_done_wk);
>  
>  	cfg80211_debugfs_rdev_del(rdev);
>  
> @@ -603,9 +609,7 @@ void wiphy_unregister(struct wiphy *wiph
>  
>  	mutex_unlock(&cfg80211_mutex);
>  
> -	flush_work(&rdev->scan_done_wk);
>  	cancel_work_sync(&rdev->conn_work);
> -	kfree(rdev->scan_req);
>  	flush_work(&rdev->event_work);
>  }
>  EXPORT_SYMBOL(wiphy_unregister);
> @@ -653,6 +657,11 @@ static int cfg80211_netdev_notifier_call
>  
>  	switch (state) {
>  	case NETDEV_REGISTER:
> +		/*
> +		 * NB: cannot take rdev->mtx here because this may be
> +		 * called within code protected by it when interfaces
> +		 * are added with nl80211.
> +		 */
>  		mutex_init(&wdev->mtx);
>  		INIT_LIST_HEAD(&wdev->event_list);
>  		spin_lock_init(&wdev->event_lock);
> @@ -730,13 +739,11 @@ static int cfg80211_netdev_notifier_call
>  #endif
>  		break;
>  	case NETDEV_UNREGISTER:
> -		cfg80211_lock_rdev(rdev);
> -
> -		if (WARN_ON(rdev->scan_req && rdev->scan_req->dev == dev)) {
> -			rdev->scan_req->aborted = true;
> -			___cfg80211_scan_done(rdev);
> -		}
> -
> +		/*
> +		 * NB: cannot take rdev->mtx here because this may be
> +		 * called within code protected by it when interfaces
> +		 * are removed with nl80211.
> +		 */
>  		mutex_lock(&rdev->devlist_mtx);
>  		/*
>  		 * It is possible to get NETDEV_UNREGISTER
> @@ -755,7 +762,6 @@ static int cfg80211_netdev_notifier_call
>  #endif
>  		}
>  		mutex_unlock(&rdev->devlist_mtx);
> -		cfg80211_unlock_rdev(rdev);
>  		break;
>  	case NETDEV_PRE_UP:
>  		if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
> 
> 

^ permalink raw reply

* Re: [PATCH v4 10/34] wireless: group Broadcom drivers on kconfig
From: Gábor Stefanik @ 2009-08-16 13:15 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: linville, linux-wireless, Larry.Finger, Michael Buesch,
	Johannes Berg
In-Reply-To: <43e72e890908151505s6cd9fea0p722de5a781a8ba8b@mail.gmail.com>

2009/8/16 Luis R. Rodriguez <lrodriguez@atheros.com>:
> 2009/8/15 Gábor Stefanik <netrolller.3d@gmail.com>:
>> On Fri, Aug 14, 2009 at 10:25 PM, Luis R.
>> Rodriguez<lrodriguez@atheros.com> wrote:
>>> This moves Broadcom wireless drivers into their own menu.
>>> There are only 2 Broadcom specific drivers so we group
>>> them into a menu which can expand. Although rndis_wlan
>>> also supports Broadcom devices, RNDIS is a spec and other
>>> vendors could technically implement solutions with it
>>> as well so we keep that separate as users most likely
>>> won't look for those devices under a Broadcom tag.
>>>
>>> Cc: Michael Buesch <mb@bu3sch.de>
>>> Cc: Gábor Stefanik <netrolller.3d@gmail.com>
>>> Cc: Johannes Berg <johannes@sipsolutions.net>
>>> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
>>> ---
>>>  drivers/net/wireless/Kconfig |   13 +++++++++++++
>>>  1 files changed, 13 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
>>> index c2e88dc..150565d 100644
>>> --- a/drivers/net/wireless/Kconfig
>>> +++ b/drivers/net/wireless/Kconfig
>>> @@ -561,8 +561,21 @@ source "drivers/net/wireless/iwmc3200wifi/Kconfig"
>>>  endif # INTEL_80211
>>>
>>>  source "drivers/net/wireless/hostap/Kconfig"
>>> +
>>> +config BROADCOM_80211
>>> +       bool "Broadcom"
>>> +       depends on WLAN_80211
>>> +       ---help---
>>> +         This will enable the support for Broadcom wireless drivers. This
>>> +         includes b43 driver, b43legacy driver and the rndis_wlan driver.
>>
>> NAK. Again, rndis_wlan is Microsoft, not Broadcom.
>
> Yes, the patch does not group rndis with broadcom, please re-read the patch.
>
>  Luis
>

But it does say "This includes b43 driver, b43legacy driver and the
rndis_wlan driver.", which is wrong.

-- 
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

^ permalink raw reply

* [PATCH] b43: LP-PHY: Update code for spec fixes, and fix a few typos
From: Gábor Stefanik @ 2009-08-16 13:26 UTC (permalink / raw)
  To: John Linville, Michael Buesch, Larry Finger
  Cc: Mark Huijgen, Broadcom Wireless, linux-wireless

A few typos have been discovered both in the specs in and our code.
This patch fixes them.

Also use lpphy_op_switch_channel consistently, and make all callers
print its return value for easier debugging.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
I think using a forward declaration is justified in this case;
as avoiding the forward decl would require moving around huge
blocks of code, completely breaking any logical ordering.

 drivers/net/wireless/b43/phy_lp.c |   51 ++++++++++++++++++++++++------------
 1 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index e4a040b..a51da6e 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -552,7 +552,7 @@ static void lpphy_2062_init(struct b43_wldev *dev)
 	B43_WARN_ON(!(bus->chipco.capabilities & SSB_CHIPCO_CAP_PMU));
 	B43_WARN_ON(crystalfreq == 0);
 
-	if (crystalfreq >= 30000000) {
+	if (crystalfreq <= 30000000) {
 		lpphy->pdiv = 1;
 		b43_radio_mask(dev, B2062_S_RFPLL_CTL1, 0xFFFB);
 	} else {
@@ -560,14 +560,16 @@ static void lpphy_2062_init(struct b43_wldev *dev)
 		b43_radio_set(dev, B2062_S_RFPLL_CTL1, 0x4);
 	}
 
-	tmp = (800000000 * lpphy->pdiv + crystalfreq) /
-	      (32000000 * lpphy->pdiv);
-	tmp = (tmp - 1) & 0xFF;
+	tmp = (((800000000 * lpphy->pdiv + crystalfreq) /
+	      (2 * crystalfreq)) - 8) & 0xFF;
+	b43_radio_write(dev, B2062_S_RFPLL_CTL7, tmp);
+
+	tmp = (((100 * crystalfreq + 16000000 * lpphy->pdiv) /
+	      (32000000 * lpphy->pdiv)) - 1) & 0xFF;
 	b43_radio_write(dev, B2062_S_RFPLL_CTL18, tmp);
 
-	tmp = (2 * crystalfreq + 1000000 * lpphy->pdiv) /
-	      (2000000 * lpphy->pdiv);
-	tmp = ((tmp & 0xFF) - 1) & 0xFFFF;
+	tmp = (((2 * crystalfreq + 1000000 * lpphy->pdiv) /
+	      (2000000 * lpphy->pdiv)) - 1) & 0xFF;
 	b43_radio_write(dev, B2062_S_RFPLL_CTL19, tmp);
 
 	ref = (1000 * lpphy->pdiv + 2 * crystalfreq) / (2000 * lpphy->pdiv);
@@ -671,7 +673,7 @@ static void lpphy_radio_init(struct b43_wldev *dev)
 	b43_phy_mask(dev, B43_LPPHY_FOURWIRE_CTL, 0xFFFD);
 	udelay(1);
 
-	if (dev->phy.rev < 2) {
+	if (dev->phy.radio_ver == 0x2062) {
 		lpphy_2062_init(dev);
 	} else {
 		lpphy_2063_init(dev);
@@ -688,11 +690,18 @@ struct lpphy_iq_est { u32 iq_prod, i_pwr, q_pwr; };
 
 static void lpphy_set_rc_cap(struct b43_wldev *dev)
 {
-	u8 rc_cap = dev->phy.lp->rc_cap;
+	struct b43_phy_lp *lpphy = dev->phy.lp;
 
-	b43_radio_write(dev, B2062_N_RXBB_CALIB2, max_t(u8, rc_cap-4, 0x80));
-	b43_radio_write(dev, B2062_N_TX_CTL_A, ((rc_cap & 0x1F) >> 1) | 0x80);
-	b43_radio_write(dev, B2062_S_RXG_CNT16, ((rc_cap & 0x1F) >> 2) | 0x80);
+	u8 rc_cap = (lpphy->rc_cap & 0x1F) >> 1;
+	
+	if (dev->phy.rev == 1) //FIXME check channel 14!
+		rc_cap = max_t(u8, rc_cap + 5, 15);
+
+	b43_radio_write(dev, B2062_N_RXBB_CALIB2,
+			max_t(u8, lpphy->rc_cap - 4, 0x80));
+	b43_radio_write(dev, B2062_N_TX_CTL_A, rc_cap | 0x80);
+	b43_radio_write(dev, B2062_S_RXG_CNT16,
+			((lpphy->rc_cap & 0x1F) >> 2) | 0x80);
 }
 
 static u8 lpphy_get_bb_mult(struct b43_wldev *dev)
@@ -1101,6 +1110,9 @@ static void lpphy_set_tx_power_control(struct b43_wldev *dev,
 	lpphy_write_tx_pctl_mode_to_hardware(dev);
 }
 
+static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
+				       unsigned int new_channel);
+
 static void lpphy_rev0_1_rc_calib(struct b43_wldev *dev)
 {
 	struct b43_phy_lp *lpphy = dev->phy.lp;
@@ -1118,11 +1130,16 @@ static void lpphy_rev0_1_rc_calib(struct b43_wldev *dev)
 	    old_rf2_ovr, old_rf2_ovrval, old_phy_ctl;
 	enum b43_lpphy_txpctl_mode old_txpctl;
 	u32 normal_pwr, ideal_pwr, mean_sq_pwr, tmp = 0, mean_sq_pwr_min = 0;
-	int loopback, i, j, inner_sum;
+	int loopback, i, j, inner_sum, err;
 
 	memset(&iq_est, 0, sizeof(iq_est));
 
-	b43_switch_channel(dev, 7);
+	err = b43_lpphy_op_switch_channel(dev, 7);
+	if (err) {
+		b43dbg(dev->wl,
+		       "RC calib: Failed to switch to channel 7, error = %d",
+		       err);
+	}
 	old_txg_ovr = (b43_phy_read(dev, B43_LPPHY_AFE_CTL_OVR) >> 6) & 1;
 	old_bbmult = lpphy_get_bb_mult(dev);
 	if (old_txg_ovr)
@@ -1881,14 +1898,14 @@ static int lpphy_b2062_tune(struct b43_wldev *dev,
 {
 	struct b43_phy_lp *lpphy = dev->phy.lp;
 	struct ssb_bus *bus = dev->dev->bus;
-	static const struct b206x_channel *chandata = NULL;
+	const struct b206x_channel *chandata = NULL;
 	u32 crystal_freq = bus->chipco.pmu.crystalfreq * 1000;
 	u32 tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9;
 	int i, err = 0;
 
-	for (i = 0; i < ARRAY_SIZE(b2063_chantbl); i++) {
+	for (i = 0; i < ARRAY_SIZE(b2062_chantbl); i++) {
 		if (b2063_chantbl[i].channel == channel) {
-			chandata = &b2063_chantbl[i];
+			chandata = &b2062_chantbl[i];
 			break;
 		}
 	}
-- 
1.6.2.4




^ permalink raw reply related

* [PATCH] b43: LP-PHY: Fix a spec error in the B2062 channel switch routine
From: Gábor Stefanik @ 2009-08-16 13:32 UTC (permalink / raw)
  To: John Linville, Michael Buesch, Larry Finger
  Cc: Mark Huijgen, Broadcom Wireless, linux-wireless

The channel switch routine had a whole instruction missing. Add it.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
 drivers/net/wireless/b43/phy_lp.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index a51da6e..3889519 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -1939,6 +1939,10 @@ static int lpphy_b2062_tune(struct b43_wldev *dev,
 	tmp5 = tmp7 * 0x100;
 	tmp6 = tmp5 / tmp4;
 	tmp7 = tmp5 % tmp4;
+	b43_radio_write(dev, B2062_S_RFPLL_CTL27, tmp6);
+	tmp5 = tmp7 * 0x100;
+	tmp6 = tmp5 / tmp4;
+	tmp7 = tmp5 % tmp4;
 	b43_radio_write(dev, B2062_S_RFPLL_CTL28, tmp6);
 	tmp5 = tmp7 * 0x100;
 	tmp6 = tmp5 / tmp4;
-- 
1.6.2.4




^ permalink raw reply related

* [RFT] Threaded IRQ handlers for b43
From: Michael Buesch @ 2009-08-16 13:39 UTC (permalink / raw)
  To: bcm43xx-dev; +Cc: linux-wireless

This request-for-test patch converts the b43 driver to use threaded
interrupt handlers. This is needed to support b43 on SDIO. But it also
simplifies the locking by removal of the wl->irq_lock spinlock.

http://bu3sch.de/patches/wireless-testing/20090816-1535/patches/002-b43-threaded-irq-handler.patch

A known regression is a new race between the interrupt handler and the
beacon update handler. But as long as you don't run AP mode, it won't hurt.
I'm working on a solution...

Please test this patch whether it creates other regressions (performance and crashes).

The patch also needs the following hack to the threaded IRQ code:
http://bu3sch.de/patches/wireless-testing/20090816-1535/patches/001-hack-threaded-irqs.patch

-- 
Greetings, Michael.

^ permalink raw reply

* Re: [PATCH] b43: LP-PHY: Update code for spec fixes, and fix a few typos
From: Michael Buesch @ 2009-08-16 13:42 UTC (permalink / raw)
  To: Gábor Stefanik
  Cc: John Linville, Larry Finger, Mark Huijgen, Broadcom Wireless,
	linux-wireless
In-Reply-To: <4A88090D.3070107@gmail.com>

On Sunday 16 August 2009 15:26:37 Gábor Stefanik wrote:
> A few typos have been discovered both in the specs in and our code.
> This patch fixes them.
> 
> Also use lpphy_op_switch_channel consistently, and make all callers
> print its return value for easier debugging.
> 
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> I think using a forward declaration is justified in this case;
> as avoiding the forward decl would require moving around huge
> blocks of code, completely breaking any logical ordering.

I don't think so, but I'll ack this anyway.

-- 
Greetings, Michael.

^ permalink raw reply

* Re: [PATCH] b43: LP-PHY: Fix a spec error in the B2062 channel switch routine
From: Michael Buesch @ 2009-08-16 13:43 UTC (permalink / raw)
  To: Gábor Stefanik
  Cc: John Linville, Larry Finger, Mark Huijgen, Broadcom Wireless,
	linux-wireless
In-Reply-To: <4A880A78.9050205@gmail.com>

On Sunday 16 August 2009 15:32:40 Gábor Stefanik wrote:
> The channel switch routine had a whole instruction missing. Add it.
> 
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>

ack

> ---
>  drivers/net/wireless/b43/phy_lp.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
> index a51da6e..3889519 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -1939,6 +1939,10 @@ static int lpphy_b2062_tune(struct b43_wldev *dev,
>  	tmp5 = tmp7 * 0x100;
>  	tmp6 = tmp5 / tmp4;
>  	tmp7 = tmp5 % tmp4;
> +	b43_radio_write(dev, B2062_S_RFPLL_CTL27, tmp6);
> +	tmp5 = tmp7 * 0x100;
> +	tmp6 = tmp5 / tmp4;
> +	tmp7 = tmp5 % tmp4;
>  	b43_radio_write(dev, B2062_S_RFPLL_CTL28, tmp6);
>  	tmp5 = tmp7 * 0x100;
>  	tmp6 = tmp5 / tmp4;



-- 
Greetings, Michael.

^ permalink raw reply

* Re: [PATCH] b43: LP-PHY: Update code for spec fixes, and fix a few typos
From: Larry Finger @ 2009-08-17  2:37 UTC (permalink / raw)
  To: Gábor Stefanik
  Cc: John Linville, Michael Buesch, Mark Huijgen, Broadcom Wireless,
	linux-wireless
In-Reply-To: <4A88090D.3070107@gmail.com>

Gábor Stefanik wrote:
> A few typos have been discovered both in the specs in and our code.
> This patch fixes them.
> 
> Also use lpphy_op_switch_channel consistently, and make all callers
> print its return value for easier debugging.
> 
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> I think using a forward declaration is justified in this case;
> as avoiding the forward decl would require moving around huge
> blocks of code, completely breaking any logical ordering.
> 
> drivers/net/wireless/b43/phy_lp.c |   51
> ++++++++++++++++++++++++------------
> 1 files changed, 34 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/phy_lp.c
> b/drivers/net/wireless/b43/phy_lp.c
> index e4a040b..a51da6e 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -552,7 +552,7 @@ static void lpphy_2062_init(struct b43_wldev *dev)
>     B43_WARN_ON(!(bus->chipco.capabilities & SSB_CHIPCO_CAP_PMU));
>     B43_WARN_ON(crystalfreq == 0);
> 
> -    if (crystalfreq >= 30000000) {
> +    if (crystalfreq <= 30000000) {
>         lpphy->pdiv = 1;
>         b43_radio_mask(dev, B2062_S_RFPLL_CTL1, 0xFFFB);
>     } else {
> @@ -560,14 +560,16 @@ static void lpphy_2062_init(struct b43_wldev *dev)
>         b43_radio_set(dev, B2062_S_RFPLL_CTL1, 0x4);
>     }
> 
> -    tmp = (800000000 * lpphy->pdiv + crystalfreq) /
> -          (32000000 * lpphy->pdiv);
> -    tmp = (tmp - 1) & 0xFF;
> +    tmp = (((800000000 * lpphy->pdiv + crystalfreq) /
> +          (2 * crystalfreq)) - 8) & 0xFF;
> +    b43_radio_write(dev, B2062_S_RFPLL_CTL7, tmp);
> +
> +    tmp = (((100 * crystalfreq + 16000000 * lpphy->pdiv) /
> +          (32000000 * lpphy->pdiv)) - 1) & 0xFF;
>     b43_radio_write(dev, B2062_S_RFPLL_CTL18, tmp);
> 
> -    tmp = (2 * crystalfreq + 1000000 * lpphy->pdiv) /
> -          (2000000 * lpphy->pdiv);
> -    tmp = ((tmp & 0xFF) - 1) & 0xFFFF;
> +    tmp = (((2 * crystalfreq + 1000000 * lpphy->pdiv) /
> +          (2000000 * lpphy->pdiv)) - 1) & 0xFF;
>     b43_radio_write(dev, B2062_S_RFPLL_CTL19, tmp);
> 
>     ref = (1000 * lpphy->pdiv + 2 * crystalfreq) / (2000 * lpphy->pdiv);
> @@ -671,7 +673,7 @@ static void lpphy_radio_init(struct b43_wldev *dev)
>     b43_phy_mask(dev, B43_LPPHY_FOURWIRE_CTL, 0xFFFD);
>     udelay(1);
> 
> -    if (dev->phy.rev < 2) {
> +    if (dev->phy.radio_ver == 0x2062) {
>         lpphy_2062_init(dev);
>     } else {
>         lpphy_2063_init(dev);
> @@ -688,11 +690,18 @@ struct lpphy_iq_est { u32 iq_prod, i_pwr, q_pwr; };
> 
> static void lpphy_set_rc_cap(struct b43_wldev *dev)
> {
> -    u8 rc_cap = dev->phy.lp->rc_cap;
> +    struct b43_phy_lp *lpphy = dev->phy.lp;
> 
> -    b43_radio_write(dev, B2062_N_RXBB_CALIB2, max_t(u8, rc_cap-4, 0x80));
> -    b43_radio_write(dev, B2062_N_TX_CTL_A, ((rc_cap & 0x1F) >> 1) | 0x80);
> -    b43_radio_write(dev, B2062_S_RXG_CNT16, ((rc_cap & 0x1F) >> 2) |
> 0x80);
> +    u8 rc_cap = (lpphy->rc_cap & 0x1F) >> 1;
> +   
> +    if (dev->phy.rev == 1) //FIXME check channel 14!
> +        rc_cap = max_t(u8, rc_cap + 5, 15);
> +
> +    b43_radio_write(dev, B2062_N_RXBB_CALIB2,
> +            max_t(u8, lpphy->rc_cap - 4, 0x80));
> +    b43_radio_write(dev, B2062_N_TX_CTL_A, rc_cap | 0x80);
> +    b43_radio_write(dev, B2062_S_RXG_CNT16,
> +            ((lpphy->rc_cap & 0x1F) >> 2) | 0x80);
> }
> 
> static u8 lpphy_get_bb_mult(struct b43_wldev *dev)
> @@ -1101,6 +1110,9 @@ static void lpphy_set_tx_power_control(struct
> b43_wldev *dev,
>     lpphy_write_tx_pctl_mode_to_hardware(dev);
> }
> 
> +static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
> +                       unsigned int new_channel);
> +
> static void lpphy_rev0_1_rc_calib(struct b43_wldev *dev)
> {
>     struct b43_phy_lp *lpphy = dev->phy.lp;
> @@ -1118,11 +1130,16 @@ static void lpphy_rev0_1_rc_calib(struct
> b43_wldev *dev)
>         old_rf2_ovr, old_rf2_ovrval, old_phy_ctl;
>     enum b43_lpphy_txpctl_mode old_txpctl;
>     u32 normal_pwr, ideal_pwr, mean_sq_pwr, tmp = 0, mean_sq_pwr_min = 0;
> -    int loopback, i, j, inner_sum;
> +    int loopback, i, j, inner_sum, err;
> 
>     memset(&iq_est, 0, sizeof(iq_est));
> 
> -    b43_switch_channel(dev, 7);
> +    err = b43_lpphy_op_switch_channel(dev, 7);
> +    if (err) {
> +        b43dbg(dev->wl,
> +               "RC calib: Failed to switch to channel 7, error = %d",
> +               err);
> +    }
>     old_txg_ovr = (b43_phy_read(dev, B43_LPPHY_AFE_CTL_OVR) >> 6) & 1;
>     old_bbmult = lpphy_get_bb_mult(dev);
>     if (old_txg_ovr)
> @@ -1881,14 +1898,14 @@ static int lpphy_b2062_tune(struct b43_wldev *dev,
> {
>     struct b43_phy_lp *lpphy = dev->phy.lp;
>     struct ssb_bus *bus = dev->dev->bus;
> -    static const struct b206x_channel *chandata = NULL;
> +    const struct b206x_channel *chandata = NULL;
>     u32 crystal_freq = bus->chipco.pmu.crystalfreq * 1000;
>     u32 tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9;
>     int i, err = 0;
> 
> -    for (i = 0; i < ARRAY_SIZE(b2063_chantbl); i++) {
> +    for (i = 0; i < ARRAY_SIZE(b2062_chantbl); i++) {
>         if (b2063_chantbl[i].channel == channel) {
              -----
This should also be b2062. As long as the two tables have the same
channel ordering, this way would work.

> -            chandata = &b2063_chantbl[i];
> +            chandata = &b2062_chantbl[i];
>             break;
>         }
>     }

Larry

^ permalink raw reply

* [PATCH v2] b43: LP-PHY: Update code for spec fixes, and fix a few typos
From: Gábor Stefanik @ 2009-08-16 16:05 UTC (permalink / raw)
  To: John Linville, Michael Buesch, Larry Finger
  Cc: Mark Huijgen, Broadcom Wireless, linux-wireless

A few typos have been discovered in both the specs and the code.
This patch fixes them.

Also use lpphy_op_switch_channel consistently, and make all users
of it print its return value for easier debugging.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
V2: Fix one more typo (this time a harmless one).

 drivers/net/wireless/b43/phy_lp.c |   53 ++++++++++++++++++++++++------------
 1 files changed, 35 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index d949cfa..1de4a74 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -554,7 +554,7 @@ static void lpphy_2062_init(struct b43_wldev *dev)
 	B43_WARN_ON(!(bus->chipco.capabilities & SSB_CHIPCO_CAP_PMU));
 	B43_WARN_ON(crystalfreq == 0);
 
-	if (crystalfreq >= 30000000) {
+	if (crystalfreq <= 30000000) {
 		lpphy->pdiv = 1;
 		b43_radio_mask(dev, B2062_S_RFPLL_CTL1, 0xFFFB);
 	} else {
@@ -562,14 +562,16 @@ static void lpphy_2062_init(struct b43_wldev *dev)
 		b43_radio_set(dev, B2062_S_RFPLL_CTL1, 0x4);
 	}
 
-	tmp = (800000000 * lpphy->pdiv + crystalfreq) /
-	      (32000000 * lpphy->pdiv);
-	tmp = (tmp - 1) & 0xFF;
+	tmp = (((800000000 * lpphy->pdiv + crystalfreq) /
+	      (2 * crystalfreq)) - 8) & 0xFF;
+	b43_radio_write(dev, B2062_S_RFPLL_CTL7, tmp);
+
+	tmp = (((100 * crystalfreq + 16000000 * lpphy->pdiv) /
+	      (32000000 * lpphy->pdiv)) - 1) & 0xFF;
 	b43_radio_write(dev, B2062_S_RFPLL_CTL18, tmp);
 
-	tmp = (2 * crystalfreq + 1000000 * lpphy->pdiv) /
-	      (2000000 * lpphy->pdiv);
-	tmp = ((tmp & 0xFF) - 1) & 0xFFFF;
+	tmp = (((2 * crystalfreq + 1000000 * lpphy->pdiv) /
+	      (2000000 * lpphy->pdiv)) - 1) & 0xFF;
 	b43_radio_write(dev, B2062_S_RFPLL_CTL19, tmp);
 
 	ref = (1000 * lpphy->pdiv + 2 * crystalfreq) / (2000 * lpphy->pdiv);
@@ -673,7 +675,7 @@ static void lpphy_radio_init(struct b43_wldev *dev)
 	b43_phy_mask(dev, B43_LPPHY_FOURWIRE_CTL, 0xFFFD);
 	udelay(1);
 
-	if (dev->phy.rev < 2) {
+	if (dev->phy.radio_ver == 0x2062) {
 		lpphy_2062_init(dev);
 	} else {
 		lpphy_2063_init(dev);
@@ -690,11 +692,18 @@ struct lpphy_iq_est { u32 iq_prod, i_pwr, q_pwr; };
 
 static void lpphy_set_rc_cap(struct b43_wldev *dev)
 {
-	u8 rc_cap = dev->phy.lp->rc_cap;
+	struct b43_phy_lp *lpphy = dev->phy.lp;
 
-	b43_radio_write(dev, B2062_N_RXBB_CALIB2, max_t(u8, rc_cap-4, 0x80));
-	b43_radio_write(dev, B2062_N_TX_CTL_A, ((rc_cap & 0x1F) >> 1) | 0x80);
-	b43_radio_write(dev, B2062_S_RXG_CNT16, ((rc_cap & 0x1F) >> 2) | 0x80);
+	u8 rc_cap = (lpphy->rc_cap & 0x1F) >> 1;
+	
+	if (dev->phy.rev == 1) //FIXME check channel 14!
+		rc_cap = max_t(u8, rc_cap + 5, 15);
+
+	b43_radio_write(dev, B2062_N_RXBB_CALIB2,
+			max_t(u8, lpphy->rc_cap - 4, 0x80));
+	b43_radio_write(dev, B2062_N_TX_CTL_A, rc_cap | 0x80);
+	b43_radio_write(dev, B2062_S_RXG_CNT16,
+			((lpphy->rc_cap & 0x1F) >> 2) | 0x80);
 }
 
 static u8 lpphy_get_bb_mult(struct b43_wldev *dev)
@@ -1103,6 +1112,9 @@ static void lpphy_set_tx_power_control(struct b43_wldev *dev,
 	lpphy_write_tx_pctl_mode_to_hardware(dev);
 }
 
+static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
+				       unsigned int new_channel);
+
 static void lpphy_rev0_1_rc_calib(struct b43_wldev *dev)
 {
 	struct b43_phy_lp *lpphy = dev->phy.lp;
@@ -1120,11 +1132,16 @@ static void lpphy_rev0_1_rc_calib(struct b43_wldev *dev)
 	    old_rf2_ovr, old_rf2_ovrval, old_phy_ctl;
 	enum b43_lpphy_txpctl_mode old_txpctl;
 	u32 normal_pwr, ideal_pwr, mean_sq_pwr, tmp = 0, mean_sq_pwr_min = 0;
-	int loopback, i, j, inner_sum;
+	int loopback, i, j, inner_sum, err;
 
 	memset(&iq_est, 0, sizeof(iq_est));
 
-	b43_switch_channel(dev, 7);
+	err = b43_lpphy_op_switch_channel(dev, 7);
+	if (err) {
+		b43dbg(dev->wl,
+		       "RC calib: Failed to switch to channel 7, error = %d",
+		       err);
+	}
 	old_txg_ovr = (b43_phy_read(dev, B43_LPPHY_AFE_CTL_OVR) >> 6) & 1;
 	old_bbmult = lpphy_get_bb_mult(dev);
 	if (old_txg_ovr)
@@ -1883,14 +1900,14 @@ static int lpphy_b2062_tune(struct b43_wldev *dev,
 {
 	struct b43_phy_lp *lpphy = dev->phy.lp;
 	struct ssb_bus *bus = dev->dev->bus;
-	static const struct b206x_channel *chandata = NULL;
+	const struct b206x_channel *chandata = NULL;
 	u32 crystal_freq = bus->chipco.pmu.crystalfreq * 1000;
 	u32 tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9;
 	int i, err = 0;
 
-	for (i = 0; i < ARRAY_SIZE(b2063_chantbl); i++) {
-		if (b2063_chantbl[i].channel == channel) {
-			chandata = &b2063_chantbl[i];
+	for (i = 0; i < ARRAY_SIZE(b2062_chantbl); i++) {
+		if (b2062_chantbl[i].channel == channel) {
+			chandata = &b2062_chantbl[i];
 			break;
 		}
 	}
-- 
1.6.2.4




^ permalink raw reply related

* Some success with LP PHY
From: Larry Finger @ 2009-08-16 16:05 UTC (permalink / raw)
  To: Gábor Stefanik; +Cc: wireless, John Linville, Michael Buesch, Mark Huijgen

Gábor,

I can report some success. This morning, I got input from a 'sudo
iwlist scan' command. It does not show all the nearby APs, including
mine on channel 1, but I see a couple on channel 6, and one on 11.

I'm having a problem with 2062 channel tune routine. It gets the "PLL
charge pump out of range" error. To get anything to work, I had to
replace the error return with a printk that prints the channel. The
error happens for channels 1-6 and 9-11. Perhaps the fact that it is
OK for channels 7 and 8 is a clue. If so, I don't understand it yet.

Thanks for your efforts. It is exciting to see this device finally
coming to life.

Larry

^ permalink raw reply

* [PATCH] b43: LP-PHY: Fix a bug in the B2062 channel tune path
From: Gábor Stefanik @ 2009-08-16 16:40 UTC (permalink / raw)
  To: John Linville, Michael Buesch, Larry Finger
  Cc: Mark Huijgen, Broadcom Wireless, linux-wireless

I missed the "+16" part of the instruction in the specs.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
 drivers/net/wireless/b43/phy_lp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 1de4a74..5a7b873 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -1952,7 +1952,7 @@ static int lpphy_b2062_tune(struct b43_wldev *dev,
 	b43_radio_write(dev, B2062_S_RFPLL_CTL29, tmp6 + ((2 * tmp7) / tmp4));
 	tmp8 = b43_phy_read(dev, B2062_S_RFPLL_CTL19);
 	tmp9 = ((2 * tmp3 * (tmp8 + 1)) + (3 * tmp1)) / (6 * tmp1);
-	b43_radio_write(dev, B2062_S_RFPLL_CTL23, tmp9 >> 8);
+	b43_radio_write(dev, B2062_S_RFPLL_CTL23, (tmp9 >> 8) + 16);
 	b43_radio_write(dev, B2062_S_RFPLL_CTL24, tmp9 & 0xFF);
 	
 	lpphy_b2062_vco_calib(dev);
-- 
1.6.2.4




^ permalink raw reply related

* [PATCH] b43: LP-PHY: Remove BROKEN from B43_PHY_LP
From: Gábor Stefanik @ 2009-08-16 16:42 UTC (permalink / raw)
  To: John Linville, Michael Buesch, Larry Finger
  Cc: Mark Huijgen, Broadcom Wireless, linux-wireless

Larry has reported success getting scan data with an LP-PHY device,
so it's probably time to release LP-PHY support for testing.

Also add a temporary BROKEN Kconfig symbol to disable 5GHz support,
as 5GHz currently causes the driver to panic (NULL pointer deref).

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
 drivers/net/wireless/b43/Kconfig  |   25 +++++++++++++++++++------
 drivers/net/wireless/b43/main.c   |    2 ++
 drivers/net/wireless/b43/phy_lp.c |    2 ++
 3 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
index 67f564e..13414c9 100644
--- a/drivers/net/wireless/b43/Kconfig
+++ b/drivers/net/wireless/b43/Kconfig
@@ -80,16 +80,29 @@ config B43_NPHY
 	  SAY N.
 
 config B43_PHY_LP
-	bool "IEEE 802.11g LP-PHY support (BROKEN)"
-	depends on B43 && EXPERIMENTAL && BROKEN
+	bool "Support for low-power (LP-PHY) devices (VERY EXPERIMENTAL)"
+	depends on B43 && EXPERIMENTAL
 	---help---
 	  Support for the LP-PHY.
-	  The LP-PHY is an IEEE 802.11g based PHY built into some notebooks
-	  and embedded devices.
+	  The LP-PHY is a low-power PHY built into some notebooks
+	  and embedded devices. It supports 802.11a/g
+	  (802.11a support is optional, and currently disabled).
 
-	  THIS IS BROKEN AND DOES NOT WORK YET.
+	  Known LP-PHY devices include the BCM4310, BCM4312 (PCI ID 0x4315),
+	  BCM4325 (currently unsupported), BCM4326 & BCM4328 wireless cards
+	  and the BCM5354 SoC.
 
-	  SAY N.
+	  This is heavily experimental, and probably will not work for you.
+	  Say N unless you want to help debug the driver.
+
+config B43_PHY_LP_5GHZ
+	bool "Enable 802.11a support for LP-PHYs (BROKEN)"
+	depends on B43_PHY_LP && BROKEN
+	---help---
+	  Enable the 5GHz band of LP-PHY devices. Currently, all it
+	  does is cause the driver to panic on startup.
+
+	  Only select this if you are a developer working on this feature.
 
 # This config option automatically enables b43 LEDS support,
 # if it's possible.
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 99b41ce..0096d25 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4514,7 +4514,9 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
 			have_5ghz_phy = 1;
 			break;
 		case B43_PHYTYPE_LP: //FIXME not always!
+#ifdef CONFIG_B43_PHY_LP_5GHZ
 			have_5ghz_phy = 1;
+#endif
 		case B43_PHYTYPE_G:
 		case B43_PHYTYPE_N:
 			have_2ghz_phy = 1;
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 3889519..c902dd1 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -43,7 +43,9 @@ static inline u16 channel2freq_lp(u8 channel)
 
 static unsigned int b43_lpphy_op_get_default_chan(struct b43_wldev *dev)
 {
+#ifdef CONFIG_B43_PHY_LP_5GHZ
 	if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
+#endif
 		return 1;
 	return 36;
 }
-- 
1.6.2.4




^ permalink raw reply related

* Re: [PATCH] b43: LP-PHY: Remove BROKEN from B43_PHY_LP
From: Michael Buesch @ 2009-08-16 17:50 UTC (permalink / raw)
  To: Gábor Stefanik
  Cc: John Linville, Larry Finger, Mark Huijgen, Broadcom Wireless,
	linux-wireless
In-Reply-To: <4A88370B.5090506@gmail.com>

On Sunday 16 August 2009 18:42:51 Gábor Stefanik wrote:
> Larry has reported success getting scan data with an LP-PHY device,
> so it's probably time to release LP-PHY support for testing.
> 
> Also add a temporary BROKEN Kconfig symbol to disable 5GHz support,
> as 5GHz currently causes the driver to panic (NULL pointer deref).
> 
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
>  drivers/net/wireless/b43/Kconfig  |   25 +++++++++++++++++++------
>  drivers/net/wireless/b43/main.c   |    2 ++
>  drivers/net/wireless/b43/phy_lp.c |    2 ++
>  3 files changed, 23 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
> index 67f564e..13414c9 100644
> --- a/drivers/net/wireless/b43/Kconfig
> +++ b/drivers/net/wireless/b43/Kconfig
> @@ -80,16 +80,29 @@ config B43_NPHY
>  	  SAY N.
>  
>  config B43_PHY_LP
> -	bool "IEEE 802.11g LP-PHY support (BROKEN)"
> -	depends on B43 && EXPERIMENTAL && BROKEN
> +	bool "Support for low-power (LP-PHY) devices (VERY EXPERIMENTAL)"

Very is a vague term. Just remove it.

> +	depends on B43 && EXPERIMENTAL
>  	---help---
>  	  Support for the LP-PHY.
> -	  The LP-PHY is an IEEE 802.11g based PHY built into some notebooks
> -	  and embedded devices.
> +	  The LP-PHY is a low-power PHY built into some notebooks
> +	  and embedded devices. It supports 802.11a/g
> +	  (802.11a support is optional, and currently disabled).
>  
> -	  THIS IS BROKEN AND DOES NOT WORK YET.
> +	  Known LP-PHY devices include the BCM4310, BCM4312 (PCI ID 0x4315),
> +	  BCM4325 (currently unsupported), BCM4326 & BCM4328 wireless cards
> +	  and the BCM5354 SoC.

It's pointless to list them here, as the list will always be obsolete and never be correct.

>  
> -	  SAY N.
> +	  This is heavily experimental, and probably will not work for you.
> +	  Say N unless you want to help debug the driver.
> +
> +config B43_PHY_LP_5GHZ
> +	bool "Enable 802.11a support for LP-PHYs (BROKEN)"
> +	depends on B43_PHY_LP && BROKEN
> +	---help---
> +	  Enable the 5GHz band of LP-PHY devices. Currently, all it
> +	  does is cause the driver to panic on startup.
> +
> +	  Only select this if you are a developer working on this feature.

I don't think we should introduce another config option. Just hardcode
disable the 802.11a for LP-PHYs. There's no point in enabling an option
that crashes the kernel. And if you fix the crash, there's no point in
leaving it disabled.

>  # This config option automatically enables b43 LEDS support,
>  # if it's possible.
> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> index 99b41ce..0096d25 100644
> --- a/drivers/net/wireless/b43/main.c
> +++ b/drivers/net/wireless/b43/main.c
> @@ -4514,7 +4514,9 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
>  			have_5ghz_phy = 1;
>  			break;
>  		case B43_PHYTYPE_LP: //FIXME not always!
> +#ifdef CONFIG_B43_PHY_LP_5GHZ
>  			have_5ghz_phy = 1;
> +#endif
>  		case B43_PHYTYPE_G:
>  		case B43_PHYTYPE_N:
>  			have_2ghz_phy = 1;
> diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
> index 3889519..c902dd1 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -43,7 +43,9 @@ static inline u16 channel2freq_lp(u8 channel)
>  
>  static unsigned int b43_lpphy_op_get_default_chan(struct b43_wldev *dev)
>  {
> +#ifdef CONFIG_B43_PHY_LP_5GHZ
>  	if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
> +#endif
>  		return 1;
>  	return 36;
>  }

This is a completely pointless ifdef.



-- 
Greetings, Michael.

^ permalink raw reply

* [PATCH] b43: LP-PHY: Update B2062 radio init with recent spec changes
From: Gábor Stefanik @ 2009-08-16 18:08 UTC (permalink / raw)
  To: John Linville, Michael Buesch, Larry Finger
  Cc: Mark Huijgen, Broadcom Wireless, linux-wireless

The spec for initializing the B2062 radio have changed recently,
update the code to match the changes.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
 drivers/net/wireless/b43/phy_lp.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 5a7b873..34b7910 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -539,10 +539,15 @@ static void lpphy_2062_init(struct b43_wldev *dev)
 	b43_radio_write(dev, B2062_N_TX_CTL3, 0);
 	b43_radio_write(dev, B2062_N_TX_CTL4, 0);
 	b43_radio_write(dev, B2062_N_TX_CTL5, 0);
+	b43_radio_write(dev, B2062_N_TX_CTL6, 0);
 	b43_radio_write(dev, B2062_N_PDN_CTL0, 0x40);
 	b43_radio_write(dev, B2062_N_PDN_CTL0, 0);
 	b43_radio_write(dev, B2062_N_CALIB_TS, 0x10);
 	b43_radio_write(dev, B2062_N_CALIB_TS, 0);
+	if (dev->phy.rev > 0) {
+		b43_radio_write(dev, B2062_S_BG_CTL1,
+			(b43_radio_read(dev, B2062_N_COMM2) >> 1) | 0x80);
+	}
 	if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
 		b43_radio_set(dev, B2062_N_TSSI_CTL0, 0x1);
 	else
-- 
1.6.2.4




^ permalink raw reply related

* Re: [PATCH] b43: LP-PHY: Update B2062 radio init with recent spec changes
From: Michael Buesch @ 2009-08-16 18:09 UTC (permalink / raw)
  To: Gábor Stefanik
  Cc: John Linville, Larry Finger, Mark Huijgen, Broadcom Wireless,
	linux-wireless
In-Reply-To: <4A884B0D.5000808@gmail.com>

On Sunday 16 August 2009 20:08:13 Gábor Stefanik wrote:
> The spec for initializing the B2062 radio have changed recently,
> update the code to match the changes.
> 
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>

ack

> ---
>  drivers/net/wireless/b43/phy_lp.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
> index 5a7b873..34b7910 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -539,10 +539,15 @@ static void lpphy_2062_init(struct b43_wldev *dev)
>  	b43_radio_write(dev, B2062_N_TX_CTL3, 0);
>  	b43_radio_write(dev, B2062_N_TX_CTL4, 0);
>  	b43_radio_write(dev, B2062_N_TX_CTL5, 0);
> +	b43_radio_write(dev, B2062_N_TX_CTL6, 0);
>  	b43_radio_write(dev, B2062_N_PDN_CTL0, 0x40);
>  	b43_radio_write(dev, B2062_N_PDN_CTL0, 0);
>  	b43_radio_write(dev, B2062_N_CALIB_TS, 0x10);
>  	b43_radio_write(dev, B2062_N_CALIB_TS, 0);
> +	if (dev->phy.rev > 0) {
> +		b43_radio_write(dev, B2062_S_BG_CTL1,
> +			(b43_radio_read(dev, B2062_N_COMM2) >> 1) | 0x80);
> +	}
>  	if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
>  		b43_radio_set(dev, B2062_N_TSSI_CTL0, 0x1);
>  	else



-- 
Greetings, Michael.

^ permalink raw reply

* [PATCH v2] b43: LP-PHY: Remove BROKEN from B43_PHY_LP
From: Gábor Stefanik @ 2009-08-16 18:22 UTC (permalink / raw)
  To: John Linville, Michael Buesch, Larry Finger
  Cc: Mark Huijgen, Broadcom Wireless, linux-wireless

Larry has reported success getting scan data with an LP-PHY device,
so it's probably time to release LP-PHY support for testing.

Also disable 802.11a support for now, as 802.11a currently causes
the driver to panic on startup (NULL pointer dereference).

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
V2:
-Remove "VERY" from the warning in the symbol name.
-Remove list of known devices.
-Don't create a separate symbol for 5GHz, just disable it in the code.

 drivers/net/wireless/b43/Kconfig |   14 +++++++-------
 drivers/net/wireless/b43/main.c  |    2 ++
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
index 67f564e..237b1aa 100644
--- a/drivers/net/wireless/b43/Kconfig
+++ b/drivers/net/wireless/b43/Kconfig
@@ -80,16 +80,16 @@ config B43_NPHY
 	  SAY N.
 
 config B43_PHY_LP
-	bool "IEEE 802.11g LP-PHY support (BROKEN)"
-	depends on B43 && EXPERIMENTAL && BROKEN
+	bool "Support for low-power (LP-PHY) devices (EXPERIMENTAL)"
+	depends on B43 && EXPERIMENTAL
 	---help---
 	  Support for the LP-PHY.
-	  The LP-PHY is an IEEE 802.11g based PHY built into some notebooks
-	  and embedded devices.
-
-	  THIS IS BROKEN AND DOES NOT WORK YET.
+	  The LP-PHY is a low-power PHY built into some notebooks
+	  and embedded devices. It supports 802.11a/g
+	  (802.11a support is optional, and currently disabled).
 
-	  SAY N.
+	  This is heavily experimental, and probably will not work for you.
+	  Say N unless you want to help debug the driver.
 
 # This config option automatically enables b43 LEDS support,
 # if it's possible.
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 99b41ce..c5bece0 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4514,7 +4514,9 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
 			have_5ghz_phy = 1;
 			break;
 		case B43_PHYTYPE_LP: //FIXME not always!
+#if 0 //FIXME enabling 5GHz causes a NULL pointer dereference
 			have_5ghz_phy = 1;
+#endif
 		case B43_PHYTYPE_G:
 		case B43_PHYTYPE_N:
 			have_2ghz_phy = 1;
-- 
1.6.2.4




^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox