diff options
author | Daniel Drake <dsd@gentoo.org> | 2006-08-12 12:59:42 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-08-14 15:43:21 -0400 |
commit | 20fe2176e5edbeb5957f113df1282a917ef87b5d (patch) | |
tree | bf1b07ba5bc22060f42e37209d41bc51183b72f4 /drivers/net/wireless/zd1211rw/zd_chip.c | |
parent | 98227a90a727029613f23c5e53554f1f4d7a1c89 (diff) |
[PATCH] zd1211rw: AL2230 ZD1211B vendor sync
This patch synchronizes our code to some recent vendor driver modifications.
A new PHY layout is supported, some values are tweaked, and the AL2230 is now
programmed over a new interface which is many times faster.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_chip.c')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_chip.c | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c index 92ddcd952423..8cc693d80f7f 100644 --- a/drivers/net/wireless/zd1211rw/zd_chip.c +++ b/drivers/net/wireless/zd1211rw/zd_chip.c | |||
@@ -68,10 +68,11 @@ static int scnprint_id(struct zd_chip *chip, char *buffer, size_t size) | |||
68 | i += scnprint_mac_oui(chip->e2p_mac, buffer+i, size-i); | 68 | i += scnprint_mac_oui(chip->e2p_mac, buffer+i, size-i); |
69 | i += scnprintf(buffer+i, size-i, " "); | 69 | i += scnprintf(buffer+i, size-i, " "); |
70 | i += zd_rf_scnprint_id(&chip->rf, buffer+i, size-i); | 70 | i += zd_rf_scnprint_id(&chip->rf, buffer+i, size-i); |
71 | i += scnprintf(buffer+i, size-i, " pa%1x %c%c%c", chip->pa_type, | 71 | i += scnprintf(buffer+i, size-i, " pa%1x %c%c%c%c", chip->pa_type, |
72 | chip->patch_cck_gain ? 'g' : '-', | 72 | chip->patch_cck_gain ? 'g' : '-', |
73 | chip->patch_cr157 ? '7' : '-', | 73 | chip->patch_cr157 ? '7' : '-', |
74 | chip->patch_6m_band_edge ? '6' : '-'); | 74 | chip->patch_6m_band_edge ? '6' : '-', |
75 | chip->new_phy_layout ? 'N' : '-'); | ||
75 | return i; | 76 | return i; |
76 | } | 77 | } |
77 | 78 | ||
@@ -330,13 +331,14 @@ static int read_pod(struct zd_chip *chip, u8 *rf_type) | |||
330 | chip->patch_cck_gain = (value >> 8) & 0x1; | 331 | chip->patch_cck_gain = (value >> 8) & 0x1; |
331 | chip->patch_cr157 = (value >> 13) & 0x1; | 332 | chip->patch_cr157 = (value >> 13) & 0x1; |
332 | chip->patch_6m_band_edge = (value >> 21) & 0x1; | 333 | chip->patch_6m_band_edge = (value >> 21) & 0x1; |
334 | chip->new_phy_layout = (value >> 31) & 0x1; | ||
333 | 335 | ||
334 | dev_dbg_f(zd_chip_dev(chip), | 336 | dev_dbg_f(zd_chip_dev(chip), |
335 | "RF %s %#01x PA type %#01x patch CCK %d patch CR157 %d " | 337 | "RF %s %#01x PA type %#01x patch CCK %d patch CR157 %d " |
336 | "patch 6M %d\n", | 338 | "patch 6M %d new PHY %d\n", |
337 | zd_rf_name(*rf_type), *rf_type, | 339 | zd_rf_name(*rf_type), *rf_type, |
338 | chip->pa_type, chip->patch_cck_gain, | 340 | chip->pa_type, chip->patch_cck_gain, |
339 | chip->patch_cr157, chip->patch_6m_band_edge); | 341 | chip->patch_cr157, chip->patch_6m_band_edge, chip->new_phy_layout); |
340 | return 0; | 342 | return 0; |
341 | error: | 343 | error: |
342 | *rf_type = 0; | 344 | *rf_type = 0; |
@@ -344,6 +346,7 @@ error: | |||
344 | chip->patch_cck_gain = 0; | 346 | chip->patch_cck_gain = 0; |
345 | chip->patch_cr157 = 0; | 347 | chip->patch_cr157 = 0; |
346 | chip->patch_6m_band_edge = 0; | 348 | chip->patch_6m_band_edge = 0; |
349 | chip->new_phy_layout = 0; | ||
347 | return r; | 350 | return r; |
348 | } | 351 | } |
349 | 352 | ||
@@ -856,7 +859,7 @@ static int zd1211b_hw_init_hmac(struct zd_chip *chip) | |||
856 | { CR_RX_PE_DELAY, 0x70 }, | 859 | { CR_RX_PE_DELAY, 0x70 }, |
857 | { CR_PS_CTRL, 0x10000000 }, | 860 | { CR_PS_CTRL, 0x10000000 }, |
858 | { CR_RTS_CTS_RATE, 0x02030203 }, | 861 | { CR_RTS_CTS_RATE, 0x02030203 }, |
859 | { CR_RX_THRESHOLD, 0x000c0640 }, | 862 | { CR_RX_THRESHOLD, 0x000c0eff, }, |
860 | { CR_AFTER_PNP, 0x1 }, | 863 | { CR_AFTER_PNP, 0x1 }, |
861 | { CR_WEP_PROTECT, 0x114 }, | 864 | { CR_WEP_PROTECT, 0x114 }, |
862 | }; | 865 | }; |
@@ -1616,3 +1619,34 @@ int zd_rfwritev_locked(struct zd_chip *chip, | |||
1616 | 1619 | ||
1617 | return 0; | 1620 | return 0; |
1618 | } | 1621 | } |
1622 | |||
1623 | /* | ||
1624 | * We can optionally program the RF directly through CR regs, if supported by | ||
1625 | * the hardware. This is much faster than the older method. | ||
1626 | */ | ||
1627 | static int zd_rfwrite_cr_locked(struct zd_chip *chip, u32 value) | ||
1628 | { | ||
1629 | struct zd_ioreq16 ioreqs[] = { | ||
1630 | { CR244, (value >> 16) & 0xff }, | ||
1631 | { CR243, (value >> 8) & 0xff }, | ||
1632 | { CR242, value & 0xff }, | ||
1633 | }; | ||
1634 | ZD_ASSERT(mutex_is_locked(&chip->mutex)); | ||
1635 | return zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs)); | ||
1636 | } | ||
1637 | |||
1638 | int zd_rfwritev_cr_locked(struct zd_chip *chip, | ||
1639 | const u32 *values, unsigned int count) | ||
1640 | { | ||
1641 | int r; | ||
1642 | unsigned int i; | ||
1643 | |||
1644 | for (i = 0; i < count; i++) { | ||
1645 | r = zd_rfwrite_cr_locked(chip, values[i]); | ||
1646 | if (r) | ||
1647 | return r; | ||
1648 | } | ||
1649 | |||
1650 | return 0; | ||
1651 | } | ||
1652 | |||