Skip to contentSkip to conversation

b43: N-PHY: fix copy&paste typo

PATCH New Rafał Miłecki 4 participants 4 messages Apr 1, 2010 – Apr 2, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 b43: N-PHY: fix copy&paste typo

---
 drivers/net/wireless/b43/phy_n.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/b43/phy_n.c +1 -1
index 6fd140a..2ae2445 100644
@@ -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);
Signature · 1 line
1.6.4.2
#1 lore raw

PATCH 1/1 b43: N-PHY: fix copy&paste typo

Does anybody else think all the magic numbers make this code hard to understand?

2010/4/1 Rafa? Mi?ecki <[email protected]>:

Quoted 28 lines

---
?drivers/net/wireless/b43/phy_n.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

drivers/net/wireless/b43/phy_n.c +1 -2
index 6fd140a..2ae2445 100644
@@ -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
b43-dev at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/b43-dev

#2 lore raw

PATCH 1/1 b43: N-PHY: fix copy&paste typo

Quoted 9 lines · richardvoigt at gmail.com

Does anybody else think all the magic numbers make this code hard to understand?

2010/4/1 Rafa? Mi?ecki <[email protected]>:

Quoted 6 lines
---
 drivers/net/wireless/b43/phy_n.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 7 lines

drivers/net/wireless/b43/phy_n.c static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev, · line 2791

Quoted 7 lines
drivers/net/wireless/b43/phy_n.c +0 -0
index 6fd140a..2ae2445 100644
@@ -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

#3 lore raw

PATCH 1/1 b43: N-PHY: fix copy&paste typo

In reply to richardvoigt at gmail.com
Quoted 1 line · On Friday 02 April 2010 01:05:22 richardvoigt at gmail.com 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.

Quoted 30 lines

2010/4/1 Rafa? Mi?ecki <[email protected]>:

Quoted 28 lines
---
 drivers/net/wireless/b43/phy_n.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/b43/phy_n.c +1 -2
index 6fd140a..2ae2445 100644
@@ -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
b43-dev at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/b43-dev

Signature · 1 line
Greetings, Michael.