Re: [PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains

2010-01-06 Thread Rafał Miłecki
W dniu 6 stycznia 2010 20:51 użytkownik Michael Buesch  napisał:
> On Wednesday 06 January 2010 20:41:52 Rafał Miłecki wrote:
>> I started composing that mail before got real idea of patches. I was
>> still thinking I need some magic headers "diff" tool generates. Hope I
>> totally understand this now and won't cause more problems to you guys
>> :)
>
> There are no problems. It's just a little bit easier for maintainers to merge
> properly formatted patches. Importing a properly formatted patch into git is 
> just
> a matter of a command or two.
>
> So that said, I think it's awesome that you started to work on the N code.
> I hope we get something usable, soon. Lots of people will love you and women
> will want to marry you. ;)
> Your patches _are_ actually in a pretty good shape. The remaining submission 
> issues
> are minor and easy to fix.

Hey, thanks a lot, glad to hear that :)

It's great opportunity to involve myself in kernel development. I
could never write full working driver myself and in this case I have
most part of driver written and great specs available :)

-- 
Rafał
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains

2010-01-06 Thread Michael Buesch
On Wednesday 06 January 2010 20:41:52 Rafał Miłecki wrote:
> I started composing that mail before got real idea of patches. I was
> still thinking I need some magic headers "diff" tool generates. Hope I
> totally understand this now and won't cause more problems to you guys
> :)

There are no problems. It's just a little bit easier for maintainers to merge
properly formatted patches. Importing a properly formatted patch into git is 
just
a matter of a command or two.

So that said, I think it's awesome that you started to work on the N code.
I hope we get something usable, soon. Lots of people will love you and women
will want to marry you. ;)
Your patches _are_ actually in a pretty good shape. The remaining submission 
issues
are minor and easy to fix.

-- 
Greetings, Michael.
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains

2010-01-06 Thread Rafał Miłecki
W dniu 6 stycznia 2010 20:36 użytkownik Michael Buesch  napisał:
> On Wednesday 06 January 2010 20:29:36 Rafał Miłecki wrote:
>> > You may read Documentation/SubmittingPatches and format your future
>> > patches according to that.
>>
>> Well, that's really poor joke :| Manually creating .orig files, using
>> "diff -up" and so dropping local commits "strategy"...? Er, I don't
>> think I'll use this one.
>
> Nobody said you need to fix your internal workflow. Why would anybody care
> _how_ you generate your patches?
> You could manually type them into your cellphone with T9. If that it results
> in a properly formated patch in the end, nobody would complain.

Good one! ;)


> So yes, reading other people's patches probably is a good idea to start with.
>
> In general only put stuff into the mail that you want to show up in the commit
> message. (If you want to have additional stuff that doesn't show up in the 
> commit
> message, you can use the "---" delimiter. But that's documented elsewhere so
> I don't have to explain that here...)

I started composing that mail before got real idea of patches. I was
still thinking I need some magic headers "diff" tool generates. Hope I
totally understand this now and won't cause more problems to you guys
:)

-- 
Rafał
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains

2010-01-06 Thread Michael Buesch
On Wednesday 06 January 2010 20:29:36 Rafał Miłecki wrote:
> > You may read Documentation/SubmittingPatches and format your future
> > patches according to that.
> 
> Well, that's really poor joke :| Manually creating .orig files, using
> "diff -up" and so dropping local commits "strategy"...? Er, I don't
> think I'll use this one.

Nobody said you need to fix your internal workflow. Why would anybody care
_how_ you generate your patches?
You could manually type them into your cellphone with T9. If that it results
in a properly formated patch in the end, nobody would complain.

So yes, reading other people's patches probably is a good idea to start with.

In general only put stuff into the mail that you want to show up in the commit
message. (If you want to have additional stuff that doesn't show up in the 
commit
message, you can use the "---" delimiter. But that's documented elsewhere so
I don't have to explain that here...)

-- 
Greetings, Michael
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains

2010-01-06 Thread Rafał Miłecki
W dniu 6 stycznia 2010 19:22 użytkownik Michael Buesch  napisał:
> On Wednesday 06 January 2010 19:18:39 Rafał Miłecki wrote:
>> > Dude what is up with this e-mail data on your patches in the commit log?
>>
>> That is way of encoding non-ASCII chars in mail header. You can find
>> info about this in RFC. That is "=?UTF-8?B?" prefix and base 64
>> encoded text.
>>
>> That was generated with git (git format-patch -5) and it understood by
>> git (git am ...).
>
> Well, however, there is no reason to include this in the mail body (and thus
> the GIT commit message).
> As you said, these are mail _headers_.
> Additionally, attaching the patch as mail attachment is _not_ required. We 
> just
> put the patch into the body.

OK, will try to follow that. I checked few patches submitted by other
ppl so probably get the correct way this time.


> You may read Documentation/SubmittingPatches and format your future
> patches according to that.

Well, that's really poor joke :| Manually creating .orig files, using
"diff -up" and so dropping local commits "strategy"...? Er, I don't
think I'll use this one.

-- 
Rafał
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains

2010-01-06 Thread Rafał Miłecki
W dniu 6 stycznia 2010 18:26 użytkownik Luis R. Rodriguez
 napisał:
> 2010/1/6 Rafał Miłecki :
>> b43: N-PHY: b43_nphy_get_tx_gains
>>
>>
>> From 5c96b3de80f7d044c42808e8123ae3f50916d6fc Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= 
>> Date: Wed, 6 Jan 2010 15:25:14 +0100
>> Subject: [PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains
>> MIME-Version: 1.0
>> Content-Type: text/plain; charset=UTF-8
>> Content-Transfer-Encoding: 8bit
>
> Dude what is up with this e-mail data on your patches in the commit log?

That is way of encoding non-ASCII chars in mail header. You can find
info about this in RFC. That is "=?UTF-8?B?" prefix and base 64
encoded text.

That was generated with git (git format-patch -5) and it understood by
git (git am ...).

-- 
Rafał
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains

2010-01-06 Thread Michael Buesch
On Wednesday 06 January 2010 19:18:39 Rafał Miłecki wrote:
> > Dude what is up with this e-mail data on your patches in the commit log?
> 
> That is way of encoding non-ASCII chars in mail header. You can find
> info about this in RFC. That is "=?UTF-8?B?" prefix and base 64
> encoded text.
> 
> That was generated with git (git format-patch -5) and it understood by
> git (git am ...).

Well, however, there is no reason to include this in the mail body (and thus
the GIT commit message).
As you said, these are mail _headers_.
Additionally, attaching the patch as mail attachment is _not_ required. We just
put the patch into the body.

You may read Documentation/SubmittingPatches and format your future
patches according to that.

-- 
Greetings, Michael.
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains

2010-01-06 Thread Luis R. Rodriguez
2010/1/6 Rafał Miłecki :
> b43: N-PHY: b43_nphy_get_tx_gains
>
>
> From 5c96b3de80f7d044c42808e8123ae3f50916d6fc Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= 
> Date: Wed, 6 Jan 2010 15:25:14 +0100
> Subject: [PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit

Dude what is up with this e-mail data on your patches in the commit log?

  Luis
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


[PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains

2010-01-06 Thread Rafał Miłecki

b43: N-PHY: b43_nphy_get_tx_gains


From 5c96b3de80f7d044c42808e8123ae3f50916d6fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= 
Date: Wed, 6 Jan 2010 15:25:14 +0100
Subject: [PATCH 2/5] b43: N-PHY: b43_nphy_get_tx_gains
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Rafał Miłecki 
---
 drivers/net/wireless/b43/phy_n.c |   75 ++
 drivers/net/wireless/b43/phy_n.h |1 +
 2 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 40d7b73..249caf0 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -30,6 +30,8 @@
 #include "tables_nphy.h"


+struct nphy_txgains { u16 txgm[2]; u16 pga[2]; u16 pad[2]; u16 ipa[2]; };
+
 void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
 {//TODO
 }
@@ -405,6 +407,79 @@ static void b43_nphy_stay_carrier_search(struct b43_wldev 
*dev, bool enable)
}
 }

+static struct nphy_txgains b43_nphy_get_tx_gains(struct b43_wldev *dev)
+{
+   struct b43_phy_n *nphy = dev->phy.n;
+
+   u16 curr_gain[2];
+   struct nphy_txgains target;
+   u32 *table = NULL;
+
+   if (nphy->txpwrctrl == 0) {
+   int i;
+
+   if (nphy->hang_avoid)
+   b43_nphy_stay_carrier_search(dev, true);
+   //TODO: Read an N PHY Table with ID 7, length 2, offset 0x110, 
width 16, and curr_gain
+   if (nphy->hang_avoid)
+   b43_nphy_stay_carrier_search(dev, false);
+
+   for (i = 0; i < 2; ++i) {
+   if (dev->phy.rev >= 3) {
+   target.ipa[i] = curr_gain[i] & 0x000F;
+   target.pad[i] = (curr_gain[i] & 0x00F0) >> 4;
+   target.pga[i] = (curr_gain[i] & 0x0F00) >> 8;
+   target.txgm[i] = (curr_gain[i] & 0x7000) >> 12;
+   } else {
+   target.ipa[i] = curr_gain[i] & 0x0003;
+   target.pad[i] = (curr_gain[i] & 0x000C) >> 2;
+   target.pga[i] = (curr_gain[i] & 0x0070) >> 4;
+   target.txgm[i] = (curr_gain[i] & 0x0380) >> 7;
+   }
+   }
+   } else {
+   int i;
+   u16 index[2];
+   
+   for (i = 0; i < 2; ++i) {
+   if (dev->phy.rev >= 3) {
+   enum ieee80211_band band =
+   b43_current_band(dev->wl);
+
+   if ((nphy->ipa2g_on && band == 
IEEE80211_BAND_2GHZ) ||
+   (nphy->ipa5g_on && band == 
IEEE80211_BAND_5GHZ)) {
+   table = NULL; //FIXME: = output of N 
PHY Get IPA GainTbl
+   } else {
+   if (band == IEEE80211_BAND_5GHZ) {
+   if (dev->phy.rev == 3)
+   table = NULL; //FIXME: N 
PHY TX Power Control - TX Gain Table Rev >= 3 (5 GHz)
+   else if (dev->phy.rev == 4)
+   table = NULL; //FIXME: 
N PHY TX Power Control - TX Gain Table Rev 4 (5 GHz)
+   else
+   table = NULL; //FIXME: 
N PHY TX Power Control - TX Gain Table Rev 5 (5 GHz)
+   } else {
+   table = NULL; //FIXME: N PHY TX 
Power Control - TX Gain Table Rev >= 3 (2.4 GHz)
+   }
+   }
+
+   target.ipa[i] = (table[index[i]] >> 16) & 0xF;
+   target.pad[i] = (table[index[i]] >> 20) & 0xF;
+   target.pga[i] = (table[index[i]] >> 24) & 0xF;
+   target.txgm[i] = (table[index[i]] >> 28) & 0xF;
+   } else {
+   table = NULL; //FIXME: N PHY TX Power Control - TX 
Gain Table Rev <= 2
+
+   target.ipa[i] = (table[index[i]] >> 16) & 0x3;
+   target.pad[i] = (table[index[i]] >> 18) & 0x3;
+   target.pga[i] = (table[index[i]] >> 20) & 0x7;
+   target.txgm[i] = (table[index[i]] >> 23) & 0x7;
+   }
+