diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2007-02-13 17:56:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-02-14 15:45:05 -0500 |
commit | a5d79d1e4fa58e12a37c91963fc071d811d2cffd (patch) | |
tree | 71326446230d02aae6826411c541764c3d78e6d9 | |
parent | 740ac4fb08866d702be90f167665d03759bd27d0 (diff) |
[PATCH] bcm43xx: OFDM fix for rev 1 cards
Nearly all of the writes to the bcm43xx internal lookup tables (ilt)
involve 16-bit quantities. Accordingly, the ilt_write routine was
coded to pass a u16 value. For one early GPHY chip, 32-bit quantities
are needed. For those writes, the value was clipped to 16 bits. This
patch adds an ilt_write32 routine that receives a 32-bit quantity
and writes it to the appropriate locations.
Signed-off-by: Larry Finger<Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_ilt.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_ilt.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_phy.c | 8 |
3 files changed, 20 insertions, 4 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c b/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c index ad8e569d1faf..f2b8dbac55a4 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c | |||
@@ -325,6 +325,21 @@ void bcm43xx_ilt_write(struct bcm43xx_private *bcm, u16 offset, u16 val) | |||
325 | } | 325 | } |
326 | } | 326 | } |
327 | 327 | ||
328 | void bcm43xx_ilt_write32(struct bcm43xx_private *bcm, u16 offset, u32 val) | ||
329 | { | ||
330 | if (bcm43xx_current_phy(bcm)->type == BCM43xx_PHYTYPE_A) { | ||
331 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_CTRL, offset); | ||
332 | mmiowb(); | ||
333 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_DATA2, (val & 0xFFFF0000) >> 16); | ||
334 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_DATA1, val & 0x0000FFFF); | ||
335 | } else { | ||
336 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_CTRL, offset); | ||
337 | mmiowb(); | ||
338 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_DATA2, (val & 0xFFFF0000) >> 16); | ||
339 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_DATA1, val & 0x0000FFFF); | ||
340 | } | ||
341 | } | ||
342 | |||
328 | u16 bcm43xx_ilt_read(struct bcm43xx_private *bcm, u16 offset) | 343 | u16 bcm43xx_ilt_read(struct bcm43xx_private *bcm, u16 offset) |
329 | { | 344 | { |
330 | if (bcm43xx_current_phy(bcm)->type == BCM43xx_PHYTYPE_A) { | 345 | if (bcm43xx_current_phy(bcm)->type == BCM43xx_PHYTYPE_A) { |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_ilt.h b/drivers/net/wireless/bcm43xx/bcm43xx_ilt.h index 464521abf73c..d7eaf5f25b7f 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_ilt.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx_ilt.h | |||
@@ -27,6 +27,7 @@ extern const u16 bcm43xx_ilt_sigmasqr2[BCM43xx_ILT_SIGMASQR_SIZE]; | |||
27 | 27 | ||
28 | 28 | ||
29 | void bcm43xx_ilt_write(struct bcm43xx_private *bcm, u16 offset, u16 val); | 29 | void bcm43xx_ilt_write(struct bcm43xx_private *bcm, u16 offset, u16 val); |
30 | void bcm43xx_ilt_write32(struct bcm43xx_private *bcm, u16 offset, u32 val); | ||
30 | u16 bcm43xx_ilt_read(struct bcm43xx_private *bcm, u16 offset); | 31 | u16 bcm43xx_ilt_read(struct bcm43xx_private *bcm, u16 offset); |
31 | 32 | ||
32 | #endif /* BCM43xx_ILT_H_ */ | 33 | #endif /* BCM43xx_ILT_H_ */ |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c index a08f9d1bd57d..3a5c9c2b2150 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c | |||
@@ -344,7 +344,7 @@ static void bcm43xx_phy_setupg(struct bcm43xx_private *bcm) | |||
344 | for (i = 0; i < BCM43xx_ILT_NOISEG1_SIZE; i++) | 344 | for (i = 0; i < BCM43xx_ILT_NOISEG1_SIZE; i++) |
345 | bcm43xx_ilt_write(bcm, 0x1800 + i, bcm43xx_ilt_noiseg1[i]); | 345 | bcm43xx_ilt_write(bcm, 0x1800 + i, bcm43xx_ilt_noiseg1[i]); |
346 | for (i = 0; i < BCM43xx_ILT_ROTOR_SIZE; i++) | 346 | for (i = 0; i < BCM43xx_ILT_ROTOR_SIZE; i++) |
347 | bcm43xx_ilt_write(bcm, 0x2000 + i, bcm43xx_ilt_rotor[i]); | 347 | bcm43xx_ilt_write32(bcm, 0x2000 + i, bcm43xx_ilt_rotor[i]); |
348 | } else { | 348 | } else { |
349 | /* nrssi values are signed 6-bit values. Not sure why we write 0x7654 here... */ | 349 | /* nrssi values are signed 6-bit values. Not sure why we write 0x7654 here... */ |
350 | bcm43xx_nrssi_hw_write(bcm, 0xBA98, (s16)0x7654); | 350 | bcm43xx_nrssi_hw_write(bcm, 0xBA98, (s16)0x7654); |
@@ -384,7 +384,7 @@ static void bcm43xx_phy_setupg(struct bcm43xx_private *bcm) | |||
384 | 384 | ||
385 | if (phy->rev == 1) { | 385 | if (phy->rev == 1) { |
386 | for (i = 0; i < BCM43xx_ILT_RETARD_SIZE; i++) | 386 | for (i = 0; i < BCM43xx_ILT_RETARD_SIZE; i++) |
387 | bcm43xx_ilt_write(bcm, 0x2400 + i, bcm43xx_ilt_retard[i]); | 387 | bcm43xx_ilt_write32(bcm, 0x2400 + i, bcm43xx_ilt_retard[i]); |
388 | for (i = 0; i < 4; i++) { | 388 | for (i = 0; i < 4; i++) { |
389 | bcm43xx_ilt_write(bcm, 0x5404 + i, 0x0020); | 389 | bcm43xx_ilt_write(bcm, 0x5404 + i, 0x0020); |
390 | bcm43xx_ilt_write(bcm, 0x5408 + i, 0x0020); | 390 | bcm43xx_ilt_write(bcm, 0x5408 + i, 0x0020); |
@@ -507,10 +507,10 @@ static void bcm43xx_phy_setupa(struct bcm43xx_private *bcm) | |||
507 | for (i = 0; i < BCM43xx_ILT_NOISEA2_SIZE; i++) | 507 | for (i = 0; i < BCM43xx_ILT_NOISEA2_SIZE; i++) |
508 | bcm43xx_ilt_write(bcm, 0x1800 + i, bcm43xx_ilt_noisea2[i]); | 508 | bcm43xx_ilt_write(bcm, 0x1800 + i, bcm43xx_ilt_noisea2[i]); |
509 | for (i = 0; i < BCM43xx_ILT_ROTOR_SIZE; i++) | 509 | for (i = 0; i < BCM43xx_ILT_ROTOR_SIZE; i++) |
510 | bcm43xx_ilt_write(bcm, 0x2000 + i, bcm43xx_ilt_rotor[i]); | 510 | bcm43xx_ilt_write32(bcm, 0x2000 + i, bcm43xx_ilt_rotor[i]); |
511 | bcm43xx_phy_init_noisescaletbl(bcm); | 511 | bcm43xx_phy_init_noisescaletbl(bcm); |
512 | for (i = 0; i < BCM43xx_ILT_RETARD_SIZE; i++) | 512 | for (i = 0; i < BCM43xx_ILT_RETARD_SIZE; i++) |
513 | bcm43xx_ilt_write(bcm, 0x2400 + i, bcm43xx_ilt_retard[i]); | 513 | bcm43xx_ilt_write32(bcm, 0x2400 + i, bcm43xx_ilt_retard[i]); |
514 | break; | 514 | break; |
515 | case 3: | 515 | case 3: |
516 | for (i = 0; i < 64; i++) | 516 | for (i = 0; i < 64; i++) |