linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/6] b43: N-PHY: add update TX cal ladder
@ 2010-01-14 22:43 Rafał Miłecki
  2010-01-14 23:08 ` Luis R. Rodriguez
  0 siblings, 1 reply; 7+ messages in thread
From: Rafał Miłecki @ 2010-01-14 22:43 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org, John W. Linville
  Cc: bcm43xx-dev@lists.berlios.de


Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
  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(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 77be96d..67717c1 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -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)
diff --git a/drivers/net/wireless/b43/phy_n.h b/drivers/net/wireless/b43/phy_n.h
index d435720..a5f3a94 100644
--- a/drivers/net/wireless/b43/phy_n.h
+++ b/drivers/net/wireless/b43/phy_n.h
@@ -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;
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
index de8a609..4816b70 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -2746,6 +2746,48 @@ const u16 tbl_iqcal_gainparams[2][9][8] = {
  	}
  };

+const struct nphy_txiqcal_ladder ladder_lo[] = {
+	{ 3, 0 },
+	{ 4, 0 },
+	{ 6, 0 },
+	{ 9, 0 },
+	{ 13, 0 },
+	{ 18, 0 },
+	{ 25, 0 },
+	{ 25, 1 },
+	{ 25, 2 },
+	{ 25, 3 },
+	{ 25, 4 },
+	{ 25, 5 },
+	{ 25, 6 },
+	{ 25, 7 },
+	{ 35, 7 },
+	{ 50, 7 },
+	{ 71, 7 },
+	{ 100, 7 }
+};
+
+const struct nphy_txiqcal_ladder ladder_iq[] = {
+	{ 3, 0 },
+	{ 4, 0 },
+	{ 6, 0 },
+	{ 9, 0 },
+	{ 13, 0 },
+	{ 18, 0 },
+	{ 25, 0 },
+	{ 35, 0 },
+	{ 50, 0 },
+	{ 71, 0 },
+	{ 100, 0 },
+	{ 100, 1 },
+	{ 100, 2 },
+	{ 100, 3 },
+	{ 100, 4 },
+	{ 100, 5 },
+	{ 100, 6 },
+	{ 100, 7 }
+};
+
  static inline void assert_ntab_array_sizes(void)
  {
  #undef check
diff --git a/drivers/net/wireless/b43/tables_nphy.h b/drivers/net/wireless/b43/tables_nphy.h
index 86c394c..b5e0e4b 100644
--- a/drivers/net/wireless/b43/tables_nphy.h
+++ b/drivers/net/wireless/b43/tables_nphy.h
@@ -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_ */
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/6] b43: N-PHY: add update TX cal ladder
  2010-01-14 22:43 [PATCH 3/6] b43: N-PHY: add update TX cal ladder Rafał Miłecki
@ 2010-01-14 23:08 ` Luis R. Rodriguez
  2010-01-14 23:13   ` Rafał Miłecki
  0 siblings, 1 reply; 7+ messages in thread
From: Luis R. Rodriguez @ 2010-01-14 23:08 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-wireless@vger.kernel.org, John W. Linville,
	bcm43xx-dev@lists.berlios.de

2010/1/14 Rafał Miłecki <zajec5@gmail.com>:

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/6] b43: N-PHY: add update TX cal ladder
  2010-01-14 23:08 ` Luis R. Rodriguez
@ 2010-01-14 23:13   ` Rafał Miłecki
  2010-01-14 23:44     ` Luis R. Rodriguez
  0 siblings, 1 reply; 7+ messages in thread
From: Rafał Miłecki @ 2010-01-14 23:13 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: linux-wireless@vger.kernel.org, John W. Linville,
	bcm43xx-dev@lists.berlios.de

W dniu 15 stycznia 2010 00:08 użytkownik Luis R. Rodriguez
<mcgrof@gmail.com> 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 :)

-- 
Rafał

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/6] b43: N-PHY: add update TX cal ladder
  2010-01-14 23:13   ` Rafał Miłecki
@ 2010-01-14 23:44     ` Luis R. Rodriguez
  2010-01-14 23:52       ` Rafał Miłecki
  0 siblings, 1 reply; 7+ messages in thread
From: Luis R. Rodriguez @ 2010-01-14 23:44 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-wireless@vger.kernel.org, John W. Linville,
	bcm43xx-dev@lists.berlios.de

2010/1/14 Rafał Miłecki <zajec5@gmail.com>:
> W dniu 15 stycznia 2010 00:08 użytkownik Luis R. Rodriguez
> <mcgrof@gmail.com> 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 :)

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/6] b43: N-PHY: add update TX cal ladder
  2010-01-14 23:44     ` Luis R. Rodriguez
@ 2010-01-14 23:52       ` Rafał Miłecki
  2010-01-14 23:59         ` Luis R. Rodriguez
  0 siblings, 1 reply; 7+ messages in thread
From: Rafał Miłecki @ 2010-01-14 23:52 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: linux-wireless@vger.kernel.org, John W. Linville,
	bcm43xx-dev@lists.berlios.de

W dniu 15 stycznia 2010 00:44 użytkownik Luis R. Rodriguez
<mcgrof@gmail.com> napisał:
> 2010/1/14 Rafał Miłecki <zajec5@gmail.com>:
>> W dniu 15 stycznia 2010 00:08 użytkownik Luis R. Rodriguez
>> <mcgrof@gmail.com> 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 :)
>
> 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 :/

-- 
Rafał

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/6] b43: N-PHY: add update TX cal ladder
  2010-01-14 23:52       ` Rafał Miłecki
@ 2010-01-14 23:59         ` Luis R. Rodriguez
  2010-01-15  0:14           ` Larry Finger
  0 siblings, 1 reply; 7+ messages in thread
From: Luis R. Rodriguez @ 2010-01-14 23:59 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-wireless@vger.kernel.org, John W. Linville,
	bcm43xx-dev@lists.berlios.de

2010/1/14 Rafał Miłecki <zajec5@gmail.com>:
> W dniu 15 stycznia 2010 00:44 użytkownik Luis R. Rodriguez
> <mcgrof@gmail.com> napisał:
>> 2010/1/14 Rafał Miłecki <zajec5@gmail.com>:
>>> W dniu 15 stycznia 2010 00:08 użytkownik Luis R. Rodriguez
>>> <mcgrof@gmail.com> 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 :)
>>
>> 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 :/

Heh well I had to try :)

  Luis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/6] b43: N-PHY: add update TX cal ladder
  2010-01-14 23:59         ` Luis R. Rodriguez
@ 2010-01-15  0:14           ` Larry Finger
  0 siblings, 0 replies; 7+ messages in thread
From: Larry Finger @ 2010-01-15  0:14 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Rafał Miłecki, linux-wireless@vger.kernel.org,
	John W. Linville, bcm43xx-dev@lists.berlios.de

On 01/14/2010 05:59 PM, Luis R. Rodriguez wrote:
> 2010/1/14 Rafał Miłecki <zajec5@gmail.com>:
>>
>> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-01-15  0:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-14 22:43 [PATCH 3/6] b43: N-PHY: add update TX cal ladder Rafał Miłecki
2010-01-14 23:08 ` Luis R. Rodriguez
2010-01-14 23:13   ` Rafał Miłecki
2010-01-14 23:44     ` Luis R. Rodriguez
2010-01-14 23:52       ` Rafał Miłecki
2010-01-14 23:59         ` Luis R. Rodriguez
2010-01-15  0:14           ` Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).