diff options
author | Daniel Drake <dsd@gentoo.org> | 2007-04-07 11:00:15 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 11:01:03 -0400 |
commit | 72018b223dcacb631f140d4c8fada3790bd1b03c (patch) | |
tree | fbe954ad79bd8496c8f549f1381749cb0d6bb1c5 /drivers/net/wireless/zd1211rw/zd_chip.c | |
parent | dc536a706951e23d3c81d0aa81414dc9f2c34ce5 (diff) |
[PATCH] zd1211rw: rework band edge patching
This change allows RF drivers to provide their own 6M band edge patching
implementation, while providing a generic implementation shared by most
currently supported RF's.
The upcoming ZD1211B/AL7230B code will use this to define its own
patching function, which is different from the other RF configurations.
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 | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c index e2cfdda20a0f..95b4a2a26707 100644 --- a/drivers/net/wireless/zd1211rw/zd_chip.c +++ b/drivers/net/wireless/zd1211rw/zd_chip.c | |||
@@ -615,16 +615,24 @@ static int patch_cr157(struct zd_chip *chip) | |||
615 | * Vendor driver says: for FCC regulation, enabled per HWFeature 6M band edge | 615 | * Vendor driver says: for FCC regulation, enabled per HWFeature 6M band edge |
616 | * bit (for AL2230, AL2230S) | 616 | * bit (for AL2230, AL2230S) |
617 | */ | 617 | */ |
618 | static int patch_6m_band_edge(struct zd_chip *chip, int channel) | 618 | static int patch_6m_band_edge(struct zd_chip *chip, u8 channel) |
619 | { | ||
620 | ZD_ASSERT(mutex_is_locked(&chip->mutex)); | ||
621 | if (!chip->patch_6m_band_edge) | ||
622 | return 0; | ||
623 | |||
624 | return zd_rf_patch_6m_band_edge(&chip->rf, channel); | ||
625 | } | ||
626 | |||
627 | /* Generic implementation of 6M band edge patching, used by most RFs via | ||
628 | * zd_rf_generic_patch_6m() */ | ||
629 | int zd_chip_generic_patch_6m_band(struct zd_chip *chip, int channel) | ||
619 | { | 630 | { |
620 | struct zd_ioreq16 ioreqs[] = { | 631 | struct zd_ioreq16 ioreqs[] = { |
621 | { CR128, 0x14 }, { CR129, 0x12 }, { CR130, 0x10 }, | 632 | { CR128, 0x14 }, { CR129, 0x12 }, { CR130, 0x10 }, |
622 | { CR47, 0x1e }, | 633 | { CR47, 0x1e }, |
623 | }; | 634 | }; |
624 | 635 | ||
625 | if (!chip->patch_6m_band_edge || !chip->rf.patch_6m_band_edge) | ||
626 | return 0; | ||
627 | |||
628 | /* FIXME: Channel 11 is not the edge for all regulatory domains. */ | 636 | /* FIXME: Channel 11 is not the edge for all regulatory domains. */ |
629 | if (channel == 1 || channel == 11) | 637 | if (channel == 1 || channel == 11) |
630 | ioreqs[0].value = 0x12; | 638 | ioreqs[0].value = 0x12; |