Skip to contentSkip to conversation

b43: N-PHY: add update TX cal ladder

PATCH In review Rafał Miłecki 3 participants 7 messages Jan 14, 2010 – Jan 15, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 3/6 b43: N-PHY: add update TX cal ladder

---
 drivers/net/wireless/b43/phy_n.c       |   23 +++++++++++++++++
 drivers/net/wireless/b43/phy_n.h       |    1 +
 drivers/net/wireless/b43/tables_nphy.c |   42 ++++++++++++++++++++++++++++++++
 drivers/net/wireless/b43/tables_nphy.h |    6 ++++
 4 files changed, 72 insertions(+), 0 deletions(-)
drivers/net/wireless/b43/phy_n.c +23 -0
index 77be96d..67717c1 100644
@@ -686,6 +686,29 @@ static void b43_nphy_tx_iq_workaround(struct b43_wldev *dev)
 	b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_NPHY_TXIQW3, array[3]);
 }
 
+/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/UpdateTxCalLadder */
+static void b43_nphy_update_tx_cal_ladder(struct b43_wldev *dev, u16 core)
+{
+	struct b43_phy_n *nphy = dev->phy.n;
+	int i;
+	u16 scale, entry;
+
+	u16 tmp = nphy->txcal_bbmult;
+	if (core == 0)
+		tmp >>= 8;
+	tmp &= 0xff;
+
+	for (i = 0; i < 18; i++) {
+		scale = (ladder_lo[i].percent * tmp) / 100;
+		entry = ((scale & 0xFF) << 8) | ladder_lo[i].g_env;
+		//TODO: Write an N PHY Table with ID 15, length 1, offset i, width 16, and data entry
+
+		scale = (ladder_iq[i].percent * tmp) / 100;
+		entry = ((scale & 0xFF) << 8) | ladder_iq[i].g_env;
+		//TODO: Write an N PHY Table with ID 15, length 1, offset i + 32, width 16, and data entry
+	}
+}
+
 /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/CalRxIqRev2 */
 static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,
 			struct nphy_txgains target, u8 type, bool debug)
drivers/net/wireless/b43/phy_n.h +1 -0
index d435720..a5f3a94 100644
@@ -972,6 +972,7 @@ struct b43_phy_n {
 	u8 mphase_cal_phase_id;
 	u8 antsel_type;
 	u16 tx_rx_cal_radio_saveregs[22];
+	u16 txcal_bbmult;
 	u16 papd_epsilon_offset[2];
 	u32 deaf_count;
 	u32 rxcalparams;
drivers/net/wireless/b43/tables_nphy.c +42 -0

48 lines not on this page · raw message

drivers/net/wireless/b43/tables_nphy.h +6 -0
index 86c394c..b5e0e4b 100644
@@ -43,6 +43,10 @@ struct b43_nphy_channeltab_entry {
 	u16 unk2;
 };
 
+struct nphy_txiqcal_ladder {
+	u8 percent;
+	u8 g_env;
+};
 
 struct b43_wldev;
 
@@ -142,5 +146,7 @@ extern const u32 txpwrctrl_tx_gain_ipa_rev5[];
 extern const u32 txpwrctrl_tx_gain_ipa_rev6[];
 extern const u32 txpwrctrl_tx_gain_ipa_5g[];
 extern const u16 tbl_iqcal_gainparams[2][9][8];
+extern const struct nphy_txiqcal_ladder ladder_lo[];
+extern const struct nphy_txiqcal_ladder ladder_iq[];
 
 #endif /* B43_TABLES_NPHY_H_ */
Signature · 1 line
1.6.4.2
#1 lore raw

2010/1/14 Rafał Miłecki <[email protected]>:

It'd be nice if your patches had a good description of what this is, I see most of these patches are one-liners with no description at all.

Luis

#2 lore raw

W dniu 15 stycznia 2010 00:08 użytkownik Luis R. Rodriguez

Quoted 2 lines · <[email protected]> napisał:

It'd be nice if your patches had a good description of what this is, I see most of these patches are one-liners with no description at all.

That's right, because I just implement function by function using specs. I guess that's how implementing driver from RE specs look like.

Maybe I could use descriptions instead of function names so we would get calculate TX IQ LO
instead of
b43_nphy_cal_tx_iq_lo
but not sure if that makes much more sense.

Do you have some better suggestion? I'm open for comments, changes :)

Signature · 1 line
Rafał
#3 lore raw

2010/1/14 Rafał Miłecki <[email protected]>:

Quoted 8 lines

W dniu 15 stycznia 2010 00:08 użytkownik Luis R. Rodriguez

Quoted 2 lines · <[email protected]> napisał:

It'd be nice if your patches had a good description of what this is, I see most of these patches are one-liners with no description at all.

That's right, because I just implement function by function using specs. I guess that's how implementing driver from RE specs look like.

Quoted 7 lines

Maybe I could use descriptions instead of function names so we would get calculate TX IQ LO
instead of
b43_nphy_cal_tx_iq_lo
but not sure if that makes much more sense.

Do you have some better suggestion? I'm open for comments, changes :)

I'm talking about the text on the commit log after the "Subject", the subject in this case being:

"b43: N-PHY: add update TX cal ladder"

Doesn't the spec talk or even speculate to some degree what this thing is?

Luis

#4 lore raw

W dniu 15 stycznia 2010 00:44 użytkownik Luis R. Rodriguez

Quoted 15 lines · <[email protected]> napisał:

2010/1/14 Rafał Miłecki <[email protected]>:

Quoted 14 lines

W dniu 15 stycznia 2010 00:08 użytkownik Luis R. Rodriguez

Quoted 2 lines · <[email protected]> napisał:

It'd be nice if your patches had a good description of what this is, I see most of these patches are one-liners with no description at all.

That's right, because I just implement function by function using specs. I guess that's how implementing driver from RE specs look like.

Maybe I could use descriptions instead of function names so we would get calculate TX IQ LO
instead of
b43_nphy_cal_tx_iq_lo
but not sure if that makes much more sense.

Quoted 8 lines
Quoted 1 line

Do you have some better suggestion? I'm open for comments, changes :)

I'm talking about the text on the commit log after the "Subject", the subject in this case being:

"b43: N-PHY: add update TX cal ladder"

Doesn't the spec talk or even speculate to some degree what this thing is?

Well, AFAIK all we know about function is:
http://bcm-v4.sipsolutions.net/802.11/PHY/N/UpdateTxCalLadder

It updates something on wireless card writing table 15. It's hard to understand what it really does, especially if you don't yet have contexts calling this function.

P.S.
Also John's comment:
<linville> "calculate TX IQ LO" -- I like that better

So definitely I will avoid putting just function names. However as I said, I don't think I will be able to be more descriptive :/

Signature · 1 line
Rafał
#5 lore raw

2010/1/14 Rafał Miłecki <[email protected]>:

Quoted 33 lines

W dniu 15 stycznia 2010 00:44 użytkownik Luis R. Rodriguez

Quoted 15 lines · <[email protected]> napisał:

2010/1/14 Rafał Miłecki <[email protected]>:

Quoted 14 lines

W dniu 15 stycznia 2010 00:08 użytkownik Luis R. Rodriguez

Quoted 2 lines · <[email protected]> napisał:

It'd be nice if your patches had a good description of what this is, I see most of these patches are one-liners with no description at all.

That's right, because I just implement function by function using specs. I guess that's how implementing driver from RE specs look like.

Maybe I could use descriptions instead of function names so we would get calculate TX IQ LO
instead of
b43_nphy_cal_tx_iq_lo
but not sure if that makes much more sense.

Quoted 8 lines
Quoted 1 line

Do you have some better suggestion? I'm open for comments, changes :)

I'm talking about the text on the commit log after the "Subject", the subject in this case being:

"b43: N-PHY: add update TX cal ladder"

Doesn't the spec talk or even speculate to some degree what this thing is?

Well, AFAIK all we know about function is:
http://bcm-v4.sipsolutions.net/802.11/PHY/N/UpdateTxCalLadder

It updates something on wireless card writing table 15. It's hard to understand what it really does, especially if you don't yet have contexts calling this function.

Quoted 6 lines

P.S.
Also John's comment:
<linville> "calculate TX IQ LO" -- I like that better

So definitely I will avoid putting just function names. However as I said, I don't think I will be able to be more descriptive :/

Heh well I had to try :)

Luis

#6 lore raw
Quoted 6 lines · Luis R. Rodriguez

2010/1/14 Rafał Miłecki <[email protected]>:

Quoted 3 lines

So definitely I will avoid putting just function names. However as I said, I don't think I will be able to be more descriptive :/

Heh well I had to try :)

Unfortunately, there are no comments in MIPS binary code. Without them, there is very little more than the function names available.

Larry