diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-02-15 19:31:20 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-12 10:32:56 -0700 |
commit | b0f1b35e3cf604dcafdeae9ba3b4a1a86df7d9e8 (patch) | |
tree | 2193bf1ba6a53e0f2966354460f116393b77f4fe /drivers/net/wireless/ath/ath9k/ar9002_hw.c | |
parent | 34a9660ba1a8b98adf852f4f1090bdf084ccf991 (diff) | |
download | kernel_samsung_smdk4412-b0f1b35e3cf604dcafdeae9ba3b4a1a86df7d9e8.zip kernel_samsung_smdk4412-b0f1b35e3cf604dcafdeae9ba3b4a1a86df7d9e8.tar.gz kernel_samsung_smdk4412-b0f1b35e3cf604dcafdeae9ba3b4a1a86df7d9e8.tar.bz2 |
ath9k_hw: prevent writes to const data on AR9160
commit 9bbb8168ed3d8b946f9c1901a63a675012de88f2 upstream.
Duplicate the data for iniAddac early on, to avoid having to do redundant
memcpy calls later. While we're at it, make AR5416 < v2.2 use the same
codepath. Fixes a reported crash on x86.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Reported-by: Magnus Määttä <magnus.maatta@logica.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9002_hw.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9002_hw.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c index c32f9d1..30bf703 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c @@ -179,6 +179,25 @@ static void ar9002_hw_init_mode_regs(struct ath_hw *ah) INIT_INI_ARRAY(&ah->iniAddac, ar5416Addac, ARRAY_SIZE(ar5416Addac), 2); } + + /* iniAddac needs to be modified for these chips */ + if (AR_SREV_9160(ah) || !AR_SREV_5416_22_OR_LATER(ah)) { + struct ar5416IniArray *addac = &ah->iniAddac; + u32 size = sizeof(u32) * addac->ia_rows * addac->ia_columns; + u32 *data; + + data = kmalloc(size, GFP_KERNEL); + if (!data) + return; + + memcpy(data, addac->ia_array, size); + addac->ia_array = data; + + if (!AR_SREV_5416_22_OR_LATER(ah)) { + /* override CLKDRV value */ + INI_RA(addac, 31,1) = 0; + } + } } /* Support for Japan ch.14 (2484) spread */ |