Skip to contentSkip to conversation

b43: N-PHY: clean table init, check PHY rev (V2)

PATCH In review Rafał Miłecki 2 participants 3 messages Jan 2, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 b43: N-PHY: clean table init, check PHY rev (V2)

From 2ba3a7f93ac358a49f36433f49b6d3cf2f930d5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
Date: Sat, 2 Jan 2010 17:06:12 +0100
Subject: [PATCH] b43: N-PHY: clean table init, check PHY rev (V2)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Move table init to tables_nphy.c, detect newer PHY which use different init. We don't init newer PHYs yet but this at least shows what more is needed.

V2: Make some functions and tables static

---
 drivers/net/wireless/b43/phy_n.c       |   43 ++-----------
 drivers/net/wireless/b43/tables_nphy.c |  100 +++++++++++++++++++++++--------
 drivers/net/wireless/b43/tables_nphy.h |   55 +++++++++--------
 3 files changed, 110 insertions(+), 88 deletions(-)
drivers/net/wireless/b43/phy_n.c +7 -36
index 992318a..a662ced 100644
@@ -197,44 +197,15 @@ void b43_nphy_radio_turn_off(struct b43_wldev *dev)
 		     ~B43_NPHY_RFCTL_CMD_EN);
 }
 
-#define ntab_upload(dev, offset, data) do { \
-		unsigned int i;						\
-		for (i = 0; i < (offset##_SIZE); i++)			\
-			b43_ntab_write(dev, (offset) + i, (data)[i]);	\
-	} while (0)
-
-/* Upload the N-PHY tables. */
+/* Upload the N-PHY tables.
+ * http://bcm-v4.sipsolutions.net/802.11/PHY/N/InitTables
+ */
 static void b43_nphy_tables_init(struct b43_wldev *dev)
 {
-	/* Static tables */
-	ntab_upload(dev, B43_NTAB_FRAMESTRUCT, b43_ntab_framestruct);
-	ntab_upload(dev, B43_NTAB_FRAMELT, b43_ntab_framelookup);
-	ntab_upload(dev, B43_NTAB_TMAP, b43_ntab_tmap);
-	ntab_upload(dev, B43_NTAB_TDTRN, b43_ntab_tdtrn);
-	ntab_upload(dev, B43_NTAB_INTLEVEL, b43_ntab_intlevel);
-	ntab_upload(dev, B43_NTAB_PILOT, b43_ntab_pilot);
-	ntab_upload(dev, B43_NTAB_PILOTLT, b43_ntab_pilotlt);
-	ntab_upload(dev, B43_NTAB_TDI20A0, b43_ntab_tdi20a0);
-	ntab_upload(dev, B43_NTAB_TDI20A1, b43_ntab_tdi20a1);
-	ntab_upload(dev, B43_NTAB_TDI40A0, b43_ntab_tdi40a0);
-	ntab_upload(dev, B43_NTAB_TDI40A1, b43_ntab_tdi40a1);
-	ntab_upload(dev, B43_NTAB_BDI, b43_ntab_bdi);
-	ntab_upload(dev, B43_NTAB_CHANEST, b43_ntab_channelest);
-	ntab_upload(dev, B43_NTAB_MCS, b43_ntab_mcs);
-
-	/* Volatile tables */
-	ntab_upload(dev, B43_NTAB_NOISEVAR10, b43_ntab_noisevar10);
-	ntab_upload(dev, B43_NTAB_NOISEVAR11, b43_ntab_noisevar11);
-	ntab_upload(dev, B43_NTAB_C0_ESTPLT, b43_ntab_estimatepowerlt0);
-	ntab_upload(dev, B43_NTAB_C1_ESTPLT, b43_ntab_estimatepowerlt1);
-	ntab_upload(dev, B43_NTAB_C0_ADJPLT, b43_ntab_adjustpower0);
-	ntab_upload(dev, B43_NTAB_C1_ADJPLT, b43_ntab_adjustpower1);
-	ntab_upload(dev, B43_NTAB_C0_GAINCTL, b43_ntab_gainctl0);
-	ntab_upload(dev, B43_NTAB_C1_GAINCTL, b43_ntab_gainctl1);
-	ntab_upload(dev, B43_NTAB_C0_IQLT, b43_ntab_iqlt0);
-	ntab_upload(dev, B43_NTAB_C1_IQLT, b43_ntab_iqlt1);
-	ntab_upload(dev, B43_NTAB_C0_LOFEEDTH, b43_ntab_loftlt0);
-	ntab_upload(dev, B43_NTAB_C1_LOFEEDTH, b43_ntab_loftlt1);
+	if (dev->phy.rev < 3)
+		b43_nphy_rev0_1_2_tables_init(dev);
+	else
+		b43_nphy_rev3plus_tables_init(dev);
 }
 
 static void b43_nphy_workarounds(struct b43_wldev *dev)
drivers/net/wireless/b43/tables_nphy.c +74 -26

252 lines not on this page · raw message

drivers/net/wireless/b43/tables_nphy.h +29 -26

61 lines not on this page · raw message

Signature · 4 lines
1.6.4.2

-- 
Rafał

From 2ba3a7f93ac358a49f36433f49b6d3cf2f930d5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
Date: Sat, 2 Jan 2010 17:06:12 +0100
Subject: [PATCH] b43: N-PHY: clean table init, check PHY rev (V2)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Move table init to tables_nphy.c, detect newer PHY which use different init. We don't init newer PHYs yet but this at least shows what more is needed.

V2: Make some functions and tables static

---
 drivers/net/wireless/b43/phy_n.c       |   43 ++-----------
 drivers/net/wireless/b43/tables_nphy.c |  100 +++++++++++++++++++++++--------
 drivers/net/wireless/b43/tables_nphy.h |   55 +++++++++--------
 3 files changed, 110 insertions(+), 88 deletions(-)
drivers/net/wireless/b43/phy_n.c +7 -36

51 lines not on this page · raw message

drivers/net/wireless/b43/tables_nphy.c +74 -26

252 lines not on this page · raw message

drivers/net/wireless/b43/tables_nphy.h +29 -26

61 lines not on this page · raw message

Signature · 1 line
1.6.4.2
#1 lore raw

drivers/net/wireless/b43/tables_nphy.h b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel); · line 134

Quoted 5 lines · On Saturday 02 January 2010 17:33:53 Rafał Miłecki wrote:
drivers/net/wireless/b43/tables_nphy.h +1 -1
 
-extern const u8 b43_ntab_adjustpower0[];
+static const u8 b43_ntab_adjustpower0[];

Are you serious? o.O
Come on... You can do better ;)

Signature · 1 line
Greetings, Michael.
#2 lore raw
Quoted 9 lines · W dniu 2 stycznia 2010 18:43 użytkownik Michael Buesch <[email protected]> napisał:

drivers/net/wireless/b43/tables_nphy.h b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel); · line 134

Quoted 5 lines · On Saturday 02 January 2010 17:33:53 Rafał Miłecki wrote:
drivers/net/wireless/b43/tables_nphy.h +1 -1
 
-extern const u8 b43_ntab_adjustpower0[];
+static const u8 b43_ntab_adjustpower0[];

Are you serious? o.O
Come on... You can do better ;)

Yeah, I guess so :)

Signature · 1 line
Rafał