b43: N-PHY: clean table init, check PHY rev (V3)
PATCH 3/5 b43: N-PHY: clean table init, check PHY rev (V3)
b43: N-PHY: clean table init, check PHY rev (V3)
This is resend with lines offset hunk "fixed".
From cb7e670134c28e3bf44d8537d953e2e8d3ec4b30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
Date: Sat, 2 Jan 2010 18:50:25 +0100
Subject: [PATCH 3/5] b43: N-PHY: clean table init, check PHY rev (V3)
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
V3: Just drop static table declarations from header
--- drivers/net/wireless/b43/phy_n.c | 43 ++----------- drivers/net/wireless/b43/tables_nphy.c | 100 +++++++++++++++++++++++-------- drivers/net/wireless/b43/tables_nphy.h | 29 +--------- 3 files changed, 83 insertions(+), 89 deletions(-)
drivers/net/wireless/b43/phy_n.c +7 -36
@@ -199,44 +199,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 +2 -27
@@ -128,32 +128,7 @@ b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel);void b43_ntab_write (struct b43_wldev *dev,u32 offset,u32 value); -extern const u8 b43_ntab_adjustpower0[]; -extern const u8 b43_ntab_adjustpower1[]; -extern const u16 b43_ntab_bdi[]; -extern const u32 b43_ntab_channelest[]; -extern const u8 b43_ntab_estimatepowerlt0[]; -extern const u8 b43_ntab_estimatepowerlt1[]; -extern const u8 b43_ntab_framelookup[]; -extern const u32 b43_ntab_framestruct[]; -extern const u32 b43_ntab_gainctl0[]; -extern const u32 b43_ntab_gainctl1[]; -extern const u32 b43_ntab_intlevel[]; -extern const u32 b43_ntab_iqlt0[]; -extern const u32 b43_ntab_iqlt1[]; -extern const u16 b43_ntab_loftlt0[]; -extern const u16 b43_ntab_loftlt1[]; -extern const u8 b43_ntab_mcs[]; -extern const u32 b43_ntab_noisevar10[]; -extern const u32 b43_ntab_noisevar11[]; -extern const u16 b43_ntab_pilot[]; -extern const u32 b43_ntab_pilotlt[]; -extern const u32 b43_ntab_tdi20a0[]; -extern const u32 b43_ntab_tdi20a1[]; -extern const u32 b43_ntab_tdi40a0[]; -extern const u32 b43_ntab_tdi40a1[]; -extern const u32 b43_ntab_tdtrn[]; -extern const u32 b43_ntab_tmap[]; - +void b43_nphy_rev0_1_2_tables_init (struct b43_wldev *dev); +void b43_nphy_rev3plus_tables_init (struct b43_wldev *dev);#endif /* B43_TABLES_NPHY_H_ */
Signature · 1 line
1.6.4.2
From cb7e670134c28e3bf44d8537d953e2e8d3ec4b30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
Date: Sat, 2 Jan 2010 18:50:25 +0100
Subject: [PATCH 3/5] b43: N-PHY: clean table init, check PHY rev (V3)
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
V3: Just drop static table declarations from header
--- drivers/net/wireless/b43/phy_n.c | 43 ++----------- drivers/net/wireless/b43/tables_nphy.c | 100 +++++++++++++++++++++++-------- drivers/net/wireless/b43/tables_nphy.h | 29 +--------- 3 files changed, 83 insertions(+), 89 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 +2 -27
@@ -128,32 +128,7 @@ b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel);void b43_ntab_write (struct b43_wldev *dev,u32 offset,u32 value); -extern const u8 b43_ntab_adjustpower0[]; -extern const u8 b43_ntab_adjustpower1[]; -extern const u16 b43_ntab_bdi[]; -extern const u32 b43_ntab_channelest[]; -extern const u8 b43_ntab_estimatepowerlt0[]; -extern const u8 b43_ntab_estimatepowerlt1[]; -extern const u8 b43_ntab_framelookup[]; -extern const u32 b43_ntab_framestruct[]; -extern const u32 b43_ntab_gainctl0[]; -extern const u32 b43_ntab_gainctl1[]; -extern const u32 b43_ntab_intlevel[]; -extern const u32 b43_ntab_iqlt0[]; -extern const u32 b43_ntab_iqlt1[]; -extern const u16 b43_ntab_loftlt0[]; -extern const u16 b43_ntab_loftlt1[]; -extern const u8 b43_ntab_mcs[]; -extern const u32 b43_ntab_noisevar10[]; -extern const u32 b43_ntab_noisevar11[]; -extern const u16 b43_ntab_pilot[]; -extern const u32 b43_ntab_pilotlt[]; -extern const u32 b43_ntab_tdi20a0[]; -extern const u32 b43_ntab_tdi20a1[]; -extern const u32 b43_ntab_tdi40a0[]; -extern const u32 b43_ntab_tdi40a1[]; -extern const u32 b43_ntab_tdtrn[]; -extern const u32 b43_ntab_tmap[]; - +void b43_nphy_rev0_1_2_tables_init (struct b43_wldev *dev); +void b43_nphy_rev3plus_tables_init (struct b43_wldev *dev);#endif /* B43_TABLES_NPHY_H_ */
Signature · 1 line
1.6.4.2