Skip to contentSkip to conversation

b43: N-PHY: fix infinite-loop-typo

PATCH New Rafał Miłecki 3 participants 8 messages Oct 22, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 b43: N-PHY: fix infinite-loop-typo

---
 drivers/net/wireless/b43/phy_n.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/b43/phy_n.c +1 -1
index dfec549..e0f2d12 100644
@@ -2964,7 +2964,7 @@ static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,
 					(2 - i));
 		}
 
-		for (j = 0; i < 4; j++) {
+		for (j = 0; j < 4; j++) {
 			if (j < 3) {
 				cur_lna = lna[j];
 				cur_hpf1 = hpf1[j];
Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/5 b43: N-PHY: fix 2055 radio init

---
 drivers/net/wireless/b43/radio_2055.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/b43/radio_2055.c +5 -3
index 1b53165..0d67715 100644
@@ -244,7 +244,7 @@ static const struct b2055_inittab_entry b2055_inittab [] = {
   [0xCB]			= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
   [0xCC]			= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
   [B2055_C1_LNA_GAINBST]	= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
-  [0xCE]			= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
+  [0xCE]			= { .ghz5 = 0x0006, .ghz2 = 0x0006, NOUPLOAD, },
   [0xCF]			= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
   [0xD0]			= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
   [0xD1]			= { .ghz5 = 0x0018, .ghz2 = 0x0018, NOUPLOAD, },
@@ -256,7 +256,7 @@ static const struct b2055_inittab_entry b2055_inittab [] = {
   [0xD7]			= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
   [0xD8]			= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
   [B2055_C2_LNA_GAINBST]	= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
-  [0xDA]			= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
+  [0xDA]			= { .ghz5 = 0x0006, .ghz2 = 0x0006, NOUPLOAD, },
   [0xDB]			= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
   [0xDC]			= { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
   [0xDD]			= { .ghz5 = 0x0018, .ghz2 = 0x0018, NOUPLOAD, },
@@ -1299,7 +1299,7 @@ void b2055_upload_inittab(struct b43_wldev *dev,
 			  bool ghz5, bool ignore_uploadflag)
 {
 	const struct b2055_inittab_entry *e;
-	unsigned int i;
+	unsigned int i, writes = 0;
 	u16 value;
 
 	for (i = 0; i < ARRAY_SIZE(b2055_inittab); i++) {
@@ -1312,6 +1312,8 @@ void b2055_upload_inittab(struct b43_wldev *dev,
 			else
 				value = e->ghz2;
 			b43_radio_write16(dev, i, value);
+			if (++writes % 4 == 0)
+				b43_read32(dev, B43_MMIO_MACCTL); /* flush */
 		}
 	}
 }
Signature · 1 line
1.7.1
#2 lore raw

PATCH 3/5 b43: define known SPROM boardflags2 bits

In reply to Rafał Miłecki
---
 drivers/net/wireless/b43/b43.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
drivers/net/wireless/b43/b43.h +13 -0
index 72821c4..9aad2ca 100644
@@ -153,6 +153,19 @@
 #define B43_BFH_FEM_BT			0x0040	/* has FEM and switch to share antenna
 						 * with bluetooth */
 
+/* SPROM boardflags2_lo values */
+#define B43_BFL2_RXBB_INT_REG_DIS	0x0001	/* external RX BB regulator present */
+#define B43_BFL2_APLL_WAR		0x0002	/* alternative A-band PLL settings implemented */
+#define B43_BFL2_TXPWRCTRL_EN 		0x0004	/* permits enabling TX Power Control */
+#define B43_BFL2_2X4_DIV		0x0008	/* 2x4 diversity switch */
+#define B43_BFL2_5G_PWRGAIN		0x0010	/* supports 5G band power gain */
+#define B43_BFL2_PCIEWAR_OVR		0x0020	/* overrides ASPM and Clkreq settings */
+#define B43_BFL2_CAESERS_BRD		0x0040	/* is Caesers board (unused) */
+#define B43_BFL2_BTC3WIRE		0x0080	/* used 3-wire bluetooth coexist */
+#define B43_BFL2_SKWRKFEM_BRD		0x0100	/* 4321mcm93 uses Skyworks FEM */
+#define B43_BFL2_SPUR_WAR		0x0200	/* has a workaround for clock-harmonic spurs */
+#define B43_BFL2_GPLL_WAR		0x0400	/* altenative G-band PLL settings implemented */
+
 /* GPIO register offset, in both ChipCommon and PCI core. */
 #define B43_GPIO_CONTROL		0x6c
 
Signature · 1 line
1.7.1
#3 lore raw

PATCH 3/5 b43: define known SPROM boardflags2 bits

2010/10/22 Rafa? Mi?ecki <[email protected]>:

Quoted 13 lines

---
?drivers/net/wireless/b43/b43.h | ? 13 +++++++++++++ ?1 files changed, 13 insertions(+), 0 deletions(-)

drivers/net/wireless/b43/b43.h +0 -0
index 72821c4..9aad2ca 100644
@@ -153,6 +153,19 @@

?#define B43_BFH_FEM_BT ? ? ? ? ? ? ? ? 0x0040 ?/* has FEM and switch to share antenna ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? * with bluetooth */

drivers/net/wireless/b43/b43.h

Quoted 8 lines
drivers/net/wireless/b43/b43.h +8 -0
+/* SPROM boardflags2_lo values */
+#define B43_BFL2_RXBB_INT_REG_DIS ? ? ?0x0001 ?/* external RX BB regulator present */
+#define B43_BFL2_APLL_WAR ? ? ? ? ? ? ?0x0002 ?/* alternative A-band PLL settings implemented */
+#define B43_BFL2_TXPWRCTRL_EN ? ? ? ? ?0x0004 ?/* permits enabling TX Power Control */
+#define B43_BFL2_2X4_DIV ? ? ? ? ? ? ? 0x0008 ?/* 2x4 diversity switch */
+#define B43_BFL2_5G_PWRGAIN ? ? ? ? ? ?0x0010 ?/* supports 5G band power gain */
+#define B43_BFL2_PCIEWAR_OVR ? ? ? ? ? 0x0020 ?/* overrides ASPM and Clkreq settings */
+#define B43_BFL2_CAESERS_BRD ? ? ? ? ? 0x0040 ?/* is Caesers board (unused) */

I'm almost sure this is a typo in the specs.

Larry?

Quoted 16 lines
drivers/net/wireless/b43/b43.h +5 -0
+#define B43_BFL2_BTC3WIRE ? ? ? ? ? ? ?0x0080 ?/* used 3-wire bluetooth coexist */
+#define B43_BFL2_SKWRKFEM_BRD ? ? ? ? ?0x0100 ?/* 4321mcm93 uses Skyworks FEM */
+#define B43_BFL2_SPUR_WAR ? ? ? ? ? ? ?0x0200 ?/* has a workaround for clock-harmonic spurs */
+#define B43_BFL2_GPLL_WAR ? ? ? ? ? ? ?0x0400 ?/* altenative G-band PLL settings implemented */
+

?/* GPIO register offset, in both ChipCommon and PCI core. */ ?#define B43_GPIO_CONTROL ? ? ? ? ? ? ? 0x6c

--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
#4 lore raw

PATCH 3/5 b43: define known SPROM boardflags2 bits

Quoted 25 lines · Gábor Stefanik

2010/10/22 Rafał Miłecki <[email protected]>:

Quoted 11 lines
---
 drivers/net/wireless/b43/b43.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
drivers/net/wireless/b43/b43.h +0 -0
index 72821c4..9aad2ca 100644
@@ -153,6 +153,19 @@
 #define B43_BFH_FEM_BT                 0x0040  /* has FEM and switch to share antenna

drivers/net/wireless/b43/b43.h line 163

Quoted 10 lines
drivers/net/wireless/b43/b43.h +8 -0
                                                * with bluetooth */
 
+/* SPROM boardflags2_lo values */
+#define B43_BFL2_RXBB_INT_REG_DIS      0x0001  /* external RX BB regulator present */
+#define B43_BFL2_APLL_WAR              0x0002  /* alternative A-band PLL settings implemented */
+#define B43_BFL2_TXPWRCTRL_EN          0x0004  /* permits enabling TX Power Control */
+#define B43_BFL2_2X4_DIV               0x0008  /* 2x4 diversity switch */
+#define B43_BFL2_5G_PWRGAIN            0x0010  /* supports 5G band power gain */
+#define B43_BFL2_PCIEWAR_OVR           0x0020  /* overrides ASPM and Clkreq settings */
+#define B43_BFL2_CAESERS_BRD           0x0040  /* is Caesers board (unused) */

I'm almost sure this is a typo in the specs.

Quoted 1 line

Larry?

Nope - it is Cae..., not Cea.... Whatever name we use is just a placeholder as that bit is never used.

Larry

#5 lore raw

PATCH 3/5 b43: define known SPROM boardflags2 bits

2010/10/22 Larry Finger <[email protected]>:

Quoted 26 lines · G?bor Stefanik
Quoted 25 lines

2010/10/22 Rafa? Mi?ecki <[email protected]>:

Quoted 13 lines

---
?drivers/net/wireless/b43/b43.h | ? 13 +++++++++++++ ?1 files changed, 13 insertions(+), 0 deletions(-)

drivers/net/wireless/b43/b43.h +0 -0
index 72821c4..9aad2ca 100644
@@ -153,6 +153,19 @@

?#define B43_BFH_FEM_BT ? ? ? ? ? ? ? ? 0x0040 ?/* has FEM and switch to share antenna ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? * with bluetooth */

drivers/net/wireless/b43/b43.h

Quoted 8 lines
drivers/net/wireless/b43/b43.h +8 -0
+/* SPROM boardflags2_lo values */
+#define B43_BFL2_RXBB_INT_REG_DIS ? ? ?0x0001 ?/* external RX BB regulator present */
+#define B43_BFL2_APLL_WAR ? ? ? ? ? ? ?0x0002 ?/* alternative A-band PLL settings implemented */
+#define B43_BFL2_TXPWRCTRL_EN ? ? ? ? ?0x0004 ?/* permits enabling TX Power Control */
+#define B43_BFL2_2X4_DIV ? ? ? ? ? ? ? 0x0008 ?/* 2x4 diversity switch */
+#define B43_BFL2_5G_PWRGAIN ? ? ? ? ? ?0x0010 ?/* supports 5G band power gain */
+#define B43_BFL2_PCIEWAR_OVR ? ? ? ? ? 0x0020 ?/* overrides ASPM and Clkreq settings */
+#define B43_BFL2_CAESERS_BRD ? ? ? ? ? 0x0040 ?/* is Caesers board (unused) */

I'm almost sure this is a typo in the specs.

Quoted 4 lines
Quoted 1 line

Larry?

Nope - it is Cae..., not Cea.... Whatever name we use is just a placeholder as that bit is never used.

No, I mean the "ser" part.

Quoted 4 lines

Larry

Signature · 1 line
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
#6 lore raw

PATCH 4/5 b43: N-PHY: determine usage of radio regulatory workaround correctly

In reply to Rafał Miłecki
---
 drivers/net/wireless/b43/phy_n.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/wireless/b43/phy_n.c +2 -1
index e0f2d12..c22dbfb 100644
@@ -191,7 +191,8 @@ static void b43_radio_init2055_post(struct b43_wldev *dev)
 				binfo->type != 0x46D ||
 				binfo->rev < 0x41);
 	else
-		workaround = ((sprom->boardflags_hi & B43_BFH_NOPA) == 0);
+		workaround =
+			!(sprom->boardflags2_lo & B43_BFL2_RXBB_INT_REG_DIS);
 
 	b43_radio_mask(dev, B2055_MASTER1, 0xFFF3);
 	if (workaround) {
Signature · 1 line
1.7.1
#7 lore raw

PATCH 5/5 b43: N-PHY: improve 2055 radio initialization

In reply to Rafał Miłecki

1) Upload 5 GHz values when needed.
2) Do not upload all values on first init. Follow wl.

---
 drivers/net/wireless/b43/phy_n.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
drivers/net/wireless/b43/phy_n.c +7 -4
index c22dbfb..6facb8a 100644
@@ -241,10 +241,13 @@ static void b43_radio_init2055_post(struct b43_wldev *dev)
 static void b43_radio_init2055(struct b43_wldev *dev)
 {
 	b43_radio_init2055_pre(dev);
-	if (b43_status(dev) < B43_STAT_INITIALIZED)
-		b2055_upload_inittab(dev, 0, 1);
-	else
-		b2055_upload_inittab(dev, 0/*FIXME on 5ghz band*/, 0);
+	if (b43_status(dev) < B43_STAT_INITIALIZED) {
+		/* Follow wl, not specs. Do not force uploading all regs */
+		b2055_upload_inittab(dev, 0, 0);
+	} else {
+		bool ghz5 = b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ;
+		b2055_upload_inittab(dev, ghz5, 0);
+	}
 	b43_radio_init2055_post(dev);
 }
 
Signature · 1 line
1.7.1