aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/zd1211rw/zd_chip.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_chip.c')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.c16
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 */
618static int patch_6m_band_edge(struct zd_chip *chip, int channel) 618static 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() */
629int 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;