From aebd1654e943404ef120413e07ce79a2afb65245 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Fri, 6 Mar 2009 10:26:18 +0000 Subject: [PATCH] mac80211: update compat-wireless to 2009-03-05, add more rt2x00 and ath9k patches SVN-Revision: 14757 --- package/mac80211/Makefile | 4 +- ...00-Use-rt2x00usb_register_multiwrite.patch | 116 +++++++++++++ ...t2x00usb_register_multiwrite-rt2800u.patch | 85 +++++++++ ...1-ath9k-dont-register-leds-on-ar9100.patch | 4 +- ...common-debugfs_root-for-all-device-i.patch | 141 +++++++++++++++ ...eanup-AR5416-version-checking-macros.patch | 161 ++++++++++++++++++ ...00-version-checking-macros-into-a-mo.patch | 60 +++++++ ...h9k-fix-AR_SREV_9100_OR_LATER-macro.patch} | 108 ++---------- ...408-ath9k-fix-compile-error-in-ahb.c.patch | 24 +++ ...9-ath9k-fix-compile-error-in-debug.c.patch | 27 +++ ...lways-compile-ath_radio_-en-dis-able.patch | 41 +++++ 11 files changed, 676 insertions(+), 95 deletions(-) create mode 100644 package/mac80211/patches/308-rt2x00-Use-rt2x00usb_register_multiwrite.patch create mode 100644 package/mac80211/patches/309-rt2x00-Use-rt2x00usb_register_multiwrite-rt2800u.patch create mode 100644 package/mac80211/patches/404-ath9k-create-a-common-debugfs_root-for-all-device-i.patch create mode 100644 package/mac80211/patches/405-ath9k-cleanup-AR5416-version-checking-macros.patch create mode 100644 package/mac80211/patches/406-ath9k-move-ar9100-version-checking-macros-into-a-mo.patch rename package/mac80211/patches/{405-ath9k-use-correct-init-values-for-ar9100-devices.patch => 407-ath9k-fix-AR_SREV_9100_OR_LATER-macro.patch} (60%) create mode 100644 package/mac80211/patches/408-ath9k-fix-compile-error-in-ahb.c.patch create mode 100644 package/mac80211/patches/409-ath9k-fix-compile-error-in-debug.c.patch create mode 100644 package/mac80211/patches/410-ath9k-always-compile-ath_radio_-en-dis-able.patch diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile index 1aeff606adac..1e515575b76f 100644 --- a/package/mac80211/Makefile +++ b/package/mac80211/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 ifneq ($(CONFIG_LINUX_2_6_27)$(CONFIG_LINUX_2_6_28),) - PKG_VERSION:=2009-03-04 + PKG_VERSION:=2009-03-05 PKG_RELEASE:=1 PKG_SOURCE_URL:= \ http://www.orbit-lab.org/kernel/compat-wireless-2.6/2009/03 \ http://wireless.kernel.org/download/compat-wireless-2.6 - PKG_MD5SUM:=8f4b9cfcc0985db945b12741b1d1ee75 + PKG_MD5SUM:=3e96bcca2be64536e206e425f0f26cfd else PKG_VERSION:=2008-08-06 PKG_RELEASE:=2 diff --git a/package/mac80211/patches/308-rt2x00-Use-rt2x00usb_register_multiwrite.patch b/package/mac80211/patches/308-rt2x00-Use-rt2x00usb_register_multiwrite.patch new file mode 100644 index 000000000000..a0f20ceac0b4 --- /dev/null +++ b/package/mac80211/patches/308-rt2x00-Use-rt2x00usb_register_multiwrite.patch @@ -0,0 +1,116 @@ +From 26f9e08ed236c602fa92b9de93b272f78cc4026b Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn +Date: Wed, 4 Mar 2009 22:22:15 +0100 +Subject: [PATCH] rt2x00: Use rt2x00usb_register_multiwrite() + +rt2x00usb.h contains a wrapper for writing multiple +bytes to the hardware in a single action. Replace +all individual calls to rt2x00usb_vendor_request_buff +with rt2x00usb_register_multiwrite. + +Signed-off-by: Ivo van Doorn +--- + drivers/net/wireless/rt2x00/rt2500usb.c | 9 ++------- + drivers/net/wireless/rt2x00/rt73usb.c | 31 ++++++++----------------------- + 2 files changed, 10 insertions(+), 30 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2500usb.c ++++ b/drivers/net/wireless/rt2x00/rt2500usb.c +@@ -348,7 +348,6 @@ static int rt2500usb_config_key(struct r + struct rt2x00lib_crypto *crypto, + struct ieee80211_key_conf *key) + { +- int timeout; + u32 mask; + u16 reg; + +@@ -376,12 +375,8 @@ static int rt2500usb_config_key(struct r + * rt2x00usb_vendor_request() to send the key to the hardware. + */ + reg = KEY_ENTRY(key->hw_key_idx); +- timeout = REGISTER_TIMEOUT32(sizeof(crypto->key)); +- rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, +- USB_VENDOR_REQUEST_OUT, reg, +- crypto->key, +- sizeof(crypto->key), +- timeout); ++ rt2500usb_register_multiwrite(rt2x00dev, reg, ++ crypto->key, sizeof(crypto->key)); + + /* + * The driver does not support the IV/EIV generation +--- a/drivers/net/wireless/rt2x00/rt73usb.c ++++ b/drivers/net/wireless/rt2x00/rt73usb.c +@@ -273,7 +273,6 @@ static int rt73usb_config_shared_key(str + { + struct hw_key_entry key_entry; + struct rt2x00_field32 field; +- int timeout; + u32 mask; + u32 reg; + +@@ -309,12 +308,8 @@ static int rt73usb_config_shared_key(str + sizeof(key_entry.rx_mic)); + + reg = SHARED_KEY_ENTRY(key->hw_key_idx); +- timeout = REGISTER_TIMEOUT32(sizeof(key_entry)); +- rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, +- USB_VENDOR_REQUEST_OUT, reg, +- &key_entry, +- sizeof(key_entry), +- timeout); ++ rt2x00usb_register_multiwrite(rt2x00dev, reg, ++ &key_entry, sizeof(key_entry)); + + /* + * The cipher types are stored over 2 registers. +@@ -375,7 +370,6 @@ static int rt73usb_config_pairwise_key(s + { + struct hw_pairwise_ta_entry addr_entry; + struct hw_key_entry key_entry; +- int timeout; + u32 mask; + u32 reg; + +@@ -410,12 +404,8 @@ static int rt73usb_config_pairwise_key(s + sizeof(key_entry.rx_mic)); + + reg = PAIRWISE_KEY_ENTRY(key->hw_key_idx); +- timeout = REGISTER_TIMEOUT32(sizeof(key_entry)); +- rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, +- USB_VENDOR_REQUEST_OUT, reg, +- &key_entry, +- sizeof(key_entry), +- timeout); ++ rt2x00usb_register_multiwrite(rt2x00dev, reg, ++ &key_entry, sizeof(key_entry)); + + /* + * Send the address and cipher type to the hardware register. +@@ -1112,11 +1102,8 @@ static int rt73usb_load_firmware(struct + /* + * Write firmware to device. + */ +- rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, +- USB_VENDOR_REQUEST_OUT, +- FIRMWARE_IMAGE_BASE, +- data, len, +- REGISTER_TIMEOUT32(len)); ++ rt2x00usb_register_multiwrite(rt2x00dev, FIRMWARE_IMAGE_BASE, ++ (void *)data, len); + + /* + * Send firmware request to device to load firmware, +@@ -1554,10 +1541,8 @@ static void rt73usb_write_beacon(struct + * Write entire beacon with descriptor to register. + */ + beacon_base = HW_BEACON_OFFSET(entry->entry_idx); +- rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, +- USB_VENDOR_REQUEST_OUT, beacon_base, +- entry->skb->data, entry->skb->len, +- REGISTER_TIMEOUT32(entry->skb->len)); ++ rt2x00usb_register_multiwrite(rt2x00dev, beacon_base, ++ entry->skb->data, entry->skb->len); + + /* + * Clean up the beacon skb. diff --git a/package/mac80211/patches/309-rt2x00-Use-rt2x00usb_register_multiwrite-rt2800u.patch b/package/mac80211/patches/309-rt2x00-Use-rt2x00usb_register_multiwrite-rt2800u.patch new file mode 100644 index 000000000000..29c31de7b762 --- /dev/null +++ b/package/mac80211/patches/309-rt2x00-Use-rt2x00usb_register_multiwrite-rt2800u.patch @@ -0,0 +1,85 @@ +From d98dacd4b09b7ec428d5e9093a5e6f1f564b1d3c Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn +Date: Wed, 4 Mar 2009 22:23:53 +0100 +Subject: [PATCH] rt2x00: Use rt2x00usb_register_multiwrite() (rt2800usb) + +Signed-off-by: Ivo van Doorn +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 31 ++++++++----------------------- + 1 files changed, 8 insertions(+), 23 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -396,7 +396,6 @@ static int rt2800usb_config_shared_key(s + { + struct hw_key_entry key_entry; + struct rt2x00_field32 field; +- int timeout; + u32 offset; + u32 reg; + +@@ -411,12 +410,8 @@ static int rt2800usb_config_shared_key(s + sizeof(key_entry.rx_mic)); + + offset = SHARED_KEY_ENTRY(key->hw_key_idx); +- timeout = REGISTER_TIMEOUT32(sizeof(key_entry)); +- rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, +- USB_VENDOR_REQUEST_OUT, +- offset, &key_entry, +- sizeof(key_entry), +- timeout); ++ rt2x00usb_register_multiwrite(rt2x00dev, offset, ++ &key_entry, sizeof(key_entry)); + } + + /* +@@ -449,7 +444,6 @@ static int rt2800usb_config_pairwise_key + struct ieee80211_key_conf *key) + { + struct hw_key_entry key_entry; +- int timeout; + u32 offset; + + if (crypto->cmd == SET_KEY) { +@@ -467,12 +461,8 @@ static int rt2800usb_config_pairwise_key + sizeof(key_entry.rx_mic)); + + offset = PAIRWISE_KEY_ENTRY(key->hw_key_idx); +- timeout = REGISTER_TIMEOUT32(sizeof(key_entry)); +- rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, +- USB_VENDOR_REQUEST_OUT, +- offset, &key_entry, +- sizeof(key_entry), +- timeout); ++ rt2x00usb_register_multiwrite(rt2x00dev, offset, ++ &key_entry, sizeof(key_entry)); + } + + /* +@@ -1217,11 +1207,8 @@ static int rt2800usb_load_firmware(struc + /* + * Write firmware to device. + */ +- rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, +- USB_VENDOR_REQUEST_OUT, +- FIRMWARE_IMAGE_BASE, +- data + offset, length, +- REGISTER_TIMEOUT32(length)); ++ rt2x00usb_register_multiwrite(rt2x00dev, FIRMWARE_IMAGE_BASE, ++ (void *)(data + offset), length); + + rt2x00usb_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0); + rt2x00usb_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0); +@@ -2067,10 +2054,8 @@ static void rt2800usb_write_beacon(struc + * Write entire beacon with descriptor to register. + */ + beacon_base = HW_BEACON_OFFSET(entry->entry_idx); +- rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, +- USB_VENDOR_REQUEST_OUT, beacon_base, +- entry->skb->data, entry->skb->len, +- REGISTER_TIMEOUT32(entry->skb->len)); ++ rt2x00usb_register_multiwrite(rt2x00dev, beacon_base, ++ entry->skb->data, entry->skb->len); + + /* + * Clean up the beacon skb. diff --git a/package/mac80211/patches/401-ath9k-dont-register-leds-on-ar9100.patch b/package/mac80211/patches/401-ath9k-dont-register-leds-on-ar9100.patch index ea8e2da17f77..5fe8a3a1f4ab 100644 --- a/package/mac80211/patches/401-ath9k-dont-register-leds-on-ar9100.patch +++ b/package/mac80211/patches/401-ath9k-dont-register-leds-on-ar9100.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c -@@ -1027,6 +1027,9 @@ static void ath_unregister_led(struct at +@@ -1024,6 +1024,9 @@ static void ath_unregister_led(struct at static void ath_deinit_leds(struct ath_softc *sc) { @@ -10,7 +10,7 @@ cancel_delayed_work_sync(&sc->ath_led_blink_work); ath_unregister_led(&sc->assoc_led); sc->sc_flags &= ~SC_OP_LED_ASSOCIATED; -@@ -1041,6 +1044,9 @@ static void ath_init_leds(struct ath_sof +@@ -1038,6 +1041,9 @@ static void ath_init_leds(struct ath_sof char *trigger; int ret; diff --git a/package/mac80211/patches/404-ath9k-create-a-common-debugfs_root-for-all-device-i.patch b/package/mac80211/patches/404-ath9k-create-a-common-debugfs_root-for-all-device-i.patch new file mode 100644 index 000000000000..bace6b599233 --- /dev/null +++ b/package/mac80211/patches/404-ath9k-create-a-common-debugfs_root-for-all-device-i.patch @@ -0,0 +1,141 @@ +From 8f94fb99b3f88aeff95743633afcc88147b7a475 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Thu, 5 Mar 2009 15:07:10 +0100 +Subject: [PATCH] ath9k: create a common debugfs_root for all device instances + +The driver are trying to create an 'ath9k' directory in debugfs for each +device currently. If there are more than one device in the system, the +second try will always fail. + +Changes-licensed-under: ISC + +Signed-off-by: Gabor Juhos +Signed-off-by: Imre Kaloz +--- + drivers/net/wireless/ath9k/debug.c | 24 ++++++++++++++++++------ + drivers/net/wireless/ath9k/debug.h | 12 +++++++++++- + drivers/net/wireless/ath9k/main.c | 13 ++++++++++++- + 3 files changed, 41 insertions(+), 8 deletions(-) + +--- a/drivers/net/wireless/ath9k/debug.c ++++ b/drivers/net/wireless/ath9k/debug.c +@@ -19,6 +19,8 @@ + static unsigned int ath9k_debug = DBG_DEFAULT; + module_param_named(debug, ath9k_debug, uint, 0); + ++static struct dentry *ath9k_debugfs_root; ++ + void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...) + { + if (!sc) +@@ -491,12 +493,8 @@ int ath9k_init_debug(struct ath_softc *s + { + sc->debug.debug_mask = ath9k_debug; + +- sc->debug.debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL); +- if (!sc->debug.debugfs_root) +- goto err; +- + sc->debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy), +- sc->debug.debugfs_root); ++ ath9k_debugfs_root); + if (!sc->debug.debugfs_phy) + goto err; + +@@ -538,5 +536,19 @@ void ath9k_exit_debug(struct ath_softc * + debugfs_remove(sc->debug.debugfs_interrupt); + debugfs_remove(sc->debug.debugfs_dma); + debugfs_remove(sc->debug.debugfs_phy); +- debugfs_remove(sc->debug.debugfs_root); ++} ++ ++int ath9k_debug_create_root(void) ++{ ++ ath9k_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL); ++ if (!ath9k_debugfs_root) ++ return -ENOENT; ++ ++ return 0; ++} ++ ++void ath9k_debug_remove_root(void) ++{ ++ debugfs_remove(ath9k_debugfs_root); ++ ath9k_debugfs_root = NULL; + } +--- a/drivers/net/wireless/ath9k/debug.h ++++ b/drivers/net/wireless/ath9k/debug.h +@@ -102,7 +102,6 @@ struct ath_stats { + + struct ath9k_debug { + int debug_mask; +- struct dentry *debugfs_root; + struct dentry *debugfs_phy; + struct dentry *debugfs_dma; + struct dentry *debugfs_interrupt; +@@ -114,6 +113,8 @@ struct ath9k_debug { + void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...); + int ath9k_init_debug(struct ath_softc *sc); + void ath9k_exit_debug(struct ath_softc *sc); ++int ath9k_debug_create_root(void); ++void ath9k_debug_remove_root(void); + void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); + void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb); + void ath_debug_stat_retries(struct ath_softc *sc, int rix, +@@ -135,6 +136,15 @@ static inline void ath9k_exit_debug(stru + { + } + ++static inline int ath9k_debug_create_root(void) ++{ ++ return 0; ++} ++ ++static inline void ath9k_debug_remove_root(void) ++{ ++} ++ + static inline void ath_debug_stat_interrupt(struct ath_softc *sc, + enum ath9k_int status) + { +--- a/drivers/net/wireless/ath9k/main.c ++++ b/drivers/net/wireless/ath9k/main.c +@@ -2864,12 +2864,20 @@ static int __init ath9k_init(void) + goto err_out; + } + ++ error = ath9k_debug_create_root(); ++ if (error) { ++ printk(KERN_ERR ++ "ath9k: Unable to create debugfs root: %d\n", ++ error); ++ goto err_rate_unregister; ++ } ++ + error = ath_pci_init(); + if (error < 0) { + printk(KERN_ERR + "ath9k: No PCI devices found, driver not installed.\n"); + error = -ENODEV; +- goto err_rate_unregister; ++ goto err_remove_root; + } + + error = ath_ahb_init(); +@@ -2883,6 +2891,8 @@ static int __init ath9k_init(void) + err_pci_exit: + ath_pci_exit(); + ++ err_remove_root: ++ ath9k_debug_remove_root(); + err_rate_unregister: + ath_rate_control_unregister(); + err_out: +@@ -2894,6 +2904,7 @@ static void __exit ath9k_exit(void) + { + ath_ahb_exit(); + ath_pci_exit(); ++ ath9k_debug_remove_root(); + ath_rate_control_unregister(); + printk(KERN_INFO "%s: Driver unloaded\n", dev_info); + } diff --git a/package/mac80211/patches/405-ath9k-cleanup-AR5416-version-checking-macros.patch b/package/mac80211/patches/405-ath9k-cleanup-AR5416-version-checking-macros.patch new file mode 100644 index 000000000000..3cc35a1f90fc --- /dev/null +++ b/package/mac80211/patches/405-ath9k-cleanup-AR5416-version-checking-macros.patch @@ -0,0 +1,161 @@ +From 0f1a8ac314c886aa3a4c14e3d868207483ad343c Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Thu, 5 Mar 2009 10:18:35 +0100 +Subject: [PATCH v2 1/3] ath9k: cleanup AR5416 version checking macros + +Currently we have two different versions of this macros. Because they +would have to do the same thing, we should simplify and merge them. + +Changes-licensed-under: ISC + +Signed-off-by: Gabor Juhos +Signed-off-by: Imre Kaloz +--- + drivers/net/wireless/ath9k/eeprom.c | 16 ++++++++-------- + drivers/net/wireless/ath9k/hw.c | 4 ++-- + drivers/net/wireless/ath9k/mac.h | 2 +- + drivers/net/wireless/ath9k/reg.h | 19 +++++++++++-------- + 4 files changed, 22 insertions(+), 19 deletions(-) + +--- a/drivers/net/wireless/ath9k/eeprom.c ++++ b/drivers/net/wireless/ath9k/eeprom.c +@@ -640,7 +640,7 @@ static void ath9k_hw_get_4k_gain_boundar + pPdGainBoundaries[i] = + min((u16)AR5416_MAX_RATE_POWER, pPdGainBoundaries[i]); + +- if ((i == 0) && !AR_SREV_5416_V20_OR_LATER(ah)) { ++ if ((i == 0) && !AR_SREV_5416_20_OR_LATER(ah)) { + minDelta = pPdGainBoundaries[0] - 23; + pPdGainBoundaries[0] = 23; + } else { +@@ -755,7 +755,7 @@ static bool ath9k_hw_set_4k_power_cal_ta + REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_3, 0); + + for (i = 0; i < AR5416_MAX_CHAINS; i++) { +- if (AR_SREV_5416_V20_OR_LATER(ah) && ++ if (AR_SREV_5416_20_OR_LATER(ah) && + (ah->rxchainmask == 5 || ah->txchainmask == 5) && + (i != 0)) { + regChainOffset = (i == 1) ? 0x2000 : 0x1000; +@@ -771,7 +771,7 @@ static bool ath9k_hw_set_4k_power_cal_ta + &tMinCalPower, gainBoundaries, + pdadcValues, numXpdGain); + +- if ((i == 0) || AR_SREV_5416_V20_OR_LATER(ah)) { ++ if ((i == 0) || AR_SREV_5416_20_OR_LATER(ah)) { + REG_WRITE(ah, AR_PHY_TPCRG5 + regChainOffset, + SM(pdGainOverlap_t2, + AR_PHY_TPCRG5_PD_GAIN_OVERLAP) +@@ -1707,7 +1707,7 @@ static bool ath9k_hw_def_set_board_value + break; + } + +- if (AR_SREV_5416_V20_OR_LATER(ah) && ++ if (AR_SREV_5416_20_OR_LATER(ah) && + (ah->rxchainmask == 5 || ah->txchainmask == 5) + && (i != 0)) + regChainOffset = (i == 1) ? 0x2000 : 0x1000; +@@ -1728,7 +1728,7 @@ static bool ath9k_hw_def_set_board_value + SM(pModal->iqCalQCh[i], + AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); + +- if ((i == 0) || AR_SREV_5416_V20_OR_LATER(ah)) { ++ if ((i == 0) || AR_SREV_5416_20_OR_LATER(ah)) { + if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { + txRxAttenLocal = pModal->txRxAttenCh[i]; + if (AR_SREV_9280_10_OR_LATER(ah)) { +@@ -2094,7 +2094,7 @@ static void ath9k_hw_get_def_gain_bounda + pPdGainBoundaries[i] = + min((u16)AR5416_MAX_RATE_POWER, pPdGainBoundaries[i]); + +- if ((i == 0) && !AR_SREV_5416_V20_OR_LATER(ah)) { ++ if ((i == 0) && !AR_SREV_5416_20_OR_LATER(ah)) { + minDelta = pPdGainBoundaries[0] - 23; + pPdGainBoundaries[0] = 23; + } else { +@@ -2228,7 +2228,7 @@ static bool ath9k_hw_set_def_power_cal_t + xpdGainValues[2]); + + for (i = 0; i < AR5416_MAX_CHAINS; i++) { +- if (AR_SREV_5416_V20_OR_LATER(ah) && ++ if (AR_SREV_5416_20_OR_LATER(ah) && + (ah->rxchainmask == 5 || ah->txchainmask == 5) && + (i != 0)) { + regChainOffset = (i == 1) ? 0x2000 : 0x1000; +@@ -2262,7 +2262,7 @@ static bool ath9k_hw_set_def_power_cal_t + numXpdGain); + } + +- if ((i == 0) || AR_SREV_5416_V20_OR_LATER(ah)) { ++ if ((i == 0) || AR_SREV_5416_20_OR_LATER(ah)) { + if (OLC_FOR_AR9280_20_LATER) { + REG_WRITE(ah, + AR_PHY_TPCRG5 + regChainOffset, +--- a/drivers/net/wireless/ath9k/hw.c ++++ b/drivers/net/wireless/ath9k/hw.c +@@ -1160,7 +1160,7 @@ static void ath9k_hw_override_ini(struct + REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); + + +- if (!AR_SREV_5416_V20_OR_LATER(ah) || ++ if (!AR_SREV_5416_20_OR_LATER(ah) || + AR_SREV_9280_10_OR_LATER(ah)) + return; + +@@ -1262,7 +1262,7 @@ static int ath9k_hw_process_ini(struct a + REG_WRITE(ah, AR_PHY_ADC_SERIAL_CTL, AR_PHY_SEL_EXTERNAL_RADIO); + ah->eep_ops->set_addac(ah, chan); + +- if (AR_SREV_5416_V22_OR_LATER(ah)) { ++ if (AR_SREV_5416_22_OR_LATER(ah)) { + REG_WRITE_ARRAY(&ah->iniAddac, 1, regWrites); + } else { + struct ar5416IniArray temp; +--- a/drivers/net/wireless/ath9k/mac.h ++++ b/drivers/net/wireless/ath9k/mac.h +@@ -17,7 +17,7 @@ + #ifndef MAC_H + #define MAC_H + +-#define RXSTATUS_RATE(ah, ads) (AR_SREV_5416_V20_OR_LATER(ah) ? \ ++#define RXSTATUS_RATE(ah, ads) (AR_SREV_5416_20_OR_LATER(ah) ? \ + MS(ads->ds_rxstatus0, AR_RxRate) : \ + (ads->ds_rxstatus3 >> 2) & 0xFF) + +--- a/drivers/net/wireless/ath9k/reg.h ++++ b/drivers/net/wireless/ath9k/reg.h +@@ -161,10 +161,6 @@ + #define AR_SREV_VERSION_9100 0x014 + + #define AR_SREV_9100(ah) ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100) +-#define AR_SREV_5416_V20_OR_LATER(_ah) \ +- (AR_SREV_9100((_ah)) || AR_SREV_5416_20_OR_LATER(_ah)) +-#define AR_SREV_5416_V22_OR_LATER(_ah) \ +- (AR_SREV_9100((_ah)) || AR_SREV_5416_22_OR_LATER(_ah)) + + #define AR_ISR 0x0080 + #define AR_ISR_RXOK 0x00000001 +@@ -748,12 +744,19 @@ + + #define AR_SREV_9100_OR_LATER(_ah) \ + (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE)) ++ ++#define AR_SREV_5416(_ah) \ ++ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI) || \ ++ ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE)) + #define AR_SREV_5416_20_OR_LATER(_ah) \ +- (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \ +- ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)) ++ (((AR_SREV_5416(_ah)) && \ ++ ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)) || \ ++ ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)) + #define AR_SREV_5416_22_OR_LATER(_ah) \ +- (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \ +- ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)) ++ (((AR_SREV_5416(_ah)) && \ ++ ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)) || \ ++ ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)) ++ + #define AR_SREV_9160(_ah) \ + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160)) + #define AR_SREV_9160_10_OR_LATER(_ah) \ diff --git a/package/mac80211/patches/406-ath9k-move-ar9100-version-checking-macros-into-a-mo.patch b/package/mac80211/patches/406-ath9k-move-ar9100-version-checking-macros-into-a-mo.patch new file mode 100644 index 000000000000..5473d8fa6c2b --- /dev/null +++ b/package/mac80211/patches/406-ath9k-move-ar9100-version-checking-macros-into-a-mo.patch @@ -0,0 +1,60 @@ +From 895dd2cb9def6733323719312ead20155b43b8e5 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Thu, 5 Mar 2009 09:56:14 +0100 +Subject: [PATCH v2 2/3] ath9k: move ar9100 version checking macros into a more appropriate place + +All other version checking macros are in a common location within the +reg.h file. The AR_SREV_9100_OR_LATER macro is wrong currently, but will +be fixed with the next patch. + +Changes-licensed-under: ISC + +Signed-off-by: Gabor Juhos +Signed-off-by: Imre Kaloz +--- + drivers/net/wireless/ath9k/reg.h | 13 ++++++------- + 1 files changed, 6 insertions(+), 7 deletions(-) + +--- a/drivers/net/wireless/ath9k/reg.h ++++ b/drivers/net/wireless/ath9k/reg.h +@@ -158,10 +158,6 @@ + #define AR_CST_TIMEOUT_LIMIT 0xFFFF0000 + #define AR_CST_TIMEOUT_LIMIT_S 16 + +-#define AR_SREV_VERSION_9100 0x014 +- +-#define AR_SREV_9100(ah) ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100) +- + #define AR_ISR 0x0080 + #define AR_ISR_RXOK 0x00000001 + #define AR_ISR_RXDESC 0x00000002 +@@ -730,6 +726,7 @@ + #define AR_SREV_REVISION_5416_10 0 + #define AR_SREV_REVISION_5416_20 1 + #define AR_SREV_REVISION_5416_22 2 ++#define AR_SREV_VERSION_9100 0x14 + #define AR_SREV_VERSION_9160 0x40 + #define AR_SREV_REVISION_9160_10 0 + #define AR_SREV_REVISION_9160_11 1 +@@ -742,9 +739,6 @@ + #define AR_SREV_REVISION_9285_11 1 + #define AR_SREV_REVISION_9285_12 2 + +-#define AR_SREV_9100_OR_LATER(_ah) \ +- (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE)) +- + #define AR_SREV_5416(_ah) \ + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI) || \ + ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE)) +@@ -757,6 +751,11 @@ + ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)) || \ + ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)) + ++#define AR_SREV_9100(ah) \ ++ ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100) ++#define AR_SREV_9100_OR_LATER(_ah) \ ++ (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE)) ++ + #define AR_SREV_9160(_ah) \ + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160)) + #define AR_SREV_9160_10_OR_LATER(_ah) \ diff --git a/package/mac80211/patches/405-ath9k-use-correct-init-values-for-ar9100-devices.patch b/package/mac80211/patches/407-ath9k-fix-AR_SREV_9100_OR_LATER-macro.patch similarity index 60% rename from package/mac80211/patches/405-ath9k-use-correct-init-values-for-ar9100-devices.patch rename to package/mac80211/patches/407-ath9k-fix-AR_SREV_9100_OR_LATER-macro.patch index d58aa309aef7..f2e508688ec1 100644 --- a/package/mac80211/patches/405-ath9k-use-correct-init-values-for-ar9100-devices.patch +++ b/package/mac80211/patches/407-ath9k-fix-AR_SREV_9100_OR_LATER-macro.patch @@ -1,51 +1,22 @@ -From 91ada2959c75a3690bf009fd4314dd52454568df Mon Sep 17 00:00:00 2001 +From e379668f86409b5027f58a14614f6c876484404c Mon Sep 17 00:00:00 2001 From: Gabor Juhos -Date: Tue, 3 Mar 2009 15:21:30 +0100 -Subject: [RFC] ath9k: use correct init values for ar9100 devices +Date: Thu, 5 Mar 2009 08:32:55 +0100 +Subject: [PATCH v2 3/3] ath9k: fix AR_SREV_9100_OR_LATER macro -Changes-licensed-under: ISC +The current macro is wrong, because detects some AR5416 devices as an +AR9100 device. The AR5416 devices would have performance issues after +this change, because the contents of the ar5416 specific and of the +ar9100 specificinitval arrays are swapped. Fortunately we can correct +this with the rename of the arrays simply. + +Changes-licesed-under: ISC Signed-off-by: Gabor Juhos Signed-off-by: Imre Kaloz --- drivers/net/wireless/ath9k/initvals.h | 44 ++++++++++++++++---------------- - drivers/net/wireless/ath9k/reg.h | 32 ++++++++++++----------- - 2 files changed, 39 insertions(+), 37 deletions(-) - -Hi, - -Currently I'm trying to resolve the following mysterious issues caused by the -ath9k driver on the ar913x based devices: - -1. In some cases the ethernet interface goes down for a short time -after'ifconfig wlan0 up'. -2. Sometimes the device simply reboots itself after 'ifconfig wlan0 up'. - -After I have added some printk statements into the code, I noticed that the -ar5416 and ar9100 devices use the same initval arrays currently. I assume -that they requires different initialization, because we have different -arrays for them. - -Although I have no detailed knowledge about the evolution of the ath9k devices, -but the version checking macros for ther AR5416 cards seemed weird enough, so I -have replaced them. Unfortunately, this leaded to very bad performance with the -ar5416 cards I have, but the driver was working on the ar913x boards. - -After some digging, I have found an interesting ifdef statement in Sam's current -HAL. In his ar5416Common initval array, this ifdef conditionally selects the -right RTC register offsets for the ar5416/ar9100 devices. The strange thing, -that in the ath9k driver the ar5416 specific RTC register offsets are used in -the ar5416Common_ar9100 array, while the ar9100 specific offsets are used in the -ar5416Common. - -After I have renamed the arrays and tested the ath9k driver with the new -settings on the ar9100 devices, the strange problems I have mentioned above -disappeared. Unfortunately I have no ar5418 devices so I can't test them, -but they are using the same array as before so this change should not -cause problems on them. - -Regards, -Gabor + drivers/net/wireless/ath9k/reg.h | 2 +- + 2 files changed, 23 insertions(+), 23 deletions(-) --- a/drivers/net/wireless/ath9k/initvals.h +++ b/drivers/net/wireless/ath9k/initvals.h @@ -219,57 +190,12 @@ Gabor {0x0000989c, 0x00000000 }, --- a/drivers/net/wireless/ath9k/reg.h +++ b/drivers/net/wireless/ath9k/reg.h -@@ -158,14 +158,6 @@ - #define AR_CST_TIMEOUT_LIMIT 0xFFFF0000 - #define AR_CST_TIMEOUT_LIMIT_S 16 - --#define AR_SREV_VERSION_9100 0x014 -- --#define AR_SREV_9100(ah) ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100) --#define AR_SREV_5416_V20_OR_LATER(_ah) \ -- (AR_SREV_9100((_ah)) || AR_SREV_5416_20_OR_LATER(_ah)) --#define AR_SREV_5416_V22_OR_LATER(_ah) \ -- (AR_SREV_9100((_ah)) || AR_SREV_5416_22_OR_LATER(_ah)) -- - #define AR_ISR 0x0080 - #define AR_ISR_RXOK 0x00000001 - #define AR_ISR_RXDESC 0x00000002 -@@ -734,6 +726,7 @@ - #define AR_SREV_REVISION_5416_10 0 - #define AR_SREV_REVISION_5416_20 1 - #define AR_SREV_REVISION_5416_22 2 -+#define AR_SREV_VERSION_9100 0x14 - #define AR_SREV_VERSION_9160 0x40 - #define AR_SREV_REVISION_9160_10 0 - #define AR_SREV_REVISION_9160_11 1 -@@ -746,14 +739,23 @@ - #define AR_SREV_REVISION_9285_11 1 - #define AR_SREV_REVISION_9285_12 2 - -+#define AR_SREV_5416(_ah) \ -+ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) || \ -+ ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI)) -+#define AR_SREV_5416_V20_OR_LATER(_ah) \ -+ (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \ -+ ((AR_SREV_5416(_ah)) && \ -+ ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))) -+#define AR_SREV_5416_V22_OR_LATER(_ah) \ -+ (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \ -+ ((AR_SREV_5416(_ah)) && \ -+ ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))) -+ -+#define AR_SREV_9100(ah) \ -+ ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100) +@@ -754,7 +754,7 @@ + #define AR_SREV_9100(ah) \ + ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100) #define AR_SREV_9100_OR_LATER(_ah) \ - (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE)) --#define AR_SREV_5416_20_OR_LATER(_ah) \ -- (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \ -- ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)) --#define AR_SREV_5416_22_OR_LATER(_ah) \ -- (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \ -- ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)) -+ ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100) -+ ++ (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)) + #define AR_SREV_9160(_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160)) - #define AR_SREV_9160_10_OR_LATER(_ah) \ diff --git a/package/mac80211/patches/408-ath9k-fix-compile-error-in-ahb.c.patch b/package/mac80211/patches/408-ath9k-fix-compile-error-in-ahb.c.patch new file mode 100644 index 000000000000..730c27b5f1d0 --- /dev/null +++ b/package/mac80211/patches/408-ath9k-fix-compile-error-in-ahb.c.patch @@ -0,0 +1,24 @@ +From c464fc7b864a15422d2d7e52f3ac3c09999a8514 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Fri, 6 Mar 2009 09:46:06 +0100 +Subject: [PATCH 1/2] ath9k: fix compile error in ahb.c + +drivers/net/wireless/ath9k/ahb.c: In function 'ath_ahb_probe': +drivers/net/wireless/ath9k/ahb.c:136: error: 'aphy' undeclared (first +use in this function) + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ath9k/ahb.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +--- a/drivers/net/wireless/ath9k/ahb.c ++++ b/drivers/net/wireless/ath9k/ahb.c +@@ -60,6 +60,7 @@ static struct ath_bus_ops ath_ahb_bus_op + static int ath_ahb_probe(struct platform_device *pdev) + { + void __iomem *mem; ++ struct ath_wiphy *aphy; + struct ath_softc *sc; + struct ieee80211_hw *hw; + struct resource *res; diff --git a/package/mac80211/patches/409-ath9k-fix-compile-error-in-debug.c.patch b/package/mac80211/patches/409-ath9k-fix-compile-error-in-debug.c.patch new file mode 100644 index 000000000000..8f655df57a31 --- /dev/null +++ b/package/mac80211/patches/409-ath9k-fix-compile-error-in-debug.c.patch @@ -0,0 +1,27 @@ +From 15af1877e9fbb75c4a7506ab86e743c49a195e97 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Fri, 6 Mar 2009 09:46:27 +0100 +Subject: [PATCH 2/2] ath9k: fix compile error in debug.c + +drivers/net/wireless/ath9k/debug.c: In function 'read_file_wiphy': +drivers/net/wireless/ath9k/debug.c:377: error: implicit declaration of +function 'put_unaligned_le32' +drivers/net/wireless/ath9k/debug.c:378: error: implicit declaration of +function 'put_unaligned_le16' + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ath9k/debug.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +--- a/drivers/net/wireless/ath9k/debug.c ++++ b/drivers/net/wireless/ath9k/debug.c +@@ -14,6 +14,8 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#include ++ + #include "ath9k.h" + + static unsigned int ath9k_debug = DBG_DEFAULT; diff --git a/package/mac80211/patches/410-ath9k-always-compile-ath_radio_-en-dis-able.patch b/package/mac80211/patches/410-ath9k-always-compile-ath_radio_-en-dis-able.patch new file mode 100644 index 000000000000..436a5616a59e --- /dev/null +++ b/package/mac80211/patches/410-ath9k-always-compile-ath_radio_-en-dis-able.patch @@ -0,0 +1,41 @@ +From eb96b22223352ed6446532c2436f301e86970144 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Fri, 6 Mar 2009 10:50:37 +0100 +Subject: [PATCH] ath9k: always compile ath_radio_{en,dis}able + +ath_radio_{en,dis}able is only compiled if RFKILL is enabled, but it is +required by the 'ath9k_wiphy_select' function. + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ath9k/main.c | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/net/wireless/ath9k/main.c ++++ b/drivers/net/wireless/ath9k/main.c +@@ -1090,12 +1090,6 @@ fail: + ath_deinit_leds(sc); + } + +-#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) +- +-/*******************/ +-/* Rfkill */ +-/*******************/ +- + void ath_radio_enable(struct ath_softc *sc) + { + struct ath_hw *ah = sc->sc_ah; +@@ -1172,6 +1166,12 @@ void ath_radio_disable(struct ath_softc + ath9k_ps_restore(sc); + } + ++#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) ++ ++/*******************/ ++/* Rfkill */ ++/*******************/ ++ + static bool ath_is_rfkill_set(struct ath_softc *sc) + { + struct ath_hw *ah = sc->sc_ah; -- 2.30.2