Skip to contentSkip to conversation

Update copyrights, module info, a little LCN improvement

PATCH In review Rafał Miłecki 2 participants 7 messages Sep 3, 2011 – Sep 4, 2011 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

cover Update copyrights, module info, a little LCN improvement

I'm adding my Copyrights to the files I've touched/created in 2010-2011.

Hope you'll accept adding myself as b43 author.

LCN patch almost finishes tables init for that family of cards.

Rafał Miłecki (3):
b43: drop Copyright for not really copyrightable info
b43: add my copyrights and myself as the module author
b43: LCN-PHY: load TX gain table on init

 drivers/net/wireless/b43/bus.c            |    2 +
 drivers/net/wireless/b43/main.c           |    2 +
 drivers/net/wireless/b43/phy_ht.c         |    2 +
 drivers/net/wireless/b43/phy_lcn.c        |    2 +
 drivers/net/wireless/b43/phy_n.c          |    1 +
 drivers/net/wireless/b43/radio_2055.c     |    1 +
 drivers/net/wireless/b43/radio_2056.c     |    2 +
 drivers/net/wireless/b43/radio_2056.h     |   26 ----
 drivers/net/wireless/b43/radio_2059.c     |    2 +
 drivers/net/wireless/b43/tables_nphy.c    |    1 +
 drivers/net/wireless/b43/tables_phy_ht.c  |    2 +
 drivers/net/wireless/b43/tables_phy_lcn.c |  197 ++++++++++++++++++++++++++++-
 12 files changed, 211 insertions(+), 29 deletions(-)
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/3 b43: drop Copyright for not really copyrightable info

As discussed in "Licensing wlc_phy_radio.h and brcm80211" (Message-ID:
<[email protected]>) content of that file is not copyrightable, just names and numbers.

---
 drivers/net/wireless/b43/radio_2056.h |   26 --------------------------
 1 files changed, 0 insertions(+), 26 deletions(-)
drivers/net/wireless/b43/radio_2056.h +0 -26
index d52df6b..a7159d8 100644
@@ -1,29 +1,3 @@
-/*
-
-  Broadcom B43 wireless driver
-
-  Copyright (c) 2010 Rafał Miłecki <[email protected]>
-
-  Some parts of the code in this file are derived from the brcm80211
-  driver  Copyright (c) 2010 Broadcom Corporation
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; see the file COPYING.  If not, write to
-  the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
-  Boston, MA 02110-1301, USA.
-
-*/
-
 #ifndef B43_RADIO_2056_H_
 #define B43_RADIO_2056_H_
 
Signature · 1 line
1.7.3.4
#2 lore raw

PATCH 2/3 b43: add my copyrights and myself as the module author

In reply to Rafał Miłecki
---
 drivers/net/wireless/b43/bus.c            |    2 ++
 drivers/net/wireless/b43/main.c           |    2 ++
 drivers/net/wireless/b43/phy_ht.c         |    2 ++
 drivers/net/wireless/b43/phy_lcn.c        |    2 ++
 drivers/net/wireless/b43/phy_n.c          |    1 +
 drivers/net/wireless/b43/radio_2055.c     |    1 +
 drivers/net/wireless/b43/radio_2056.c     |    2 ++
 drivers/net/wireless/b43/radio_2059.c     |    2 ++
 drivers/net/wireless/b43/tables_nphy.c    |    1 +
 drivers/net/wireless/b43/tables_phy_ht.c  |    2 ++
 drivers/net/wireless/b43/tables_phy_lcn.c |    2 ++
 11 files changed, 19 insertions(+), 0 deletions(-)
drivers/net/wireless/b43/bus.c +2 -0
index 05f6c7b..424692d 100644
@@ -3,6 +3,8 @@
   Broadcom B43 wireless driver
   Bus abstraction layer
 
+  Copyright (c) 2011 Rafał Miłecki <[email protected]>
+
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
drivers/net/wireless/b43/main.c +2 -0
index 6bca727..2407702 100644
@@ -7,6 +7,7 @@
   Copyright (c) 2005-2009 Michael Buesch <[email protected]>
   Copyright (c) 2005 Danny van Dyk <[email protected]>
   Copyright (c) 2005 Andreas Jaggi <[email protected]>
+  Copyright (c) 2010-2011 Rafał Miłecki <[email protected]>
 
   SDIO support
   Copyright (c) 2009 Albert Herranz <[email protected]>
@@ -64,6 +65,7 @@ MODULE_AUTHOR("Martin Langer");
 MODULE_AUTHOR("Stefano Brivio");
 MODULE_AUTHOR("Michael Buesch");
 MODULE_AUTHOR("Gábor Stefanik");
+MODULE_AUTHOR("Rafał Miłecki");
 MODULE_LICENSE("GPL");
 
 MODULE_FIRMWARE("b43/ucode11.fw");
drivers/net/wireless/b43/phy_ht.c +2 -0
index 4d6345e..7416c5e 100644
@@ -3,6 +3,8 @@
   Broadcom B43 wireless driver
   IEEE 802.11n HT-PHY support
 
+  Copyright (c) 2011 Rafał Miłecki <[email protected]>
+
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
drivers/net/wireless/b43/phy_lcn.c +2 -0
index d0f106e..d1dfeec 100644
@@ -3,6 +3,8 @@
   Broadcom B43 wireless driver
   IEEE 802.11n LCN-PHY support
 
+  Copyright (c) 2011 Rafał Miłecki <[email protected]>
+
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
drivers/net/wireless/b43/phy_n.c +1 -0
index 6e91680..4951678 100644
@@ -4,6 +4,7 @@
   IEEE 802.11n PHY support
 
   Copyright (c) 2008 Michael Buesch <[email protected]>
+  Copyright (c) 2010-2011 Rafał Miłecki <[email protected]>
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
drivers/net/wireless/b43/radio_2055.c +1 -0
index 93643f1..5289a18 100644
@@ -4,6 +4,7 @@
   IEEE 802.11n PHY and radio device data tables
 
   Copyright (c) 2008 Michael Buesch <[email protected]>
+  Copyright (c) 2010 Rafał Miłecki <[email protected]>
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
drivers/net/wireless/b43/radio_2056.c +2 -0
index 8890df0..a01f776 100644
@@ -3,6 +3,8 @@
   Broadcom B43 wireless driver
   IEEE 802.11n 2056 radio device data tables
 
+  Copyright (c) 2010 Rafał Miłecki <[email protected]>
+
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
drivers/net/wireless/b43/radio_2059.c +2 -0
index f029f6e..d4ce8a1 100644
@@ -3,6 +3,8 @@
   Broadcom B43 wireless driver
   IEEE 802.11n 2059 radio device data tables
 
+  Copyright (c) 2011 Rafał Miłecki <[email protected]>
+
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
drivers/net/wireless/b43/tables_nphy.c +1 -0
index 916f238..7b326f2 100644
@@ -4,6 +4,7 @@
   IEEE 802.11n PHY data tables
 
   Copyright (c) 2008 Michael Buesch <[email protected]>
+  Copyright (c) 2010 Rafał Miłecki <[email protected]>
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
drivers/net/wireless/b43/tables_phy_ht.c +2 -0
index 677d217..176c49d 100644
@@ -3,6 +3,8 @@
   Broadcom B43 wireless driver
   IEEE 802.11n HT-PHY data tables
 
+  Copyright (c) 2011 Rafał Miłecki <[email protected]>
+
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
drivers/net/wireless/b43/tables_phy_lcn.c +2 -0
index 7bf7057..1682ba0 100644
@@ -3,6 +3,8 @@
   Broadcom B43 wireless driver
   IEEE 802.11n LCN-PHY data tables
 
+  Copyright (c) 2011 Rafał Miłecki <[email protected]>
+
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
Signature · 1 line
1.7.3.4
#3 lore raw

PATCH 3/3 b43: LCN-PHY: load TX gain table on init

In reply to Rafał Miłecki

Values and ops were taken from MMIO dump of wl. struct was copied from brcmsmac.

---
 drivers/net/wireless/b43/tables_phy_lcn.c |  195 ++++++++++++++++++++++++++++-
 1 files changed, 192 insertions(+), 3 deletions(-)
drivers/net/wireless/b43/tables_phy_lcn.c +192 -3
index 1682ba0..a2dd72e 100644
@@ -27,6 +27,18 @@
 #include "phy_common.h"
 #include "phy_lcn.h"
 
+struct b43_lcntab_tx_gain_tbl_entry {
+	u8 gm;
+	u8 pga;
+	u8 pad;
+	u8 dac;
+	u8 bb_mult;
+};
+
+/**************************************************
+ * Static tables.
+ **************************************************/
+
 static const u16 b43_lcntab_0x02[] = {
 	0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d,
 	0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d,
@@ -297,6 +309,146 @@ static const u32 b43_lcntab_0x18[] = {
 	0x00080000, 0x00080000, 0x00080000, 0x00080000,
 };
 
+/**************************************************
+ * TX gain.
+ **************************************************/
+
+const struct b43_lcntab_tx_gain_tbl_entry
+		b43_lcntab_tx_gain_tbl_2ghz_ext_pa_rev0[] = {
+	{ 0x03, 0x00, 0x1f, 0x0, 0x48 },
+	{ 0x03, 0x00, 0x1f, 0x0, 0x46 },
+	{ 0x03, 0x00, 0x1f, 0x0, 0x44 },
+	{ 0x03, 0x00, 0x1e, 0x0, 0x43 },
+	{ 0x03, 0x00, 0x1d, 0x0, 0x44 },
+	{ 0x03, 0x00, 0x1c, 0x0, 0x44 },
+	{ 0x03, 0x00, 0x1b, 0x0, 0x45 },
+	{ 0x03, 0x00, 0x1a, 0x0, 0x46 },
+	{ 0x03, 0x00, 0x19, 0x0, 0x46 },
+	{ 0x03, 0x00, 0x18, 0x0, 0x47 },
+	{ 0x03, 0x00, 0x17, 0x0, 0x48 },
+	{ 0x03, 0x00, 0x17, 0x0, 0x46 },
+	{ 0x03, 0x00, 0x16, 0x0, 0x47 },
+	{ 0x03, 0x00, 0x15, 0x0, 0x48 },
+	{ 0x03, 0x00, 0x15, 0x0, 0x46 },
+	{ 0x03, 0x00, 0x15, 0x0, 0x44 },
+	{ 0x03, 0x00, 0x15, 0x0, 0x42 },
+	{ 0x03, 0x00, 0x15, 0x0, 0x40 },
+	{ 0x03, 0x00, 0x15, 0x0, 0x3f },
+	{ 0x03, 0x00, 0x14, 0x0, 0x40 },
+	{ 0x03, 0x00, 0x13, 0x0, 0x41 },
+	{ 0x03, 0x00, 0x13, 0x0, 0x40 },
+	{ 0x03, 0x00, 0x12, 0x0, 0x41 },
+	{ 0x03, 0x00, 0x12, 0x0, 0x40 },
+	{ 0x03, 0x00, 0x11, 0x0, 0x41 },
+	{ 0x03, 0x00, 0x11, 0x0, 0x40 },
+	{ 0x03, 0x00, 0x10, 0x0, 0x41 },
+	{ 0x03, 0x00, 0x10, 0x0, 0x40 },
+	{ 0x03, 0x00, 0x10, 0x0, 0x3e },
+	{ 0x03, 0x00, 0x10, 0x0, 0x3c },
+	{ 0x03, 0x00, 0x10, 0x0, 0x3a },
+	{ 0x03, 0x00, 0x0f, 0x0, 0x3d },
+	{ 0x03, 0x00, 0x0f, 0x0, 0x3b },
+	{ 0x03, 0x00, 0x0e, 0x0, 0x3d },
+	{ 0x03, 0x00, 0x0e, 0x0, 0x3c },
+	{ 0x03, 0x00, 0x0e, 0x0, 0x3a },
+	{ 0x03, 0x00, 0x0d, 0x0, 0x3c },
+	{ 0x03, 0x00, 0x0d, 0x0, 0x3b },
+	{ 0x03, 0x00, 0x0c, 0x0, 0x3e },
+	{ 0x03, 0x00, 0x0c, 0x0, 0x3c },
+	{ 0x03, 0x00, 0x0c, 0x0, 0x3a },
+	{ 0x03, 0x00, 0x0b, 0x0, 0x3e },
+	{ 0x03, 0x00, 0x0b, 0x0, 0x3c },
+	{ 0x03, 0x00, 0x0b, 0x0, 0x3b },
+	{ 0x03, 0x00, 0x0b, 0x0, 0x39 },
+	{ 0x03, 0x00, 0x0a, 0x0, 0x3d },
+	{ 0x03, 0x00, 0x0a, 0x0, 0x3b },
+	{ 0x03, 0x00, 0x0a, 0x0, 0x39 },
+	{ 0x03, 0x00, 0x09, 0x0, 0x3e },
+	{ 0x03, 0x00, 0x09, 0x0, 0x3c },
+	{ 0x03, 0x00, 0x09, 0x0, 0x3a },
+	{ 0x03, 0x00, 0x09, 0x0, 0x39 },
+	{ 0x03, 0x00, 0x08, 0x0, 0x3e },
+	{ 0x03, 0x00, 0x08, 0x0, 0x3c },
+	{ 0x03, 0x00, 0x08, 0x0, 0x3a },
+	{ 0x03, 0x00, 0x08, 0x0, 0x39 },
+	{ 0x03, 0x00, 0x08, 0x0, 0x37 },
+	{ 0x03, 0x00, 0x07, 0x0, 0x3d },
+	{ 0x03, 0x00, 0x07, 0x0, 0x3c },
+	{ 0x03, 0x00, 0x07, 0x0, 0x3a },
+	{ 0x03, 0x00, 0x07, 0x0, 0x38 },
+	{ 0x03, 0x00, 0x07, 0x0, 0x37 },
+	{ 0x03, 0x00, 0x06, 0x0, 0x3e },
+	{ 0x03, 0x00, 0x06, 0x0, 0x3c },
+	{ 0x03, 0x00, 0x06, 0x0, 0x3a },
+	{ 0x03, 0x00, 0x06, 0x0, 0x39 },
+	{ 0x03, 0x00, 0x06, 0x0, 0x37 },
+	{ 0x03, 0x00, 0x06, 0x0, 0x36 },
+	{ 0x03, 0x00, 0x06, 0x0, 0x34 },
+	{ 0x03, 0x00, 0x05, 0x0, 0x3d },
+	{ 0x03, 0x00, 0x05, 0x0, 0x3b },
+	{ 0x03, 0x00, 0x05, 0x0, 0x39 },
+	{ 0x03, 0x00, 0x05, 0x0, 0x38 },
+	{ 0x03, 0x00, 0x05, 0x0, 0x36 },
+	{ 0x03, 0x00, 0x05, 0x0, 0x35 },
+	{ 0x03, 0x00, 0x05, 0x0, 0x33 },
+	{ 0x03, 0x00, 0x04, 0x0, 0x3e },
+	{ 0x03, 0x00, 0x04, 0x0, 0x3c },
+	{ 0x03, 0x00, 0x04, 0x0, 0x3a },
+	{ 0x03, 0x00, 0x04, 0x0, 0x39 },
+	{ 0x03, 0x00, 0x04, 0x0, 0x37 },
+	{ 0x03, 0x00, 0x04, 0x0, 0x36 },
+	{ 0x03, 0x00, 0x04, 0x0, 0x34 },
+	{ 0x03, 0x00, 0x04, 0x0, 0x33 },
+	{ 0x03, 0x00, 0x04, 0x0, 0x31 },
+	{ 0x03, 0x00, 0x04, 0x0, 0x30 },
+	{ 0x03, 0x00, 0x04, 0x0, 0x2e },
+	{ 0x03, 0x00, 0x03, 0x0, 0x3c },
+	{ 0x03, 0x00, 0x03, 0x0, 0x3a },
+	{ 0x03, 0x00, 0x03, 0x0, 0x39 },
+	{ 0x03, 0x00, 0x03, 0x0, 0x37 },
+	{ 0x03, 0x00, 0x03, 0x0, 0x36 },
+	{ 0x03, 0x00, 0x03, 0x0, 0x34 },
+	{ 0x03, 0x00, 0x03, 0x0, 0x33 },
+	{ 0x03, 0x00, 0x03, 0x0, 0x31 },
+	{ 0x03, 0x00, 0x03, 0x0, 0x30 },
+	{ 0x03, 0x00, 0x03, 0x0, 0x2e },
+	{ 0x03, 0x00, 0x03, 0x0, 0x2d },
+	{ 0x03, 0x00, 0x03, 0x0, 0x2c },
+	{ 0x03, 0x00, 0x03, 0x0, 0x2b },
+	{ 0x03, 0x00, 0x03, 0x0, 0x29 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x3d },
+	{ 0x03, 0x00, 0x02, 0x0, 0x3b },
+	{ 0x03, 0x00, 0x02, 0x0, 0x39 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x38 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x36 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x35 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x33 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x32 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x30 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x2f },
+	{ 0x03, 0x00, 0x02, 0x0, 0x2e },
+	{ 0x03, 0x00, 0x02, 0x0, 0x2c },
+	{ 0x03, 0x00, 0x02, 0x0, 0x2b },
+	{ 0x03, 0x00, 0x02, 0x0, 0x2a },
+	{ 0x03, 0x00, 0x02, 0x0, 0x29 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x27 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x26 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x25 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x24 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x23 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x22 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x21 },
+	{ 0x03, 0x00, 0x02, 0x0, 0x20 },
+	{ 0x03, 0x00, 0x01, 0x0, 0x3f },
+	{ 0x03, 0x00, 0x01, 0x0, 0x3d },
+	{ 0x03, 0x00, 0x01, 0x0, 0x3b },
+	{ 0x03, 0x00, 0x01, 0x0, 0x39 },
+};
+
+/**************************************************
+ * SW control.
+ **************************************************/
+
 const u16 b43_lcntab_sw_ctl_4313_epa_rev0[] = {
 	0x0002, 0x0008, 0x0004, 0x0001, 0x0002, 0x0008,
 	0x0004, 0x0001, 0x0002, 0x0008, 0x0004, 0x0001,
@@ -479,6 +631,32 @@ static void b43_phy_lcn_upload_static_tables(struct b43_wldev *dev)
 	lcntab_upload(dev, B43_LCNTAB32(0x18, 0), b43_lcntab_0x18);
 }
 
+void b43_phy_lcn_load_tx_gain_tab(struct b43_wldev *dev,
+			const struct b43_lcntab_tx_gain_tbl_entry *gain_table)
+{
+	u32 i;
+	u32 val;
+
+	u16 pa_gain = 0x70;
+	if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_FEM)
+		pa_gain = 0x10;
+
+	for (i = 0; i < 128; i++) {
+		val = ((pa_gain << 24) |
+		       (gain_table[i].pad << 16) |
+		       (gain_table[i].pga << 8) |
+			gain_table[i].gm);
+		b43_lcntab_write(dev, B43_LCNTAB32(0x7, 0xc0 + i), val);
+
+		/* brcmsmac doesn't maskset, we follow newer wl here */
+		val = b43_lcntab_read(dev, B43_LCNTAB32(0x7, 0x140 + i));
+		val &= 0x000fffff;
+		val |= ((gain_table[i].dac << 28) |
+			(gain_table[i].bb_mult << 20));
+		b43_lcntab_write(dev, B43_LCNTAB32(0x7, 0x140 + i), val);
+	}
+}
+
 /* Not implemented in brcmsmac, noticed in wl in MMIO dump */
 static void b43_phy_lcn_rewrite_tables(struct b43_wldev *dev)
 {
@@ -499,13 +677,24 @@ static void b43_phy_lcn_clean_papd_comp_table(struct b43_wldev *dev)
 		b43_lcntab_write(dev, B43_LCNTAB32(0x18, i), 0x80000);
 }
 
+/* wlc_lcnphy_tbl_init */
 void b43_phy_lcn_tables_init(struct b43_wldev *dev)
 {
+	struct ssb_sprom *sprom = dev->dev->bus_sprom;
+
 	b43_phy_lcn_upload_static_tables(dev);
-	/* TODO: various tables ops here */
 
-	if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_FEM &&
-	    !(dev->dev->bus_sprom->boardflags_hi & B43_BFH_FEM_BT))
+	if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
+		if (sprom->boardflags_lo & B43_BFL_EXTLNA)
+			b43_phy_lcn_load_tx_gain_tab(dev,
+				b43_lcntab_tx_gain_tbl_2ghz_ext_pa_rev0);
+		else
+			b43err(dev->wl,
+			       "TX gain table unknown for this card\n");
+	}
+
+	if (sprom->boardflags_lo & B43_BFL_FEM &&
+	    !(sprom->boardflags_hi & B43_BFH_FEM_BT))
 		b43_lcntab_write_bulk(dev, B43_LCNTAB16(0xf, 0),
 			ARRAY_SIZE(b43_lcntab_sw_ctl_4313_epa_rev0),
 			b43_lcntab_sw_ctl_4313_epa_rev0);
Signature · 1 line
1.7.3.4
#4 lore raw

PATCH 3/3 b43: LCN-PHY: load TX gain table on init

W dniu 3 wrze?nia 2011 21:01 u?ytkownik Rafa? Mi?ecki <[email protected]> napisa?:

Quoted 2 lines

Values and ops were taken from MMIO dump of wl. struct was copied from brcmsmac.

To get table I've simply used vim and RegExp plus find&replace:

:%s/phy_write(0x0455) <- 0x....\n phy_read(0x0456) -> 0x....\n phy_read(0x0457) -> 0x....\n\(.*\n.*\n.*\n\)/\1\r/ :%s/phy_write(0x0455) <- 0x....\nphy_write(0x0457) <- 0x\(....\)\nphy_write(0x0456) <- 0x\(....\)/0x\1\2/ :%s/0x\(..\)\(..\)\(..\)\(..\)\n0x\(.\)\(..\).....\n/\t{ 0x\4, 0x\3, 0x\2, 0x\5, 0x\6 },/

Signature · 1 line
Rafa?
#5 lore raw

Re: [PATCH 3/3] b43: LCN-PHY: load TX gain table on init

In reply to Rafał Miłecki
Quoted 2 lines · Rafał Miłecki

Values and ops were taken from MMIO dump of wl. struct was copied from brcmsmac.

[]

drivers/net/wireless/b43/tables_phy_lcn.c

Quoted 1 line
drivers/net/wireless/b43/tables_phy_lcn.c +0 -0

[]

drivers/net/wireless/b43/tables_phy_lcn.c static const u32 b43_lcntab_0x18[] = { · line 317

Quoted 2 lines
drivers/net/wireless/b43/tables_phy_lcn.c +2 -0
+const struct b43_lcntab_tx_gain_tbl_entry
+		b43_lcntab_tx_gain_tbl_2ghz_ext_pa_rev0[] = {

128 entries follow...

drivers/net/wireless/b43/tables_phy_lcn.c static const u32 b43_lcntab_0x18[] = { · line 318

Quoted 1 line
drivers/net/wireless/b43/tables_phy_lcn.c +1 -0
+	{ 0x03, 0x00, 0x1f, 0x0, 0x48 },

[etc]

drivers/net/wireless/b43/tables_phy_lcn.c static void b43_phy_lcn_upload_static_tables(struct b43_wldev *dev) · line 635

Quoted 5 lines
drivers/net/wireless/b43/tables_phy_lcn.c +4 -0
+	{ 0x03, 0x00, 0x01, 0x0, 0x39 },
+};
 
+void b43_phy_lcn_load_tx_gain_tab(struct b43_wldev *dev,
+			const struct b43_lcntab_tx_gain_tbl_entry *gain_table)

Are there multiple gain tables?

drivers/net/wireless/b43/tables_phy_lcn.c static void b43_phy_lcn_upload_static_tables(struct b43_wldev *dev) · line 644

Quoted 9 lines
drivers/net/wireless/b43/tables_phy_lcn.c +9 -0
+{
+	u32 i;
+	u32 val;
+
+	u16 pa_gain = 0x70;
+	if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_FEM)
+		pa_gain = 0x10;
+
+	for (i = 0; i < 128; i++) {

Can this be a fixed table and ARRAY_SIZE?

#6 lore raw

PATCH 3/3 b43: LCN-PHY: load TX gain table on init

W dniu 3 wrze?nia 2011 22:21 u?ytkownik Joe Perches <[email protected]> napisa?:

Quoted 10 lines · Rafa? Mi?ecki
Quoted 2 lines

Values and ops were taken from MMIO dump of wl. struct was copied from brcmsmac.

[]

drivers/net/wireless/b43/tables_phy_lcn.c

Quoted 1 line
drivers/net/wireless/b43/tables_phy_lcn.c +0 -0

[]

Quoted 2 lines

+const struct b43_lcntab_tx_gain_tbl_entry
+ ? ? ? ? ? ? b43_lcntab_tx_gain_tbl_2ghz_ext_pa_rev0[] = {

128 entries follow...

OK, I'll fix that.

Quoted 9 lines
Quoted 1 line

+ ? ? { 0x03, 0x00, 0x1f, 0x0, 0x48 },

[etc]

drivers/net/wireless/b43/tables_phy_lcn.c static void b43_phy_lcn_upload_static_tables(struct b43_wldev *dev)

Quoted 5 lines

+ ? ? { 0x03, 0x00, 0x01, 0x0, 0x39 },

drivers/net/wireless/b43/tables_phy_lcn.c +3 -0
+};
 
+void b43_phy_lcn_load_tx_gain_tab(struct b43_wldev *dev,
+ ? ? ? ? ? ? ? ? ? ? const struct b43_lcntab_tx_gain_tbl_entry *gain_table)

Are there multiple gain tables?

Yes, please check for the condition where we call b43_phy_lcn_load_tx_gain_tab, and the table name. Different hardware will need different table.

Quoted 11 lines

drivers/net/wireless/b43/tables_phy_lcn.c

Quoted 9 lines
drivers/net/wireless/b43/tables_phy_lcn.c +9 -0
+{
+ ? ? u32 i;
+ ? ? u32 val;
+
+ ? ? u16 pa_gain = 0x70;
+ ? ? if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_FEM)
+ ? ? ? ? ? ? pa_gain = 0x10;
+
+ ? ? for (i = 0; i < 128; i++) {

Can this be a fixed table and ARRAY_SIZE?

Not trivial, as we accept multiple tables here. I could do BUG_BUILD_ON(ARRAY_SIZE(tab1) != ARRAY_SIZE(tab2); and then use ARRAY_SIZE(tab1)
Or maybe I'll just use a define... Probably a better idea.

Signature · 1 line
Rafa?