mac80211: merge changes from trunk and add back the !LINUX_2_4 dependency
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 24 Dec 2010 12:11:53 +0000 (12:11 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 24 Dec 2010 12:11:53 +0000 (12:11 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@24820 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/mac80211/Makefile
package/mac80211/files/lib/wifi/mac80211.sh
package/mac80211/patches/019-remove_ath5k_pci_option.patch [new file with mode: 0644]
package/mac80211/patches/303-tpt_led_trigger_declaration_fix.patch [new file with mode: 0644]
package/mac80211/patches/310-ath9k_pending_work.patch
package/mac80211/patches/550-ath9k_intr_mitigation_tweak.patch [new file with mode: 0644]

index d8af462bbcec2f9cb2cb3e77d5070bf523d84332..2755cb0ad917ecae0b29db2d9ecd0e684ea9b239 100644 (file)
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 PKG_NAME:=mac80211
 
 PKG_VERSION:=2010-12-16
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
 PKG_MD5SUM:=39196307aa67c1f19f498b570b994112
 
@@ -35,7 +35,7 @@ define KernelPackage/mac80211/Default
   SUBMENU:=$(WMENU)
   URL:=http://linuxwireless.org/
   MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
-  DEPENDS:=@(!(TARGET_avr32||TARGET_ep93xx||TARGET_ps3||TARGET_pxcab)||BROKEN)
+  DEPENDS:=@(!(TARGET_avr32||TARGET_ep93xx||TARGET_ps3||TARGET_pxcab)||BROKEN) @!LINUX_2_4
 endef
 
 define KernelPackage/cfg80211
@@ -868,7 +868,7 @@ BUILDFLAGS:= \
        $(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS -DCONFIG_B43_LEDS -DCONFIG_B43LEGACY_LEDS -DCONFIG_AR9170_LEDS) \
        -DCONFIG_B43_HWRNG -DCONFIG_B43LEGACY_HWRNG \
        $(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),-DCONFIG_MAC80211_DEBUGFS -DCONFIG_ATH9K_DEBUGFS -DCONFIG_CARL9170_DEBUGFS) \
-       $(if $(CONFIG_PACKAGE_ATH_DEBUG),-DCONFIG_ATH_DEBUG -DCONFIG_ATH9K_PKTLOG) \
+       $(if $(CONFIG_PACKAGE_ATH_DEBUG),-DCONFIG_ATH_DEBUG -DCONFIG_ATH9K_PKTLOG -DCONFIG_ATH5K_DEBUG) \
        -D__CONFIG_MAC80211_RC_DEFAULT=minstrel \
        -DCONFIG_MAC80211_RC_MINSTREL_HT \
        $(if $(CONFIG_ATH_USER_REGD),-DATH_USER_REGD=1) \
@@ -881,8 +881,7 @@ BUILDFLAGS:= \
        $(if $(CONFIG_PACKAGE_kmod-rt2x00-pci),-DCONFIG_RT2X00_LIB_PCI) \
        $(if $(CONFIG_PACKAGE_kmod-rt2x00-usb),-DCONFIG_RT2X00_LIB_USB) \
        $(if $(CONFIG_PACKAGE_kmod-rt2x00-soc),-DCONFIG_RT2X00_LIB_SOC) \
-       $(if $(CONFIG_PCI_SUPPORT),-DCONFIG_RT2800PCI_PCI) \
-       $(if $(CONFIG_TARGET_ramips),-DCONFIG_RT2800PCI_SOC) \
+       $(if $(CONFIG_TARGET_atheros),-DCONFIG_ATH5K_AHB,-DCONFIG_ATH5K_PCI) \
        -DCONFIG_P54_SPI_DEFAULT_EEPROM
 
 MAKE_OPTS:= \
@@ -905,8 +904,11 @@ MAKE_OPTS:= \
        CONFIG_B43LEGACY=$(if $(CONFIG_PACKAGE_kmod-b43legacy),m) \
        CONFIG_ATH_COMMON=$(if $(CONFIG_PACKAGE_kmod-ath),m) \
        CONFIG_ATH_DEBUG=$(if $(CONFIG_PACKAGE_ATH_DEBUG),y) \
+       CONFIG_ATH5K_DEBUG=$(if $(CONFIG_PACKAGE_ATH_DEBUG),y) \
        CONFIG_ATH9K_PKTLOG=$(if $(CONFIG_PACKAGE_ATH_DEBUG),y) \
        CONFIG_ATH5K=$(if $(CONFIG_PACKAGE_kmod-ath5k),m) \
+       CONFIG_ATH5K_PCI=$(if $(CONFIG_TARGET_atheros),,y) \
+       CONFIG_ATH5K_AHB=$(if $(CONFIG_TARGET_atheros),y) \
        CONFIG_ATH9K=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \
        CONFIG_ATH9K_HW=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \
        CONFIG_ATH9K_COMMON=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \
@@ -936,8 +938,6 @@ MAKE_OPTS:= \
        CONFIG_RT73USB=$(if $(CONFIG_PACKAGE_kmod-rt73-usb),m) \
        CONFIG_RT2800_LIB=$(if $(CONFIG_PACKAGE_kmod-rt2800-lib),m) \
        CONFIG_RT2800PCI=$(if $(CONFIG_PACKAGE_kmod-rt2800-pci),m) \
-       CONFIG_RT2800PCI_PCI=$(if $(CONFIG_PCI_SUPPORT),y) \
-       CONFIG_RT2800PCI_SOC=$(if $(CONFIG_TARGET_ramips),y) \
        CONFIG_RT2800USB=$(if $(CONFIG_PACKAGE_kmod-rt2800-usb),m) \
        CONFIG_RTL8180=$(if $(CONFIG_PACKAGE_kmod-rtl8180),m) \
        CONFIG_RTL8187=$(if $(CONFIG_PACKAGE_kmod-rtl8187),m) \
@@ -957,7 +957,6 @@ MAKE_OPTS:= \
        CONFIG_LIB80211_CRYPT_WEP= \
        CONFIG_LIB80211_CRYPT_CCMP= \
        CONFIG_LIB80211_CRYPT_TKIP= \
-       CONFIG_IWLWIFI= \
        CONFIG_COMPAT_IWLWIFI= \
        CONFIG_IWLAGN= \
        CONFIG_MWL8K=$(if $(CONFIG_PACKAGE_kmod-mwl8k),m) \
index 9ebc0be0320f8fac3084d82312c6543e7a6cd333..2f4abd0852a091c4d07ef11bcb2e0823edfb627d 100644 (file)
@@ -105,11 +105,13 @@ mac80211_hostapd_setup_bss() {
 
        config_get macaddr "$vif" macaddr
        config_get_bool hidden "$vif" hidden 0
+       config_get maxassoc "$vif" maxassoc
        cat >> /var/run/hostapd-$phy.conf <<EOF
 $hostapd_cfg
 wmm_enabled=1
 bssid=$macaddr
 ignore_broadcast_ssid=$hidden
+${maxassoc:+max_num_sta=$maxassoc}
 EOF
 }
 
diff --git a/package/mac80211/patches/019-remove_ath5k_pci_option.patch b/package/mac80211/patches/019-remove_ath5k_pci_option.patch
new file mode 100644 (file)
index 0000000..792ecb5
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/config.mk
++++ b/config.mk
+@@ -189,7 +189,7 @@ CONFIG_MAC80211_HWSIM=m
+ ifdef CONFIG_PCI
+ CONFIG_ATH5K=m
+-CONFIG_ATH5K_PCI=y
++# CONFIG_ATH5K_PCI=y
+ # CONFIG_ATH5K_DEBUG=y
+ # CONFIG_ATH5K_AHB=y
+ CONFIG_ATH9K_HW=m
diff --git a/package/mac80211/patches/303-tpt_led_trigger_declaration_fix.patch b/package/mac80211/patches/303-tpt_led_trigger_declaration_fix.patch
new file mode 100644 (file)
index 0000000..9386176
--- /dev/null
@@ -0,0 +1,35 @@
+From: Luciano Coelho <luciano.coelho@xxxxxxxxx>
+
+If CONFIG_MAC80211_LEDS is not set, ieee80211_i.h was failing to compile,
+because struct led_trigger is only declared when CONFIG_LEDS_TRIGGERS is
+set.
+
+This patch adds ifdefs around the tpt_led_trigger declaration in
+ieee80211_i.h to avoid the problem.
+
+Cc: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
+Signed-off-by: Luciano Coelho <luciano.coelho@xxxxxxxxx>
+---
+ net/mac80211/ieee80211_i.h |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
+index 0817ec6..7541d42 100644
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -631,6 +631,7 @@ enum queue_stop_reason {
+       IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
+ };
++#ifdef CONFIG_MAC80211_LEDS
+ struct tpt_led_trigger {
+       struct led_trigger trig;
+       char name[32];
+@@ -642,6 +643,7 @@ struct tpt_led_trigger {
+       unsigned int active, want;
+       bool running;
+ };
++#endif
+ /**
+  * mac80211 scan flags - currently active scan mode
index ec0a26197e0fbfb6c15524e1a1b28c2a3273f754..7278551d188b6329f16c7bcf90b00db537b30285 100644 (file)
        if (!ath9k_hw_private_ops(ah)->restore_chainmask)
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -1399,7 +1399,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+@@ -491,6 +491,17 @@ static int __ath9k_hw_init(struct ath_hw
+       if (ah->hw_version.devid == AR5416_AR9100_DEVID)
+               ah->hw_version.macVersion = AR_SREV_VERSION_9100;
++      ath9k_hw_read_revisions(ah);
++
++      /*
++       * Read back AR_WA into a permanent copy and set bits 14 and 17.
++       * We need to do this to avoid RMW of this register. We cannot
++       * read the reg when chip is asleep.
++       */
++      ah->WARegVal = REG_READ(ah, AR_WA);
++      ah->WARegVal |= (AR_WA_D3_L1_DISABLE |
++                       AR_WA_ASPM_TIMER_BASED_DISABLE);
++
+       if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) {
+               ath_err(common, "Couldn't reset chip\n");
+               return -EIO;
+@@ -559,14 +570,6 @@ static int __ath9k_hw_init(struct ath_hw
+       ath9k_hw_init_mode_regs(ah);
+-      /*
+-       * Read back AR_WA into a permanent copy and set bits 14 and 17.
+-       * We need to do this to avoid RMW of this register. We cannot
+-       * read the reg when chip is asleep.
+-       */
+-      ah->WARegVal = REG_READ(ah, AR_WA);
+-      ah->WARegVal |= (AR_WA_D3_L1_DISABLE |
+-                       AR_WA_ASPM_TIMER_BASED_DISABLE);
+       if (ah->is_pciexpress)
+               ath9k_hw_configpcipowersave(ah, 0, 0);
+@@ -1078,8 +1081,6 @@ static bool ath9k_hw_set_reset_power_on(
+               return false;
+       }
+-      ath9k_hw_read_revisions(ah);
+-
+       return ath9k_hw_set_reset(ah, ATH9K_RESET_WARM);
+ }
+@@ -1399,7 +1400,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
        ath9k_hw_init_qos(ah);
  
        if (ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT)
diff --git a/package/mac80211/patches/550-ath9k_intr_mitigation_tweak.patch b/package/mac80211/patches/550-ath9k_intr_mitigation_tweak.patch
new file mode 100644 (file)
index 0000000..be17062
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -1426,8 +1426,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+       REG_WRITE(ah, AR_OBS, 8);
+       if (ah->config.rx_intr_mitigation) {
+-              REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500);
+-              REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, 2000);
++              REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 250);
++              REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, 500);
+       }
+       if (ah->config.tx_intr_mitigation) {