diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-01-15 06:18:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-15 17:05:29 -0500 |
commit | 4772ae107c42cdce1d3864d8d540ea0401eb09d6 (patch) | |
tree | 20c010e7c71b4ff534e822ec602407cb149f7232 /drivers/net/wireless/b43 | |
parent | 003d6d2792bebb2b66966ce5f1da11849e855180 (diff) |
b43: N-PHY: clean table init, check PHY rev
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.
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')
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 38 | ||||
-rw-r--r-- | drivers/net/wireless/b43/tables_nphy.c | 100 | ||||
-rw-r--r-- | drivers/net/wireless/b43/tables_nphy.h | 29 |
3 files changed, 84 insertions, 83 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 992318a78077..6b995b92af7a 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -203,38 +203,16 @@ void b43_nphy_radio_turn_off(struct b43_wldev *dev) | |||
203 | b43_ntab_write(dev, (offset) + i, (data)[i]); \ | 203 | b43_ntab_write(dev, (offset) + i, (data)[i]); \ |
204 | } while (0) | 204 | } while (0) |
205 | 205 | ||
206 | /* Upload the N-PHY tables. */ | 206 | /* |
207 | * Upload the N-PHY tables. | ||
208 | * http://bcm-v4.sipsolutions.net/802.11/PHY/N/InitTables | ||
209 | */ | ||
207 | static void b43_nphy_tables_init(struct b43_wldev *dev) | 210 | static void b43_nphy_tables_init(struct b43_wldev *dev) |
208 | { | 211 | { |
209 | /* Static tables */ | 212 | if (dev->phy.rev < 3) |
210 | ntab_upload(dev, B43_NTAB_FRAMESTRUCT, b43_ntab_framestruct); | 213 | b43_nphy_rev0_1_2_tables_init(dev); |
211 | ntab_upload(dev, B43_NTAB_FRAMELT, b43_ntab_framelookup); | 214 | else |
212 | ntab_upload(dev, B43_NTAB_TMAP, b43_ntab_tmap); | 215 | b43_nphy_rev3plus_tables_init(dev); |
213 | ntab_upload(dev, B43_NTAB_TDTRN, b43_ntab_tdtrn); | ||
214 | ntab_upload(dev, B43_NTAB_INTLEVEL, b43_ntab_intlevel); | ||
215 | ntab_upload(dev, B43_NTAB_PILOT, b43_ntab_pilot); | ||
216 | ntab_upload(dev, B43_NTAB_PILOTLT, b43_ntab_pilotlt); | ||
217 | ntab_upload(dev, B43_NTAB_TDI20A0, b43_ntab_tdi20a0); | ||
218 | ntab_upload(dev, B43_NTAB_TDI20A1, b43_ntab_tdi20a1); | ||
219 | ntab_upload(dev, B43_NTAB_TDI40A0, b43_ntab_tdi40a0); | ||
220 | ntab_upload(dev, B43_NTAB_TDI40A1, b43_ntab_tdi40a1); | ||
221 | ntab_upload(dev, B43_NTAB_BDI, b43_ntab_bdi); | ||
222 | ntab_upload(dev, B43_NTAB_CHANEST, b43_ntab_channelest); | ||
223 | ntab_upload(dev, B43_NTAB_MCS, b43_ntab_mcs); | ||
224 | |||
225 | /* Volatile tables */ | ||
226 | ntab_upload(dev, B43_NTAB_NOISEVAR10, b43_ntab_noisevar10); | ||
227 | ntab_upload(dev, B43_NTAB_NOISEVAR11, b43_ntab_noisevar11); | ||
228 | ntab_upload(dev, B43_NTAB_C0_ESTPLT, b43_ntab_estimatepowerlt0); | ||
229 | ntab_upload(dev, B43_NTAB_C1_ESTPLT, b43_ntab_estimatepowerlt1); | ||
230 | ntab_upload(dev, B43_NTAB_C0_ADJPLT, b43_ntab_adjustpower0); | ||
231 | ntab_upload(dev, B43_NTAB_C1_ADJPLT, b43_ntab_adjustpower1); | ||
232 | ntab_upload(dev, B43_NTAB_C0_GAINCTL, b43_ntab_gainctl0); | ||
233 | ntab_upload(dev, B43_NTAB_C1_GAINCTL, b43_ntab_gainctl1); | ||
234 | ntab_upload(dev, B43_NTAB_C0_IQLT, b43_ntab_iqlt0); | ||
235 | ntab_upload(dev, B43_NTAB_C1_IQLT, b43_ntab_iqlt1); | ||
236 | ntab_upload(dev, B43_NTAB_C0_LOFEEDTH, b43_ntab_loftlt0); | ||
237 | ntab_upload(dev, B43_NTAB_C1_LOFEEDTH, b43_ntab_loftlt1); | ||
238 | } | 216 | } |
239 | 217 | ||
240 | static void b43_nphy_workarounds(struct b43_wldev *dev) | 218 | static void b43_nphy_workarounds(struct b43_wldev *dev) |
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c index 4e2336315545..d0b91b561fb8 100644 --- a/drivers/net/wireless/b43/tables_nphy.c +++ b/drivers/net/wireless/b43/tables_nphy.c | |||
@@ -1336,7 +1336,7 @@ b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel) | |||
1336 | } | 1336 | } |
1337 | 1337 | ||
1338 | 1338 | ||
1339 | const u8 b43_ntab_adjustpower0[] = { | 1339 | static const u8 b43_ntab_adjustpower0[] = { |
1340 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, | 1340 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, |
1341 | 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, | 1341 | 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, |
1342 | 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, | 1342 | 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, |
@@ -1355,7 +1355,7 @@ const u8 b43_ntab_adjustpower0[] = { | |||
1355 | 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, | 1355 | 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, |
1356 | }; | 1356 | }; |
1357 | 1357 | ||
1358 | const u8 b43_ntab_adjustpower1[] = { | 1358 | static const u8 b43_ntab_adjustpower1[] = { |
1359 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, | 1359 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, |
1360 | 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, | 1360 | 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, |
1361 | 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, | 1361 | 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, |
@@ -1374,11 +1374,11 @@ const u8 b43_ntab_adjustpower1[] = { | |||
1374 | 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, | 1374 | 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, |
1375 | }; | 1375 | }; |
1376 | 1376 | ||
1377 | const u16 b43_ntab_bdi[] = { | 1377 | static const u16 b43_ntab_bdi[] = { |
1378 | 0x0070, 0x0126, 0x012C, 0x0246, 0x048D, 0x04D2, | 1378 | 0x0070, 0x0126, 0x012C, 0x0246, 0x048D, 0x04D2, |
1379 | }; | 1379 | }; |
1380 | 1380 | ||
1381 | const u32 b43_ntab_channelest[] = { | 1381 | static const u32 b43_ntab_channelest[] = { |
1382 | 0x44444444, 0x44444444, 0x44444444, 0x44444444, | 1382 | 0x44444444, 0x44444444, 0x44444444, 0x44444444, |
1383 | 0x44444444, 0x44444444, 0x44444444, 0x44444444, | 1383 | 0x44444444, 0x44444444, 0x44444444, 0x44444444, |
1384 | 0x10101010, 0x10101010, 0x10101010, 0x10101010, | 1384 | 0x10101010, 0x10101010, 0x10101010, 0x10101010, |
@@ -1405,7 +1405,7 @@ const u32 b43_ntab_channelest[] = { | |||
1405 | 0x10101010, 0x10101010, 0x10101010, 0x10101010, | 1405 | 0x10101010, 0x10101010, 0x10101010, 0x10101010, |
1406 | }; | 1406 | }; |
1407 | 1407 | ||
1408 | const u8 b43_ntab_estimatepowerlt0[] = { | 1408 | static const u8 b43_ntab_estimatepowerlt0[] = { |
1409 | 0x50, 0x4F, 0x4E, 0x4D, 0x4C, 0x4B, 0x4A, 0x49, | 1409 | 0x50, 0x4F, 0x4E, 0x4D, 0x4C, 0x4B, 0x4A, 0x49, |
1410 | 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41, | 1410 | 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41, |
1411 | 0x40, 0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, | 1411 | 0x40, 0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, |
@@ -1416,7 +1416,7 @@ const u8 b43_ntab_estimatepowerlt0[] = { | |||
1416 | 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, | 1416 | 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, |
1417 | }; | 1417 | }; |
1418 | 1418 | ||
1419 | const u8 b43_ntab_estimatepowerlt1[] = { | 1419 | static const u8 b43_ntab_estimatepowerlt1[] = { |
1420 | 0x50, 0x4F, 0x4E, 0x4D, 0x4C, 0x4B, 0x4A, 0x49, | 1420 | 0x50, 0x4F, 0x4E, 0x4D, 0x4C, 0x4B, 0x4A, 0x49, |
1421 | 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41, | 1421 | 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41, |
1422 | 0x40, 0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, | 1422 | 0x40, 0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, |
@@ -1427,14 +1427,14 @@ const u8 b43_ntab_estimatepowerlt1[] = { | |||
1427 | 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, | 1427 | 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, |
1428 | }; | 1428 | }; |
1429 | 1429 | ||
1430 | const u8 b43_ntab_framelookup[] = { | 1430 | static const u8 b43_ntab_framelookup[] = { |
1431 | 0x02, 0x04, 0x14, 0x14, 0x03, 0x05, 0x16, 0x16, | 1431 | 0x02, 0x04, 0x14, 0x14, 0x03, 0x05, 0x16, 0x16, |
1432 | 0x0A, 0x0C, 0x1C, 0x1C, 0x0B, 0x0D, 0x1E, 0x1E, | 1432 | 0x0A, 0x0C, 0x1C, 0x1C, 0x0B, 0x0D, 0x1E, 0x1E, |
1433 | 0x06, 0x08, 0x18, 0x18, 0x07, 0x09, 0x1A, 0x1A, | 1433 | 0x06, 0x08, 0x18, 0x18, 0x07, 0x09, 0x1A, 0x1A, |
1434 | 0x0E, 0x10, 0x20, 0x28, 0x0F, 0x11, 0x22, 0x2A, | 1434 | 0x0E, 0x10, 0x20, 0x28, 0x0F, 0x11, 0x22, 0x2A, |
1435 | }; | 1435 | }; |
1436 | 1436 | ||
1437 | const u32 b43_ntab_framestruct[] = { | 1437 | static const u32 b43_ntab_framestruct[] = { |
1438 | 0x08004A04, 0x00100000, 0x01000A05, 0x00100020, | 1438 | 0x08004A04, 0x00100000, 0x01000A05, 0x00100020, |
1439 | 0x09804506, 0x00100030, 0x09804507, 0x00100030, | 1439 | 0x09804506, 0x00100030, 0x09804507, 0x00100030, |
1440 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, | 1440 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
@@ -1645,7 +1645,7 @@ const u32 b43_ntab_framestruct[] = { | |||
1645 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, | 1645 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
1646 | }; | 1646 | }; |
1647 | 1647 | ||
1648 | const u32 b43_ntab_gainctl0[] = { | 1648 | static const u32 b43_ntab_gainctl0[] = { |
1649 | 0x007F003F, 0x007E013F, 0x007D023E, 0x007C033E, | 1649 | 0x007F003F, 0x007E013F, 0x007D023E, 0x007C033E, |
1650 | 0x007B043D, 0x007A053D, 0x0079063C, 0x0078073C, | 1650 | 0x007B043D, 0x007A053D, 0x0079063C, 0x0078073C, |
1651 | 0x0077083B, 0x0076093B, 0x00750A3A, 0x00740B3A, | 1651 | 0x0077083B, 0x0076093B, 0x00750A3A, 0x00740B3A, |
@@ -1680,7 +1680,7 @@ const u32 b43_ntab_gainctl0[] = { | |||
1680 | 0x00030C01, 0x00020D01, 0x00010E00, 0x00000F00, | 1680 | 0x00030C01, 0x00020D01, 0x00010E00, 0x00000F00, |
1681 | }; | 1681 | }; |
1682 | 1682 | ||
1683 | const u32 b43_ntab_gainctl1[] = { | 1683 | static const u32 b43_ntab_gainctl1[] = { |
1684 | 0x007F003F, 0x007E013F, 0x007D023E, 0x007C033E, | 1684 | 0x007F003F, 0x007E013F, 0x007D023E, 0x007C033E, |
1685 | 0x007B043D, 0x007A053D, 0x0079063C, 0x0078073C, | 1685 | 0x007B043D, 0x007A053D, 0x0079063C, 0x0078073C, |
1686 | 0x0077083B, 0x0076093B, 0x00750A3A, 0x00740B3A, | 1686 | 0x0077083B, 0x0076093B, 0x00750A3A, 0x00740B3A, |
@@ -1715,12 +1715,12 @@ const u32 b43_ntab_gainctl1[] = { | |||
1715 | 0x00030C01, 0x00020D01, 0x00010E00, 0x00000F00, | 1715 | 0x00030C01, 0x00020D01, 0x00010E00, 0x00000F00, |
1716 | }; | 1716 | }; |
1717 | 1717 | ||
1718 | const u32 b43_ntab_intlevel[] = { | 1718 | static const u32 b43_ntab_intlevel[] = { |
1719 | 0x00802070, 0x0671188D, 0x0A60192C, 0x0A300E46, | 1719 | 0x00802070, 0x0671188D, 0x0A60192C, 0x0A300E46, |
1720 | 0x00C1188D, 0x080024D2, 0x00000070, | 1720 | 0x00C1188D, 0x080024D2, 0x00000070, |
1721 | }; | 1721 | }; |
1722 | 1722 | ||
1723 | const u32 b43_ntab_iqlt0[] = { | 1723 | static const u32 b43_ntab_iqlt0[] = { |
1724 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, | 1724 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, |
1725 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, | 1725 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, |
1726 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, | 1726 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, |
@@ -1755,7 +1755,7 @@ const u32 b43_ntab_iqlt0[] = { | |||
1755 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, | 1755 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, |
1756 | }; | 1756 | }; |
1757 | 1757 | ||
1758 | const u32 b43_ntab_iqlt1[] = { | 1758 | static const u32 b43_ntab_iqlt1[] = { |
1759 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, | 1759 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, |
1760 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, | 1760 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, |
1761 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, | 1761 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, |
@@ -1790,7 +1790,7 @@ const u32 b43_ntab_iqlt1[] = { | |||
1790 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, | 1790 | 0x0000007F, 0x0000007F, 0x0000007F, 0x0000007F, |
1791 | }; | 1791 | }; |
1792 | 1792 | ||
1793 | const u16 b43_ntab_loftlt0[] = { | 1793 | static const u16 b43_ntab_loftlt0[] = { |
1794 | 0x0000, 0x0101, 0x0002, 0x0103, 0x0000, 0x0101, | 1794 | 0x0000, 0x0101, 0x0002, 0x0103, 0x0000, 0x0101, |
1795 | 0x0002, 0x0103, 0x0000, 0x0101, 0x0002, 0x0103, | 1795 | 0x0002, 0x0103, 0x0000, 0x0101, 0x0002, 0x0103, |
1796 | 0x0000, 0x0101, 0x0002, 0x0103, 0x0000, 0x0101, | 1796 | 0x0000, 0x0101, 0x0002, 0x0103, 0x0000, 0x0101, |
@@ -1815,7 +1815,7 @@ const u16 b43_ntab_loftlt0[] = { | |||
1815 | 0x0002, 0x0103, | 1815 | 0x0002, 0x0103, |
1816 | }; | 1816 | }; |
1817 | 1817 | ||
1818 | const u16 b43_ntab_loftlt1[] = { | 1818 | static const u16 b43_ntab_loftlt1[] = { |
1819 | 0x0000, 0x0101, 0x0002, 0x0103, 0x0000, 0x0101, | 1819 | 0x0000, 0x0101, 0x0002, 0x0103, 0x0000, 0x0101, |
1820 | 0x0002, 0x0103, 0x0000, 0x0101, 0x0002, 0x0103, | 1820 | 0x0002, 0x0103, 0x0000, 0x0101, 0x0002, 0x0103, |
1821 | 0x0000, 0x0101, 0x0002, 0x0103, 0x0000, 0x0101, | 1821 | 0x0000, 0x0101, 0x0002, 0x0103, 0x0000, 0x0101, |
@@ -1840,7 +1840,7 @@ const u16 b43_ntab_loftlt1[] = { | |||
1840 | 0x0002, 0x0103, | 1840 | 0x0002, 0x0103, |
1841 | }; | 1841 | }; |
1842 | 1842 | ||
1843 | const u8 b43_ntab_mcs[] = { | 1843 | static const u8 b43_ntab_mcs[] = { |
1844 | 0x00, 0x08, 0x0A, 0x10, 0x12, 0x19, 0x1A, 0x1C, | 1844 | 0x00, 0x08, 0x0A, 0x10, 0x12, 0x19, 0x1A, 0x1C, |
1845 | 0x40, 0x48, 0x4A, 0x50, 0x52, 0x59, 0x5A, 0x5C, | 1845 | 0x40, 0x48, 0x4A, 0x50, 0x52, 0x59, 0x5A, 0x5C, |
1846 | 0x80, 0x88, 0x8A, 0x90, 0x92, 0x99, 0x9A, 0x9C, | 1846 | 0x80, 0x88, 0x8A, 0x90, 0x92, 0x99, 0x9A, 0x9C, |
@@ -1859,7 +1859,7 @@ const u8 b43_ntab_mcs[] = { | |||
1859 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1859 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
1860 | }; | 1860 | }; |
1861 | 1861 | ||
1862 | const u32 b43_ntab_noisevar10[] = { | 1862 | static const u32 b43_ntab_noisevar10[] = { |
1863 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, | 1863 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, |
1864 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, | 1864 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, |
1865 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, | 1865 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, |
@@ -1926,7 +1926,7 @@ const u32 b43_ntab_noisevar10[] = { | |||
1926 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, | 1926 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, |
1927 | }; | 1927 | }; |
1928 | 1928 | ||
1929 | const u32 b43_ntab_noisevar11[] = { | 1929 | static const u32 b43_ntab_noisevar11[] = { |
1930 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, | 1930 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, |
1931 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, | 1931 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, |
1932 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, | 1932 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, |
@@ -1993,7 +1993,7 @@ const u32 b43_ntab_noisevar11[] = { | |||
1993 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, | 1993 | 0x020C020C, 0x0000014D, 0x020C020C, 0x0000014D, |
1994 | }; | 1994 | }; |
1995 | 1995 | ||
1996 | const u16 b43_ntab_pilot[] = { | 1996 | static const u16 b43_ntab_pilot[] = { |
1997 | 0xFF08, 0xFF08, 0xFF08, 0xFF08, 0xFF08, 0xFF08, | 1997 | 0xFF08, 0xFF08, 0xFF08, 0xFF08, 0xFF08, 0xFF08, |
1998 | 0xFF08, 0xFF08, 0x80D5, 0x80D5, 0x80D5, 0x80D5, | 1998 | 0xFF08, 0xFF08, 0x80D5, 0x80D5, 0x80D5, 0x80D5, |
1999 | 0x80D5, 0x80D5, 0x80D5, 0x80D5, 0xFF0A, 0xFF82, | 1999 | 0x80D5, 0x80D5, 0x80D5, 0x80D5, 0xFF0A, 0xFF82, |
@@ -2011,12 +2011,12 @@ const u16 b43_ntab_pilot[] = { | |||
2011 | 0xF0A0, 0xF028, 0xFFFF, 0xFFFF, | 2011 | 0xF0A0, 0xF028, 0xFFFF, 0xFFFF, |
2012 | }; | 2012 | }; |
2013 | 2013 | ||
2014 | const u32 b43_ntab_pilotlt[] = { | 2014 | static const u32 b43_ntab_pilotlt[] = { |
2015 | 0x76540123, 0x62407351, 0x76543201, 0x76540213, | 2015 | 0x76540123, 0x62407351, 0x76543201, 0x76540213, |
2016 | 0x76540123, 0x76430521, | 2016 | 0x76540123, 0x76430521, |
2017 | }; | 2017 | }; |
2018 | 2018 | ||
2019 | const u32 b43_ntab_tdi20a0[] = { | 2019 | static const u32 b43_ntab_tdi20a0[] = { |
2020 | 0x00091226, 0x000A1429, 0x000B56AD, 0x000C58B0, | 2020 | 0x00091226, 0x000A1429, 0x000B56AD, 0x000C58B0, |
2021 | 0x000D5AB3, 0x000E9CB6, 0x000F9EBA, 0x0000C13D, | 2021 | 0x000D5AB3, 0x000E9CB6, 0x000F9EBA, 0x0000C13D, |
2022 | 0x00020301, 0x00030504, 0x00040708, 0x0005090B, | 2022 | 0x00020301, 0x00030504, 0x00040708, 0x0005090B, |
@@ -2033,7 +2033,7 @@ const u32 b43_ntab_tdi20a0[] = { | |||
2033 | 0x00000000, 0x00000000, 0x00000000, | 2033 | 0x00000000, 0x00000000, 0x00000000, |
2034 | }; | 2034 | }; |
2035 | 2035 | ||
2036 | const u32 b43_ntab_tdi20a1[] = { | 2036 | static const u32 b43_ntab_tdi20a1[] = { |
2037 | 0x00014B26, 0x00028D29, 0x000393AD, 0x00049630, | 2037 | 0x00014B26, 0x00028D29, 0x000393AD, 0x00049630, |
2038 | 0x0005D833, 0x0006DA36, 0x00099C3A, 0x000A9E3D, | 2038 | 0x0005D833, 0x0006DA36, 0x00099C3A, 0x000A9E3D, |
2039 | 0x000BC081, 0x000CC284, 0x000DC488, 0x000F068B, | 2039 | 0x000BC081, 0x000CC284, 0x000DC488, 0x000F068B, |
@@ -2050,7 +2050,7 @@ const u32 b43_ntab_tdi20a1[] = { | |||
2050 | 0x00000000, 0x00000000, 0x00000000, | 2050 | 0x00000000, 0x00000000, 0x00000000, |
2051 | }; | 2051 | }; |
2052 | 2052 | ||
2053 | const u32 b43_ntab_tdi40a0[] = { | 2053 | static const u32 b43_ntab_tdi40a0[] = { |
2054 | 0x0011A346, 0x00136CCF, 0x0014F5D9, 0x001641E2, | 2054 | 0x0011A346, 0x00136CCF, 0x0014F5D9, 0x001641E2, |
2055 | 0x0017CB6B, 0x00195475, 0x001B2383, 0x001CAD0C, | 2055 | 0x0017CB6B, 0x00195475, 0x001B2383, 0x001CAD0C, |
2056 | 0x001E7616, 0x0000821F, 0x00020BA8, 0x0003D4B2, | 2056 | 0x001E7616, 0x0000821F, 0x00020BA8, 0x0003D4B2, |
@@ -2081,7 +2081,7 @@ const u32 b43_ntab_tdi40a0[] = { | |||
2081 | 0x00000000, 0x00000000, | 2081 | 0x00000000, 0x00000000, |
2082 | }; | 2082 | }; |
2083 | 2083 | ||
2084 | const u32 b43_ntab_tdi40a1[] = { | 2084 | static const u32 b43_ntab_tdi40a1[] = { |
2085 | 0x001EDB36, 0x000129CA, 0x0002B353, 0x00047CDD, | 2085 | 0x001EDB36, 0x000129CA, 0x0002B353, 0x00047CDD, |
2086 | 0x0005C8E6, 0x000791EF, 0x00091BF9, 0x000AAA07, | 2086 | 0x0005C8E6, 0x000791EF, 0x00091BF9, 0x000AAA07, |
2087 | 0x000C3391, 0x000DFD1A, 0x00120923, 0x0013D22D, | 2087 | 0x000C3391, 0x000DFD1A, 0x00120923, 0x0013D22D, |
@@ -2112,7 +2112,7 @@ const u32 b43_ntab_tdi40a1[] = { | |||
2112 | 0x00000000, 0x00000000, | 2112 | 0x00000000, 0x00000000, |
2113 | }; | 2113 | }; |
2114 | 2114 | ||
2115 | const u32 b43_ntab_tdtrn[] = { | 2115 | static const u32 b43_ntab_tdtrn[] = { |
2116 | 0x061C061C, 0x0050EE68, 0xF592FE36, 0xFE5212F6, | 2116 | 0x061C061C, 0x0050EE68, 0xF592FE36, 0xFE5212F6, |
2117 | 0x00000C38, 0xFE5212F6, 0xF592FE36, 0x0050EE68, | 2117 | 0x00000C38, 0xFE5212F6, 0xF592FE36, 0x0050EE68, |
2118 | 0x061C061C, 0xEE680050, 0xFE36F592, 0x12F6FE52, | 2118 | 0x061C061C, 0xEE680050, 0xFE36F592, 0x12F6FE52, |
@@ -2291,7 +2291,7 @@ const u32 b43_ntab_tdtrn[] = { | |||
2291 | 0xFA58FC00, 0x0B64FC7E, 0x0800F7B6, 0x00F006BE, | 2291 | 0xFA58FC00, 0x0B64FC7E, 0x0800F7B6, 0x00F006BE, |
2292 | }; | 2292 | }; |
2293 | 2293 | ||
2294 | const u32 b43_ntab_tmap[] = { | 2294 | static const u32 b43_ntab_tmap[] = { |
2295 | 0x8A88AA80, 0x8AAAAA8A, 0x8A8A8AA8, 0x00000888, | 2295 | 0x8A88AA80, 0x8AAAAA8A, 0x8A8A8AA8, 0x00000888, |
2296 | 0x88000000, 0x8A8A88AA, 0x8AA88888, 0x8888A8A8, | 2296 | 0x88000000, 0x8A8A88AA, 0x8AA88888, 0x8888A8A8, |
2297 | 0xF1111110, 0x11111111, 0x11F11111, 0x00000111, | 2297 | 0xF1111110, 0x11111111, 0x11F11111, 0x00000111, |
@@ -2474,3 +2474,51 @@ void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value) | |||
2474 | /* Some compiletime assertions... */ | 2474 | /* Some compiletime assertions... */ |
2475 | assert_ntab_array_sizes(); | 2475 | assert_ntab_array_sizes(); |
2476 | } | 2476 | } |
2477 | |||
2478 | #define ntab_upload(dev, offset, data) do { \ | ||
2479 | unsigned int i; \ | ||
2480 | for (i = 0; i < (offset##_SIZE); i++) \ | ||
2481 | b43_ntab_write(dev, (offset) + i, (data)[i]); \ | ||
2482 | } while (0) | ||
2483 | |||
2484 | void b43_nphy_rev0_1_2_tables_init(struct b43_wldev *dev) | ||
2485 | { | ||
2486 | /* Static tables */ | ||
2487 | ntab_upload(dev, B43_NTAB_FRAMESTRUCT, b43_ntab_framestruct); | ||
2488 | ntab_upload(dev, B43_NTAB_FRAMELT, b43_ntab_framelookup); | ||
2489 | ntab_upload(dev, B43_NTAB_TMAP, b43_ntab_tmap); | ||
2490 | ntab_upload(dev, B43_NTAB_TDTRN, b43_ntab_tdtrn); | ||
2491 | ntab_upload(dev, B43_NTAB_INTLEVEL, b43_ntab_intlevel); | ||
2492 | ntab_upload(dev, B43_NTAB_PILOT, b43_ntab_pilot); | ||
2493 | ntab_upload(dev, B43_NTAB_PILOTLT, b43_ntab_pilotlt); | ||
2494 | ntab_upload(dev, B43_NTAB_TDI20A0, b43_ntab_tdi20a0); | ||
2495 | ntab_upload(dev, B43_NTAB_TDI20A1, b43_ntab_tdi20a1); | ||
2496 | ntab_upload(dev, B43_NTAB_TDI40A0, b43_ntab_tdi40a0); | ||
2497 | ntab_upload(dev, B43_NTAB_TDI40A1, b43_ntab_tdi40a1); | ||
2498 | ntab_upload(dev, B43_NTAB_BDI, b43_ntab_bdi); | ||
2499 | ntab_upload(dev, B43_NTAB_CHANEST, b43_ntab_channelest); | ||
2500 | ntab_upload(dev, B43_NTAB_MCS, b43_ntab_mcs); | ||
2501 | |||
2502 | /* Volatile tables */ | ||
2503 | ntab_upload(dev, B43_NTAB_NOISEVAR10, b43_ntab_noisevar10); | ||
2504 | ntab_upload(dev, B43_NTAB_NOISEVAR11, b43_ntab_noisevar11); | ||
2505 | ntab_upload(dev, B43_NTAB_C0_ESTPLT, b43_ntab_estimatepowerlt0); | ||
2506 | ntab_upload(dev, B43_NTAB_C1_ESTPLT, b43_ntab_estimatepowerlt1); | ||
2507 | ntab_upload(dev, B43_NTAB_C0_ADJPLT, b43_ntab_adjustpower0); | ||
2508 | ntab_upload(dev, B43_NTAB_C1_ADJPLT, b43_ntab_adjustpower1); | ||
2509 | ntab_upload(dev, B43_NTAB_C0_GAINCTL, b43_ntab_gainctl0); | ||
2510 | ntab_upload(dev, B43_NTAB_C1_GAINCTL, b43_ntab_gainctl1); | ||
2511 | ntab_upload(dev, B43_NTAB_C0_IQLT, b43_ntab_iqlt0); | ||
2512 | ntab_upload(dev, B43_NTAB_C1_IQLT, b43_ntab_iqlt1); | ||
2513 | ntab_upload(dev, B43_NTAB_C0_LOFEEDTH, b43_ntab_loftlt0); | ||
2514 | ntab_upload(dev, B43_NTAB_C1_LOFEEDTH, b43_ntab_loftlt1); | ||
2515 | } | ||
2516 | |||
2517 | void b43_nphy_rev3plus_tables_init(struct b43_wldev *dev) | ||
2518 | { | ||
2519 | /* Static tables */ | ||
2520 | /* TODO */ | ||
2521 | |||
2522 | /* Volatile tables */ | ||
2523 | /* TODO */ | ||
2524 | } | ||
diff --git a/drivers/net/wireless/b43/tables_nphy.h b/drivers/net/wireless/b43/tables_nphy.h index 4d498b053ec7..1f0a602fd247 100644 --- a/drivers/net/wireless/b43/tables_nphy.h +++ b/drivers/net/wireless/b43/tables_nphy.h | |||
@@ -128,32 +128,7 @@ b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel); | |||
128 | 128 | ||
129 | void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value); | 129 | void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value); |
130 | 130 | ||
131 | extern const u8 b43_ntab_adjustpower0[]; | 131 | void b43_nphy_rev0_1_2_tables_init(struct b43_wldev *dev); |
132 | extern const u8 b43_ntab_adjustpower1[]; | 132 | void b43_nphy_rev3plus_tables_init(struct b43_wldev *dev); |
133 | extern const u16 b43_ntab_bdi[]; | ||
134 | extern const u32 b43_ntab_channelest[]; | ||
135 | extern const u8 b43_ntab_estimatepowerlt0[]; | ||
136 | extern const u8 b43_ntab_estimatepowerlt1[]; | ||
137 | extern const u8 b43_ntab_framelookup[]; | ||
138 | extern const u32 b43_ntab_framestruct[]; | ||
139 | extern const u32 b43_ntab_gainctl0[]; | ||
140 | extern const u32 b43_ntab_gainctl1[]; | ||
141 | extern const u32 b43_ntab_intlevel[]; | ||
142 | extern const u32 b43_ntab_iqlt0[]; | ||
143 | extern const u32 b43_ntab_iqlt1[]; | ||
144 | extern const u16 b43_ntab_loftlt0[]; | ||
145 | extern const u16 b43_ntab_loftlt1[]; | ||
146 | extern const u8 b43_ntab_mcs[]; | ||
147 | extern const u32 b43_ntab_noisevar10[]; | ||
148 | extern const u32 b43_ntab_noisevar11[]; | ||
149 | extern const u16 b43_ntab_pilot[]; | ||
150 | extern const u32 b43_ntab_pilotlt[]; | ||
151 | extern const u32 b43_ntab_tdi20a0[]; | ||
152 | extern const u32 b43_ntab_tdi20a1[]; | ||
153 | extern const u32 b43_ntab_tdi40a0[]; | ||
154 | extern const u32 b43_ntab_tdi40a1[]; | ||
155 | extern const u32 b43_ntab_tdtrn[]; | ||
156 | extern const u32 b43_ntab_tmap[]; | ||
157 | |||
158 | 133 | ||
159 | #endif /* B43_TABLES_NPHY_H_ */ | 134 | #endif /* B43_TABLES_NPHY_H_ */ |