aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2007-04-03 18:17:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-04-10 14:35:56 -0400
commit92b3e2e9253a9f4c9224071842fd263c334dece0 (patch)
tree460e99558feb77f65ef285774480f4fbdd75e09b
parentae6ead4623bfbc57f3945ff86f27e51811e2e91b (diff)
[PATCH] zd1211rw: Fix E2P_PHY_REG patching
Due to conflicting/confusing defines in the vendor driver, we were reading E2P_PHY_REG from the wrong location. CR157 patching was slightly incorrect in that the vendor driver only patches in an 8-bit value, whereas we were patching 24 bits. Additionally, CR157 patching was happening on both zd1211 and zd1211b, but this should only happen on zd1211. Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: Ulrich Kunitz <kune@deine-taler.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.c11
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.h2
2 files changed, 4 insertions, 9 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
index 9d299bd18850..87ee3ee020fe 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.c
+++ b/drivers/net/wireless/zd1211rw/zd_chip.c
@@ -592,16 +592,16 @@ int zd_chip_unlock_phy_regs(struct zd_chip *chip)
592 return r; 592 return r;
593} 593}
594 594
595/* CR157 can be optionally patched by the EEPROM */ 595/* CR157 can be optionally patched by the EEPROM for original ZD1211 */
596static int patch_cr157(struct zd_chip *chip) 596static int patch_cr157(struct zd_chip *chip)
597{ 597{
598 int r; 598 int r;
599 u32 value; 599 u16 value;
600 600
601 if (!chip->patch_cr157) 601 if (!chip->patch_cr157)
602 return 0; 602 return 0;
603 603
604 r = zd_ioread32_locked(chip, &value, E2P_PHY_REG); 604 r = zd_ioread16_locked(chip, &value, E2P_PHY_REG);
605 if (r) 605 if (r)
606 return r; 606 return r;
607 607
@@ -791,11 +791,6 @@ static int zd1211b_hw_reset_phy(struct zd_chip *chip)
791 goto out; 791 goto out;
792 792
793 r = zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs)); 793 r = zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
794 if (r)
795 goto unlock;
796
797 r = patch_cr157(chip);
798unlock:
799 t = zd_chip_unlock_phy_regs(chip); 794 t = zd_chip_unlock_phy_regs(chip);
800 if (t && !r) 795 if (t && !r)
801 r = t; 796 r = t;
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.h b/drivers/net/wireless/zd1211rw/zd_chip.h
index ae39c225bc9e..e57ed75d9425 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.h
+++ b/drivers/net/wireless/zd1211rw/zd_chip.h
@@ -641,8 +641,8 @@ enum {
641 * also only 11 channels. */ 641 * also only 11 channels. */
642#define E2P_ALLOWED_CHANNEL E2P_DATA(0x18) 642#define E2P_ALLOWED_CHANNEL E2P_DATA(0x18)
643 643
644#define E2P_PHY_REG E2P_DATA(0x1a)
645#define E2P_DEVICE_VER E2P_DATA(0x20) 644#define E2P_DEVICE_VER E2P_DATA(0x20)
645#define E2P_PHY_REG E2P_DATA(0x25)
646#define E2P_36M_CAL_VALUE1 E2P_DATA(0x28) 646#define E2P_36M_CAL_VALUE1 E2P_DATA(0x28)
647#define E2P_36M_CAL_VALUE2 E2P_DATA(0x2a) 647#define E2P_36M_CAL_VALUE2 E2P_DATA(0x2a)
648#define E2P_36M_CAL_VALUE3 E2P_DATA(0x2c) 648#define E2P_36M_CAL_VALUE3 E2P_DATA(0x2c)