aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/radio_2056.c
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-04-20 07:05:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-04-22 15:06:33 -0400
commitc7ebe237e0bf8960f9b764c5fc51f6448fa48cc7 (patch)
treeec828d2d69def1310c8091d447c015b0426457f9 /drivers/net/wireless/b43/radio_2056.c
parent4bd48b86f1606e33fea8a0d4ec5c478f0c625489 (diff)
b43: N-PHY: fix selection of init & calib values
Logic in specs and our code was wrong. Init and calibration values for newer cards depend on radio revision, not PHY revision. To make code clearer, change tables names to include "radio" or "phy". Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/radio_2056.c')
-rw-r--r--drivers/net/wireless/b43/radio_2056.c172
1 files changed, 105 insertions, 67 deletions
diff --git a/drivers/net/wireless/b43/radio_2056.c b/drivers/net/wireless/b43/radio_2056.c
index d252c5247bb8..a07e4cacab77 100644
--- a/drivers/net/wireless/b43/radio_2056.c
+++ b/drivers/net/wireless/b43/radio_2056.c
@@ -48,7 +48,7 @@ struct b2056_inittabs_pts {
48 unsigned int rx_length; 48 unsigned int rx_length;
49}; 49};
50 50
51static const struct b2056_inittab_entry b2056_inittab_rev3_syn[] = { 51static const struct b2056_inittab_entry b2056_inittab_phy_rev3_syn[] = {
52 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 52 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
53 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 53 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
54 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 54 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -232,7 +232,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev3_syn[] = {
232 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 232 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
233}; 233};
234 234
235static const struct b2056_inittab_entry b2056_inittab_rev3_tx[] = { 235static const struct b2056_inittab_entry b2056_inittab_phy_rev3_tx[] = {
236 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 236 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
237 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 237 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
238 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 238 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -380,7 +380,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev3_tx[] = {
380 [B2056_TX_STATUS_TXLPF_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 380 [B2056_TX_STATUS_TXLPF_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
381}; 381};
382 382
383static const struct b2056_inittab_entry b2056_inittab_rev3_rx[] = { 383static const struct b2056_inittab_entry b2056_inittab_phy_rev3_rx[] = {
384 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 384 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
385 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 385 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
386 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 386 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -530,7 +530,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev3_rx[] = {
530 [B2056_RX_STATUS_HPC_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 530 [B2056_RX_STATUS_HPC_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
531}; 531};
532 532
533static const struct b2056_inittab_entry b2056_inittab_rev4_syn[] = { 533static const struct b2056_inittab_entry b2056_inittab_phy_rev4_syn[] = {
534 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 534 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
535 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 535 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
536 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 536 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -714,7 +714,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev4_syn[] = {
714 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 714 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
715}; 715};
716 716
717static const struct b2056_inittab_entry b2056_inittab_rev4_tx[] = { 717static const struct b2056_inittab_entry b2056_inittab_phy_rev4_tx[] = {
718 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 718 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
719 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 719 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
720 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 720 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -862,7 +862,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev4_tx[] = {
862 [B2056_TX_STATUS_TXLPF_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 862 [B2056_TX_STATUS_TXLPF_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
863}; 863};
864 864
865static const struct b2056_inittab_entry b2056_inittab_rev4_rx[] = { 865static const struct b2056_inittab_entry b2056_inittab_phy_rev4_rx[] = {
866 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 866 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
867 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 867 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
868 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 868 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -1012,7 +1012,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev4_rx[] = {
1012 [B2056_RX_STATUS_HPC_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1012 [B2056_RX_STATUS_HPC_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1013}; 1013};
1014 1014
1015static const struct b2056_inittab_entry b2056_inittab_rev5_syn[] = { 1015static const struct b2056_inittab_entry b2056_inittab_radio_rev5_syn[] = {
1016 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1016 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1017 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1017 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1018 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1018 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -1196,7 +1196,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev5_syn[] = {
1196 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1196 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1197}; 1197};
1198 1198
1199static const struct b2056_inittab_entry b2056_inittab_rev5_tx[] = { 1199static const struct b2056_inittab_entry b2056_inittab_radio_rev5_tx[] = {
1200 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1200 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1201 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1201 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1202 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1202 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -1352,7 +1352,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev5_tx[] = {
1352 [B2056_TX_GMBB_IDAC7] = { .ghz5 = 0x0075, .ghz2 = 0x0075, UPLOAD, }, 1352 [B2056_TX_GMBB_IDAC7] = { .ghz5 = 0x0075, .ghz2 = 0x0075, UPLOAD, },
1353}; 1353};
1354 1354
1355static const struct b2056_inittab_entry b2056_inittab_rev5_rx[] = { 1355static const struct b2056_inittab_entry b2056_inittab_radio_rev5_rx[] = {
1356 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1356 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1357 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1357 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1358 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1358 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -1502,7 +1502,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev5_rx[] = {
1502 [B2056_RX_STATUS_HPC_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1502 [B2056_RX_STATUS_HPC_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1503}; 1503};
1504 1504
1505static const struct b2056_inittab_entry b2056_inittab_rev6_syn[] = { 1505static const struct b2056_inittab_entry b2056_inittab_radio_rev6_syn[] = {
1506 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1506 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1507 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1507 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1508 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1508 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -1686,7 +1686,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev6_syn[] = {
1686 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1686 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1687}; 1687};
1688 1688
1689static const struct b2056_inittab_entry b2056_inittab_rev6_tx[] = { 1689static const struct b2056_inittab_entry b2056_inittab_radio_rev6_tx[] = {
1690 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1690 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1691 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1691 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1692 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1692 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -1842,7 +1842,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev6_tx[] = {
1842 [B2056_TX_GMBB_IDAC7] = { .ghz5 = 0x0070, .ghz2 = 0x0070, NOUPLOAD, }, 1842 [B2056_TX_GMBB_IDAC7] = { .ghz5 = 0x0070, .ghz2 = 0x0070, NOUPLOAD, },
1843}; 1843};
1844 1844
1845static const struct b2056_inittab_entry b2056_inittab_rev6_rx[] = { 1845static const struct b2056_inittab_entry b2056_inittab_radio_rev6_rx[] = {
1846 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1846 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1847 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1847 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1848 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1848 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -1992,7 +1992,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev6_rx[] = {
1992 [B2056_RX_STATUS_HPC_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1992 [B2056_RX_STATUS_HPC_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1993}; 1993};
1994 1994
1995static const struct b2056_inittab_entry b2056_inittab_rev7_syn[] = { 1995static const struct b2056_inittab_entry b2056_inittab_radio_rev7_9_syn[] = {
1996 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1996 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1997 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1997 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
1998 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 1998 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -2176,7 +2176,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev7_syn[] = {
2176 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2176 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2177}; 2177};
2178 2178
2179static const struct b2056_inittab_entry b2056_inittab_rev7_tx[] = { 2179static const struct b2056_inittab_entry b2056_inittab_radio_rev7_9_tx[] = {
2180 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2180 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2181 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2181 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2182 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2182 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -2332,7 +2332,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev7_tx[] = {
2332 [B2056_TX_GMBB_IDAC7] = { .ghz5 = 0x0075, .ghz2 = 0x0075, UPLOAD, }, 2332 [B2056_TX_GMBB_IDAC7] = { .ghz5 = 0x0075, .ghz2 = 0x0075, UPLOAD, },
2333}; 2333};
2334 2334
2335static const struct b2056_inittab_entry b2056_inittab_rev7_rx[] = { 2335static const struct b2056_inittab_entry b2056_inittab_radio_rev7_9_rx[] = {
2336 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2336 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2337 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2337 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2338 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2338 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -2482,7 +2482,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev7_rx[] = {
2482 [B2056_RX_STATUS_HPC_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2482 [B2056_RX_STATUS_HPC_RC] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2483}; 2483};
2484 2484
2485static const struct b2056_inittab_entry b2056_inittab_rev8_syn[] = { 2485static const struct b2056_inittab_entry b2056_inittab_radio_rev8_syn[] = {
2486 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2486 [B2056_SYN_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2487 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2487 [B2056_SYN_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2488 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2488 [B2056_SYN_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -2666,7 +2666,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev8_syn[] = {
2666 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2666 [B2056_SYN_LOGEN_TX_CMOS_VALID] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2667}; 2667};
2668 2668
2669static const struct b2056_inittab_entry b2056_inittab_rev8_tx[] = { 2669static const struct b2056_inittab_entry b2056_inittab_radio_rev8_tx[] = {
2670 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2670 [B2056_TX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2671 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2671 [B2056_TX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2672 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2672 [B2056_TX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -2822,7 +2822,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev8_tx[] = {
2822 [B2056_TX_GMBB_IDAC7] = { .ghz5 = 0x0070, .ghz2 = 0x0070, NOUPLOAD, }, 2822 [B2056_TX_GMBB_IDAC7] = { .ghz5 = 0x0070, .ghz2 = 0x0070, NOUPLOAD, },
2823}; 2823};
2824 2824
2825static const struct b2056_inittab_entry b2056_inittab_rev8_rx[] = { 2825static const struct b2056_inittab_entry b2056_inittab_radio_rev8_rx[] = {
2826 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2826 [B2056_RX_RESERVED_ADDR2] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2827 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2827 [B2056_RX_RESERVED_ADDR3] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
2828 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, }, 2828 [B2056_RX_RESERVED_ADDR4] = { .ghz5 = 0x0000, .ghz2 = 0x0000, NOUPLOAD, },
@@ -3018,22 +3018,22 @@ static const struct b2056_inittab_entry b2056_inittab_radio_rev11_rx[] = {
3018}; 3018};
3019 3019
3020#define INITTABSPTS(prefix) \ 3020#define INITTABSPTS(prefix) \
3021 .syn = prefix##_syn, \ 3021 static const struct b2056_inittabs_pts prefix = { \
3022 .syn_length = ARRAY_SIZE(prefix##_syn), \ 3022 .syn = prefix##_syn, \
3023 .tx = prefix##_tx, \ 3023 .syn_length = ARRAY_SIZE(prefix##_syn), \
3024 .tx_length = ARRAY_SIZE(prefix##_tx), \ 3024 .tx = prefix##_tx, \
3025 .rx = prefix##_rx, \ 3025 .tx_length = ARRAY_SIZE(prefix##_tx), \
3026 .rx_length = ARRAY_SIZE(prefix##_rx) 3026 .rx = prefix##_rx, \
3027 .rx_length = ARRAY_SIZE(prefix##_rx), \
3028 }
3027 3029
3028static const struct b2056_inittabs_pts b2056_inittabs[] = { 3030INITTABSPTS(b2056_inittab_phy_rev3);
3029 [3] = { INITTABSPTS(b2056_inittab_rev3) }, 3031INITTABSPTS(b2056_inittab_phy_rev4);
3030 [4] = { INITTABSPTS(b2056_inittab_rev4) }, 3032INITTABSPTS(b2056_inittab_radio_rev5);
3031 [5] = { INITTABSPTS(b2056_inittab_rev5) }, 3033INITTABSPTS(b2056_inittab_radio_rev6);
3032 [6] = { INITTABSPTS(b2056_inittab_rev6) }, 3034INITTABSPTS(b2056_inittab_radio_rev7_9);
3033 [7] = { INITTABSPTS(b2056_inittab_rev7) }, 3035INITTABSPTS(b2056_inittab_radio_rev8);
3034 [8] = { INITTABSPTS(b2056_inittab_rev8) }, 3036INITTABSPTS(b2056_inittab_radio_rev11);
3035 [9] = { INITTABSPTS(b2056_inittab_rev7) },
3036};
3037 3037
3038#define RADIOREGS3(r00, r01, r02, r03, r04, r05, r06, r07, r08, r09, \ 3038#define RADIOREGS3(r00, r01, r02, r03, r04, r05, r06, r07, r08, r09, \
3039 r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, \ 3039 r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, \
@@ -3086,7 +3086,7 @@ static const struct b2056_inittabs_pts b2056_inittabs[] = {
3086 .phy_regs.phy_bw6 = r5 3086 .phy_regs.phy_bw6 = r5
3087 3087
3088/* http://bcm-v4.sipsolutions.net/802.11/Radio/2056/ChannelTable */ 3088/* http://bcm-v4.sipsolutions.net/802.11/Radio/2056/ChannelTable */
3089static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev3[] = { 3089static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_phy_rev3[] = {
3090 { .freq = 4920, 3090 { .freq = 4920,
3091 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 3091 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04,
3092 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 3092 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00,
@@ -4081,7 +4081,7 @@ static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev3[] =
4081 }, 4081 },
4082}; 4082};
4083 4083
4084static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev4[] = { 4084static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_phy_rev4[] = {
4085 { .freq = 4920, 4085 { .freq = 4920,
4086 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 4086 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04,
4087 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 4087 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00,
@@ -5076,7 +5076,7 @@ static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev4[] =
5076 }, 5076 },
5077}; 5077};
5078 5078
5079static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev5[] = { 5079static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_radio_rev5[] = {
5080 { .freq = 4920, 5080 { .freq = 4920,
5081 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 5081 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04,
5082 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 5082 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00,
@@ -6071,7 +6071,7 @@ static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev5[] =
6071 }, 6071 },
6072}; 6072};
6073 6073
6074static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev6[] = { 6074static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_radio_rev6[] = {
6075 { .freq = 4920, 6075 { .freq = 4920,
6076 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 6076 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04,
6077 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 6077 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00,
@@ -7066,7 +7066,7 @@ static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev6[] =
7066 }, 7066 },
7067}; 7067};
7068 7068
7069static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev7_9[] = { 7069static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_radio_rev7_9[] = {
7070 { .freq = 4920, 7070 { .freq = 4920,
7071 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 7071 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04,
7072 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 7072 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00,
@@ -8061,7 +8061,7 @@ static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev7_9[]
8061 }, 8061 },
8062}; 8062};
8063 8063
8064static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev8[] = { 8064static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_radio_rev8[] = {
8065 { .freq = 4920, 8065 { .freq = 4920,
8066 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 8066 RADIOREGS3(0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04,
8067 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 8067 0x0c, 0x01, 0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00,
@@ -9257,6 +9257,35 @@ static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_radio_rev
9257 }, 9257 },
9258}; 9258};
9259 9259
9260static const struct b2056_inittabs_pts
9261*b43_nphy_get_inittabs_rev3(struct b43_wldev *dev)
9262{
9263 struct b43_phy *phy = &dev->phy;
9264
9265 switch (dev->phy.rev) {
9266 case 3:
9267 return &b2056_inittab_phy_rev3;
9268 case 4:
9269 return &b2056_inittab_phy_rev4;
9270 default:
9271 switch (phy->radio_rev) {
9272 case 5:
9273 return &b2056_inittab_radio_rev5;
9274 case 6:
9275 return &b2056_inittab_radio_rev6;
9276 case 7:
9277 case 9:
9278 return &b2056_inittab_radio_rev7_9;
9279 case 8:
9280 return &b2056_inittab_radio_rev8;
9281 case 11:
9282 return &b2056_inittab_radio_rev11;
9283 }
9284 }
9285
9286 return NULL;
9287}
9288
9260static void b2056_upload_inittab(struct b43_wldev *dev, bool ghz5, 9289static void b2056_upload_inittab(struct b43_wldev *dev, bool ghz5,
9261 bool ignore_uploadflag, u16 routing, 9290 bool ignore_uploadflag, u16 routing,
9262 const struct b2056_inittab_entry *e, 9291 const struct b2056_inittab_entry *e,
@@ -9283,11 +9312,11 @@ void b2056_upload_inittabs(struct b43_wldev *dev,
9283{ 9312{
9284 const struct b2056_inittabs_pts *pts; 9313 const struct b2056_inittabs_pts *pts;
9285 9314
9286 if (dev->phy.rev >= ARRAY_SIZE(b2056_inittabs)) { 9315 pts = b43_nphy_get_inittabs_rev3(dev);
9316 if (!pts) {
9287 B43_WARN_ON(1); 9317 B43_WARN_ON(1);
9288 return; 9318 return;
9289 } 9319 }
9290 pts = &b2056_inittabs[dev->phy.rev];
9291 9320
9292 b2056_upload_inittab(dev, ghz5, ignore_uploadflag, 9321 b2056_upload_inittab(dev, ghz5, ignore_uploadflag,
9293 B2056_SYN, pts->syn, pts->syn_length); 9322 B2056_SYN, pts->syn, pts->syn_length);
@@ -9306,11 +9335,12 @@ void b2056_upload_syn_pll_cp2(struct b43_wldev *dev, bool ghz5)
9306 const struct b2056_inittabs_pts *pts; 9335 const struct b2056_inittabs_pts *pts;
9307 const struct b2056_inittab_entry *e; 9336 const struct b2056_inittab_entry *e;
9308 9337
9309 if (dev->phy.rev >= ARRAY_SIZE(b2056_inittabs)) { 9338 pts = b43_nphy_get_inittabs_rev3(dev);
9339 if (!pts) {
9310 B43_WARN_ON(1); 9340 B43_WARN_ON(1);
9311 return; 9341 return;
9312 } 9342 }
9313 pts = &b2056_inittabs[dev->phy.rev]; 9343
9314 e = &pts->syn[B2056_SYN_PLL_CP2]; 9344 e = &pts->syn[B2056_SYN_PLL_CP2];
9315 9345
9316 b43_radio_write(dev, B2056_SYN_PLL_CP2, ghz5 ? e->ghz5 : e->ghz2); 9346 b43_radio_write(dev, B2056_SYN_PLL_CP2, ghz5 ? e->ghz5 : e->ghz2);
@@ -9319,38 +9349,46 @@ void b2056_upload_syn_pll_cp2(struct b43_wldev *dev, bool ghz5)
9319const struct b43_nphy_channeltab_entry_rev3 * 9349const struct b43_nphy_channeltab_entry_rev3 *
9320b43_nphy_get_chantabent_rev3(struct b43_wldev *dev, u16 freq) 9350b43_nphy_get_chantabent_rev3(struct b43_wldev *dev, u16 freq)
9321{ 9351{
9352 struct b43_phy *phy = &dev->phy;
9322 const struct b43_nphy_channeltab_entry_rev3 *e; 9353 const struct b43_nphy_channeltab_entry_rev3 *e;
9323 unsigned int length, i; 9354 unsigned int length, i;
9324 9355
9325 switch (dev->phy.rev) { 9356 switch (phy->rev) {
9326 case 3: 9357 case 3:
9327 e = b43_nphy_channeltab_rev3; 9358 e = b43_nphy_channeltab_phy_rev3;
9328 length = ARRAY_SIZE(b43_nphy_channeltab_rev3); 9359 length = ARRAY_SIZE(b43_nphy_channeltab_phy_rev3);
9329 break; 9360 break;
9330 case 4: 9361 case 4:
9331 e = b43_nphy_channeltab_rev4; 9362 e = b43_nphy_channeltab_phy_rev4;
9332 length = ARRAY_SIZE(b43_nphy_channeltab_rev4); 9363 length = ARRAY_SIZE(b43_nphy_channeltab_phy_rev4);
9333 break;
9334 case 5:
9335 e = b43_nphy_channeltab_rev5;
9336 length = ARRAY_SIZE(b43_nphy_channeltab_rev5);
9337 break;
9338 case 6:
9339 e = b43_nphy_channeltab_rev6;
9340 length = ARRAY_SIZE(b43_nphy_channeltab_rev6);
9341 break;
9342 case 7:
9343 case 9:
9344 e = b43_nphy_channeltab_rev7_9;
9345 length = ARRAY_SIZE(b43_nphy_channeltab_rev7_9);
9346 break;
9347 case 8:
9348 e = b43_nphy_channeltab_rev8;
9349 length = ARRAY_SIZE(b43_nphy_channeltab_rev8);
9350 break; 9364 break;
9351 default: 9365 default:
9352 B43_WARN_ON(1); 9366 switch (phy->radio_rev) {
9353 return NULL; 9367 case 5:
9368 e = b43_nphy_channeltab_radio_rev5;
9369 length = ARRAY_SIZE(b43_nphy_channeltab_radio_rev5);
9370 break;
9371 case 6:
9372 e = b43_nphy_channeltab_radio_rev6;
9373 length = ARRAY_SIZE(b43_nphy_channeltab_radio_rev6);
9374 break;
9375 case 7:
9376 case 9:
9377 e = b43_nphy_channeltab_radio_rev7_9;
9378 length = ARRAY_SIZE(b43_nphy_channeltab_radio_rev7_9);
9379 break;
9380 case 8:
9381 e = b43_nphy_channeltab_radio_rev8;
9382 length = ARRAY_SIZE(b43_nphy_channeltab_radio_rev8);
9383 break;
9384 case 11:
9385 e = b43_nphy_channeltab_radio_rev11;
9386 length = ARRAY_SIZE(b43_nphy_channeltab_radio_rev11);
9387 break;
9388 default:
9389 B43_WARN_ON(1);
9390 return NULL;
9391 }
9354 } 9392 }
9355 9393
9356 for (i = 0; i < length; i++, e++) { 9394 for (i = 0; i < length; i++, e++) {