mac80211: update to 2013-01-07, add several ath9k stability fixes
SVN-Revision: 35063v19.07.3_mercusys_ac12_duma
parent
4834d09a3f
commit
5c9fd3b2d2
File diff suppressed because it is too large
Load Diff
@ -1,73 +0,0 @@
|
||||
From b4d6c33df61d95fa1e223101ca345f4c797e8823 Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Sun, 9 Dec 2012 23:37:13 +0100
|
||||
Subject: [PATCH] ath9k: ar9003: fix OTP register offsets for AR9340
|
||||
|
||||
Trying to access the OTP memory on the AR9340
|
||||
causes a data bus error like this:
|
||||
|
||||
Data bus error, epc == 86e84164, ra == 86e84164
|
||||
Oops[#1]:
|
||||
Cpu 0
|
||||
$ 0 : 00000000 00000061 deadc0de 00000000
|
||||
$ 4 : b8115f18 00015f18 00000007 00000004
|
||||
$ 8 : 00000001 7c7c3c7c 7c7c7c7c 7c7c7c7c
|
||||
$12 : 7c7c3c7c 001f0041 00000000 7c7c7c3c
|
||||
$16 : 86ee0000 00015f18 00000000 00000007
|
||||
$20 : 00000004 00000064 00000004 86d71c44
|
||||
$24 : 00000000 86e6ca00
|
||||
$28 : 86d70000 86d71b20 86ece0c0 86e84164
|
||||
Hi : 00000000
|
||||
Lo : 00000064
|
||||
epc : 86e84164 ath9k_hw_wait+0x58/0xb0 [ath9k_hw]
|
||||
Tainted: G O
|
||||
ra : 86e84164 ath9k_hw_wait+0x58/0xb0 [ath9k_hw]
|
||||
Status: 1100d403 KERNEL EXL IE
|
||||
Cause : 4080801c
|
||||
PrId : 0001974c (MIPS 74Kc)
|
||||
Modules linked in: ath9k(O+) ath9k_common(O) ath9k_hw(O) ath(O) ar934x_nfc
|
||||
mac80211(O) usbcore usb_common scsi_mod nls_base nand nand_ecc nand_ids
|
||||
crc_ccitt cfg80211(O) compat(O) arc4 aes_generic crypto_blkcipher cryptomgr
|
||||
aead crypto_hash crypto_algapi ledtrig_timer ledtrig_default_on leds_gpio
|
||||
Process insmod (pid: 459, threadinfo=86d70000, task=87942140, tls=779ac440)
|
||||
Stack : 802fb500 000200da 804db150 804e0000 87816130 86ee0000 00010000 86d71b88
|
||||
86d71bc0 00000004 00000003 86e9fcd0 80305300 0002c0d0 86e74c50 800b4c20
|
||||
000003e8 00000001 00000000 86ee0000 000003ff 86e9fd64 80305300 80123938
|
||||
fffffffc 00000004 000058bc 00000000 86ea0000 86ee0000 000001ff 878d6000
|
||||
99999999 86e9fdc0 86ee0fcc 86e9e664 0000c0d0 86ee0000 0000700000007000
|
||||
...
|
||||
Call Trace:
|
||||
[<86e84164>] ath9k_hw_wait+0x58/0xb0 [ath9k_hw]
|
||||
[<86e9fcd0>] ath9k_hw_setup_statusring+0x16b8/0x1c7c [ath9k_hw]
|
||||
|
||||
Code: 0000a812 0040f809 00000000 <00531024> 1054000b 24020001 0c05b5dc 2404000a 26520001
|
||||
|
||||
The cause of the error is that the OTP register
|
||||
offsets are different on the AR9340 than the
|
||||
actually used values.
|
||||
|
||||
Cc: <stable@vger.kernel.org> # 3.0+
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
|
||||
@@ -68,13 +68,13 @@
|
||||
#define AR9300_BASE_ADDR 0x3ff
|
||||
#define AR9300_BASE_ADDR_512 0x1ff
|
||||
|
||||
-#define AR9300_OTP_BASE 0x14000
|
||||
-#define AR9300_OTP_STATUS 0x15f18
|
||||
+#define AR9300_OTP_BASE (AR_SREV_9340(ah) ? 0x30000 : 0x14000)
|
||||
+#define AR9300_OTP_STATUS (AR_SREV_9340(ah) ? 0x30018 : 0x15f18)
|
||||
#define AR9300_OTP_STATUS_TYPE 0x7
|
||||
#define AR9300_OTP_STATUS_VALID 0x4
|
||||
#define AR9300_OTP_STATUS_ACCESS_BUSY 0x2
|
||||
#define AR9300_OTP_STATUS_SM_BUSY 0x1
|
||||
-#define AR9300_OTP_READ_DATA 0x15f1c
|
||||
+#define AR9300_OTP_READ_DATA (AR_SREV_9340(ah) ? 0x3001c : 0x15f1c)
|
||||
|
||||
enum targetPowerHTRates {
|
||||
HT_TARGET_RATE_0_8_16,
|
@ -1,83 +0,0 @@
|
||||
From cd3d888d569f5908c4345f7c99018f574c80a32b Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Sun, 9 Dec 2012 14:58:56 +0100
|
||||
Subject: [PATCH 1/4] ath9k: move duplicated debug message to
|
||||
'ath9k_hw_nvram_read'
|
||||
|
||||
The fill_eeprom functions are printing the same
|
||||
debug message in case the 'ath9k_hw_nvram_read'
|
||||
function fails. Remove the duplicated code from
|
||||
fill_eeprom functions and add the ath_dbg call
|
||||
directly into 'ath9k_hw_nvram_read'.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/eeprom.c | 8 +++++++-
|
||||
drivers/net/wireless/ath/ath9k/eeprom_4k.c | 6 ++----
|
||||
drivers/net/wireless/ath/ath9k/eeprom_9287.c | 5 +----
|
||||
drivers/net/wireless/ath/ath9k/eeprom_def.c | 5 +----
|
||||
4 files changed, 11 insertions(+), 13 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
|
||||
@@ -115,7 +115,13 @@ void ath9k_hw_usb_gen_fill_eeprom(struct
|
||||
|
||||
bool ath9k_hw_nvram_read(struct ath_common *common, u32 off, u16 *data)
|
||||
{
|
||||
- return common->bus_ops->eeprom_read(common, off, data);
|
||||
+ bool ret;
|
||||
+
|
||||
+ ret = common->bus_ops->eeprom_read(common, off, data);
|
||||
+ if (!ret)
|
||||
+ ath_dbg(common, EEPROM, "Unable to read eeprom region\n");
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
void ath9k_hw_fill_vpd_table(u8 pwrMin, u8 pwrMax, u8 *pPwrList,
|
||||
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
|
||||
@@ -37,11 +37,9 @@ static bool __ath9k_hw_4k_fill_eeprom(st
|
||||
int addr, eep_start_loc = 64;
|
||||
|
||||
for (addr = 0; addr < SIZE_EEPROM_4K; addr++) {
|
||||
- if (!ath9k_hw_nvram_read(common, addr + eep_start_loc, eep_data)) {
|
||||
- ath_dbg(common, EEPROM,
|
||||
- "Unable to read eeprom region\n");
|
||||
+ if (!ath9k_hw_nvram_read(common, addr + eep_start_loc,
|
||||
+ eep_data))
|
||||
return false;
|
||||
- }
|
||||
eep_data++;
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
|
||||
@@ -40,11 +40,8 @@ static bool __ath9k_hw_ar9287_fill_eepro
|
||||
|
||||
for (addr = 0; addr < SIZE_EEPROM_AR9287; addr++) {
|
||||
if (!ath9k_hw_nvram_read(common, addr + eep_start_loc,
|
||||
- eep_data)) {
|
||||
- ath_dbg(common, EEPROM,
|
||||
- "Unable to read eeprom region\n");
|
||||
+ eep_data))
|
||||
return false;
|
||||
- }
|
||||
eep_data++;
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
|
||||
@@ -97,11 +97,8 @@ static bool __ath9k_hw_def_fill_eeprom(s
|
||||
|
||||
for (addr = 0; addr < SIZE_EEPROM_DEF; addr++) {
|
||||
if (!ath9k_hw_nvram_read(common, addr + ar5416_eep_start_loc,
|
||||
- eep_data)) {
|
||||
- ath_err(ath9k_hw_common(ah),
|
||||
- "Unable to read eeprom region\n");
|
||||
+ eep_data))
|
||||
return false;
|
||||
- }
|
||||
eep_data++;
|
||||
}
|
||||
return true;
|
@ -1,26 +0,0 @@
|
||||
From 910b74fb0e0369b18aa689ab02c9413235c18f98 Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Sun, 9 Dec 2012 16:47:35 +0100
|
||||
Subject: [PATCH 2/4] ath9k: add EEPROM offset to debug message
|
||||
|
||||
Show the EEPROM offset of the failed read operation
|
||||
in 'ath9k_hw_nvram_read'. The debug message is more
|
||||
informative this way.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/eeprom.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
|
||||
@@ -119,7 +119,8 @@ bool ath9k_hw_nvram_read(struct ath_comm
|
||||
|
||||
ret = common->bus_ops->eeprom_read(common, off, data);
|
||||
if (!ret)
|
||||
- ath_dbg(common, EEPROM, "Unable to read eeprom region\n");
|
||||
+ ath_dbg(common, EEPROM,
|
||||
+ "unable to read eeprom region at offset %u\n", off);
|
||||
|
||||
return ret;
|
||||
}
|
@ -1,203 +0,0 @@
|
||||
From 26c22324cca2db37fa294156fd875100d95438f4 Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Sun, 9 Dec 2012 15:19:01 +0100
|
||||
Subject: [PATCH 3/4] ath9k: use 'struct ath_hw *' as the first argument for
|
||||
'ath9k_hw_nvram_read'
|
||||
|
||||
The 'ath9k_hw_nvram_read' function takes a
|
||||
'struct ath_common *' as its first argument.
|
||||
Almost each of its caller has a 'struct ath_hw *'
|
||||
parameter in their argument list, and that is
|
||||
dereferenced in order to get the 'struct ath_common'
|
||||
pointer.
|
||||
|
||||
Change the first argument of 'ath9k_hw_nvram_read'
|
||||
to be a 'struct ath_hw *', and remove the dereference
|
||||
calls from the callers.
|
||||
|
||||
Also change the type of the first argument of the
|
||||
ar9300_eeprom_read_{byte,word} functions.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 17 ++++++++---------
|
||||
drivers/net/wireless/ath/ath9k/eeprom.c | 3 ++-
|
||||
drivers/net/wireless/ath/ath9k/eeprom.h | 2 +-
|
||||
drivers/net/wireless/ath/ath9k/eeprom_4k.c | 6 ++----
|
||||
drivers/net/wireless/ath/ath9k/eeprom_9287.c | 6 ++----
|
||||
drivers/net/wireless/ath/ath9k/eeprom_def.c | 5 ++---
|
||||
6 files changed, 17 insertions(+), 22 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
|
||||
@@ -3005,24 +3005,24 @@ static u32 ath9k_hw_ar9300_get_eeprom(st
|
||||
}
|
||||
}
|
||||
|
||||
-static bool ar9300_eeprom_read_byte(struct ath_common *common, int address,
|
||||
+static bool ar9300_eeprom_read_byte(struct ath_hw *ah, int address,
|
||||
u8 *buffer)
|
||||
{
|
||||
u16 val;
|
||||
|
||||
- if (unlikely(!ath9k_hw_nvram_read(common, address / 2, &val)))
|
||||
+ if (unlikely(!ath9k_hw_nvram_read(ah, address / 2, &val)))
|
||||
return false;
|
||||
|
||||
*buffer = (val >> (8 * (address % 2))) & 0xff;
|
||||
return true;
|
||||
}
|
||||
|
||||
-static bool ar9300_eeprom_read_word(struct ath_common *common, int address,
|
||||
+static bool ar9300_eeprom_read_word(struct ath_hw *ah, int address,
|
||||
u8 *buffer)
|
||||
{
|
||||
u16 val;
|
||||
|
||||
- if (unlikely(!ath9k_hw_nvram_read(common, address / 2, &val)))
|
||||
+ if (unlikely(!ath9k_hw_nvram_read(ah, address / 2, &val)))
|
||||
return false;
|
||||
|
||||
buffer[0] = val >> 8;
|
||||
@@ -3048,14 +3048,14 @@ static bool ar9300_read_eeprom(struct at
|
||||
* the 16-bit word at that address
|
||||
*/
|
||||
if (address % 2 == 0) {
|
||||
- if (!ar9300_eeprom_read_byte(common, address--, buffer++))
|
||||
+ if (!ar9300_eeprom_read_byte(ah, address--, buffer++))
|
||||
goto error;
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
for (i = 0; i < count / 2; i++) {
|
||||
- if (!ar9300_eeprom_read_word(common, address, buffer))
|
||||
+ if (!ar9300_eeprom_read_word(ah, address, buffer))
|
||||
goto error;
|
||||
|
||||
address -= 2;
|
||||
@@ -3063,7 +3063,7 @@ static bool ar9300_read_eeprom(struct at
|
||||
}
|
||||
|
||||
if (count % 2)
|
||||
- if (!ar9300_eeprom_read_byte(common, address, buffer))
|
||||
+ if (!ar9300_eeprom_read_byte(ah, address, buffer))
|
||||
goto error;
|
||||
|
||||
return true;
|
||||
@@ -3240,12 +3240,11 @@ static bool ar9300_check_eeprom_header(s
|
||||
static int ar9300_eeprom_restore_flash(struct ath_hw *ah, u8 *mptr,
|
||||
int mdata_size)
|
||||
{
|
||||
- struct ath_common *common = ath9k_hw_common(ah);
|
||||
u16 *data = (u16 *) mptr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < mdata_size / 2; i++, data++)
|
||||
- ath9k_hw_nvram_read(common, i, data);
|
||||
+ ath9k_hw_nvram_read(ah, i, data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
|
||||
@@ -113,8 +113,9 @@ void ath9k_hw_usb_gen_fill_eeprom(struct
|
||||
}
|
||||
}
|
||||
|
||||
-bool ath9k_hw_nvram_read(struct ath_common *common, u32 off, u16 *data)
|
||||
+bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data)
|
||||
{
|
||||
+ struct ath_common *common = ath9k_hw_common(ah);
|
||||
bool ret;
|
||||
|
||||
ret = common->bus_ops->eeprom_read(common, off, data);
|
||||
--- a/drivers/net/wireless/ath/ath9k/eeprom.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
|
||||
@@ -663,7 +663,7 @@ int16_t ath9k_hw_interpolate(u16 target,
|
||||
int16_t targetRight);
|
||||
bool ath9k_hw_get_lower_upper_index(u8 target, u8 *pList, u16 listSize,
|
||||
u16 *indexL, u16 *indexR);
|
||||
-bool ath9k_hw_nvram_read(struct ath_common *common, u32 off, u16 *data);
|
||||
+bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data);
|
||||
void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data,
|
||||
int eep_start_loc, int size);
|
||||
void ath9k_hw_fill_vpd_table(u8 pwrMin, u8 pwrMax, u8 *pPwrList,
|
||||
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
|
||||
@@ -32,13 +32,11 @@ static int ath9k_hw_4k_get_eeprom_rev(st
|
||||
|
||||
static bool __ath9k_hw_4k_fill_eeprom(struct ath_hw *ah)
|
||||
{
|
||||
- struct ath_common *common = ath9k_hw_common(ah);
|
||||
u16 *eep_data = (u16 *)&ah->eeprom.map4k;
|
||||
int addr, eep_start_loc = 64;
|
||||
|
||||
for (addr = 0; addr < SIZE_EEPROM_4K; addr++) {
|
||||
- if (!ath9k_hw_nvram_read(common, addr + eep_start_loc,
|
||||
- eep_data))
|
||||
+ if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data))
|
||||
return false;
|
||||
eep_data++;
|
||||
}
|
||||
@@ -194,7 +192,7 @@ static int ath9k_hw_4k_check_eeprom(stru
|
||||
|
||||
|
||||
if (!ath9k_hw_use_flash(ah)) {
|
||||
- if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET,
|
||||
+ if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET,
|
||||
&magic)) {
|
||||
ath_err(common, "Reading Magic # failed\n");
|
||||
return false;
|
||||
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
|
||||
@@ -33,14 +33,12 @@ static int ath9k_hw_ar9287_get_eeprom_re
|
||||
static bool __ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
|
||||
{
|
||||
struct ar9287_eeprom *eep = &ah->eeprom.map9287;
|
||||
- struct ath_common *common = ath9k_hw_common(ah);
|
||||
u16 *eep_data;
|
||||
int addr, eep_start_loc = AR9287_EEP_START_LOC;
|
||||
eep_data = (u16 *)eep;
|
||||
|
||||
for (addr = 0; addr < SIZE_EEPROM_AR9287; addr++) {
|
||||
- if (!ath9k_hw_nvram_read(common, addr + eep_start_loc,
|
||||
- eep_data))
|
||||
+ if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data))
|
||||
return false;
|
||||
eep_data++;
|
||||
}
|
||||
@@ -187,7 +185,7 @@ static int ath9k_hw_ar9287_check_eeprom(
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
|
||||
if (!ath9k_hw_use_flash(ah)) {
|
||||
- if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET,
|
||||
+ if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET,
|
||||
&magic)) {
|
||||
ath_err(common, "Reading Magic # failed\n");
|
||||
return false;
|
||||
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
|
||||
@@ -91,12 +91,11 @@ static int ath9k_hw_def_get_eeprom_rev(s
|
||||
|
||||
static bool __ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
|
||||
{
|
||||
- struct ath_common *common = ath9k_hw_common(ah);
|
||||
u16 *eep_data = (u16 *)&ah->eeprom.def;
|
||||
int addr, ar5416_eep_start_loc = 0x100;
|
||||
|
||||
for (addr = 0; addr < SIZE_EEPROM_DEF; addr++) {
|
||||
- if (!ath9k_hw_nvram_read(common, addr + ar5416_eep_start_loc,
|
||||
+ if (!ath9k_hw_nvram_read(ah, addr + ar5416_eep_start_loc,
|
||||
eep_data))
|
||||
return false;
|
||||
eep_data++;
|
||||
@@ -268,7 +267,7 @@ static int ath9k_hw_def_check_eeprom(str
|
||||
bool need_swap = false;
|
||||
int i, addr, size;
|
||||
|
||||
- if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, &magic)) {
|
||||
+ if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) {
|
||||
ath_err(common, "Reading Magic # failed\n");
|
||||
return false;
|
||||
}
|
@ -1,184 +0,0 @@
|
||||
From ee4581f2f024c601a5e247ec6acab3e7df538f88 Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Sun, 9 Dec 2012 17:31:54 +0100
|
||||
Subject: [PATCH 4/4] ath9k: allow to load EEPROM content via firmware API
|
||||
|
||||
The calibration data for devices w/o a separate
|
||||
EEPROM chip can be specified via the 'eeprom_data'
|
||||
field of 'ath9k_platform_data'. The 'eeprom_data'
|
||||
is usually filled from board specific setup
|
||||
functions. It is easy if the EEPROM data is mapped
|
||||
to the memory, but it can be complicated if it is
|
||||
stored elsewhere.
|
||||
|
||||
The patch adds support for loading of the EEPROM
|
||||
data via the firmware API to avoid this limitation.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/eeprom.c | 19 +++++++++-
|
||||
drivers/net/wireless/ath/ath9k/hw.h | 3 ++
|
||||
drivers/net/wireless/ath/ath9k/init.c | 60 ++++++++++++++++++++++++++++++-
|
||||
include/linux/ath9k_platform.h | 2 ++
|
||||
4 files changed, 82 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
|
||||
@@ -113,12 +113,29 @@ void ath9k_hw_usb_gen_fill_eeprom(struct
|
||||
}
|
||||
}
|
||||
|
||||
+static bool ath9k_hw_nvram_read_blob(struct ath_hw *ah, u32 off,
|
||||
+ u16 *data)
|
||||
+{
|
||||
+ u16 *blob_data;
|
||||
+
|
||||
+ if (off * sizeof(u16) > ah->eeprom_blob->size)
|
||||
+ return false;
|
||||
+
|
||||
+ blob_data = (u16 *)ah->eeprom_blob->data;
|
||||
+ *data = blob_data[off];
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data)
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
bool ret;
|
||||
|
||||
- ret = common->bus_ops->eeprom_read(common, off, data);
|
||||
+ if (ah->eeprom_blob)
|
||||
+ ret = ath9k_hw_nvram_read_blob(ah, off, data);
|
||||
+ else
|
||||
+ ret = common->bus_ops->eeprom_read(common, off, data);
|
||||
+
|
||||
if (!ret)
|
||||
ath_dbg(common, EEPROM,
|
||||
"unable to read eeprom region at offset %u\n", off);
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.h
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/io.h>
|
||||
+#include <linux/firmware.h>
|
||||
|
||||
#include "mac.h"
|
||||
#include "ani.h"
|
||||
@@ -920,6 +921,8 @@ struct ath_hw {
|
||||
bool is_clk_25mhz;
|
||||
int (*get_mac_revision)(void);
|
||||
int (*external_reset)(void);
|
||||
+
|
||||
+ const struct firmware *eeprom_blob;
|
||||
};
|
||||
|
||||
struct ath_bus_ops {
|
||||
--- a/drivers/net/wireless/ath/ath9k/init.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
||||
@@ -25,6 +25,11 @@
|
||||
|
||||
#include "ath9k.h"
|
||||
|
||||
+struct ath9k_eeprom_ctx {
|
||||
+ struct completion complete;
|
||||
+ struct ath_hw *ah;
|
||||
+};
|
||||
+
|
||||
static char *dev_info = "ath9k";
|
||||
|
||||
MODULE_AUTHOR("Atheros Communications");
|
||||
@@ -508,6 +513,51 @@ static void ath9k_init_misc(struct ath_s
|
||||
sc->ant_comb.count = ATH_ANT_DIV_COMB_INIT_COUNT;
|
||||
}
|
||||
|
||||
+static void ath9k_eeprom_request_cb(const struct firmware *eeprom_blob,
|
||||
+ void *ctx)
|
||||
+{
|
||||
+ struct ath9k_eeprom_ctx *ec = ctx;
|
||||
+
|
||||
+ if (eeprom_blob)
|
||||
+ ec->ah->eeprom_blob = eeprom_blob;
|
||||
+
|
||||
+ complete(&ec->complete);
|
||||
+}
|
||||
+
|
||||
+static int ath9k_eeprom_request(struct ath_softc *sc, const char *name)
|
||||
+{
|
||||
+ struct ath9k_eeprom_ctx ec;
|
||||
+ struct ath_hw *ah = ah = sc->sc_ah;
|
||||
+ int err;
|
||||
+
|
||||
+ /* try to load the EEPROM content asynchronously */
|
||||
+ init_completion(&ec.complete);
|
||||
+ ec.ah = sc->sc_ah;
|
||||
+
|
||||
+ err = request_firmware_nowait(THIS_MODULE, 1, name, sc->dev, GFP_KERNEL,
|
||||
+ &ec, ath9k_eeprom_request_cb);
|
||||
+ if (err < 0) {
|
||||
+ ath_err(ath9k_hw_common(ah),
|
||||
+ "EEPROM request failed\n");
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ wait_for_completion(&ec.complete);
|
||||
+
|
||||
+ if (!ah->eeprom_blob) {
|
||||
+ ath_err(ath9k_hw_common(ah),
|
||||
+ "Unable to load EEPROM file %s\n", name);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void ath9k_eeprom_release(struct ath_softc *sc)
|
||||
+{
|
||||
+ release_firmware(sc->sc_ah->eeprom_blob);
|
||||
+}
|
||||
+
|
||||
static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
|
||||
const struct ath_bus_ops *bus_ops)
|
||||
{
|
||||
@@ -585,6 +635,12 @@ static int ath9k_init_softc(u16 devid, s
|
||||
ath_read_cachesize(common, &csz);
|
||||
common->cachelsz = csz << 2; /* convert to bytes */
|
||||
|
||||
+ if (pdata && pdata->eeprom_name) {
|
||||
+ ret = ath9k_eeprom_request(sc, pdata->eeprom_name);
|
||||
+ if (ret)
|
||||
+ goto err_eeprom;
|
||||
+ }
|
||||
+
|
||||
/* Initializes the hardware for all supported chipsets */
|
||||
ret = ath9k_hw_init(ah);
|
||||
if (ret)
|
||||
@@ -621,7 +677,8 @@ err_btcoex:
|
||||
err_queues:
|
||||
ath9k_hw_deinit(ah);
|
||||
err_hw:
|
||||
-
|
||||
+ ath9k_eeprom_release(sc);
|
||||
+err_eeprom:
|
||||
kfree(ah);
|
||||
sc->sc_ah = NULL;
|
||||
|
||||
@@ -884,6 +941,7 @@ static void ath9k_deinit_softc(struct at
|
||||
if (sc->dfs_detector != NULL)
|
||||
sc->dfs_detector->exit(sc->dfs_detector);
|
||||
|
||||
+ ath9k_eeprom_release(sc);
|
||||
kfree(sc->sc_ah);
|
||||
sc->sc_ah = NULL;
|
||||
}
|
||||
--- a/include/linux/ath9k_platform.h
|
||||
+++ b/include/linux/ath9k_platform.h
|
||||
@@ -22,6 +22,8 @@
|
||||
#define ATH9K_PLAT_EEP_MAX_WORDS 2048
|
||||
|
||||
struct ath9k_platform_data {
|
||||
+ const char *eeprom_name;
|
||||
+
|
||||
u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
|
||||
u8 *macaddr;
|
||||
|
@ -1,65 +0,0 @@
|
||||
From e922d683ca8001ce9a6272d6ab12d74e72c36521 Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Tue, 11 Dec 2012 14:15:53 +0100
|
||||
Subject: [PATCH v2] rt2x00: zero-out rx_status
|
||||
|
||||
In commit 'mac80211: support radiotap vendor namespace RX data'
|
||||
new fields were added to 'struct ieee80211_rx_status' and those
|
||||
fileds must be zeroed. However the rt2x00 driver stores driver
|
||||
specific data in the cb array of the rx skbs, so the fields
|
||||
might contain garbage and this can cause unexpected behaviour.
|
||||
|
||||
The rt2x00 driver from the compat-wireless-2012-12-01
|
||||
tarball caused the following warning:
|
||||
|
||||
WARNING: at
|
||||
/devel/ramips/build_dir/target-mipsel_r2_uClibc-0.9.33.2/linux-ramips_rt305x/
|
||||
compat-wireless-2012-12-01/net/mac80211/rx.c:115 ieee80211_rx_irqsafe+0x274/0xbcc
|
||||
[mac80211]()
|
||||
Modules linked in: dwc_otg ledtrig_usbdev nf_nat_irc
|
||||
nf_nat_ftp nf_conntrack_irc nf_conntrack_ftp ipt_MASQUERADE
|
||||
iptable_nat nf_nat pppoe xt_conntrack xt_CT xt_NOTRACK iptable_raw
|
||||
xt_state nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack pppox
|
||||
ipt_REJECT xt_TCPMSS xt_comment xt_multiport xt_mac xt_limit
|
||||
iptable_mangle iptable_filter ip_tables xt_tcpudp x_tables ppp_async
|
||||
ppp_generic slhc rt2800pci(O) rt2800lib(O) rt2x00soc(O) rt2x00pci(O)
|
||||
rt2x00lib(O) mac80211(O) usbcore usb_common nls_base crc_itu_t
|
||||
crc_ccitt eeprom_93cx6 cfg80211(O) compat(O) arc4 aes_generic
|
||||
crypto_blkcipher cryptomgr aead crypto_hash crypto_algapi leds_gpio
|
||||
button_hotplug(O) gpio_keys_polled input_polldev input_core
|
||||
Call Trace:
|
||||
[<801e96b4>] dump_stack+0x8/0x34
|
||||
[<80010a9c>] warn_slowpath_common+0x78/0xa4
|
||||
[<80010ae0>] warn_slowpath_null+0x18/0x24
|
||||
[<80a9710c>] ieee80211_rx_irqsafe+0x274/0xbcc [mac80211]
|
||||
|
||||
The patch ensures that each field gets initialized with
|
||||
zeroes.
|
||||
|
||||
Cc: <users@rt2x00.serialmonkey.com>
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
---
|
||||
v2:
|
||||
- update the commit message and add a comment to the code
|
||||
- drop the ath5k and p54 patches
|
||||
---
|
||||
drivers/net/wireless/rt2x00/rt2x00dev.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
|
||||
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
|
||||
@@ -685,6 +685,14 @@ void rt2x00lib_rxdone(struct queue_entry
|
||||
* to mac80211.
|
||||
*/
|
||||
rx_status = IEEE80211_SKB_RXCB(entry->skb);
|
||||
+
|
||||
+ /* Ensure that all fields of rx_status are initialized
|
||||
+ * properly. The skb->cb array was used for driver
|
||||
+ * specific informations, so rx_status might contain
|
||||
+ * garbage.
|
||||
+ */
|
||||
+ memset(rx_status, 0, sizeof(*rx_status));
|
||||
+
|
||||
rx_status->mactime = rxdesc.timestamp;
|
||||
rx_status->band = rt2x00dev->curr_band;
|
||||
rx_status->freq = rt2x00dev->curr_freq;
|
@ -1,20 +1,19 @@
|
||||
--- a/net/wireless/reg.c
|
||||
+++ b/net/wireless/reg.c
|
||||
@@ -1805,6 +1805,8 @@ void regulatory_hint_11d(struct wiphy *w
|
||||
@@ -1717,6 +1717,8 @@ void regulatory_hint_11d(struct wiphy *w
|
||||
enum environment_cap env = ENVIRON_ANY;
|
||||
struct regulatory_request *request;
|
||||
struct regulatory_request *request, *lr;
|
||||
|
||||
+ return;
|
||||
+
|
||||
mutex_lock(®_mutex);
|
||||
lr = get_last_request();
|
||||
|
||||
if (unlikely(!last_request))
|
||||
@@ -2039,6 +2041,8 @@ static void restore_regulatory_settings(
|
||||
@@ -1913,6 +1915,7 @@ static void restore_regulatory_settings(
|
||||
|
||||
void regulatory_hint_disconnect(void)
|
||||
{
|
||||
+ return;
|
||||
+
|
||||
REG_DBG_PRINT("All devices are disconnected, going to "
|
||||
"restore regulatory settings\n");
|
||||
REG_DBG_PRINT("All devices are disconnected, going to restore regulatory settings\n");
|
||||
restore_regulatory_settings(false);
|
||||
}
|
||||
|
@ -1,39 +0,0 @@
|
||||
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
|
||||
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
|
||||
@@ -95,6 +95,7 @@ MODULE_FIRMWARE("brcm/bcm43xx_hdr-0.fw")
|
||||
|
||||
/* recognized BCMA Core IDs */
|
||||
static struct bcma_device_id brcms_coreid_table[] = {
|
||||
+ BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 17, BCMA_ANY_CLASS),
|
||||
BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 23, BCMA_ANY_CLASS),
|
||||
BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 24, BCMA_ANY_CLASS),
|
||||
BCMA_CORETABLE_END
|
||||
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
|
||||
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
|
||||
@@ -719,7 +719,7 @@ static void brcms_c_ucode_bsinit(struct
|
||||
brcms_c_write_mhf(wlc_hw, wlc_hw->band->mhfs);
|
||||
|
||||
/* do band-specific ucode IHR, SHM, and SCR inits */
|
||||
- if (D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
+ if (D11REV_IS(wlc_hw->corerev, 17) || D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
if (BRCMS_ISNPHY(wlc_hw->band))
|
||||
brcms_c_write_inits(wlc_hw, ucode->d11n0bsinitvals16);
|
||||
else
|
||||
@@ -2266,7 +2266,7 @@ static void brcms_ucode_download(struct
|
||||
if (wlc_hw->ucode_loaded)
|
||||
return;
|
||||
|
||||
- if (D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
+ if (D11REV_IS(wlc_hw->corerev, 17) || D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
if (BRCMS_ISNPHY(wlc_hw->band)) {
|
||||
brcms_ucode_write(wlc_hw, ucode->bcm43xx_16_mimo,
|
||||
ucode->bcm43xx_16_mimosz);
|
||||
@@ -3218,7 +3218,7 @@ static void brcms_b_coreinit(struct brcm
|
||||
|
||||
sflags = bcma_aread32(core, BCMA_IOST);
|
||||
|
||||
- if (D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
+ if (D11REV_IS(wlc_hw->corerev, 17) || D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
if (BRCMS_ISNPHY(wlc_hw->band))
|
||||
brcms_c_write_inits(wlc_hw, ucode->d11n0initvals16);
|
||||
else
|
@ -1,21 +0,0 @@
|
||||
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
|
||||
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
|
||||
@@ -4502,7 +4502,8 @@ static int brcms_b_attach(struct brcms_c
|
||||
|
||||
/* check device id(srom, nvram etc.) to set bands */
|
||||
if (wlc_hw->deviceid == BCM43224_D11N_ID ||
|
||||
- wlc_hw->deviceid == BCM43224_D11N_ID_VEN1)
|
||||
+ wlc_hw->deviceid == BCM43224_D11N_ID_VEN1 ||
|
||||
+ wlc_hw->deviceid == BCM43224_CHIP_ID)
|
||||
/* Dualband boards */
|
||||
wlc_hw->_nbands = 2;
|
||||
else
|
||||
@@ -5655,7 +5656,7 @@ static bool brcms_c_chipmatch_pci(struct
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (device == BCM43224_D11N_ID_VEN1)
|
||||
+ if (device == BCM43224_D11N_ID_VEN1 || device == BCM43224_CHIP_ID)
|
||||
return true;
|
||||
if ((device == BCM43224_D11N_ID) || (device == BCM43225_D11N2G_ID))
|
||||
return true;
|
@ -1,11 +0,0 @@
|
||||
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
|
||||
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
|
||||
@@ -2922,7 +2922,7 @@ brcms_b_write_objmem(struct brcms_hardwa
|
||||
if (offset & 2)
|
||||
objoff += 2;
|
||||
|
||||
- bcma_write16(core, objoff, v);
|
||||
+ bcma_wflush16(core, objoff, v);
|
||||
}
|
||||
|
||||
/*
|
Loading…
Reference in New Issue