2010-12-07 08:42:42

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH 1/4] b43: N-PHY: update init tables

Signed-off-by: Rafał Miłecki <[email protected]>
---
drivers/net/wireless/b43/tables_nphy.c | 212 ++++++++++++++++----------------
1 files changed, 106 insertions(+), 106 deletions(-)

diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
index d60db07..46f0a7a 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -28,41 +28,41 @@
#include "phy_n.h"

static const u8 b43_ntab_adjustpower0[] = {
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
- 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
- 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
- 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
- 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
- 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
- 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
- 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
- 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
- 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
- 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
- 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
- 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
- 0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
- 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

static const u8 b43_ntab_adjustpower1[] = {
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
- 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
- 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
- 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
- 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
- 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
- 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
- 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
- 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
- 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
- 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
- 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
- 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
- 0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
- 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

static const u16 b43_ntab_bdi[] = {
@@ -130,8 +130,8 @@ static const u32 b43_ntab_framestruct[] = {
0x09804506, 0x00100030, 0x09804507, 0x00100030,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x08004A0C, 0x00100008, 0x01000A0D, 0x00100028,
- 0x0980450E, 0x00100038, 0x0980450F, 0x00100038,
+ 0x08004A0C, 0x00100004, 0x01000A0D, 0x00100024,
+ 0x0980450E, 0x00100034, 0x0980450F, 0x00100034,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000A04, 0x00100000, 0x11008A05, 0x00100020,
@@ -202,13 +202,13 @@ static const u32 b43_ntab_framestruct[] = {
0x53028A06, 0x01900060, 0x53028A07, 0x01900060,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x4002140C, 0x000F4810, 0x6203140D, 0x00100050,
- 0x53028A0E, 0x01900070, 0x53028A0F, 0x01900070,
+ 0x4002140C, 0x000F4808, 0x6203140D, 0x00100048,
+ 0x53028A0E, 0x01900068, 0x53028A0F, 0x01900068,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000A0C, 0x00100008, 0x11008A0D, 0x00100028,
- 0x1980C50E, 0x00100038, 0x2181050E, 0x00100038,
- 0x2181050E, 0x00100038, 0x0180050C, 0x00100038,
+ 0x00000A0C, 0x00100004, 0x11008A0D, 0x00100024,
+ 0x1980C50E, 0x00100034, 0x2181050E, 0x00100034,
+ 0x2181050E, 0x00100034, 0x0180050C, 0x00100038,
0x1180850D, 0x00100038, 0x1181850D, 0x00100038,
0x2981450F, 0x01100038, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -238,9 +238,9 @@ static const u32 b43_ntab_framestruct[] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x4002140C, 0x00100010, 0x0200140D, 0x00100050,
- 0x0B004A0E, 0x01900070, 0x13008A0E, 0x01900070,
- 0x13008A0E, 0x01900070, 0x43020A0C, 0x00100070,
+ 0x4002140C, 0x00100008, 0x0200140D, 0x00100048,
+ 0x0B004A0E, 0x01900068, 0x13008A0E, 0x01900068,
+ 0x13008A0E, 0x01900068, 0x43020A0C, 0x00100070,
0x1B00CA0D, 0x00100070, 0x1B014A0D, 0x00100070,
0x23010A0F, 0x01500070, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -337,73 +337,73 @@ static const u32 b43_ntab_framestruct[] = {
};

static const u32 b43_ntab_gainctl0[] = {
- 0x007F003F, 0x007E013F, 0x007D023E, 0x007C033E,
- 0x007B043D, 0x007A053D, 0x0079063C, 0x0078073C,
- 0x0077083B, 0x0076093B, 0x00750A3A, 0x00740B3A,
- 0x00730C39, 0x00720D39, 0x00710E38, 0x00700F38,
- 0x006F0037, 0x006E0137, 0x006D0236, 0x006C0336,
- 0x006B0435, 0x006A0535, 0x00690634, 0x00680734,
- 0x00670833, 0x00660933, 0x00650A32, 0x00640B32,
- 0x00630C31, 0x00620D31, 0x00610E30, 0x00600F30,
- 0x005F002F, 0x005E012F, 0x005D022E, 0x005C032E,
- 0x005B042D, 0x005A052D, 0x0059062C, 0x0058072C,
- 0x0057082B, 0x0056092B, 0x00550A2A, 0x00540B2A,
- 0x00530C29, 0x00520D29, 0x00510E28, 0x00500F28,
- 0x004F0027, 0x004E0127, 0x004D0226, 0x004C0326,
- 0x004B0425, 0x004A0525, 0x00490624, 0x00480724,
- 0x00470823, 0x00460923, 0x00450A22, 0x00440B22,
- 0x00430C21, 0x00420D21, 0x00410E20, 0x00400F20,
- 0x003F001F, 0x003E011F, 0x003D021E, 0x003C031E,
- 0x003B041D, 0x003A051D, 0x0039061C, 0x0038071C,
- 0x0037081B, 0x0036091B, 0x00350A1A, 0x00340B1A,
- 0x00330C19, 0x00320D19, 0x00310E18, 0x00300F18,
- 0x002F0017, 0x002E0117, 0x002D0216, 0x002C0316,
- 0x002B0415, 0x002A0515, 0x00290614, 0x00280714,
- 0x00270813, 0x00260913, 0x00250A12, 0x00240B12,
- 0x00230C11, 0x00220D11, 0x00210E10, 0x00200F10,
- 0x001F000F, 0x001E010F, 0x001D020E, 0x001C030E,
- 0x001B040D, 0x001A050D, 0x0019060C, 0x0018070C,
- 0x0017080B, 0x0016090B, 0x00150A0A, 0x00140B0A,
- 0x00130C09, 0x00120D09, 0x00110E08, 0x00100F08,
- 0x000F0007, 0x000E0107, 0x000D0206, 0x000C0306,
- 0x000B0405, 0x000A0505, 0x00090604, 0x00080704,
- 0x00070803, 0x00060903, 0x00050A02, 0x00040B02,
- 0x00030C01, 0x00020D01, 0x00010E00, 0x00000F00,
+ 0x03CC2B44, 0x03CC2B42, 0x03CC2B40, 0x03CC2B3E,
+ 0x03CC2B3D, 0x03CC2B3B, 0x03C82B44, 0x03C82B42,
+ 0x03C82B40, 0x03C82B3E, 0x03C82B3D, 0x03C82B3B,
+ 0x03C82B39, 0x03C82B38, 0x03C82B36, 0x03C82B34,
+ 0x03C42B44, 0x03C42B42, 0x03C42B40, 0x03C42B3E,
+ 0x03C42B3D, 0x03C42B3B, 0x03C42B39, 0x03C42B38,
+ 0x03C42B36, 0x03C42B34, 0x03C42B33, 0x03C42B32,
+ 0x03C42B30, 0x03C42B2F, 0x03C42B2D, 0x03C02B44,
+ 0x03C02B42, 0x03C02B40, 0x03C02B3E, 0x03C02B3D,
+ 0x03C02B3B, 0x03C02B39, 0x03C02B38, 0x03C02B36,
+ 0x03C02B34, 0x03B02B44, 0x03B02B42, 0x03B02B40,
+ 0x03B02B3E, 0x03B02B3D, 0x03B02B3B, 0x03B02B39,
+ 0x03B02B38, 0x03B02B36, 0x03B02B34, 0x03B02B33,
+ 0x03B02B32, 0x03B02B30, 0x03B02B2F, 0x03B02B2D,
+ 0x03A02B44, 0x03A02B42, 0x03A02B40, 0x03A02B3E,
+ 0x03A02B3D, 0x03A02B3B, 0x03A02B39, 0x03A02B38,
+ 0x03A02B36, 0x03A02B34, 0x03902B44, 0x03902B42,
+ 0x03902B40, 0x03902B3E, 0x03902B3D, 0x03902B3B,
+ 0x03902B39, 0x03902B38, 0x03902B36, 0x03902B34,
+ 0x03902B33, 0x03902B32, 0x03902B30, 0x03802B44,
+ 0x03802B42, 0x03802B40, 0x03802B3E, 0x03802B3D,
+ 0x03802B3B, 0x03802B39, 0x03802B38, 0x03802B36,
+ 0x03802B34, 0x03802B33, 0x03802B32, 0x03802B30,
+ 0x03802B2F, 0x03802B2D, 0x03802B2C, 0x03802B2B,
+ 0x03802B2A, 0x03802B29, 0x03802B27, 0x03802B26,
+ 0x03802B25, 0x03802B24, 0x03802B23, 0x03802B22,
+ 0x03802B21, 0x03802B20, 0x03802B1F, 0x03802B1E,
+ 0x03802B1E, 0x03802B1D, 0x03802B1C, 0x03802B1B,
+ 0x03802B1A, 0x03802B1A, 0x03802B19, 0x03802B18,
+ 0x03802B18, 0x03802B18, 0x03802B18, 0x03802B18,
+ 0x03802B18, 0x03802B18, 0x03802B18, 0x03802B18,
+ 0x03802B18, 0x03802B18, 0x03802B18, 0x00002B00,
};

static const u32 b43_ntab_gainctl1[] = {
- 0x007F003F, 0x007E013F, 0x007D023E, 0x007C033E,
- 0x007B043D, 0x007A053D, 0x0079063C, 0x0078073C,
- 0x0077083B, 0x0076093B, 0x00750A3A, 0x00740B3A,
- 0x00730C39, 0x00720D39, 0x00710E38, 0x00700F38,
- 0x006F0037, 0x006E0137, 0x006D0236, 0x006C0336,
- 0x006B0435, 0x006A0535, 0x00690634, 0x00680734,
- 0x00670833, 0x00660933, 0x00650A32, 0x00640B32,
- 0x00630C31, 0x00620D31, 0x00610E30, 0x00600F30,
- 0x005F002F, 0x005E012F, 0x005D022E, 0x005C032E,
- 0x005B042D, 0x005A052D, 0x0059062C, 0x0058072C,
- 0x0057082B, 0x0056092B, 0x00550A2A, 0x00540B2A,
- 0x00530C29, 0x00520D29, 0x00510E28, 0x00500F28,
- 0x004F0027, 0x004E0127, 0x004D0226, 0x004C0326,
- 0x004B0425, 0x004A0525, 0x00490624, 0x00480724,
- 0x00470823, 0x00460923, 0x00450A22, 0x00440B22,
- 0x00430C21, 0x00420D21, 0x00410E20, 0x00400F20,
- 0x003F001F, 0x003E011F, 0x003D021E, 0x003C031E,
- 0x003B041D, 0x003A051D, 0x0039061C, 0x0038071C,
- 0x0037081B, 0x0036091B, 0x00350A1A, 0x00340B1A,
- 0x00330C19, 0x00320D19, 0x00310E18, 0x00300F18,
- 0x002F0017, 0x002E0117, 0x002D0216, 0x002C0316,
- 0x002B0415, 0x002A0515, 0x00290614, 0x00280714,
- 0x00270813, 0x00260913, 0x00250A12, 0x00240B12,
- 0x00230C11, 0x00220D11, 0x00210E10, 0x00200F10,
- 0x001F000F, 0x001E010F, 0x001D020E, 0x001C030E,
- 0x001B040D, 0x001A050D, 0x0019060C, 0x0018070C,
- 0x0017080B, 0x0016090B, 0x00150A0A, 0x00140B0A,
- 0x00130C09, 0x00120D09, 0x00110E08, 0x00100F08,
- 0x000F0007, 0x000E0107, 0x000D0206, 0x000C0306,
- 0x000B0405, 0x000A0505, 0x00090604, 0x00080704,
- 0x00070803, 0x00060903, 0x00050A02, 0x00040B02,
- 0x00030C01, 0x00020D01, 0x00010E00, 0x00000F00,
+ 0x03CC2B44, 0x03CC2B42, 0x03CC2B40, 0x03CC2B3E,
+ 0x03CC2B3D, 0x03CC2B3B, 0x03C82B44, 0x03C82B42,
+ 0x03C82B40, 0x03C82B3E, 0x03C82B3D, 0x03C82B3B,
+ 0x03C82B39, 0x03C82B38, 0x03C82B36, 0x03C82B34,
+ 0x03C42B44, 0x03C42B42, 0x03C42B40, 0x03C42B3E,
+ 0x03C42B3D, 0x03C42B3B, 0x03C42B39, 0x03C42B38,
+ 0x03C42B36, 0x03C42B34, 0x03C42B33, 0x03C42B32,
+ 0x03C42B30, 0x03C42B2F, 0x03C42B2D, 0x03C02B44,
+ 0x03C02B42, 0x03C02B40, 0x03C02B3E, 0x03C02B3D,
+ 0x03C02B3B, 0x03C02B39, 0x03C02B38, 0x03C02B36,
+ 0x03C02B34, 0x03B02B44, 0x03B02B42, 0x03B02B40,
+ 0x03B02B3E, 0x03B02B3D, 0x03B02B3B, 0x03B02B39,
+ 0x03B02B38, 0x03B02B36, 0x03B02B34, 0x03B02B33,
+ 0x03B02B32, 0x03B02B30, 0x03B02B2F, 0x03B02B2D,
+ 0x03A02B44, 0x03A02B42, 0x03A02B40, 0x03A02B3E,
+ 0x03A02B3D, 0x03A02B3B, 0x03A02B39, 0x03A02B38,
+ 0x03A02B36, 0x03A02B34, 0x03902B44, 0x03902B42,
+ 0x03902B40, 0x03902B3E, 0x03902B3D, 0x03902B3B,
+ 0x03902B39, 0x03902B38, 0x03902B36, 0x03902B34,
+ 0x03902B33, 0x03902B32, 0x03902B30, 0x03802B44,
+ 0x03802B42, 0x03802B40, 0x03802B3E, 0x03802B3D,
+ 0x03802B3B, 0x03802B39, 0x03802B38, 0x03802B36,
+ 0x03802B34, 0x03802B33, 0x03802B32, 0x03802B30,
+ 0x03802B2F, 0x03802B2D, 0x03802B2C, 0x03802B2B,
+ 0x03802B2A, 0x03802B29, 0x03802B27, 0x03802B26,
+ 0x03802B25, 0x03802B24, 0x03802B23, 0x03802B22,
+ 0x03802B21, 0x03802B20, 0x03802B1F, 0x03802B1E,
+ 0x03802B1E, 0x03802B1D, 0x03802B1C, 0x03802B1B,
+ 0x03802B1A, 0x03802B1A, 0x03802B19, 0x03802B18,
+ 0x03802B18, 0x03802B18, 0x03802B18, 0x03802B18,
+ 0x03802B18, 0x03802B18, 0x03802B18, 0x03802B18,
+ 0x03802B18, 0x03802B18, 0x03802B18, 0x00002B00,
};

static const u32 b43_ntab_intlevel[] = {
--
1.6.3.3



2010-12-10 06:36:57

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables

W dniu 10 grudnia 2010 03:26 użytkownik <[email protected]> napisał:
> -----Original Message-----
>>From: Rafał Miłecki <[email protected]>
>>Sent: Dec 9, 2010 6:06 AM
>>To: [email protected]
>>Cc: Larry Finger <[email protected]>, Hauke Mehrtens <[email protected]>, [email protected], [email protected]
>>Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables
>>
>>2010/12/8  <[email protected]>:
>>> Larry,
>>>
>>>
>>> -----Original Message-----
>>>>From: Larry Finger <[email protected]>
>>>>Sent: Dec 7, 2010 12:00 PM
>>>>To: [email protected]
>>>>Cc: Hauke Mehrtens <[email protected]>, [email protected], [email protected]
>>>>Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables
>>>>
>>>>On 12/07/2010 01:49 PM, [email protected] wrote:
>>>>>> One reason is that these tables changed from non-zero to zero values between
>>>>>> Broadcom driver 4.174.64.19 and 5.10.56.46. As they might change again, I think
>>>>>> we should retain the full version.
>>>>>
>>>>> Is there a way to check for version of the driver?
>>>>> This way whoever uses old one won't be screwed...
>>>>
>>>>That will not be a problem as no older version of b43 works at all with b43. To
>>>>help you understand this change, when the 4.174.64.19 Broadcom driver was
>>>>reverse-engineered, the tables had non-zero values. Rafel later compared the
>>>>trace dumps of b43 with the latest version of wl and found that the values are
>>>>now zero. When I rechecked driver 5.10.56.46, I found them to be zero there as
>>>>well and changed the specs.
>>>
>>> Well, it maybe feasible to keep the old values and check
>>> the version of the driver, since you are saying yourself
>>> that the value might be changing in the future.
>>> Maybe for couple of releases only?
>>
>>Sorry, but I don't understand that at all. What do you mean by version
>>of the driver? What driver?
>
> #if B43_VERSION <= x.x.x.x
> // table initialized to some values
> #else
> //table initialized to 0's
> #endif

You want to put condition checking b43 version in... b43 driver? I
can't follow you.

--
Rafał

2010-12-07 19:08:52

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables

On 12/07/2010 09:42 AM, Rafał Miłecki wrote:
> Signed-off-by: Rafał Miłecki <[email protected]>
> ---
> drivers/net/wireless/b43/tables_nphy.c | 212 ++++++++++++++++----------------
> 1 files changed, 106 insertions(+), 106 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
> index d60db07..46f0a7a 100644
> --- a/drivers/net/wireless/b43/tables_nphy.c
> +++ b/drivers/net/wireless/b43/tables_nphy.c
> @@ -28,41 +28,41 @@
> #include "phy_n.h"
>
> static const u8 b43_ntab_adjustpower0[] = {
> - 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
> - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
> - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
> - 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
> - 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
> - 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
> - 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
> - 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
> - 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
> - 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
> - 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
> - 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
> - 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
> - 0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
> - 0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
> - 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> };
Why do you have this table when it only contains 0x00? If it is correct
there will be a better way to define such a table.

>
> static const u8 b43_ntab_adjustpower1[] = {
> - 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
> - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
> - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
> - 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
> - 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
> - 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
> - 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
> - 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
> - 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
> - 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
> - 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
> - 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
> - 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
> - 0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
> - 0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
> - 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> };
Same here.

Hauke

2010-12-09 14:06:10

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables

2010/12/8 <[email protected]>:
> Larry,
>
>
> -----Original Message-----
>>From: Larry Finger <[email protected]>
>>Sent: Dec 7, 2010 12:00 PM
>>To: [email protected]
>>Cc: Hauke Mehrtens <[email protected]>, [email protected], [email protected]
>>Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables
>>
>>On 12/07/2010 01:49 PM, [email protected] wrote:
>>>> One reason is that these tables changed from non-zero to zero values between
>>>> Broadcom driver 4.174.64.19 and 5.10.56.46. As they might change again, I think
>>>> we should retain the full version.
>>>
>>> Is there a way to check for version of the driver?
>>> This way whoever uses old one won't be screwed...
>>
>>That will not be a problem as no older version of b43 works at all with b43. To
>>help you understand this change, when the 4.174.64.19 Broadcom driver was
>>reverse-engineered, the tables had non-zero values. Rafel later compared the
>>trace dumps of b43 with the latest version of wl and found that the values are
>>now zero. When I rechecked driver 5.10.56.46, I found them to be zero there as
>>well and changed the specs.
>
> Well, it maybe feasible to keep the old values and check
> the version of the driver, since you are saying yourself
> that the value might be changing in the future.
> Maybe for couple of releases only?

Sorry, but I don't understand that at all. What do you mean by version
of the driver? What driver?

b43 comes with tables built in, there is no way b43 could use tables
from other version of b43...

--
Rafał

2010-12-07 19:24:59

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables

On 12/07/2010 01:08 PM, Hauke Mehrtens wrote:
> On 12/07/2010 09:42 AM, Rafał Miłecki wrote:
>> Signed-off-by: Rafał Miłecki <[email protected]>
>> ---
>> drivers/net/wireless/b43/tables_nphy.c | 212 ++++++++++++++++----------------
>> 1 files changed, 106 insertions(+), 106 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
>> index d60db07..46f0a7a 100644
>> --- a/drivers/net/wireless/b43/tables_nphy.c
>> +++ b/drivers/net/wireless/b43/tables_nphy.c
>> @@ -28,41 +28,41 @@
>> #include "phy_n.h"
>>
>> static const u8 b43_ntab_adjustpower0[] = {
>> - 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
>> - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
>> - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
>> - 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
>> - 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
>> - 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
>> - 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
>> - 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
>> - 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
>> - 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
>> - 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
>> - 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
>> - 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
>> - 0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
>> - 0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
>> - 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> };
> Why do you have this table when it only contains 0x00? If it is correct
> there will be a better way to define such a table.
>
>>
>> static const u8 b43_ntab_adjustpower1[] = {
>> - 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
>> - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
>> - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
>> - 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
>> - 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
>> - 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
>> - 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
>> - 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
>> - 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
>> - 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
>> - 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
>> - 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
>> - 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
>> - 0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
>> - 0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
>> - 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> };
> Same here.

One reason is that these tables changed from non-zero to zero values between
Broadcom driver 4.174.64.19 and 5.10.56.46. As they might change again, I think
we should retain the full version.

Larry



2010-12-07 08:42:59

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH 4/4] b43: flush PHY writes when needed

Signed-off-by: Rafał Miłecki <[email protected]>
---
drivers/net/wireless/b43/phy_common.c | 5 +++++
drivers/net/wireless/b43/phy_common.h | 6 ++++++
2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c
index fa7f83f..0a91fc3 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -231,6 +231,7 @@ void b43_radio_maskset(struct b43_wldev *dev, u16 offset, u16 mask, u16 set)
u16 b43_phy_read(struct b43_wldev *dev, u16 reg)
{
assert_mac_suspended(dev);
+ dev->phy.writes_counter = 0;
return dev->phy.ops->phy_read(dev, reg);
}

@@ -238,6 +239,10 @@ void b43_phy_write(struct b43_wldev *dev, u16 reg, u16 value)
{
assert_mac_suspended(dev);
dev->phy.ops->phy_write(dev, reg, value);
+ if (++dev->phy.writes_counter == B43_MAX_WRITES_IN_ROW) {
+ b43_read16(dev, B43_MMIO_PHY_VER);
+ dev->phy.writes_counter = 0;
+ }
}

void b43_phy_copy(struct b43_wldev *dev, u16 destreg, u16 srcreg)
diff --git a/drivers/net/wireless/b43/phy_common.h b/drivers/net/wireless/b43/phy_common.h
index 0e61942..2ed60e5 100644
--- a/drivers/net/wireless/b43/phy_common.h
+++ b/drivers/net/wireless/b43/phy_common.h
@@ -39,6 +39,9 @@ struct b43_c32 { s32 i, q; };
#define B43_PHYVER_TYPE_SHIFT 8
#define B43_PHYVER_VERSION 0x00FF

+/* PHY writes need to be flushed if we reach limit */
+#define B43_MAX_WRITES_IN_ROW 24
+
/**
* enum b43_interference_mitigation - Interference Mitigation mode
*
@@ -232,6 +235,9 @@ struct b43_phy {
/* PHY revision number. */
u8 rev;

+ /* Count writes since last read */
+ u8 writes_counter;
+
/* Radio versioning */
u16 radio_manuf; /* Radio manufacturer */
u16 radio_ver; /* Radio version */
--
1.6.3.3


2010-12-07 19:49:33

by ikorot

[permalink] [raw]
Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables

Hi, ALL,


-----Original Message-----
>From: Larry Finger <[email protected]>
>Sent: Dec 7, 2010 11:19 AM
>To: Hauke Mehrtens <[email protected]>
>Cc: [email protected], [email protected]
>Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables
>
>On 12/07/2010 01:08 PM, Hauke Mehrtens wrote:
>> On 12/07/2010 09:42 AM, Rafał Miłecki wrote:
>>> Signed-off-by: Rafał Miłecki <[email protected]>
>>> ---
>>> drivers/net/wireless/b43/tables_nphy.c | 212 ++++++++++++++++----------------
>>> 1 files changed, 106 insertions(+), 106 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
>>> index d60db07..46f0a7a 100644
>>> --- a/drivers/net/wireless/b43/tables_nphy.c
>>> +++ b/drivers/net/wireless/b43/tables_nphy.c
>>> @@ -28,41 +28,41 @@
>>> #include "phy_n.h"
>>>
>>> static const u8 b43_ntab_adjustpower0[] = {
>>> - 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
>>> - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
>>> - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
>>> - 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
>>> - 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
>>> - 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
>>> - 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
>>> - 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
>>> - 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
>>> - 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
>>> - 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
>>> - 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
>>> - 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
>>> - 0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
>>> - 0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
>>> - 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> };
>> Why do you have this table when it only contains 0x00? If it is correct
>> there will be a better way to define such a table.
>>
>>>
>>> static const u8 b43_ntab_adjustpower1[] = {
>>> - 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
>>> - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
>>> - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
>>> - 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
>>> - 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
>>> - 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
>>> - 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
>>> - 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
>>> - 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
>>> - 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
>>> - 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
>>> - 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
>>> - 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
>>> - 0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
>>> - 0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
>>> - 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> };
>> Same here.
>
>One reason is that these tables changed from non-zero to zero values between
>Broadcom driver 4.174.64.19 and 5.10.56.46. As they might change again, I think
>we should retain the full version.

Is there a way to check for version of the driver?
This way whoever uses old one won't be screwed...

Thank you.

>
>Larry
>
>
>
>_______________________________________________
>b43-dev mailing list
>[email protected]
>http://lists.infradead.org/mailman/listinfo/b43-dev


2010-12-07 20:00:20

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables

On 12/07/2010 01:49 PM, [email protected] wrote:
>> One reason is that these tables changed from non-zero to zero values between
>> Broadcom driver 4.174.64.19 and 5.10.56.46. As they might change again, I think
>> we should retain the full version.
>
> Is there a way to check for version of the driver?
> This way whoever uses old one won't be screwed...

That will not be a problem as no older version of b43 works at all with b43. To
help you understand this change, when the 4.174.64.19 Broadcom driver was
reverse-engineered, the tables had non-zero values. Rafel later compared the
trace dumps of b43 with the latest version of wl and found that the values are
now zero. When I rechecked driver 5.10.56.46, I found them to be zero there as
well and changed the specs.

Larry

2010-12-07 08:42:52

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH 3/4] b43: N-PHY: implement own maskset

This let us avoid double addressing while still having reg check.

Signed-off-by: Rafał Miłecki <[email protected]>
---
drivers/net/wireless/b43/phy_n.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 905f1d7..f78f4e9 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -3705,6 +3705,15 @@ static void b43_nphy_op_write(struct b43_wldev *dev, u16 reg, u16 value)
b43_write16(dev, B43_MMIO_PHY_DATA, value);
}

+static void b43_nphy_op_maskset(struct b43_wldev *dev, u16 reg, u16 mask,
+ u16 set)
+{
+ check_phyreg(dev, reg);
+ b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
+ b43_write16(dev, B43_MMIO_PHY_DATA,
+ (b43_read16(dev, B43_MMIO_PHY_DATA) & mask) | set);
+}
+
static u16 b43_nphy_op_radio_read(struct b43_wldev *dev, u16 reg)
{
/* Register 1 is a 32-bit register. */
@@ -3799,6 +3808,7 @@ const struct b43_phy_operations b43_phyops_n = {
.init = b43_nphy_op_init,
.phy_read = b43_nphy_op_read,
.phy_write = b43_nphy_op_write,
+ .phy_maskset = b43_nphy_op_maskset,
.radio_read = b43_nphy_op_radio_read,
.radio_write = b43_nphy_op_radio_write,
.software_rfkill = b43_nphy_op_software_rfkill,
--
1.6.3.3


2010-12-10 02:26:30

by ikorot

[permalink] [raw]
Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables

Rafal,


-----Original Message-----
>From: Rafał Miłecki <[email protected]>
>Sent: Dec 9, 2010 6:06 AM
>To: [email protected]
>Cc: Larry Finger <[email protected]>, Hauke Mehrtens <[email protected]>, [email protected], [email protected]
>Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables
>
>2010/12/8 <[email protected]>:
>> Larry,
>>
>>
>> -----Original Message-----
>>>From: Larry Finger <[email protected]>
>>>Sent: Dec 7, 2010 12:00 PM
>>>To: [email protected]
>>>Cc: Hauke Mehrtens <[email protected]>, [email protected], [email protected]
>>>Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables
>>>
>>>On 12/07/2010 01:49 PM, [email protected] wrote:
>>>>> One reason is that these tables changed from non-zero to zero values between
>>>>> Broadcom driver 4.174.64.19 and 5.10.56.46. As they might change again, I think
>>>>> we should retain the full version.
>>>>
>>>> Is there a way to check for version of the driver?
>>>> This way whoever uses old one won't be screwed...
>>>
>>>That will not be a problem as no older version of b43 works at all with b43. To
>>>help you understand this change, when the 4.174.64.19 Broadcom driver was
>>>reverse-engineered, the tables had non-zero values. Rafel later compared the
>>>trace dumps of b43 with the latest version of wl and found that the values are
>>>now zero. When I rechecked driver 5.10.56.46, I found them to be zero there as
>>>well and changed the specs.
>>
>> Well, it maybe feasible to keep the old values and check
>> the version of the driver, since you are saying yourself
>> that the value might be changing in the future.
>> Maybe for couple of releases only?
>
>Sorry, but I don't understand that at all. What do you mean by version
>of the driver? What driver?

#if B43_VERSION <= x.x.x.x
// table initialized to some values
#else
//table initialized to 0's
#endif

>
>b43 comes with tables built in, there is no way b43 could use tables
>from other version of b43...

Thank you.

>
>--
>Rafał


2010-12-07 08:42:48

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH 2/4] b43: N-PHY: reorder and optimize tables initialization

Order was changed in specs. For writing arrays we have designed bulk function
which makes use of auto increment and do not write table address over and over.

Signed-off-by: Rafał Miłecki <[email protected]>
---
drivers/net/wireless/b43/tables_nphy.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
index 46f0a7a..df61c16 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -1811,9 +1811,7 @@ void b43_ntab_write_bulk(struct b43_wldev *dev, u32 offset,
}

#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]); \
+ b43_ntab_write_bulk(dev, offset, offset##_SIZE, data); \
} while (0)

void b43_nphy_rev0_1_2_tables_init(struct b43_wldev *dev)
@@ -1825,18 +1823,18 @@ void b43_nphy_rev0_1_2_tables_init(struct b43_wldev *dev)
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);
+
+ /* Volatile tables */
+ ntab_upload(dev, B43_NTAB_BDI, b43_ntab_bdi);
+ ntab_upload(dev, B43_NTAB_PILOTLT, b43_ntab_pilotlt);
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);
--
1.6.3.3


2010-12-08 01:56:53

by ikorot

[permalink] [raw]
Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables

Larry,


-----Original Message-----
>From: Larry Finger <[email protected]>
>Sent: Dec 7, 2010 12:00 PM
>To: [email protected]
>Cc: Hauke Mehrtens <[email protected]>, [email protected], [email protected]
>Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables
>
>On 12/07/2010 01:49 PM, [email protected] wrote:
>>> One reason is that these tables changed from non-zero to zero values between
>>> Broadcom driver 4.174.64.19 and 5.10.56.46. As they might change again, I think
>>> we should retain the full version.
>>
>> Is there a way to check for version of the driver?
>> This way whoever uses old one won't be screwed...
>
>That will not be a problem as no older version of b43 works at all with b43. To
>help you understand this change, when the 4.174.64.19 Broadcom driver was
>reverse-engineered, the tables had non-zero values. Rafel later compared the
>trace dumps of b43 with the latest version of wl and found that the values are
>now zero. When I rechecked driver 5.10.56.46, I found them to be zero there as
>well and changed the specs.

Well, it maybe feasible to keep the old values and check
the version of the driver, since you are saying yourself
that the value might be changing in the future.
Maybe for couple of releases only?

Thank you.
>
>Larry