2010-04-01 21:10:47

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH] b43: N-PHY: fix copy&paste typo

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

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 6fd140a..2ae2445 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -2790,7 +2790,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
}
b43_ntab_write_bulk(dev, B43_NTAB16(15, 88), 4,
buffer);
- b43_ntab_write_bulk(dev, B43_NTAB16(15, 101), 2,
+ b43_ntab_read_bulk(dev, B43_NTAB16(15, 101), 2,
buffer);
b43_ntab_write_bulk(dev, B43_NTAB16(15, 85), 2,
buffer);
--
1.6.4.2



2010-04-02 07:28:09

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH] b43: N-PHY: fix copy&paste typo

On Friday 02 April 2010 01:05:22 [email protected] wrote:
> Does anybody else think all the magic numbers make this code hard to understand?

Not at all. These are perfectly valid decimal numbers.
In my country you learn them in first class at school.

Seriously. What should we do?
#define NTAB_OFFSET_THAT_IS_FIFTEEN 15
No!

And btw, I'm pretty sure that broadcom also opencodes lots of these offsets
and values in their code. And that often is a sane thing to do. Creating
hundred thousands of defines that nobody understands is not a sane solution, either.

> 2010/4/1 Rafał Miłecki <[email protected]>:
> > Reported-by: Myhailo Danylenko <[email protected]>
> > Signed-off-by: Rafał Miłecki <[email protected]>
> > ---
> > drivers/net/wireless/b43/phy_n.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
> > index 6fd140a..2ae2445 100644
> > --- a/drivers/net/wireless/b43/phy_n.c
> > +++ b/drivers/net/wireless/b43/phy_n.c
> > @@ -2790,7 +2790,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
> > }
> > b43_ntab_write_bulk(dev, B43_NTAB16(15, 88), 4,
> > buffer);
> > - b43_ntab_write_bulk(dev, B43_NTAB16(15, 101), 2,
> > + b43_ntab_read_bulk(dev, B43_NTAB16(15, 101), 2,
> > buffer);
> > b43_ntab_write_bulk(dev, B43_NTAB16(15, 85), 2,
> > buffer);
> > --
> > 1.6.4.2
> >
> >
> > _______________________________________________
> > b43-dev mailing list
> > [email protected]
> > http://lists.infradead.org/mailman/listinfo/b43-dev
> >
>

--
Greetings, Michael.

2010-04-01 23:12:47

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH] b43: N-PHY: fix copy&paste typo

On 04/01/2010 06:05 PM, [email protected] wrote:
> Does anybody else think all the magic numbers make this code hard to understand?
>
> 2010/4/1 Rafał Miłecki <[email protected]>:
>> Reported-by: Myhailo Danylenko <[email protected]>
>> Signed-off-by: Rafał Miłecki <[email protected]>
>> ---
>> drivers/net/wireless/b43/phy_n.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
>> index 6fd140a..2ae2445 100644
>> --- a/drivers/net/wireless/b43/phy_n.c
>> +++ b/drivers/net/wireless/b43/phy_n.c
>> @@ -2790,7 +2790,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
>> }
>> b43_ntab_write_bulk(dev, B43_NTAB16(15, 88), 4,

If you have any idea what the 16-bit N PHY table 15 with offset 88 and
length 4 means to the firmware, please be our guest. All those us that
do the RE can only decompile the Broadcom driver, and write the specs.
Rafal writes the b43 code from that.

Larry


2010-04-01 23:05:23

by [email protected]

[permalink] [raw]
Subject: Re: [PATCH] b43: N-PHY: fix copy&paste typo

RG9lcyBhbnlib2R5IGVsc2UgdGhpbmsgYWxsIHRoZSBtYWdpYyBudW1iZXJzIG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