mac80211: backport latest version from trunk as of r27395
authorFelix Fietkau <nbd@openwrt.org>
Mon, 4 Jul 2011 01:55:04 +0000 (01:55 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 4 Jul 2011 01:55:04 +0000 (01:55 +0000)
SVN-Revision: 27431

64 files changed:
package/mac80211/Makefile
package/mac80211/files/lib/wifi/mac80211.sh
package/mac80211/patches/001-disable_b44.patch
package/mac80211/patches/002-disable_rfkill.patch
package/mac80211/patches/003-disable_bt.patch
package/mac80211/patches/005-disable_ssb_build.patch
package/mac80211/patches/006-disable_bcma_build.patch [new file with mode: 0644]
package/mac80211/patches/007-remove_misc_drivers.patch
package/mac80211/patches/009-remove_mac80211_module_dependence.patch
package/mac80211/patches/010-no_pcmcia.patch
package/mac80211/patches/011-no_sdio.patch
package/mac80211/patches/013-disable_b43_nphy.patch
package/mac80211/patches/015-remove-rt2x00-options.patch
package/mac80211/patches/016-remove_pid_algo.patch
package/mac80211/patches/017-remove_ath9k_rc.patch
package/mac80211/patches/018-revert_printk_va_format.patch
package/mac80211/patches/019-remove_ath5k_pci_option.patch
package/mac80211/patches/020-netlink_seq.patch [new file with mode: 0644]
package/mac80211/patches/021-add_include_for_bcma.patch [new file with mode: 0644]
package/mac80211/patches/030-disable_tty_set_termios.patch
package/mac80211/patches/040-compat_backports.patch [deleted file]
package/mac80211/patches/070-add_eeprom_def.patch [deleted file]
package/mac80211/patches/110-disable_usb_compat.patch
package/mac80211/patches/120-pr_fmt_warnings.patch
package/mac80211/patches/300-pending_work.patch
package/mac80211/patches/310-ibss_ht.patch [new file with mode: 0644]
package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch
package/mac80211/patches/406-regd_no_assoc_hints.patch
package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch
package/mac80211/patches/411-ath5k_allow_adhoc_and_ap.patch
package/mac80211/patches/420-mac80211_ignore_invalid_ccmp_rx_pn.patch
package/mac80211/patches/430-ath5k_disable_fast_cc.patch [new file with mode: 0644]
package/mac80211/patches/440-ath5k_calibrate_srev_checks.patch [new file with mode: 0644]
package/mac80211/patches/441-ath5k_synth_voltage_srev_check.patch [new file with mode: 0644]
package/mac80211/patches/442-ath5k_spur_channel_srev_check.patch [new file with mode: 0644]
package/mac80211/patches/443-ath5k_initialize_clockrate.patch [new file with mode: 0644]
package/mac80211/patches/444-ath5k_delay_calibration.patch [new file with mode: 0644]
package/mac80211/patches/445-ath5k_fix_mac_clock_restore.patch [new file with mode: 0644]
package/mac80211/patches/446-ath5k_disable_32khz_clock.patch [new file with mode: 0644]
package/mac80211/patches/447-ath5k_fix_queue_stop_warning.patch [new file with mode: 0644]
package/mac80211/patches/500-ath9k_eeprom_debugfs.patch
package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch
package/mac80211/patches/511-ath9k_increase_bcbuf.patch
package/mac80211/patches/512-ath9k_reduce_rxbuf.patch [new file with mode: 0644]
package/mac80211/patches/521-mac80211_ht_change_rate_update.patch [new file with mode: 0644]
package/mac80211/patches/530-ath9k_noise_dbm_fixup.patch [new file with mode: 0644]
package/mac80211/patches/540-ath9k_channelbw_debugfs.patch [new file with mode: 0644]
package/mac80211/patches/540-mac80211_remove_wds_sta_flag.patch [deleted file]
package/mac80211/patches/541-ath9k_pllclock_fix.patch [new file with mode: 0644]
package/mac80211/patches/541-mac80211_fix_iftype_wds.patch [deleted file]
package/mac80211/patches/542-mac80211_enable_iftype_wds_aggregation.patch [deleted file]
package/mac80211/patches/550-ath9k_debugfs_show_xretry.patch [deleted file]
package/mac80211/patches/560-mac80211_ht_change_rate_update.patch [deleted file]
package/mac80211/patches/570-ath9k_noise_dbm_fixup.patch [deleted file]
package/mac80211/patches/580-ath9k_fix_adhoc_beacons.patch [deleted file]
package/mac80211/patches/581-ath9k_fix_adhoc_nexttbtt.patch [deleted file]
package/mac80211/patches/601-rt2x00-set_pci_mwi.patch [new file with mode: 0644]
package/mac80211/patches/602-rt2x00-introduce-rt2x00_platform_h.patch [new file with mode: 0644]
package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch [new file with mode: 0644]
package/mac80211/patches/604-rt2x00-add-CONFIG_RT2X00_LIB_EEPROM-option.patch [new file with mode: 0644]
package/mac80211/patches/610-set_pci_mwi.patch [deleted file]
package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
package/mac80211/patches/800-b43-gpio-mask-module-option.patch
package/mac80211/patches/810-b43_no_pio.patch

index ffeee71c47cf8dddb22469e5147f74fc59f16b94..3ca26700d6c3e62d0ad73585ccc0703397008803 100644 (file)
@@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mac80211
 
-PKG_VERSION:=2011-04-19
-PKG_RELEASE:=3
+PKG_VERSION:=2011-06-22
+PKG_RELEASE:=2
 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
-PKG_MD5SUM:=7b789b726927bcc8e3b06c7df40214d9
+PKG_MD5SUM:=3ffdd5cecedcf4236f599bdbc55ba10d
 
 PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
@@ -104,6 +104,23 @@ define KernelPackage/mac80211/description
 Generic IEEE 802.11 Networking Stack (mac80211)
 endef
 
+PKG_LINUX_FIRMWARE_NAME:=linux-firmware
+PKG_LINUX_FIRMWARE_VERSION:=97649b1e5449029c845ebf7500e780a8867c3e89
+PKG_LINUX_FIRMWARE_SOURCE:=$(PKG_LINUX_FIRMWARE_NAME)-$(PKG_LINUX_FIRMWARE_VERSION).tar.bz2
+PKG_LINUX_FIRMWARE_PROTO:=git
+PKG_LINUX_FIRMWARE_SOURCE_URL:=git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git
+PKG_LINUX_FIRMWARE_SUBDIR:=$(PKG_LINUX_FIRMWARE_NAME)-$(PKG_LINUX_FIRMWARE_VERSION)
+
+define Download/linux-firmware
+  FILE:=$(PKG_LINUX_FIRMWARE_SOURCE)
+  URL:=$(PKG_LINUX_FIRMWARE_SOURCE_URL)
+  MD5SUM:=$(PKG_LINUX_FIRMWARE_MD5SUM)
+  PROTO:=$(PKG_LINUX_FIRMWARE_PROTO)
+  VERSION:=$(PKG_LINUX_FIRMWARE_VERSION)
+  SUBDIR:=$(PKG_LINUX_FIRMWARE_SUBDIR)
+endef
+$(eval $(call Download,linux-firmware))
+
 # Prism54 drivers
 P54PCIFW:=2.13.12.0.arm
 P54USBFW:=2.13.24.0.lm87.arm
@@ -179,51 +196,9 @@ define KernelPackage/p54-spi
   AUTOLOAD:=$(call AutoLoad,31,p54spi)
 endef
 
-# Ralink rt2x00 drivers
-RT61FW:=RT61_Firmware_V1.2.zip
-RT71FW:=RT71W_Firmware_V1.8.zip
-RT2860FW:=RT2860_Firmware_V11.zip
-RT2870FW:=RT2870_Firmware_V8.zip
-
-define Download/rt61
-  FILE:=$(RT61FW)
-  URL:=http://www.ralinktech.com.tw/data/
-  MD5SUM:=d4c690c93b470bc9a681297c2adc6281
-endef
-$(eval $(call Download,rt61))
-
-define Download/rt71w
-  FILE:=$(RT71FW)
-  URL:=http://www.ralinktech.com.tw/data/
-  MD5SUM:=1e7a5dc574e0268574fcda3fd5cf52f7
-endef
-$(eval $(call Download,rt71w))
-
-define Download/rt2860
-  FILE:=$(RT2860FW)
-  URL:=http://www.ralinktech.com.tw/data/drivers
-  MD5SUM:=440a81756a52c53528f16faa41c40124
-endef
-$(eval $(call Download,rt2860))
-
-define Download/rt2870
-  FILE:=$(RT2870FW)
-  URL:=http://www.ralinktech.com.tw/data/drivers
-  MD5SUM:=a7aae1d8cfd68e4d86a73000df0b6584
-endef
-$(eval $(call Download,rt2870))
-
-AR9170FW:=ar9170.fw
-
-define Download/ar9170
-  FILE:=$(AR9170FW)
-  URL:=http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170
-  MD5SUM:=34feec4ec0eae3bb92c7c1ea2dfb4530
-endef
-$(eval $(call Download,ar9170))
-
 NEED_RT2X00_LIB_CRYPTO:=y
 NEED_RT2X00_LIB_FIRMWARE:=y
+NEED_RT2X00_LIB_EEPROM:=y
 NEED_RT2X00_LIB_HT:=y
 NEED_RT2X00_LIB_LEDS:=y
 
@@ -416,7 +391,7 @@ endef
 define KernelPackage/ath
   $(call KernelPackage/mac80211/Default)
   TITLE:=Atheros common driver part
-  DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT +kmod-mac80211
+  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-mac80211
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko
   AUTOLOAD:=$(call AutoLoad,26,ath)
   MENU:=1
@@ -444,7 +419,7 @@ define KernelPackage/ath9k-common
   $(call KernelPackage/mac80211/Default)
   TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
   URL:=http://linuxwireless.org/en/users/Drivers/ath9k
-  DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT
+  DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx +kmod-ath +@DRIVER_11N_SUPPORT
   FILES:= \
        $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
        $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
@@ -455,7 +430,7 @@ define KernelPackage/ath9k
   $(call KernelPackage/mac80211/Default)
   TITLE:=Atheros 802.11n PCI wireless cards support
   URL:=http://linuxwireless.org/en/users/Drivers/ath9k
-  DEPENDS+= @PCI_SUPPORT +kmod-ath9k-common
+  DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx +kmod-ath9k-common
   FILES:= \
        $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko
   AUTOLOAD:=$(call AutoLoad,28,ath9k)
@@ -466,31 +441,6 @@ This module adds support for wireless adapters based on
 Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
 endef
 
-AR7010FW:=ar7010.fw
-AR7010_1_1_FW:=ar7010_1_1.fw
-AR9271FW:=ar9271.fw
-
-define Download/ar9271
-  FILE:=$(AR9271FW)
-  URL:=http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=blob_plain;f=ar9271.fw;h=d0ee74a1c8dccb7cc21f5be90f1d4048fa9dbf9e;hb=HEAD;?
-  MD5SUM:=2e6f5045ec4c5a42bb93ced242bad0ba
-endef
-$(eval $(call Download,ar9271))
-
-define Download/ar7010
-  FILE:=$(AR7010FW)
-  URL:=http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=blob_plain;f=ar7010.fw;h=840005d0f0c81838c581b8cd5d76c8dd3843731c;hb=HEAD;?
-  MD5SUM:=59823b82b1f72bed9b044e8cc78ad65c
-endef
-$(eval $(call Download,ar7010))
-
-define Download/ar7010_1_1
-  FILE:=$(AR7010_1_1_FW)
-  URL:=http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=blob_plain;f=ar7010_1_1.fw;h=684d4cd1a8cac4f58305589e31f9d856d03a8ef0;hb=HEAD;?
-  MD5SUM:=544fcbe5a93cfa53c7e6d3ded2b05347
-endef
-$(eval $(call Download,ar7010_1_1))
-
 define KernelPackage/ath9k-htc
   $(call KernelPackage/mac80211/Default)
   TITLE:=Atheros 802.11n USB device support
@@ -519,36 +469,6 @@ define KernelPackage/carl9170/install
        $(INSTALL_DATA) $(DL_DIR)/$(CARL9170_FW)-$(CARL9170_FW_VERSION) $(1)/lib/firmware/$(CARL9170_FW)
 endef
 
-
-USB8388FW_NAME:=usb8388
-USB8388FW_VERSION:=5.110.22.p23
-
-define Download/usb8388
-  URL:=http://dev.laptop.org/pub/firmware/libertas/
-  FILE:=$(USB8388FW_NAME)-$(USB8388FW_VERSION).bin
-  MD5SUM=5e38f55719df3d0c58dd3bd02575a09c
-endef
-$(eval $(call Download,usb8388))
-
-SD8686FW_NAME:=sd8686
-SD8686FW_VERSION:=9.70.7.p0
-
-define Download/sd8686
-  URL:=http://dev.laptop.org/pub/firmware/libertas/
-  FILE:=$(SD8686FW_NAME)-$(SD8686FW_VERSION).bin
-  MD5SUM=b4f8be61e19780a14836f146c538c5dd
-endef
-$(eval $(call Download,sd8686))
-
-SD8686HELPER_NAME:=sd8686_helper
-
-define Download/sd8686_helper
-  URL:=http://dev.laptop.org/pub/firmware/libertas/
-  FILE:=$(SD8686HELPER_NAME).bin
-  MD5SUM=2a4d8f4df198ce949c350df5674f4ac6
-endef
-$(eval $(call Download,sd8686_helper))
-
 define KernelPackage/libertas-usb
   $(call KernelPackage/mac80211/Default)
   DEPENDS+= @USB_SUPPORT +kmod-mac80211 +kmod-usb-core +kmod-lib80211
@@ -686,112 +606,6 @@ define KernelPackage/net-hermes-pcmcia/description
  Kernel modules for Hermes based PCMCIA adaptors
 endef
 
-IWL3945_NAME:=iwlwifi-3945-ucode
-IWL3945_VERSION:=15.32.2.9
-IWL3945_MD5SUM:=d99a75ab1305d1532a09471b2f9a547a
-IWL4965_NAME:=iwlwifi-4965-ucode
-IWL4965_VERSION:=228.61.2.24
-IWL4965_MD5SUM:=2531028773cfc22aca5539c734f2a241
-IWL5000_NAME:=iwlwifi-5000-ucode
-IWL5000_VERSION:=8.83.5.1
-IWL5000_MD5SUM:=da82465019b3c7d1ee5156474ab4931d
-IWL5150_NAME:=iwlwifi-5150-ucode
-IWL5150_VERSION:=8.24.2.2
-IWL5150_MD5SUM:=f9cee16e455e8046b1bf62c93f882d5d
-IWL1000_NAME:=iwlwifi-1000-ucode
-IWL1000_VERSION:=39.31.5.1
-IWL1000_MD5SUM:=8098503cb2abcdeffffb3ddd2d8d6f60
-IWL6000_NAME:=iwlwifi-6000-ucode
-IWL6000_VERSION:=9.221.4.1
-IWL6000_MD5SUM:=c132a4c1946a9dbc0c36b41696e5c793
-IWL6050_NAME:=iwlwifi-6050-ucode
-IWL6050_VERSION:=41.28.5.1
-IWL6050_MD5SUM:=cb484a65b9139666d4ddebf60598a87b
-IWL6005_NAME:=iwlwifi-6000g2a-ucode
-IWL6005_VERSION:=17.168.5.2
-IWL6005_MD5SUM:=0b9579f4b8faf51c955295607a8e79a8
-IWL6030_NAME:=iwlwifi-6000g2b-ucode
-IWL6030_VERSION:=17.168.5.2
-IWL6030_MD5SUM:=d87411296b4eeda0c91322228e9f8437
-IWL100_NAME:=iwlwifi-100-ucode
-IWL100_VERSION:=39.31.5.1
-IWL100_MD5SUM:=b686f0ab94888ccca3ce74d2d6ee1133
-
-
-define Download/iwl-fw/Default
-  URL:=http://intellinuxwireless.org/iwlwifi/downloads/
-endef
-
-define Download/iwl3945-fw
-  $(call Download/iwl-fw/Default)
-  FILE:=$(IWL3945_NAME)-$(IWL3945_VERSION).tgz
-  MD5SUM:=$(IWL3945_MD5SUM)
-endef
-$(eval $(call Download,iwl3945-fw))
-
-define Download/iwl4965-fw
-  $(call Download/iwl-fw/Default)
-  FILE:=$(IWL4965_NAME)-$(IWL4965_VERSION).tgz
-  MD5SUM:=$(IWL4965_MD5SUM)
-endef
-$(eval $(call Download,iwl4965-fw))
-
-define Download/iwl5000-fw
-  $(call Download/iwl-fw/Default)
-  FILE:=$(IWL5000_NAME)-$(IWL5000_VERSION).tgz
-  MD5SUM:=$(IWL5000_MD5SUM)
-endef
-$(eval $(call Download,iwl5000-fw))
-
-define Download/iwl5150-fw
-  $(call Download/iwl-fw/Default)
-  FILE:=$(IWL5150_NAME)-$(IWL5150_VERSION).tgz
-  MD5SUM:=$(IWL5150_MD5SUM)
-endef
-$(eval $(call Download,iwl5150-fw))
-
-define Download/iwl1000-fw
-  $(call Download/iwl-fw/Default)
-  FILE:=$(IWL1000_NAME)-$(IWL1000_VERSION).tgz
-  MD5SUM:=$(IWL1000_MD5SUM)
-endef
-$(eval $(call Download,iwl1000-fw))
-
-define Download/iwl6000-fw
-  $(call Download/iwl-fw/Default)
-  FILE:=$(IWL6000_NAME)-$(IWL6000_VERSION).tgz
-  MD5SUM:=$(IWL6000_MD5SUM)
-endef
-$(eval $(call Download,iwl6000-fw))
-
-define Download/iwl6050-fw
-  $(call Download/iwl-fw/Default)
-  FILE:=$(IWL6050_NAME)-$(IWL6050_VERSION).tgz
-  MD5SUM:=$(IWL6050_MD5SUM)
-endef
-$(eval $(call Download,iwl6050-fw))
-
-define Download/iwl6005-fw
-  $(call Download/iwl-fw/Default)
-  FILE:=$(IWL6005_NAME)-$(IWL6005_VERSION).tgz
-  MD5SUM:=$(IWL6005_MD5SUM)
-endef
-$(eval $(call Download,iwl6005-fw))
-
-define Download/iwl6030-fw
-  $(call Download/iwl-fw/Default)
-  FILE:=$(IWL6030_NAME)-$(IWL6030_VERSION).tgz
-  MD5SUM:=$(IWL6030_MD5SUM)
-endef
-$(eval $(call Download,iwl6030-fw))
-
-define Download/iwl100-fw
-  $(call Download/iwl-fw/Default)
-  FILE:=$(IWL100_NAME)-$(IWL100_VERSION).tgz
-  MD5SUM:=$(IWL100_MD5SUM)
-endef
-$(eval $(call Download,iwl100-fw))
-
 define KernelPackage/iwlagn
   $(call KernelPackage/mac80211/Default)
   DEPENDS:= +kmod-mac80211 @PCI_SUPPORT
@@ -1197,10 +1011,11 @@ BUILDFLAGS:= \
        -I$(PKG_BUILD_DIR)/include \
        $(foreach opt,$(CONFOPTS),-DCONFIG_$(opt)) \
        $(if $(CONFIG_PCI),-DCONFIG_B43_PCI_AUTOSELECT -DCONFIG_B43_PCICORE_AUTOSELECT) \
-       $(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS -DCONFIG_B43_LEDS -DCONFIG_B43LEGACY_LEDS -DCONFIG_AR9170_LEDS) \
+       $(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS -DCONFIG_B43_LEDS -DCONFIG_B43LEGACY_LEDS) \
        -DCONFIG_B43_HWRNG -DCONFIG_B43LEGACY_HWRNG \
-       -DCONFIG_ATH9K_PCI $(if $(CONFIG_TARGET_ar71xx),-DCONFIG_ATH9K_AHB) \
-       $(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),-DCONFIG_MAC80211_DEBUGFS -DCONFIG_ATH9K_DEBUGFS -DCONFIG_CARL9170_DEBUGFS -DCONFIG_ATH9K_HTC_DEBUGFS -DCONFIG_ATH5K_DEBUG) \
+       $(if $(CONFIG_PCI),-DCONFIG_ATH9K_PCI) \
+       $(if $(CONFIG_TARGET_ar71xx),-DCONFIG_ATH9K_AHB) \
+       $(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS), -DCONFIG_CFG80211_DEBUGFS -DCONFIG_MAC80211_DEBUGFS -DCONFIG_ATH9K_DEBUGFS -DCONFIG_CARL9170_DEBUGFS -DCONFIG_ATH9K_HTC_DEBUGFS -DCONFIG_ATH5K_DEBUG) \
        $(if $(CONFIG_PACKAGE_ATH_DEBUG),-DCONFIG_ATH_DEBUG -DCONFIG_ATH9K_PKTLOG) \
        -D__CONFIG_MAC80211_RC_DEFAULT=minstrel \
        -DCONFIG_MAC80211_RC_MINSTREL_HT \
@@ -1213,6 +1028,7 @@ BUILDFLAGS:= \
        $(if $(NEED_RT2X00_LIB_HT),-DCONFIG_RT2X00_LIB_HT) \
        $(if $(NEED_RT2X00_LIB_CRYPTO),-DCONFIG_RT2X00_LIB_CRYPTO) \
        $(if $(NEED_RT2X00_LIB_FIRMWARE),-DCONFIG_RT2X00_LIB_FIRMWARE) \
+       $(if $(NEED_RT2X00_LIB_EEPROM),-DCONFIG_RT2X00_LIB_EEPROM) \
        $(if $(NEED_RT2X00_LIB_LEDS),-DCONFIG_RT2X00_LIB_LEDS) \
        $(if $(CONFIG_PACKAGE_kmod-rt2x00-pci),-DCONFIG_RT2X00_LIB_PCI) \
        $(if $(CONFIG_PACKAGE_kmod-rt2x00-usb),-DCONFIG_RT2X00_LIB_USB) \
@@ -1229,6 +1045,7 @@ MAKE_OPTS:= \
        CONFIG_MAC80211=$(if $(CONFIG_PACKAGE_kmod-mac80211),m) \
        CONFIG_MAC80211_RC_MINSTREL=y \
        CONFIG_MAC80211_LEDS=$(CONFIG_LEDS_TRIGGERS) \
+       CONFIG_CFG80211_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \
        CONFIG_MAC80211_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \
        CONFIG_B43_PCMCIA=n CONFIG_B43_PIO=n \
        CONFIG_B43_PCI_AUTOSELECT=$(if $(CONFIG_PCI),y) \
@@ -1244,16 +1061,16 @@ MAKE_OPTS:= \
        CONFIG_B43_PHY_N=$(if $(CONFIG_PACKAGE_B43_PHY_N),y) \
        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_ATH5K_DEBUG=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \
        CONFIG_ATH9K=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \
-       CONFIG_ATH9K_PCI=y \
+       CONFIG_ATH9K_PCI=$(CONFIG_PCI) \
        CONFIG_ATH9K_AHB=$(if $(CONFIG_TARGET_ar71xx),y) \
        CONFIG_ATH9K_HTC=$(if $(CONFIG_PACKAGE_kmod-ath9k-htc),m) \
+       CONFIG_ATH9K_HTC_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \
        CONFIG_ATH9K_HW=$(if $(CONFIG_PACKAGE_kmod-ath9k-common),m) \
        CONFIG_ATH9K_COMMON=$(if $(CONFIG_PACKAGE_kmod-ath9k-common),m) \
        CONFIG_ATH9K_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \
@@ -1273,6 +1090,7 @@ MAKE_OPTS:= \
        CONFIG_RT2X00_LIB_DEBUGFS=$(CONFIG_PACKAGE_RT2X00_LIB_DEBUGFS) \
        CONFIG_RT2X00_LIB_CRYPTO=$(NEED_RT2X00_LIB_CRYPTO) \
        CONFIG_RT2X00_LIB_FIRMWARE=$(NEED_RT2X00_LIB_FIRMWARE) \
+       CONFIG_RT2X00_LIB_EEPROM=$(NEED_RT2X00_LIB_EEPROM) \
        CONFIG_RT2X00_LIB_HT=$(NEED_RT2X00_LIB_HT) \
        CONFIG_RT2X00_LIB_LEDS=$(NEED_RT2X00_LIB_LEDS) \
        CONFIG_RT2400PCI=$(if $(CONFIG_PACKAGE_kmod-rt2400-pci),m) \
@@ -1329,12 +1147,15 @@ MAKE_OPTS:= \
        CONFIG_NORTEL_HERMES= \
        CONFIG_PCMCIA_SPECTRUM= \
        CONFIG_ORINOCO_USB= \
-       CONFIG_AR9170_USB=$(if $(CONFIG_PACKAGE_kmod-ar9170),m) \
-       CONFIG_AR9170_LEDS=$(CONFIG_LEDS_TRIGGERS) \
        CONFIG_IWM= \
        CONFIG_MWIFIEX= \
        CONFIG_MAC80211_RC_MINSTREL_HT=y \
        MADWIFI= \
+       CONFIG_B44= \
+       CONFIG_ATL1= \
+       CONFIG_ATL2= \
+       CONFIG_ATL1E= \
+       CONFIG_ATL1C= \
        KLIB_BUILD="$(LINUX_DIR)" \
        MODPROBE=: \
        KLIB=$(TARGET_MODULES_DIR) \
@@ -1350,26 +1171,12 @@ define Build/Prepare
        mkdir -p $(PKG_BUILD_DIR)
        $(PKG_UNPACK)
        $(Build/Patch)
-       unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT61FW)
-       unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT71FW)
-       -unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT2860FW)
-       -unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT2870FW)
        $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2100_NAME)-$(IPW2100_VERSION).tgz
        $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION).tgz
-       $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IWL3945_NAME)-$(IWL3945_VERSION).tgz
-       $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IWL4965_NAME)-$(IWL4965_VERSION).tgz
-       $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IWL5000_NAME)-$(IWL5000_VERSION).tgz
-       $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IWL5150_NAME)-$(IWL5150_VERSION).tgz
-       $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IWL1000_NAME)-$(IWL1000_VERSION).tgz
-       $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IWL6000_NAME)-$(IWL6000_VERSION).tgz
-       $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IWL6050_NAME)-$(IWL6050_VERSION).tgz
-       $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IWL6005_NAME)-$(IWL6005_VERSION).tgz
-       $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IWL6030_NAME)-$(IWL6030_VERSION).tgz
-       $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IWL100_NAME)-$(IWL100_VERSION).tgz
        $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
+       $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_LINUX_FIRMWARE_SOURCE)
        rm -rf $(PKG_BUILD_DIR)/include/linux/ssb
        rm -f $(PKG_BUILD_DIR)/include/net/ieee80211.h
-       rm $(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h
 endef
 
 ifneq ($(CONFIG_PACKAGE_kmod-cfg80211),)
@@ -1395,14 +1202,25 @@ endef
 
 define KernelPackage/libertas-usb/install
        $(INSTALL_DIR) $(1)/lib/firmware
-       $(INSTALL_DATA) $(DL_DIR)/$(USB8388FW_NAME)-$(USB8388FW_VERSION).bin $(1)/lib/firmware/$(USB8388FW_NAME).bin
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8388_v9.bin \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8388_v5.bin \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8682.bin \
+               $(1)/lib/firmware/
 endef
 
 define KernelPackage/libertas-sd/install
-       echo "Libertas install: $(CONFIG_PACKAGE_kmod-libertas-sd)"
        $(INSTALL_DIR) $(1)/lib/firmware
-       $(INSTALL_DATA) $(DL_DIR)/$(SD8686FW_NAME)-$(SD8686FW_VERSION).bin $(1)/lib/firmware/$(SD8686FW_NAME).bin
-       $(INSTALL_DATA) $(DL_DIR)/$(SD8686HELPER_NAME).bin $(1)/lib/firmware/$(SD8686HELPER_NAME).bin
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385_helper.bin \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385.bin \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9_helper.bin \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9.bin \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v8_helper.bin \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v8.bin \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688_helper.bin \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688.bin \
+               $(1)/lib/firmware/
 endef
 
 define KernelPackage/cfg80211/install
@@ -1427,22 +1245,26 @@ endef
 
 define KernelPackage/rt61-pci/install
        $(INSTALL_DIR) $(1)/lib/firmware
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561.bin \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561s.bin \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2661.bin \
+               $(1)/lib/firmware/
 endef
 
 define KernelPackage/rt73-usb/install
        $(INSTALL_DIR) $(1)/lib/firmware
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt73.bin $(1)/lib/firmware/
 endef
 
 define KernelPackage/rt2800-pci/install
        $(INSTALL_DIR) $(1)/lib/firmware
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2860.bin $(1)/lib/firmware/
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2860.bin $(1)/lib/firmware/
 endef
 
 define KernelPackage/rt2800-usb/install
        $(INSTALL_DIR) $(1)/lib/firmware
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2870.bin $(1)/lib/firmware/
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2870.bin $(1)/lib/firmware/
 endef
 
 define KernelPackage/zd1211rw/install
@@ -1450,17 +1272,22 @@ define KernelPackage/zd1211rw/install
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
 endef
 
-define KernelPackage/ar9170/install
+define KernelPackage/ath9k-htc/install
        $(INSTALL_DIR) $(1)/lib/firmware
-       $(INSTALL_DATA) $(DL_DIR)/$(AR9170FW) $(1)/lib/firmware/
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ar9271.fw \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ar7010.fw \
+               $(1)/lib/firmware/
 endef
 
-define KernelPackage/ath9k-htc/install
+define KernelPackage/mwl8k/install
        $(INSTALL_DIR) $(1)/lib/firmware
        $(INSTALL_DATA) \
-               $(DL_DIR)/$(AR9271FW) \
-               $(DL_DIR)/$(AR7010FW) \
-               $(DL_DIR)/$(AR7010_1_1_FW) \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366_ap-2.fw \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366.fw \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8366.fw \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8687.fw \
+               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8687.fw \
                $(1)/lib/firmware/
 endef
 
@@ -1477,39 +1304,39 @@ endef
 define KernelPackage/iwlagn/install
         $(INSTALL_DIR) $(1)/lib/firmware
 ifneq ($(CONFIG_IWL5000_FW),)
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IWL5000_NAME)-$(IWL5000_VERSION)/iwlwifi-5000-*.ucode $(1)/lib/firmware
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-5000-5.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL5150_FW),)
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IWL5150_NAME)-$(IWL5150_VERSION)/iwlwifi-5150-*.ucode $(1)/lib/firmware
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-5150-2.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL1000_FW),)
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IWL1000_NAME)-$(IWL1000_VERSION)/iwlwifi-1000-*.ucode $(1)/lib/firmware
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-1000-5.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL6000_FW),)
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IWL6000_NAME)-$(IWL6000_VERSION)/iwlwifi-6000-*.ucode $(1)/lib/firmware
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000-4.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL6050_FW),)
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IWL6050_NAME)-$(IWL6050_VERSION)/iwlwifi-6050-*.ucode $(1)/lib/firmware
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6050-5.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL6005_FW),)
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IWL6005_NAME)-$(IWL6005_VERSION)/iwlwifi-6000g2a-*.ucode $(1)/lib/firmware
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000g2a-5.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL6030_FW),)
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IWL6030_NAME)-$(IWL6030_VERSION)/iwlwifi-6000g2b-*.ucode $(1)/lib/firmware
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000g2b-5.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL100_FW),)
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IWL100_NAME)-$(IWL100_VERSION)/iwlwifi-100-*.ucode $(1)/lib/firmware
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-100-5.ucode $(1)/lib/firmware
 endif
 endef
 
 define KernelPackage/iwl3945/install
         $(INSTALL_DIR) $(1)/lib/firmware
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IWL3945_NAME)-$(IWL3945_VERSION)/iwlwifi-3945-*.ucode $(1)/lib/firmware
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3945-2.ucode $(1)/lib/firmware
 endef
 
 define KernelPackage/iwl4965/install
         $(INSTALL_DIR) $(1)/lib/firmware
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IWL4965_NAME)-$(IWL4965_VERSION)/iwlwifi-4965-*.ucode $(1)/lib/firmware
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-4965-2.ucode $(1)/lib/firmware
 endef
 
 define Build/b43-common
index 2ca63bb5cf8917bad5fb7e974b9908a475f84734..2472f8ea8483c8575765f2851352e209e32d03c6 100644 (file)
@@ -457,7 +457,13 @@ enable_mac80211() {
                                                [ "$mcsub" -gt 0 ] && mcval="$mcval.$mcsub"
                                        }
 
-                                       iw dev "$ifname" ibss join "$ssid" $freq \
+                                       config_get htmode "$device" htmode
+                                       case "$htmode" in
+                                               HT20|HT40+|HT40-) ;;
+                                               *) htmode= ;;
+                                       esac
+
+                                       iw dev "$ifname" ibss join "$ssid" $freq $htmode \
                                                ${fixed:+fixed-freq} $bssid \
                                                ${beacon_int:+beacon-interval $beacon_int} \
                                                ${brstr:+basic-rates $brstr} \
index 017c8f98a1aaecac34953b3f4d4dc91761845a88..7e6018fa9d7b7b72bd3cb89bc168f5668415b1fd 100644 (file)
@@ -1,6 +1,6 @@
 --- a/config.mk
 +++ b/config.mk
-@@ -311,8 +311,8 @@ endif #CONFIG_SSB
+@@ -337,8 +337,8 @@ CONFIG_BCMA_HOST_PCI=y
  
  CONFIG_P54_PCI=m
  
index a8704b89035f3e1c610806dc68c61d943f4f7b00..1cb319e39ed39d75b0ae4c1d2c21597d91073801 100644 (file)
@@ -1,6 +1,6 @@
 --- a/config.mk
 +++ b/config.mk
-@@ -74,7 +74,7 @@ endif # build check
+@@ -87,7 +87,7 @@ endif # build check
  endif # kernel Makefile check
  
  # These both are needed by compat-wireless || compat-bluetooth so enable them
@@ -9,10 +9,10 @@
  
  ifeq ($(CONFIG_MAC80211),y)
  $(error "ERROR: you have MAC80211 compiled into the kernel, CONFIG_MAC80211=y, as such you cannot replace its mac80211 driver. You need this set to CONFIG_MAC80211=m. If you are using Fedora upgrade your kernel as later version should this set as modular. For further information on Fedora see https://bugzilla.redhat.com/show_bug.cgi?id=470143. If you are using your own kernel recompile it and make mac80211 modular")
-@@ -614,10 +614,10 @@ endif #CONFIG_COMPAT_KERNEL_27
+@@ -646,10 +646,10 @@ endif #CONFIG_COMPAT_KERNEL_2_6_27
  # We need the backported rfkill module on kernel < 2.6.31.
  # In more recent kernel versions use the in kernel rfkill module.
- ifdef CONFIG_COMPAT_KERNEL_31
+ ifdef CONFIG_COMPAT_KERNEL_2_6_31
 -CONFIG_RFKILL_BACKPORT=m
 +# CONFIG_RFKILL_BACKPORT=m
  ifdef CONFIG_LEDS_TRIGGERS
@@ -21,7 +21,7 @@
  endif #CONFIG_LEDS_TRIGGERS
 -CONFIG_RFKILL_BACKPORT_INPUT=y
 +# CONFIG_RFKILL_BACKPORT_INPUT=y
- endif #CONFIG_COMPAT_KERNEL_31
+ endif #CONFIG_COMPAT_KERNEL_2_6_31
  
 --- a/include/linux/rfkill.h
 +++ b/include/linux/rfkill.h
index 50b9e98c02d44f3be73f80e91906d41db47eaf6a..ebccddde6e541d20340a54677d248b41ea02385e 100644 (file)
@@ -1,6 +1,6 @@
 --- a/config.mk
 +++ b/config.mk
-@@ -96,8 +96,8 @@ ifndef CONFIG_COMPAT_KERNEL_27
+@@ -109,8 +109,8 @@ ifndef CONFIG_COMPAT_KERNEL_2_6_27
  ifeq ($(CONFIG_BT),y)
  # we'll ignore compiling bluetooth
  else
@@ -9,5 +9,5 @@
 +# CONFIG_COMPAT_BLUETOOTH=y
 +# CONFIG_COMPAT_BLUETOOTH_MODULES=m
  endif
- endif #CONFIG_COMPAT_KERNEL_27
+ endif #CONFIG_COMPAT_KERNEL_2_6_27
  
index a6b49c39021ce4583d8c96667f721a30481f9eab..b067956cff22a67a4e670ecdb8e2a861a343bc72 100644 (file)
@@ -4,8 +4,8 @@
  obj-$(CONFIG_COMPAT_NET_USB_MODULES) += drivers/net/usb/
  
  obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/
--obj-$(CONFIG_COMPAT_VAR_MODULES) +=  drivers/ssb/ drivers/misc/eeprom/
-+obj-$(CONFIG_COMPAT_VAR_MODULES) +=  drivers/misc/eeprom/
+-obj-$(CONFIG_COMPAT_VAR_MODULES) +=  drivers/ssb/ drivers/bcma/ drivers/misc/eeprom/
++obj-$(CONFIG_COMPAT_VAR_MODULES) +=  drivers/bcma/ drivers/misc/eeprom/
  
  ifeq ($(CONFIG_STAGING_EXCLUDE_BUILD),)
  obj-$(CONFIG_COMPAT_STAGING) += drivers/staging/ath6kl/
  else
  include $(KLIB_BUILD)/.config
  endif
-@@ -295,19 +294,18 @@ CONFIG_IPW2200_QOS=y
+@@ -314,7 +313,8 @@ CONFIG_IPW2200_QOS=y
  # % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface
  endif #CONFIG_WIRELESS_EXT
  
 -ifdef CONFIG_SSB
--# Sonics Silicon Backplane
--CONFIG_SSB_SPROM=y
--
--CONFIG_SSB_BLOCKIO=y
--CONFIG_SSB_PCIHOST=y
--CONFIG_SSB_B43_PCI_BRIDGE=y
--ifdef CONFIG_PCMCIA
--CONFIG_SSB_PCMCIAHOST=y
--endif #CONFIG_PCMCIA
--# CONFIG_SSB_DEBUG=y
--CONFIG_SSB_DRIVER_PCICORE=y
++# disabled
++ifdef __CONFIG_SSB
+ # Sonics Silicon Backplane
+ CONFIG_SSB_SPROM=y
+@@ -327,7 +327,7 @@ endif #CONFIG_PCMCIA
+ # CONFIG_SSB_DEBUG=y
+ CONFIG_SSB_DRIVER_PCICORE=y
+ CONFIG_B43_SSB=y
 -endif #CONFIG_SSB
-+# ifdef CONFIG_SSB
-+# # Sonics Silicon Backplane
-+# CONFIG_SSB_SPROM=y
-+# CONFIG_SSB_BLOCKIO=y
-+# CONFIG_SSB_PCIHOST=y
-+# CONFIG_SSB_B43_PCI_BRIDGE=y
-+# ifdef CONFIG_PCMCIA
-+# CONFIG_SSB_PCMCIAHOST=y
-+# endif #CONFIG_PCMCIA
-+# # CONFIG_SSB_DEBUG=y
-+# CONFIG_SSB_DRIVER_PCICORE=y
-+# endif #CONFIG_SSB
- CONFIG_P54_PCI=m
-@@ -502,7 +500,6 @@ endif #CONFIG_SPI_MASTER end of SPI driv
++endif #__CONFIG_SSB
+ CONFIG_BCMA=m
+ CONFIG_BCMA_BLOCKIO=y
+@@ -534,7 +534,6 @@ endif #CONFIG_SPI_MASTER end of SPI driv
  
  ifdef CONFIG_MMC
  
diff --git a/package/mac80211/patches/006-disable_bcma_build.patch b/package/mac80211/patches/006-disable_bcma_build.patch
new file mode 100644 (file)
index 0000000..5835ea2
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/config.mk
++++ b/config.mk
+@@ -329,9 +329,9 @@ CONFIG_SSB_DRIVER_PCICORE=y
+ CONFIG_B43_SSB=y
+ endif #__CONFIG_SSB
+-CONFIG_BCMA=m
+-CONFIG_BCMA_BLOCKIO=y
+-CONFIG_BCMA_HOST_PCI=y
++# CONFIG_BCMA=m
++# CONFIG_BCMA_BLOCKIO=y
++# CONFIG_BCMA_HOST_PCI=y
+ # CONFIG_BCMA_DEBUG=y
+ # CONFIG_B43_BCMA=y
index 662302292a95fee9ce1f7d02889eb7c7a8b8e4b5..37c03f2eef46715616c66d7b5625e1e8b625a3b3 100644 (file)
@@ -1,15 +1,15 @@
 --- a/config.mk
 +++ b/config.mk
-@@ -199,7 +199,7 @@ $(warning "WARNING: CONFIG_CFG80211_WEXT
+@@ -212,7 +212,7 @@ $(warning "WARNING: CONFIG_CFG80211_WEXT
  endif #CONFIG_WIRELESS_EXT
  
  ifdef CONFIG_STAGING
--CONFIG_COMPAT_STAGING=y
-+# CONFIG_COMPAT_STAGING=y
+-CONFIG_COMPAT_STAGING=m
++# CONFIG_COMPAT_STAGING=m
  endif #CONFIG_STAGING
  
  # mac80211 test driver
-@@ -337,13 +337,13 @@ endif #CONFIG_CRC_ITU_T
+@@ -365,13 +365,13 @@ endif #CONFIG_CRC_ITU_T
  CONFIG_MWL8K=m
  
  # Ethernet drivers go here
 +# CONFIG_ATL1=m
 +# CONFIG_ATL2=m
 +# CONFIG_ATL1E=m
- ifdef CONFIG_COMPAT_KERNEL_27
+ ifdef CONFIG_COMPAT_KERNEL_2_6_27
 -CONFIG_ATL1C=n
 +# CONFIG_ATL1C=n
- else #CONFIG_COMPAT_KERNEL_27
+ else #CONFIG_COMPAT_KERNEL_2_6_27
 -CONFIG_ATL1C=m
 +# CONFIG_ATL1C=m
- endif #CONFIG_COMPAT_KERNEL_27
+ endif #CONFIG_COMPAT_KERNEL_2_6_27
  
  ifdef CONFIG_WIRELESS_EXT
-@@ -398,21 +398,21 @@ endif #CONFIG_COMPAT_KERNEL_29
+@@ -431,21 +431,21 @@ endif #CONFIG_COMPAT_KERNEL_2_6_29
  # Note: this depends on CONFIG_USB_NET_RNDIS_HOST and CONFIG_USB_NET_CDCETHER
  # it also requires new RNDIS_HOST and CDC_ETHER modules which we add
- ifdef CONFIG_COMPAT_KERNEL_29
+ ifdef CONFIG_COMPAT_KERNEL_2_6_29
 -CONFIG_USB_COMPAT_USBNET=n
 -CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
 -CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
@@ -40,7 +40,7 @@
 +# CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
 +# CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
 +# CONFIG_USB_NET_COMPAT_CDCETHER=n
- else #CONFIG_COMPAT_KERNEL_29
+ else #CONFIG_COMPAT_KERNEL_2_6_29
 -CONFIG_USB_COMPAT_USBNET=m
 +# CONFIG_USB_COMPAT_USBNET=m
  ifdef CONFIG_USB_NET_CDCETHER
@@ -57,6 +57,6 @@
  endif #CONFIG_USB_NET_CDCETHER
 -CONFIG_USB_NET_COMPAT_CDCETHER=m
 +# CONFIG_USB_NET_COMPAT_CDCETHER=m
- endif #CONFIG_COMPAT_KERNEL_29
+ endif #CONFIG_COMPAT_KERNEL_2_6_29
  
  
index 6c421b022c5ea3841c5103187d1a02512ab251d2..ed67de27c98984bf57a2281451c023de52e0d00c 100644 (file)
@@ -1,6 +1,6 @@
 --- a/config.mk
 +++ b/config.mk
-@@ -42,23 +42,6 @@ $(error "ERROR: Your 2.6.27 kernel has C
+@@ -50,23 +50,6 @@ $(error "ERROR: Your 2.6.27 kernel has C
  endif
  endif
  
@@ -15,7 +15,7 @@
 -#
 -# In kernel 2.6.32 both attributes were removed.
 -#
--ifeq ($(shell test $(KERNEL_SUBLEVEL) -ge 27 -a $(KERNEL_SUBLEVEL) -le 31 && echo yes),yes)
+-ifeq ($(shell test $(KERNEL_VERSION) -eq 2 -a $(KERNEL_SUBLEVEL) -ge 27 -a $(KERNEL_SUBLEVEL) -le 31 && echo yes),yes)
 -ifeq ($(CONFIG_MAC80211),)
 -$(error "ERROR: Your >=2.6.27 and <= 2.6.31 kernel has CONFIG_MAC80211 disabled, you should have it CONFIG_MAC80211=m if you want to use this thing.")
 -endif
@@ -23,4 +23,4 @@
 -
  ifneq ($(KERNELRELEASE),) # This prevents a warning
  
- ifeq ($(CONFIG_NET_SCHED),)
+ # We will warn when you don't have MQ support or NET_SCHED enabled.
index c7457c856b40e1b6166af7b23470ba9538ac20d8..f6b89d86bc9e159211e5d4ce7d751a37bfa82595 100644 (file)
@@ -9,7 +9,7 @@
  else
  include $(KLIB_BUILD)/.config
  endif
-@@ -229,7 +229,7 @@ CONFIG_B43=m
+@@ -247,7 +247,7 @@ CONFIG_B43=m
  CONFIG_B43_HWRNG=y
  CONFIG_B43_PCI_AUTOSELECT=y
  ifdef CONFIG_PCMCIA
index 4a787553efd28fc374339bd9cd284a21c5632485..857020ec52728b037d18c7662147a11ed95b7828 100644 (file)
@@ -1,6 +1,6 @@
 --- a/config.mk
 +++ b/config.mk
-@@ -483,7 +483,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv
+@@ -517,7 +517,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv
  
  ifdef CONFIG_MMC
  
index b5c47593feac4b662d1b314d72ee5dc6b2fd462e..63ae11df71e0a0c0220a10f4990db59b8b5f61cd 100644 (file)
@@ -1,11 +1,11 @@
 --- a/config.mk
 +++ b/config.mk
-@@ -235,7 +235,7 @@ ifdef CONFIG_MAC80211_LEDS
+@@ -253,7 +253,7 @@ ifdef CONFIG_MAC80211_LEDS
  CONFIG_B43_LEDS=y
  endif #CONFIG_MAC80211_LEDS
  CONFIG_B43_PHY_LP=y
 -CONFIG_B43_PHY_N=y
 +# CONFIG_B43_PHY_N=y
+ # CONFIG_B43_PHY_HT=y
  # CONFIG_B43_FORCE_PIO=y
  # CONFIG_B43_DEBUG=y
index 04c7ae09d75c5f582b79d2bb62e3e38348a24594..86556d7a47d4a2f5790cbef2e3f9adea1d00d24a 100644 (file)
@@ -1,6 +1,6 @@
 --- a/config.mk
 +++ b/config.mk
-@@ -299,7 +299,7 @@ CONFIG_RTL8180=m
+@@ -327,7 +327,7 @@ CONFIG_RTL8180=m
  
  CONFIG_ADM8211=m
  
@@ -9,8 +9,8 @@
  CONFIG_RT2400PCI=m
  CONFIG_RT2500PCI=m
  ifdef CONFIG_CRC_CCITT
-@@ -432,7 +432,7 @@ CONFIG_RT2800USB=m
- # CONFIG_RT2800USB_RT35XX=y
+@@ -466,7 +466,7 @@ CONFIG_RT2800USB_RT35XX=y
+ # CONFIG_RT2800USB_RT53XX=y
  CONFIG_RT2800USB_UNKNOWN=y
  endif #CONFIG_CRC_CCITT
 -CONFIG_RT2X00_LIB_USB=m
index 83431b3ad7a69e987d8506dbb608341587c65dc0..b003f4c52559d13274419c6f1e75143f870bd104 100644 (file)
@@ -1,6 +1,6 @@
 --- a/config.mk
 +++ b/config.mk
-@@ -111,7 +111,7 @@ CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
+@@ -124,7 +124,7 @@ CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
  # This is the one used by our compat-wireless net/mac80211/rate.c
  # in case you have and old kernel which is overriding this to pid.
  CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstrel_ht
index b21358aad8159ad04b9e2d495d53ca5c82a8e28f..d27528316604afd039ff05c3525cec6734fb9e90 100644 (file)
@@ -1,6 +1,6 @@
 --- a/config.mk
 +++ b/config.mk
-@@ -202,7 +202,7 @@ CONFIG_ATH9K_COMMON=m
+@@ -219,7 +219,7 @@ CONFIG_ATH9K_COMMON=m
  # as default once we get minstrel properly tested and blessed by
  # our systems engineering team. CCK rates also need to be used
  # for long range considerations.
index 2cbc0f95e9a1e5cd87e43c6d6d38acc316101cc7..960a65b915c1b3dda2e48f489589013a0ef4f540 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/b43/main.c
 +++ b/drivers/net/wireless/b43/main.c
-@@ -322,83 +322,59 @@ static int b43_ratelimit(struct b43_wl *
+@@ -334,83 +334,59 @@ static int b43_ratelimit(struct b43_wl *
  
  void b43info(struct b43_wl *wl, const char *fmt, ...)
  {
index a6505eaf711a41681290e9247f317efd1023abcd..07e30549c422634efd9211952d733f6abd995c7f 100644 (file)
@@ -1,11 +1,11 @@
 --- a/config.mk
 +++ b/config.mk
-@@ -207,7 +207,7 @@ CONFIG_ATH9K_COMMON=m
+@@ -224,7 +224,7 @@ CONFIG_ATH9K_COMMON=m
  # PCI Drivers
  ifdef CONFIG_PCI
  
 -CONFIG_ATH5K_PCI=y
 +# CONFIG_ATH5K_PCI=y
- CONFIG_ATH9K=m
+ CONFIG_ATH9K_PCI=y
  
  CONFIG_IWLAGN=m
diff --git a/package/mac80211/patches/020-netlink_seq.patch b/package/mac80211/patches/020-netlink_seq.patch
new file mode 100644 (file)
index 0000000..2897b40
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -3728,7 +3728,9 @@ static int nl80211_dump_scan(struct sk_b
+       spin_lock_bh(&rdev->bss_lock);
+       cfg80211_bss_expire(rdev);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+       cb->seq = rdev->bss_generation;
++#endif
+       list_for_each_entry(scan, &rdev->bss_list, list) {
+               if (++idx <= start)
diff --git a/package/mac80211/patches/021-add_include_for_bcma.patch b/package/mac80211/patches/021-add_include_for_bcma.patch
new file mode 100644 (file)
index 0000000..6d1bc64
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/include/linux/compat-3.0.h
++++ b/include/linux/compat-3.0.h
+@@ -5,6 +5,8 @@
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0))
++#include <linux/mod_devicetable.h>
++
+ /*
+  * since commit 1c5cae815d19ffe02bdfda1260949ef2b1806171
+  * "net: call dev_alloc_name from register_netdevice" dev_alloc_name is
index 654c2a8bc7fa5d91138d9d6fa7721a76dbb0e1b8..fc5d4d63fb3c7a961cf4781f82c9b2033d9cc920 100644 (file)
@@ -1,14 +1,14 @@
 --- a/compat/compat-2.6.39.c
 +++ b/compat/compat-2.6.39.c
-@@ -11,6 +11,7 @@
- #include <linux/compat.h>
+@@ -12,6 +12,7 @@
  #include <linux/tty.h>
+ #include <linux/sched.h>
  
 +#ifdef CONFIG_COMPAT_BLUETOOTH
  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
  /*
   *            Termios Helper Methods
-@@ -110,4 +111,4 @@ int tty_set_termios(struct tty_struct *t
+@@ -111,4 +112,4 @@ int tty_set_termios(struct tty_struct *t
  }
  EXPORT_SYMBOL_GPL(tty_set_termios);
  #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) */
diff --git a/package/mac80211/patches/040-compat_backports.patch b/package/mac80211/patches/040-compat_backports.patch
deleted file mode 100644 (file)
index aea7039..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
---- a/compat/compat-2.6.32.c
-+++ b/compat/compat-2.6.32.c
-@@ -117,3 +117,100 @@ void __dev_addr_unsync(struct dev_addr_l
- }
- EXPORT_SYMBOL_GPL(__dev_addr_unsync);
-+/*
-+ * Nonzero if YEAR is a leap year (every 4 years,
-+ * except every 100th isn't, and every 400th is).
-+ */
-+static int __isleap(long year)
-+{
-+      return (year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0);
-+}
-+
-+/* do a mathdiv for long type */
-+static long math_div(long a, long b)
-+{
-+      return a / b - (a % b < 0);
-+}
-+
-+/* How many leap years between y1 and y2, y1 must less or equal to y2 */
-+static long leaps_between(long y1, long y2)
-+{
-+      long leaps1 = math_div(y1 - 1, 4) - math_div(y1 - 1, 100)
-+              + math_div(y1 - 1, 400);
-+      long leaps2 = math_div(y2 - 1, 4) - math_div(y2 - 1, 100)
-+              + math_div(y2 - 1, 400);
-+      return leaps2 - leaps1;
-+}
-+
-+/* How many days come before each month (0-12). */
-+static const unsigned short __mon_yday[2][13] = {
-+      /* Normal years. */
-+      {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365},
-+      /* Leap years. */
-+      {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366}
-+};
-+
-+#define SECS_PER_HOUR (60 * 60)
-+#define SECS_PER_DAY  (SECS_PER_HOUR * 24)
-+
-+/**
-+ * time_to_tm - converts the calendar time to local broken-down time
-+ *
-+ * @totalsecs the number of seconds elapsed since 00:00:00 on January 1, 1970,
-+ *            Coordinated Universal Time (UTC).
-+ * @offset    offset seconds adding to totalsecs.
-+ * @result    pointer to struct tm variable to receive broken-down time
-+ */
-+void time_to_tm(time_t totalsecs, int offset, struct tm *result)
-+{
-+      long days, rem, y;
-+      const unsigned short *ip;
-+
-+      days = totalsecs / SECS_PER_DAY;
-+      rem = totalsecs % SECS_PER_DAY;
-+      rem += offset;
-+      while (rem < 0) {
-+              rem += SECS_PER_DAY;
-+              --days;
-+      }
-+      while (rem >= SECS_PER_DAY) {
-+              rem -= SECS_PER_DAY;
-+              ++days;
-+      }
-+
-+      result->tm_hour = rem / SECS_PER_HOUR;
-+      rem %= SECS_PER_HOUR;
-+      result->tm_min = rem / 60;
-+      result->tm_sec = rem % 60;
-+
-+      /* January 1, 1970 was a Thursday. */
-+      result->tm_wday = (4 + days) % 7;
-+      if (result->tm_wday < 0)
-+              result->tm_wday += 7;
-+
-+      y = 1970;
-+
-+      while (days < 0 || days >= (__isleap(y) ? 366 : 365)) {
-+              /* Guess a corrected year, assuming 365 days per year. */
-+              long yg = y + math_div(days, 365);
-+
-+              /* Adjust DAYS and Y to match the guessed year. */
-+              days -= (yg - y) * 365 + leaps_between(y, yg);
-+              y = yg;
-+      }
-+
-+      result->tm_year = y - 1900;
-+
-+      result->tm_yday = days;
-+
-+      ip = __mon_yday[__isleap(y)];
-+      for (y = 11; days < ip[y]; y--)
-+              continue;
-+      days -= ip[y];
-+
-+      result->tm_mon = y;
-+      result->tm_mday = days + 1;
-+}
-+EXPORT_SYMBOL(time_to_tm);
-+/* source: kernel/time/timeconv.c*/
-+
---- a/compat/compat-2.6.39.c
-+++ b/compat/compat-2.6.39.c
-@@ -10,6 +10,7 @@
- #include <linux/compat.h>
- #include <linux/tty.h>
-+#include <linux/sched.h>
- #ifdef CONFIG_COMPAT_BLUETOOTH
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
---- a/compat/kstrtox.c
-+++ b/compat/kstrtox.c
-@@ -11,6 +11,14 @@
-  *
-  * If -E is returned, result is not touched.
-  */
-+#include <linux/kernel.h>
-+/* 
-+ * kstrto* was included in kernel 2.6.38.4 and causes conflicts with the
-+ * version included in compat-wireless. We use strict_strtol to check if
-+ * kstrto* is already available.
-+ */
-+#ifndef strict_strtol
-+
- #include <linux/ctype.h>
- #include <linux/errno.h>
- #include <linux/kernel.h>
-@@ -225,3 +233,4 @@ int kstrtos8(const char *s, unsigned int
-       return 0;
- }
- EXPORT_SYMBOL(kstrtos8);
-+#endif /* #ifndef strict_strtol */
---- a/include/linux/compat-2.6.32.h
-+++ b/include/linux/compat-2.6.32.h
-@@ -96,6 +96,34 @@ struct dev_pm_ops name = { \
- #define lockdep_assert_held(l)                        do { } while (0)
-+/*
-+ * Similar to the struct tm in userspace <time.h>, but it needs to be here so
-+ * that the kernel source is self contained.
-+ */
-+struct tm {
-+      /*
-+       * the number of seconds after the minute, normally in the range
-+       * 0 to 59, but can be up to 60 to allow for leap seconds
-+       */
-+      int tm_sec;
-+      /* the number of minutes after the hour, in the range 0 to 59*/
-+      int tm_min;
-+      /* the number of hours past midnight, in the range 0 to 23 */
-+      int tm_hour;
-+      /* the day of the month, in the range 1 to 31 */
-+      int tm_mday;
-+      /* the number of months since January, in the range 0 to 11 */
-+      int tm_mon;
-+      /* the number of years since 1900 */
-+      long tm_year;
-+      /* the number of days since Sunday, in the range 0 to 6 */
-+      int tm_wday;
-+      /* the number of days since January 1, in the range 0 to 365 */
-+      int tm_yday;
-+};
-+
-+void time_to_tm(time_t totalsecs, int offset, struct tm *result);
-+
- #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) */
- #endif /* LINUX_26_32_COMPAT_H */
---- a/include/linux/compat-2.6.39.h
-+++ b/include/linux/compat-2.6.39.h
-@@ -94,6 +94,12 @@ static inline struct msi_desc *irq_desc_
- }
- #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) */
-+/* 
-+ * kstrto* was included in kernel 2.6.38.4 and causes conflicts with the
-+ * version included in compat-wireless. We use strict_strtol to check if
-+ * kstrto* is already available.
-+ */
-+#ifndef strict_strtol
- /* Internal, do not use. */
- int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);
- int __must_check _kstrtol(const char *s, unsigned int base, long *res);
-@@ -153,6 +159,7 @@ int __must_check kstrtou16(const char *s
- int __must_check kstrtos16(const char *s, unsigned int base, s16 *res);
- int __must_check kstrtou8(const char *s, unsigned int base, u8 *res);
- int __must_check kstrtos8(const char *s, unsigned int base, s8 *res);
-+#endif /* ifndef strict_strtol */
- #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */
diff --git a/package/mac80211/patches/070-add_eeprom_def.patch b/package/mac80211/patches/070-add_eeprom_def.patch
deleted file mode 100644 (file)
index 70e784c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/include/linux/compat-2.6.36.h
-+++ b/include/linux/compat-2.6.36.h
-@@ -120,6 +120,9 @@ static inline void tty_unlock(void) __re
- #define tty_locked()           (kernel_locked())
- #define usleep_range(_min, _max)      msleep((_max) / 1000)
-+
-+#define PCI_EEPROM_WIDTH_93C86        8
-+
- #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
- #endif /* LINUX_26_36_COMPAT_H */
index 737a2d2592e45f4c51bf82aeb7531a64fad6acea..5738dd023e9bc21b9f64c9d43d31447cdf864c9d 100644 (file)
@@ -33,7 +33,7 @@
  #endif
 --- a/config.mk
 +++ b/config.mk
-@@ -419,7 +419,7 @@ endif #CONFIG_COMPAT_KERNEL_29
+@@ -452,7 +452,7 @@ endif #CONFIG_COMPAT_KERNEL_2_6_29
  # This activates a threading fix for usb urb.
  # this is mainline commit: b3e670443b7fb8a2d29831b62b44a039c283e351
  # This fix will be included in some stable releases.
index 595c6b7de1d85aa44970137e5f24965fba549271..6de5fd6dd5778f386200e235294239781cb4b568 100644 (file)
  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  
  #include <linux/kernel.h>
+--- a/drivers/net/wireless/libertas/cfg.c
++++ b/drivers/net/wireless/libertas/cfg.c
+@@ -6,6 +6,7 @@
+  *
+  */
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+ #include <linux/sched.h>
+--- a/drivers/net/wireless/libertas/if_cs.c
++++ b/drivers/net/wireless/libertas/if_cs.c
+@@ -21,6 +21,7 @@
+ */
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+ #include <linux/module.h>
+--- a/drivers/net/wireless/libertas/if_sdio.c
++++ b/drivers/net/wireless/libertas/if_sdio.c
+@@ -26,6 +26,7 @@
+  * if_sdio_card_to_host() to pad the data.
+  */
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+ #include <linux/kernel.h>
+--- a/drivers/net/wireless/libertas/if_spi.c
++++ b/drivers/net/wireless/libertas/if_spi.c
+@@ -17,6 +17,7 @@
+  * (at your option) any later version.
+  */
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+ #include <linux/moduleparam.h>
+--- a/drivers/net/wireless/libertas/if_usb.c
++++ b/drivers/net/wireless/libertas/if_usb.c
+@@ -2,6 +2,7 @@
+  * This file contains functions used in USB interface module.
+  */
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+ #include <linux/delay.h>
+--- a/drivers/net/wireless/libertas/main.c
++++ b/drivers/net/wireless/libertas/main.c
+@@ -4,6 +4,7 @@
+  * thread etc..
+  */
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+ #include <linux/moduleparam.h>
+--- a/drivers/net/wireless/libertas/mesh.c
++++ b/drivers/net/wireless/libertas/mesh.c
+@@ -1,3 +1,4 @@
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+ #include <linux/delay.h>
+--- a/drivers/net/wireless/libertas/rx.c
++++ b/drivers/net/wireless/libertas/rx.c
+@@ -2,6 +2,7 @@
+  * This file contains the handling of RX in wlan driver.
+  */
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+ #include <linux/etherdevice.h>
index f06e9df99b29413504f571459870586e25fb54c5..0900596dc980c44360dddf8c6b33304c00cd13c8 100644 (file)
---- a/net/wireless/reg.c
-+++ b/net/wireless/reg.c
-@@ -1456,7 +1456,8 @@ static void reg_process_hint(struct regu
-        * We only time out user hints, given that they should be the only
-        * source of bogus requests.
-        */
--      if (reg_request->initiator == NL80211_REGDOM_SET_BY_USER)
-+      if (r != -EALREADY &&
-+          reg_request->initiator == NL80211_REGDOM_SET_BY_USER)
-               schedule_delayed_work(&reg_timeout, msecs_to_jiffies(3142));
- }
+--- a/net/mac80211/agg-rx.c
++++ b/net/mac80211/agg-rx.c
+@@ -176,6 +176,8 @@ static void ieee80211_send_addba_resp(st
+               memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
+       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
+               memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
++      else if (sdata->vif.type == NL80211_IFTYPE_WDS)
++              memcpy(mgmt->bssid, da, ETH_ALEN);
+       mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
+                                         IEEE80211_STYPE_ACTION);
+@@ -262,7 +264,11 @@ void ieee80211_process_addba_request(str
+                               "%pM on tid %u\n",
+                               mgmt->sa, tid);
+ #endif /* CONFIG_MAC80211_HT_DEBUG */
+-              goto end;
++
++              /* delete existing Rx BA session on the same tid */
++              ___ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_RECIPIENT,
++                                              WLAN_STATUS_UNSPECIFIED_QOS,
++                                              false);
+       }
  
---- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
-@@ -18,13 +18,13 @@
- #include "hw-ops.h"
- #include "ar9003_phy.h"
--#define MPASS 3
- #define MAX_MEASUREMENT       8
--#define MAX_DIFFERENCE        10
-+#define MAX_MAG_DELTA 11
-+#define MAX_PHS_DELTA 10
- struct coeff {
--      int mag_coeff[AR9300_MAX_CHAINS][MAX_MEASUREMENT][MPASS];
--      int phs_coeff[AR9300_MAX_CHAINS][MAX_MEASUREMENT][MPASS];
-+      int mag_coeff[AR9300_MAX_CHAINS][MAX_MEASUREMENT];
-+      int phs_coeff[AR9300_MAX_CHAINS][MAX_MEASUREMENT];
-       int iqc_coeff[2];
- };
-@@ -608,36 +608,48 @@ static bool ar9003_hw_calc_iq_corr(struc
-       return true;
+       /* prepare A-MPDU MLME for Rx aggregation */
+--- a/net/mac80211/agg-tx.c
++++ b/net/mac80211/agg-tx.c
+@@ -79,7 +79,8 @@ static void ieee80211_send_addba_request
+       memcpy(mgmt->da, da, ETH_ALEN);
+       memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
+       if (sdata->vif.type == NL80211_IFTYPE_AP ||
+-          sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
++          sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
++          sdata->vif.type == NL80211_IFTYPE_WDS)
+               memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
+       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
+               memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+@@ -398,7 +399,8 @@ int ieee80211_start_tx_ba_session(struct
+        */
+       if (sdata->vif.type != NL80211_IFTYPE_STATION &&
+           sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
+-          sdata->vif.type != NL80211_IFTYPE_AP)
++          sdata->vif.type != NL80211_IFTYPE_AP &&
++          sdata->vif.type != NL80211_IFTYPE_WDS)
+               return -EINVAL;
+       if (test_sta_flags(sta, WLAN_STA_BLOCK_BA)) {
+--- a/net/mac80211/debugfs_sta.c
++++ b/net/mac80211/debugfs_sta.c
+@@ -59,7 +59,7 @@ static ssize_t sta_flags_read(struct fil
+       char buf[100];
+       struct sta_info *sta = file->private_data;
+       u32 staflags = get_sta_flags(sta);
+-      int res = scnprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s",
++      int res = scnprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s",
+               staflags & WLAN_STA_AUTH ? "AUTH\n" : "",
+               staflags & WLAN_STA_ASSOC ? "ASSOC\n" : "",
+               staflags & WLAN_STA_PS_STA ? "PS (sta)\n" : "",
+@@ -67,7 +67,6 @@ static ssize_t sta_flags_read(struct fil
+               staflags & WLAN_STA_AUTHORIZED ? "AUTHORIZED\n" : "",
+               staflags & WLAN_STA_SHORT_PREAMBLE ? "SHORT PREAMBLE\n" : "",
+               staflags & WLAN_STA_WME ? "WME\n" : "",
+-              staflags & WLAN_STA_WDS ? "WDS\n" : "",
+               staflags & WLAN_STA_MFP ? "MFP\n" : "");
+       return simple_read_from_buffer(userbuf, count, ppos, buf, res);
  }
--static bool ar9003_hw_compute_closest_pass_and_avg(int *mp_coeff, int *mp_avg)
-+static void ar9003_hw_detect_outlier(int *mp_coeff, int nmeasurement,
-+                                   int max_delta)
+--- a/net/mac80211/iface.c
++++ b/net/mac80211/iface.c
+@@ -178,7 +178,6 @@ static int ieee80211_do_open(struct net_
  {
--      int diff[MPASS];
+       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+       struct ieee80211_local *local = sdata->local;
+-      struct sta_info *sta;
+       u32 changed = 0;
+       int res;
+       u32 hw_reconf_flags = 0;
+@@ -290,27 +289,6 @@ static int ieee80211_do_open(struct net_
+       set_bit(SDATA_STATE_RUNNING, &sdata->state);
+-      if (sdata->vif.type == NL80211_IFTYPE_WDS) {
+-              /* Create STA entry for the WDS peer */
+-              sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
+-                                   GFP_KERNEL);
+-              if (!sta) {
+-                      res = -ENOMEM;
+-                      goto err_del_interface;
+-              }
 -
--      diff[0] = abs(mp_coeff[0] - mp_coeff[1]);
--      diff[1] = abs(mp_coeff[1] - mp_coeff[2]);
--      diff[2] = abs(mp_coeff[2] - mp_coeff[0]);
+-              /* no locking required since STA is not live yet */
+-              sta->flags |= WLAN_STA_AUTHORIZED;
 -
--      if (diff[0] > MAX_DIFFERENCE &&
--          diff[1] > MAX_DIFFERENCE &&
--          diff[2] > MAX_DIFFERENCE)
--              return false;
+-              res = sta_info_insert(sta);
+-              if (res) {
+-                      /* STA has been freed */
+-                      goto err_del_interface;
+-              }
 -
--      if (diff[0] <= diff[1] && diff[0] <= diff[2])
--              *mp_avg = (mp_coeff[0] + mp_coeff[1]) / 2;
--      else if (diff[1] <= diff[2])
--              *mp_avg = (mp_coeff[1] + mp_coeff[2]) / 2;
--      else
--              *mp_avg = (mp_coeff[2] + mp_coeff[0]) / 2;
-+      int mp_max = -64, max_idx = 0;
-+      int mp_min = 63, min_idx = 0;
-+      int mp_avg = 0, i, outlier_idx = 0;
+-              rate_control_rate_init(sta);
+-      }
+-
+       /*
+        * set_multicast_list will be invoked by the networking core
+        * which will check whether any increments here were done in
+@@ -344,8 +322,7 @@ static int ieee80211_do_open(struct net_
+       netif_tx_start_all_queues(dev);
+       return 0;
+- err_del_interface:
+-      drv_remove_interface(local, &sdata->vif);
 +
-+      /* find min/max mismatch across all calibrated gains */
-+      for (i = 0; i < nmeasurement; i++) {
-+              mp_avg += mp_coeff[i];
-+              if (mp_coeff[i] > mp_max) {
-+                      mp_max = mp_coeff[i];
-+                      max_idx = i;
-+              } else if (mp_coeff[i] < mp_min) {
-+                      mp_min = mp_coeff[i];
-+                      min_idx = i;
-+              }
-+      }
+  err_stop:
+       if (!local->open_count)
+               drv_stop(local);
+@@ -718,6 +695,70 @@ static void ieee80211_if_setup(struct ne
+       dev->destructor = free_netdev;
+ }
  
--      return true;
-+      /* find average (exclude max abs value) */
-+      for (i = 0; i < nmeasurement; i++) {
-+              if ((abs(mp_coeff[i]) < abs(mp_max)) ||
-+                  (abs(mp_coeff[i]) < abs(mp_min)))
-+                      mp_avg += mp_coeff[i];
++static void ieee80211_wds_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
++                                       struct sk_buff *skb)
++{
++      struct ieee80211_local *local = sdata->local;
++      struct ieee80211_rx_status *rx_status;
++      struct ieee802_11_elems elems;
++      struct ieee80211_mgmt *mgmt;
++      struct sta_info *sta;
++      size_t baselen;
++      u32 rates = 0;
++      u16 stype;
++      bool new = false;
++      enum ieee80211_band band = local->hw.conf.channel->band;
++      struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band];
++
++      rx_status = IEEE80211_SKB_RXCB(skb);
++      mgmt = (struct ieee80211_mgmt *) skb->data;
++      stype = le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE;
++
++      if (stype != IEEE80211_STYPE_BEACON)
++              return;
++
++      baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
++      if (baselen > skb->len)
++              return;
++
++      ieee802_11_parse_elems(mgmt->u.probe_resp.variable,
++                             skb->len - baselen, &elems);
++
++      rates = ieee80211_sta_get_rates(local, &elems, band);
++
++      rcu_read_lock();
++
++      sta = sta_info_get(sdata, sdata->u.wds.remote_addr);
++
++      if (!sta) {
++              rcu_read_unlock();
++              sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
++                                   GFP_KERNEL);
++              if (!sta)
++                      return;
++
++              new = true;
 +      }
-+      mp_avg /= (nmeasurement - 1);
 +
-+      /* detect outlier */
-+      if (abs(mp_max - mp_min) > max_delta) {
-+              if (abs(mp_max - mp_avg) > abs(mp_min - mp_avg))
-+                      outlier_idx = max_idx;
-+              else
-+                      outlier_idx = min_idx;
++      sta->last_rx = jiffies;
++      sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
++
++      if (elems.ht_cap_elem)
++              ieee80211_ht_cap_ie_to_sta_ht_cap(sband,
++                              elems.ht_cap_elem, &sta->sta.ht_cap);
++
++      if (elems.wmm_param)
++              set_sta_flags(sta, WLAN_STA_WME);
++
++      if (new) {
++              sta->flags = WLAN_STA_AUTHORIZED;
++              rate_control_rate_init(sta);
++              sta_info_insert_rcu(sta);
 +      }
-+      mp_coeff[outlier_idx] = mp_avg;
- }
- static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
-                                                u8 num_chains,
-                                                struct coeff *coeff)
++
++      rcu_read_unlock();
++}
++
+ static void ieee80211_iface_work(struct work_struct *work)
  {
--      struct ath_common *common = ath9k_hw_common(ah);
-       int i, im, nmeasurement;
--      int magnitude, phase;
-       u32 tx_corr_coeff[MAX_MEASUREMENT][AR9300_MAX_CHAINS];
-       memset(tx_corr_coeff, 0, sizeof(tx_corr_coeff));
-@@ -657,37 +669,28 @@ static void ar9003_hw_tx_iqcal_load_avg_
-       /* Load the average of 2 passes */
-       for (i = 0; i < num_chains; i++) {
--              if (AR_SREV_9485(ah))
--                      nmeasurement = REG_READ_FIELD(ah,
--                                      AR_PHY_TX_IQCAL_STATUS_B0_9485,
--                                      AR_PHY_CALIBRATED_GAINS_0);
--              else
--                      nmeasurement = REG_READ_FIELD(ah,
--                                      AR_PHY_TX_IQCAL_STATUS_B0,
--                                      AR_PHY_CALIBRATED_GAINS_0);
-+              nmeasurement = REG_READ_FIELD(ah,
-+                              AR_PHY_TX_IQCAL_STATUS_B0,
-+                              AR_PHY_CALIBRATED_GAINS_0);
-               if (nmeasurement > MAX_MEASUREMENT)
-                       nmeasurement = MAX_MEASUREMENT;
--              for (im = 0; im < nmeasurement; im++) {
--                      /*
--                       * Determine which 2 passes are closest and compute avg
--                       * magnitude
--                       */
--                      if (!ar9003_hw_compute_closest_pass_and_avg(coeff->mag_coeff[i][im],
--                                                                  &magnitude))
--                              goto disable_txiqcal;
-+              /* detect outlier only if nmeasurement > 1 */
-+              if (nmeasurement > 1) {
-+                      /* Detect magnitude outlier */
-+                      ar9003_hw_detect_outlier(coeff->mag_coeff[i],
-+                                      nmeasurement, MAX_MAG_DELTA);
+       struct ieee80211_sub_if_data *sdata =
+@@ -822,6 +863,9 @@ static void ieee80211_iface_work(struct 
+                               break;
+                       ieee80211_mesh_rx_queued_mgmt(sdata, skb);
+                       break;
++              case NL80211_IFTYPE_WDS:
++                      ieee80211_wds_rx_queued_mgmt(sdata, skb);
++                      break;
+               default:
+                       WARN(1, "frame for unexpected interface type");
+                       break;
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2137,7 +2137,8 @@ ieee80211_rx_h_action(struct ieee80211_r
+                */
+               if (sdata->vif.type != NL80211_IFTYPE_STATION &&
+                   sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
+-                  sdata->vif.type != NL80211_IFTYPE_AP)
++                  sdata->vif.type != NL80211_IFTYPE_AP &&
++                  sdata->vif.type != NL80211_IFTYPE_WDS)
+                       break;
+               /* verify action_code is present */
+@@ -2335,13 +2336,14 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_
+       if (!ieee80211_vif_is_mesh(&sdata->vif) &&
+           sdata->vif.type != NL80211_IFTYPE_ADHOC &&
+-          sdata->vif.type != NL80211_IFTYPE_STATION)
++          sdata->vif.type != NL80211_IFTYPE_STATION &&
++          sdata->vif.type != NL80211_IFTYPE_WDS)
+               return RX_DROP_MONITOR;
+       switch (stype) {
+       case cpu_to_le16(IEEE80211_STYPE_BEACON):
+       case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP):
+-              /* process for all: mesh, mlme, ibss */
++              /* process for all: mesh, mlme, ibss, wds */
+               break;
+       case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
+       case cpu_to_le16(IEEE80211_STYPE_DISASSOC):
+@@ -2680,10 +2682,16 @@ static int prepare_for_handlers(struct i
+               }
+               break;
+       case NL80211_IFTYPE_WDS:
+-              if (bssid || !ieee80211_is_data(hdr->frame_control))
+-                      return 0;
+               if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2))
+                       return 0;
++
++              if (ieee80211_is_data(hdr->frame_control) ||
++                  ieee80211_is_action(hdr->frame_control)) {
++                      if (compare_ether_addr(sdata->vif.addr, hdr->addr1))
++                              return 0;
++              } else if (!ieee80211_is_beacon(hdr->frame_control))
++                      return 0;
 +
-+                      /* Detect phase outlier */
-+                      ar9003_hw_detect_outlier(coeff->phs_coeff[i],
-+                                      nmeasurement, MAX_PHS_DELTA);
+               break;
+       default:
+               /* should never get here */
+--- a/net/mac80211/sta_info.h
++++ b/net/mac80211/sta_info.h
+@@ -31,7 +31,6 @@
+  *    frames.
+  * @WLAN_STA_ASSOC_AP: We're associated to that station, it is an AP.
+  * @WLAN_STA_WME: Station is a QoS-STA.
+- * @WLAN_STA_WDS: Station is one of our WDS peers.
+  * @WLAN_STA_CLEAR_PS_FILT: Clear PS filter in hardware (using the
+  *    IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next
+  *    frame to this station is transmitted.
+@@ -54,7 +53,6 @@ enum ieee80211_sta_info_flags {
+       WLAN_STA_SHORT_PREAMBLE = 1<<4,
+       WLAN_STA_ASSOC_AP       = 1<<5,
+       WLAN_STA_WME            = 1<<6,
+-      WLAN_STA_WDS            = 1<<7,
+       WLAN_STA_CLEAR_PS_FILT  = 1<<9,
+       WLAN_STA_MFP            = 1<<10,
+       WLAN_STA_BLOCK_BA       = 1<<11,
+--- a/drivers/net/wireless/ath/ath9k/beacon.c
++++ b/drivers/net/wireless/ath/ath9k/beacon.c
+@@ -384,7 +384,9 @@ void ath_beacon_tasklet(unsigned long da
+                       ath_dbg(common, ATH_DBG_BSTUCK,
+                               "beacon is officially stuck\n");
+                       sc->sc_flags |= SC_OP_TSF_RESET;
++                      spin_lock(&sc->sc_pcu_lock);
+                       ath_reset(sc, true);
++                      spin_unlock(&sc->sc_pcu_lock);
+               }
+               return;
+--- a/drivers/net/wireless/ath/ath9k/main.c
++++ b/drivers/net/wireless/ath/ath9k/main.c
+@@ -617,8 +617,11 @@ void ath_hw_check(struct work_struct *wo
+       ath_dbg(common, ATH_DBG_RESET, "Possible baseband hang, "
+               "busy=%d (try %d)\n", busy, sc->hw_busy_count + 1);
+       if (busy >= 99) {
+-              if (++sc->hw_busy_count >= 3)
++              if (++sc->hw_busy_count >= 3) {
++                      spin_lock_bh(&sc->sc_pcu_lock);
+                       ath_reset(sc, true);
++                      spin_unlock_bh(&sc->sc_pcu_lock);
 +              }
+       } else if (busy >= 0)
+               sc->hw_busy_count = 0;
+@@ -637,7 +640,9 @@ static void ath_hw_pll_rx_hang_check(str
+                       /* Rx is hung for more than 500ms. Reset it */
+                       ath_dbg(common, ATH_DBG_RESET,
+                               "Possible RX hang, resetting");
++                      spin_lock_bh(&sc->sc_pcu_lock);
+                       ath_reset(sc, true);
++                      spin_unlock_bh(&sc->sc_pcu_lock);
+                       count = 0;
+               }
+       } else
+@@ -674,7 +679,9 @@ void ath9k_tasklet(unsigned long data)
+       if ((status & ATH9K_INT_FATAL) ||
+           (status & ATH9K_INT_BB_WATCHDOG)) {
++              spin_lock(&sc->sc_pcu_lock);
+               ath_reset(sc, true);
++              spin_unlock(&sc->sc_pcu_lock);
+               return;
+       }
  
--                      /*
--                       * Determine which 2 passes are closest and compute avg
--                       * phase
--                       */
--                      if (!ar9003_hw_compute_closest_pass_and_avg(coeff->phs_coeff[i][im],
--                                                                  &phase))
--                              goto disable_txiqcal;
-+              for (im = 0; im < nmeasurement; im++) {
--                      coeff->iqc_coeff[0] = (magnitude & 0x7f) |
--                                            ((phase & 0x7f) << 7);
-+                      coeff->iqc_coeff[0] = (coeff->mag_coeff[i][im] & 0x7f) |
-+                              ((coeff->phs_coeff[i][im] & 0x7f) << 7);
-                       if ((im % 2) == 0)
-                               REG_RMW_FIELD(ah, tx_corr_coeff[im][i],
-@@ -707,141 +710,37 @@ static void ar9003_hw_tx_iqcal_load_avg_
-       return;
--disable_txiqcal:
--      REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_3,
--                    AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN, 0x0);
--      REG_RMW_FIELD(ah, AR_PHY_RX_IQCAL_CORR_B0,
--                    AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN, 0x0);
--
--      ath_dbg(common, ATH_DBG_CALIBRATE, "TX IQ Cal disabled\n");
- }
+@@ -980,7 +987,6 @@ int ath_reset(struct ath_softc *sc, bool
+       del_timer_sync(&common->ani.timer);
  
--static void ar9003_hw_tx_iq_cal(struct ath_hw *ah)
-+static bool ar9003_hw_tx_iq_cal_run(struct ath_hw *ah)
- {
-       struct ath_common *common = ath9k_hw_common(ah);
--      static const u32 txiqcal_status[AR9300_MAX_CHAINS] = {
--              AR_PHY_TX_IQCAL_STATUS_B0,
--              AR_PHY_TX_IQCAL_STATUS_B1,
--              AR_PHY_TX_IQCAL_STATUS_B2,
--      };
--      static const u32 chan_info_tab[] = {
--              AR_PHY_CHAN_INFO_TAB_0,
--              AR_PHY_CHAN_INFO_TAB_1,
--              AR_PHY_CHAN_INFO_TAB_2,
--      };
--      struct coeff coeff;
--      s32 iq_res[6];
--      s32 i, j, ip, im, nmeasurement;
--      u8 nchains = get_streams(common->tx_chainmask);
--
--      for (ip = 0; ip < MPASS; ip++) {
--              REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_1,
--                            AR_PHY_TX_IQCAQL_CONTROL_1_IQCORR_I_Q_COFF_DELPT,
--                            DELPT);
--              REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_START,
--                            AR_PHY_TX_IQCAL_START_DO_CAL,
--                            AR_PHY_TX_IQCAL_START_DO_CAL);
--
--              if (!ath9k_hw_wait(ah, AR_PHY_TX_IQCAL_START,
--                                 AR_PHY_TX_IQCAL_START_DO_CAL,
--                                 0, AH_WAIT_TIMEOUT)) {
--                      ath_dbg(common, ATH_DBG_CALIBRATE,
--                              "Tx IQ Cal not complete.\n");
--                      goto TX_IQ_CAL_FAILED;
--              }
--
--              nmeasurement = REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_STATUS_B0,
--                                            AR_PHY_CALIBRATED_GAINS_0);
--                      if (nmeasurement > MAX_MEASUREMENT)
--                              nmeasurement = MAX_MEASUREMENT;
--
--              for (i = 0; i < nchains; i++) {
--                      ath_dbg(common, ATH_DBG_CALIBRATE,
--                              "Doing Tx IQ Cal for chain %d.\n", i);
--                      for (im = 0; im < nmeasurement; im++) {
--                              if (REG_READ(ah, txiqcal_status[i]) &
--                                           AR_PHY_TX_IQCAL_STATUS_FAILED) {
--                                      ath_dbg(common, ATH_DBG_CALIBRATE,
--                                              "Tx IQ Cal failed for chain %d.\n", i);
--                                      goto TX_IQ_CAL_FAILED;
--                              }
--
--                              for (j = 0; j < 3; j++) {
--                                      u8 idx = 2 * j,
--                                         offset = 4 * (3 * im + j);
--
--                                      REG_RMW_FIELD(ah, AR_PHY_CHAN_INFO_MEMORY,
--                                                    AR_PHY_CHAN_INFO_TAB_S2_READ,
--                                                    0);
--
--                                      /* 32 bits */
--                                      iq_res[idx] = REG_READ(ah,
--                                                      chan_info_tab[i] +
--                                                      offset);
--
--                                      REG_RMW_FIELD(ah, AR_PHY_CHAN_INFO_MEMORY,
--                                                    AR_PHY_CHAN_INFO_TAB_S2_READ,
--                                                    1);
--
--                                      /* 16 bits */
--                                      iq_res[idx+1] = 0xffff & REG_READ(ah,
--                                                              chan_info_tab[i] +
--                                                              offset);
--
--                                      ath_dbg(common, ATH_DBG_CALIBRATE,
--                                              "IQ RES[%d]=0x%x IQ_RES[%d]=0x%x\n",
--                                              idx, iq_res[idx], idx+1, iq_res[idx+1]);
--                              }
--
--                              if (!ar9003_hw_calc_iq_corr(ah, i, iq_res,
--                                                          coeff.iqc_coeff)) {
--                                      ath_dbg(common, ATH_DBG_CALIBRATE,
--                                              "Failed in calculation of IQ correction.\n");
--                                      goto TX_IQ_CAL_FAILED;
--                              }
--                              coeff.mag_coeff[i][im][ip] =
--                                              coeff.iqc_coeff[0] & 0x7f;
--                              coeff.phs_coeff[i][im][ip] =
--                                              (coeff.iqc_coeff[0] >> 7) & 0x7f;
--
--                              if (coeff.mag_coeff[i][im][ip] > 63)
--                                      coeff.mag_coeff[i][im][ip] -= 128;
--                              if (coeff.phs_coeff[i][im][ip] > 63)
--                                      coeff.phs_coeff[i][im][ip] -= 128;
--
--                      }
--              }
+       ath9k_ps_wakeup(sc);
+-      spin_lock_bh(&sc->sc_pcu_lock);
+       ieee80211_stop_queues(hw);
+@@ -1023,7 +1029,6 @@ int ath_reset(struct ath_softc *sc, bool
+       }
+       ieee80211_wake_queues(hw);
+-      spin_unlock_bh(&sc->sc_pcu_lock);
+       /* Start ANI */
+       if (!common->disable_ani)
+@@ -2326,9 +2331,9 @@ static void ath9k_flush(struct ieee80211
+       ath9k_ps_wakeup(sc);
+       spin_lock_bh(&sc->sc_pcu_lock);
+       drain_txq = ath_drain_all_txq(sc, false);
+-      spin_unlock_bh(&sc->sc_pcu_lock);
+       if (!drain_txq)
+               ath_reset(sc, false);
++      spin_unlock_bh(&sc->sc_pcu_lock);
+       ath9k_ps_restore(sc);
+       ieee80211_wake_queues(hw);
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -565,11 +565,8 @@ static void ath_tx_complete_aggr(struct 
+       rcu_read_unlock();
+-      if (needreset) {
+-              spin_unlock_bh(&sc->sc_pcu_lock);
++      if (needreset)
+               ath_reset(sc, false);
+-              spin_lock_bh(&sc->sc_pcu_lock);
 -      }
--
--      ar9003_hw_tx_iqcal_load_avg_2_passes(ah, nchains, &coeff);
--
--      return;
--
--TX_IQ_CAL_FAILED:
--      ath_dbg(common, ATH_DBG_CALIBRATE, "Tx IQ Cal failed\n");
--}
--
--static void ar9003_hw_tx_iq_cal_run(struct ath_hw *ah)
--{
-       u8 tx_gain_forced;
--      REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_1_9485,
--                    AR_PHY_TX_IQCAQL_CONTROL_1_IQCORR_I_Q_COFF_DELPT, DELPT);
-       tx_gain_forced = REG_READ_FIELD(ah, AR_PHY_TX_FORCED_GAIN,
-                                       AR_PHY_TXGAIN_FORCE);
-       if (tx_gain_forced)
-               REG_RMW_FIELD(ah, AR_PHY_TX_FORCED_GAIN,
-                             AR_PHY_TXGAIN_FORCE, 0);
--      REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_START_9485,
--                    AR_PHY_TX_IQCAL_START_DO_CAL_9485, 1);
-+      REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_START,
-+                    AR_PHY_TX_IQCAL_START_DO_CAL, 1);
-+
-+      if (!ath9k_hw_wait(ah, AR_PHY_TX_IQCAL_START,
-+                      AR_PHY_TX_IQCAL_START_DO_CAL, 0,
-+                      AH_WAIT_TIMEOUT)) {
-+              ath_dbg(common, ATH_DBG_CALIBRATE,
-+                      "Tx IQ Cal is not completed.\n");
-+              return false;
-+      }
-+      return true;
  }
  
- static void ar9003_hw_tx_iq_cal_post_proc(struct ath_hw *ah)
- {
-       struct ath_common *common = ath9k_hw_common(ah);
-       const u32 txiqcal_status[AR9300_MAX_CHAINS] = {
--              AR_PHY_TX_IQCAL_STATUS_B0_9485,
-+              AR_PHY_TX_IQCAL_STATUS_B0,
-               AR_PHY_TX_IQCAL_STATUS_B1,
-               AR_PHY_TX_IQCAL_STATUS_B2,
-       };
-@@ -853,7 +752,7 @@ static void ar9003_hw_tx_iq_cal_post_pro
-       struct coeff coeff;
-       s32 iq_res[6];
-       u8 num_chains = 0;
--      int i, ip, im, j;
-+      int i, im, j;
-       int nmeasurement;
-       for (i = 0; i < AR9300_MAX_CHAINS; i++) {
-@@ -861,71 +760,69 @@ static void ar9003_hw_tx_iq_cal_post_pro
-                       num_chains++;
+ static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,
+@@ -664,7 +661,8 @@ static int ath_compute_num_delims(struct
+        * TODO - this could be improved to be dependent on the rate.
+        *      The hardware can keep up at lower rates, but not higher rates
+        */
+-      if (fi->keyix != ATH9K_TXKEYIX_INVALID)
++      if ((fi->keyix != ATH9K_TXKEYIX_INVALID) &&
++          !(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA))
+               ndelim += ATH_AGGR_ENCRYPTDELIM;
+       /*
+@@ -2169,7 +2167,9 @@ static void ath_tx_complete_poll_work(st
+       if (needreset) {
+               ath_dbg(ath9k_hw_common(sc->sc_ah), ATH_DBG_RESET,
+                       "tx hung, resetting the chip\n");
++              spin_lock_bh(&sc->sc_pcu_lock);
+               ath_reset(sc, true);
++              spin_unlock_bh(&sc->sc_pcu_lock);
        }
  
--      for (ip = 0; ip < MPASS; ip++) {
--              for (i = 0; i < num_chains; i++) {
--                      nmeasurement = REG_READ_FIELD(ah,
--                                      AR_PHY_TX_IQCAL_STATUS_B0_9485,
--                                      AR_PHY_CALIBRATED_GAINS_0);
--                      if (nmeasurement > MAX_MEASUREMENT)
--                              nmeasurement = MAX_MEASUREMENT;
-+      for (i = 0; i < num_chains; i++) {
-+              nmeasurement = REG_READ_FIELD(ah,
-+                              AR_PHY_TX_IQCAL_STATUS_B0,
-+                              AR_PHY_CALIBRATED_GAINS_0);
-+              if (nmeasurement > MAX_MEASUREMENT)
-+                      nmeasurement = MAX_MEASUREMENT;
-+
-+              for (im = 0; im < nmeasurement; im++) {
-+                      ath_dbg(common, ATH_DBG_CALIBRATE,
-+                              "Doing Tx IQ Cal for chain %d.\n", i);
--                      for (im = 0; im < nmeasurement; im++) {
-+                      if (REG_READ(ah, txiqcal_status[i]) &
-+                                      AR_PHY_TX_IQCAL_STATUS_FAILED) {
-                               ath_dbg(common, ATH_DBG_CALIBRATE,
--                                      "Doing Tx IQ Cal for chain %d.\n", i);
--
--                              if (REG_READ(ah, txiqcal_status[i]) &
--                                  AR_PHY_TX_IQCAL_STATUS_FAILED) {
--                                      ath_dbg(common, ATH_DBG_CALIBRATE,
-                                       "Tx IQ Cal failed for chain %d.\n", i);
--                                      goto tx_iqcal_fail;
--                              }
-+                              goto tx_iqcal_fail;
-+                      }
--                              for (j = 0; j < 3; j++) {
--                                      u32 idx = 2 * j, offset = 4 * (3 * im + j);
-+                      for (j = 0; j < 3; j++) {
-+                              u32 idx = 2 * j, offset = 4 * (3 * im + j);
--                                      REG_RMW_FIELD(ah,
-+                              REG_RMW_FIELD(ah,
-                                               AR_PHY_CHAN_INFO_MEMORY,
-                                               AR_PHY_CHAN_INFO_TAB_S2_READ,
-                                               0);
--                                      /* 32 bits */
--                                      iq_res[idx] = REG_READ(ah,
--                                                      chan_info_tab[i] +
--                                                      offset);
-+                              /* 32 bits */
-+                              iq_res[idx] = REG_READ(ah,
-+                                              chan_info_tab[i] +
-+                                              offset);
--                                      REG_RMW_FIELD(ah,
-+                              REG_RMW_FIELD(ah,
-                                               AR_PHY_CHAN_INFO_MEMORY,
-                                               AR_PHY_CHAN_INFO_TAB_S2_READ,
-                                               1);
--                                      /* 16 bits */
--                                      iq_res[idx + 1] = 0xffff & REG_READ(ah,
--                                                        chan_info_tab[i] + offset);
--
--                                      ath_dbg(common, ATH_DBG_CALIBRATE,
--                                              "IQ RES[%d]=0x%x"
--                                              "IQ_RES[%d]=0x%x\n",
--                                              idx, iq_res[idx], idx + 1,
--                                              iq_res[idx + 1]);
--                              }
-+                              /* 16 bits */
-+                              iq_res[idx + 1] = 0xffff & REG_READ(ah,
-+                                              chan_info_tab[i] + offset);
--                              if (!ar9003_hw_calc_iq_corr(ah, i, iq_res,
--                                                          coeff.iqc_coeff)) {
--                                      ath_dbg(common, ATH_DBG_CALIBRATE,
--                                       "Failed in calculation of IQ correction.\n");
--                                      goto tx_iqcal_fail;
--                              }
-+                              ath_dbg(common, ATH_DBG_CALIBRATE,
-+                                      "IQ RES[%d]=0x%x"
-+                                      "IQ_RES[%d]=0x%x\n",
-+                                      idx, iq_res[idx], idx + 1,
-+                                      iq_res[idx + 1]);
-+                      }
--                              coeff.mag_coeff[i][im][ip] =
--                                              coeff.iqc_coeff[0] & 0x7f;
--                              coeff.phs_coeff[i][im][ip] =
--                                              (coeff.iqc_coeff[0] >> 7) & 0x7f;
--
--                              if (coeff.mag_coeff[i][im][ip] > 63)
--                                      coeff.mag_coeff[i][im][ip] -= 128;
--                              if (coeff.phs_coeff[i][im][ip] > 63)
--                                      coeff.phs_coeff[i][im][ip] -= 128;
-+                      if (!ar9003_hw_calc_iq_corr(ah, i, iq_res,
-+                                              coeff.iqc_coeff)) {
-+                              ath_dbg(common, ATH_DBG_CALIBRATE,
-+                                      "Failed in calculation of \
-+                                      IQ correction.\n");
-+                              goto tx_iqcal_fail;
-                       }
-+
-+                      coeff.mag_coeff[i][im] = coeff.iqc_coeff[0] & 0x7f;
-+                      coeff.phs_coeff[i][im] =
-+                              (coeff.iqc_coeff[0] >> 7) & 0x7f;
-+
-+                      if (coeff.mag_coeff[i][im] > 63)
-+                              coeff.mag_coeff[i][im] -= 128;
-+                      if (coeff.phs_coeff[i][im] > 63)
-+                              coeff.phs_coeff[i][im] -= 128;
-               }
-       }
-       ar9003_hw_tx_iqcal_load_avg_2_passes(ah, num_chains, &coeff);
-@@ -941,6 +838,7 @@ static bool ar9003_hw_init_cal(struct at
+       ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work,
+--- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
++++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
+@@ -236,7 +236,7 @@ static void ar9003_paprd_get_gain_table(
+       memset(entry, 0, sizeof(ah->paprd_gain_table_entries));
+       memset(index, 0, sizeof(ah->paprd_gain_table_index));
+-      for (i = 0; i < 32; i++) {
++      for (i = 0; i < PAPRD_GAIN_TABLE_ENTRIES; i++) {
+               entry[i] = REG_READ(ah, reg);
+               index[i] = (entry[i] >> 24) & 0xff;
+               reg += 4;
+@@ -246,13 +246,13 @@ static void ar9003_paprd_get_gain_table(
+ static unsigned int ar9003_get_desired_gain(struct ath_hw *ah, int chain,
+                                           int target_power)
  {
-       struct ath_common *common = ath9k_hw_common(ah);
-       int val;
-+      bool txiqcal_done = false;
-       val = REG_READ(ah, AR_ENT_OTP);
-       ath_dbg(common, ATH_DBG_CALIBRATE, "ath9k: AR_ENT_OTP 0x%x\n", val);
-@@ -957,14 +855,22 @@ static bool ar9003_hw_init_cal(struct at
-               ar9003_hw_set_chain_masks(ah, 0x7, 0x7);
-       /* Do Tx IQ Calibration */
--      if (AR_SREV_9485(ah))
--              ar9003_hw_tx_iq_cal_run(ah);
+-      int olpc_gain_delta = 0;
++      int olpc_gain_delta = 0, cl_gain_mod;
+       int alpha_therm, alpha_volt;
+       int therm_cal_value, volt_cal_value;
+       int therm_value, volt_value;
+       int thermal_gain_corr, voltage_gain_corr;
+       int desired_scale, desired_gain = 0;
+-      u32 reg;
++      u32 reg_olpc  = 0, reg_cl_gain  = 0;
+       REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1,
+                   AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE);
+@@ -271,15 +271,29 @@ static unsigned int ar9003_get_desired_g
+       volt_value = REG_READ_FIELD(ah, AR_PHY_BB_THERM_ADC_4,
+                                   AR_PHY_BB_THERM_ADC_4_LATEST_VOLT_VALUE);
+-      if (chain == 0)
+-              reg = AR_PHY_TPC_11_B0;
+-      else if (chain == 1)
+-              reg = AR_PHY_TPC_11_B1;
 -      else
--              ar9003_hw_tx_iq_cal(ah);
-+      REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_1,
-+                    AR_PHY_TX_IQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT,
-+                    DELPT);
--      REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_DIS);
--      udelay(5);
--      REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN);
-+      /*
-+       * For AR9485 or later chips, TxIQ cal runs as part of
-+       * AGC calibration
-+       */
-+      if (AR_SREV_9485_OR_LATER(ah))
-+              txiqcal_done = true;
-+      else {
-+              txiqcal_done = ar9003_hw_tx_iq_cal_run(ah);
-+              REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_DIS);
-+              udelay(5);
-+              REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN);
+-              reg = AR_PHY_TPC_11_B2;
++      switch (chain) {
++      case 0:
++              reg_olpc = AR_PHY_TPC_11_B0;
++              reg_cl_gain = AR_PHY_CL_TAB_0;
++              break;
++      case 1:
++              reg_olpc = AR_PHY_TPC_11_B1;
++              reg_cl_gain = AR_PHY_CL_TAB_1;
++              break;
++      case 2:
++              reg_olpc = AR_PHY_TPC_11_B2;
++              reg_cl_gain = AR_PHY_CL_TAB_2;
++              break;
++      default:
++              ath_dbg(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
++              "Invalid chainmask: %d\n", chain);
++              break;
 +      }
  
-       /* Calibrate the AGC */
-       REG_WRITE(ah, AR_PHY_AGC_CONTROL,
-@@ -979,7 +885,7 @@ static bool ar9003_hw_init_cal(struct at
-               return false;
-       }
--      if (AR_SREV_9485(ah))
-+      if (txiqcal_done)
-               ar9003_hw_tx_iq_cal_post_proc(ah);
-       /* Revert chainmasks to their original values before NF cal */
+-      olpc_gain_delta = REG_READ_FIELD(ah, reg,
++      olpc_gain_delta = REG_READ_FIELD(ah, reg_olpc,
+                                        AR_PHY_TPC_11_OLPC_GAIN_DELTA);
++      cl_gain_mod = REG_READ_FIELD(ah, reg_cl_gain,
++                                       AR_PHY_CL_TAB_CL_GAIN_MOD);
+       if (olpc_gain_delta >= 128)
+               olpc_gain_delta = olpc_gain_delta - 256;
+@@ -289,7 +303,7 @@ static unsigned int ar9003_get_desired_g
+       voltage_gain_corr = (alpha_volt * (volt_value - volt_cal_value) +
+                            (128 / 2)) / 128;
+       desired_gain = target_power - olpc_gain_delta - thermal_gain_corr -
+-          voltage_gain_corr + desired_scale;
++          voltage_gain_corr + desired_scale + cl_gain_mod;
+       return desired_gain;
+ }
+@@ -727,7 +741,7 @@ int ar9003_paprd_setup_gain_table(struct
+       desired_gain = ar9003_get_desired_gain(ah, chain, train_power);
+       gain_index = 0;
+-      for (i = 0; i < 32; i++) {
++      for (i = 0; i < PAPRD_GAIN_TABLE_ENTRIES; i++) {
+               if (ah->paprd_gain_table_index[i] >= desired_gain)
+                       break;
+               gain_index++;
 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
 +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
-@@ -548,15 +548,12 @@
- #define AR_PHY_TXGAIN_TABLE      (AR_SM_BASE + 0x300)
+@@ -1121,6 +1121,9 @@
+ #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5    0x3F00
+ #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5_S  8
  
--#define AR_PHY_TX_IQCAL_START_9485            (AR_SM_BASE + 0x3c4)
--#define AR_PHY_TX_IQCAL_START_DO_CAL_9485     0x80000000
--#define AR_PHY_TX_IQCAL_START_DO_CAL_9485_S   31
--#define AR_PHY_TX_IQCAL_CONTROL_1_9485                (AR_SM_BASE + 0x3c8)
--#define AR_PHY_TX_IQCAL_STATUS_B0_9485                (AR_SM_BASE + 0x3f0)
--
--#define AR_PHY_TX_IQCAL_CONTROL_1   (AR_SM_BASE + 0x448)
--#define AR_PHY_TX_IQCAL_START       (AR_SM_BASE + 0x440)
--#define AR_PHY_TX_IQCAL_STATUS_B0   (AR_SM_BASE + 0x48c)
-+#define AR_PHY_TX_IQCAL_CONTROL_1   (AR_SM_BASE + AR_SREV_9485(ah) ? \
-+                                               0x3c8 : 0x448)
-+#define AR_PHY_TX_IQCAL_START       (AR_SM_BASE + AR_SREV_9485(ah) ? \
-+                                               0x3c4 : 0x440)
-+#define AR_PHY_TX_IQCAL_STATUS_B0   (AR_SM_BASE + AR_SREV_9485(ah) ? \
-+                                               0x3f0 : 0x48c)
- #define AR_PHY_TX_IQCAL_CORR_COEFF_B0(_i)    (AR_SM_BASE + \
-                                            (AR_SREV_9485(ah) ? \
-                                             0x3d0 : 0x450) + ((_i) << 2))
-@@ -758,10 +755,10 @@
- #define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT   0x01000000
- #define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_S 24
- #define AR_PHY_CHANNEL_STATUS_RX_CLEAR      0x00000004
--#define AR_PHY_TX_IQCAQL_CONTROL_1_IQCORR_I_Q_COFF_DELPT             0x01fc0000
--#define AR_PHY_TX_IQCAQL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_S                   18
--#define AR_PHY_TX_IQCAL_START_DO_CAL        0x00000001
--#define AR_PHY_TX_IQCAL_START_DO_CAL_S      0
-+#define AR_PHY_TX_IQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT             0x01fc0000
-+#define AR_PHY_TX_IQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_S                   18
-+#define AR_PHY_TX_IQCAL_START_DO_CAL      0x00000001
-+#define AR_PHY_TX_IQCAL_START_DO_CAL_S            0
- #define AR_PHY_TX_IQCAL_STATUS_FAILED    0x00000001
- #define AR_PHY_CALIBRATED_GAINS_0      0x3e
---- a/drivers/net/wireless/ath/ath9k/ath9k.h
-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -453,6 +453,7 @@ void ath9k_btcoex_timer_pause(struct ath
- #define ATH_LED_PIN_DEF               1
- #define ATH_LED_PIN_9287              8
-+#define ATH_LED_PIN_9300              10
- #define ATH_LED_PIN_9485              6
- #ifdef CONFIG_MAC80211_LEDS
---- a/drivers/net/wireless/ath/ath9k/gpio.c
-+++ b/drivers/net/wireless/ath/ath9k/gpio.c
-@@ -46,6 +46,8 @@ void ath_init_leds(struct ath_softc *sc)
-                       sc->sc_ah->led_pin = ATH_LED_PIN_9287;
-               else if (AR_SREV_9485(sc->sc_ah))
-                       sc->sc_ah->led_pin = ATH_LED_PIN_9485;
-+              else if (AR_SREV_9300(sc->sc_ah))
-+                      sc->sc_ah->led_pin = ATH_LED_PIN_9300;
-               else
-                       sc->sc_ah->led_pin = ATH_LED_PIN_DEF;
-       }
---- a/drivers/net/wireless/ath/ath9k/reg.h
-+++ b/drivers/net/wireless/ath/ath9k/reg.h
-@@ -868,6 +868,8 @@
- #define AR_SREV_9485_11(_ah) \
-       (AR_SREV_9485(_ah) && \
-        ((_ah)->hw_version.macRev == AR_SREV_REVISION_9485_11))
-+#define AR_SREV_9485_OR_LATER(_ah) \
-+      (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9485))
- #define AR_SREV_9285E_20(_ah) \
-     (AR_SREV_9285_12_OR_LATER(_ah) && \
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -652,7 +652,7 @@ static void ieee80211_sta_reorder_releas
-  set_release_timer:
-               mod_timer(&tid_agg_rx->reorder_timer,
--                        tid_agg_rx->reorder_time[j] +
-+                        tid_agg_rx->reorder_time[j] + 1 +
-                         HT_RX_REORDER_BUF_TIMEOUT);
-       } else {
-               del_timer(&tid_agg_rx->reorder_timer);
---- a/drivers/net/wireless/ath/ath9k/calib.c
-+++ b/drivers/net/wireless/ath/ath9k/calib.c
-@@ -69,15 +69,21 @@ static void ath9k_hw_update_nfcal_hist_b
-                                             int16_t *nfarray)
- {
-       struct ath_common *common = ath9k_hw_common(ah);
-+      struct ieee80211_conf *conf = &common->hw->conf;
-       struct ath_nf_limits *limit;
-       struct ath9k_nfcal_hist *h;
-       bool high_nf_mid = false;
-+      u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask;
-       int i;
-       h = cal->nfCalHist;
-       limit = ath9k_hw_get_nf_limits(ah, ah->curchan);
-       for (i = 0; i < NUM_NF_READINGS; i++) {
-+              if (!(chainmask & (1 << i)) ||
-+                  ((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf)))
-+                      continue;
-+
-               h[i].nfCalBuffer[h[i].currIndex] = nfarray[i];
-               if (++h[i].currIndex >= ATH9K_NF_CAL_HIST_MAX)
-@@ -225,6 +231,7 @@ void ath9k_hw_loadnf(struct ath_hw *ah, 
-       int32_t val;
-       u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask;
-       struct ath_common *common = ath9k_hw_common(ah);
-+      struct ieee80211_conf *conf = &common->hw->conf;
-       s16 default_nf = ath9k_hw_get_default_nf(ah, chan);
-       if (ah->caldata)
-@@ -234,6 +241,9 @@ void ath9k_hw_loadnf(struct ath_hw *ah, 
-               if (chainmask & (1 << i)) {
-                       s16 nfval;
-+                      if ((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf))
-+                              continue;
++#define AR_PHY_CL_TAB_CL_GAIN_MOD             0x1f
++#define AR_PHY_CL_TAB_CL_GAIN_MOD_S           0
 +
-                       if (h)
-                               nfval = h[i].privNF;
-                       else
-@@ -293,6 +303,9 @@ void ath9k_hw_loadnf(struct ath_hw *ah, 
-       ENABLE_REGWRITE_BUFFER(ah);
-       for (i = 0; i < NUM_NF_READINGS; i++) {
-               if (chainmask & (1 << i)) {
-+                      if ((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf))
-+                              continue;
-+
-                       val = REG_READ(ah, ah->nf_regs[i]);
-                       val &= 0xFFFFFE00;
-                       val |= (((u32) (-50) << 1) & 0x1ff);
+ void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx);
+ #endif  /* AR9003_PHY_H */
diff --git a/package/mac80211/patches/310-ibss_ht.patch b/package/mac80211/patches/310-ibss_ht.patch
new file mode 100644 (file)
index 0000000..1518afd
--- /dev/null
@@ -0,0 +1,637 @@
+--- a/include/net/cfg80211.h
++++ b/include/net/cfg80211.h
+@@ -1038,6 +1038,7 @@ struct cfg80211_ibss_params {
+       u8 *ssid;
+       u8 *bssid;
+       struct ieee80211_channel *channel;
++      enum nl80211_channel_type channel_type;
+       u8 *ie;
+       u8 ssid_len, ie_len;
+       u16 beacon_interval;
+@@ -2539,6 +2540,12 @@ struct cfg80211_bss *cfg80211_get_bss(st
+                                     const u8 *bssid,
+                                     const u8 *ssid, size_t ssid_len,
+                                     u16 capa_mask, u16 capa_val);
++struct cfg80211_bss *cfg80211_get_bss_ht(struct wiphy *wiphy,
++                                        struct ieee80211_channel *channel,
++                                        const u8 *bssid,
++                                        const u8 *ssid, size_t ssid_len,
++                                        u16 capa_mask, u16 capa_val,
++                                     enum nl80211_channel_type channel_type);
+ static inline struct cfg80211_bss *
+ cfg80211_get_ibss(struct wiphy *wiphy,
+                 struct ieee80211_channel *channel,
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -439,6 +439,7 @@ struct ieee80211_if_ibss {
+       u8 ssid_len, ie_len;
+       u8 *ie;
+       struct ieee80211_channel *channel;
++      enum nl80211_channel_type channel_type;
+       unsigned long ibss_join_req;
+       /* probe response/beacon for IBSS */
+@@ -1121,6 +1122,7 @@ void ieee80211_ibss_notify_scan_complete
+ void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata);
+ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
+                                       u8 *bssid, u8 *addr, u32 supp_rates,
++                                      struct ieee80211_ht_cap *ht_cap,
+                                       gfp_t gfp);
+ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
+                       struct cfg80211_ibss_params *params);
+@@ -1373,6 +1375,12 @@ void ieee80211_recalc_smps(struct ieee80
+ size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
+                         const u8 *ids, int n_ids, size_t offset);
+ size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset);
++u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_supported_band *sband,
++                             u16 cap);
++u8 *ieee80211_ie_build_ht_info(u8 *pos,
++                              struct ieee80211_sta_ht_cap *ht_cap,
++                              struct ieee80211_channel *channel,
++                              enum nl80211_channel_type channel_type);
+ /* internal work items */
+ void ieee80211_work_init(struct ieee80211_local *local);
+@@ -1401,6 +1409,8 @@ ieee80211_get_channel_mode(struct ieee80
+ bool ieee80211_set_channel_type(struct ieee80211_local *local,
+                               struct ieee80211_sub_if_data *sdata,
+                               enum nl80211_channel_type chantype);
++enum nl80211_channel_type ieee80211_ht_info_to_channel_type(
++                                      struct ieee80211_ht_info *ht_info);
+ #ifdef CONFIG_MAC80211_NOINLINE
+ #define debug_noinline noinline
+--- a/net/mac80211/util.c
++++ b/net/mac80211/util.c
+@@ -1007,23 +1007,8 @@ int ieee80211_build_preq_ies(struct ieee
+               offset = noffset;
+       }
+-      if (sband->ht_cap.ht_supported) {
+-              u16 cap = sband->ht_cap.cap;
+-              __le16 tmp;
+-
+-              *pos++ = WLAN_EID_HT_CAPABILITY;
+-              *pos++ = sizeof(struct ieee80211_ht_cap);
+-              memset(pos, 0, sizeof(struct ieee80211_ht_cap));
+-              tmp = cpu_to_le16(cap);
+-              memcpy(pos, &tmp, sizeof(u16));
+-              pos += sizeof(u16);
+-              *pos++ = sband->ht_cap.ampdu_factor |
+-                       (sband->ht_cap.ampdu_density <<
+-                              IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
+-              memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
+-              pos += sizeof(sband->ht_cap.mcs);
+-              pos += 2 + 4 + 1; /* ext info, BF cap, antsel */
+-      }
++      if (sband->ht_cap.ht_supported)
++              pos = ieee80211_ie_build_ht_cap(pos, sband, sband->ht_cap.cap);
+       /*
+        * If adding more here, adjust code in main.c
+@@ -1464,3 +1449,100 @@ size_t ieee80211_ie_split_vendor(const u
+       return pos;
+ }
++
++u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_supported_band *sband,
++                             u16 cap)
++{
++      __le16 tmp;
++
++      *pos++ = WLAN_EID_HT_CAPABILITY;
++      *pos++ = sizeof(struct ieee80211_ht_cap);
++      memset(pos, 0, sizeof(struct ieee80211_ht_cap));
++
++      /* capability flags */
++      tmp = cpu_to_le16(cap);
++      memcpy(pos, &tmp, sizeof(u16));
++      pos += sizeof(u16);
++
++      /* AMPDU parameters */
++      *pos++ = sband->ht_cap.ampdu_factor |
++               (sband->ht_cap.ampdu_density <<
++                      IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
++
++      /* MCS set */
++      memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
++      pos += sizeof(sband->ht_cap.mcs);
++
++      /* extended capabilities */
++      pos += sizeof(__le16);
++
++      /* BF capabilities */
++      pos += sizeof(__le32);
++
++      /* antenna selection */
++      pos += sizeof(u8);
++
++      return pos;
++}
++
++u8 *ieee80211_ie_build_ht_info(u8 *pos,
++                              struct ieee80211_sta_ht_cap *ht_cap,
++                              struct ieee80211_channel *channel,
++                              enum nl80211_channel_type channel_type)
++{
++      struct ieee80211_ht_info *ht_info;
++      /* Build HT Information */
++      *pos++ = WLAN_EID_HT_INFORMATION;
++      *pos++ = sizeof(struct ieee80211_ht_info);
++      ht_info = (struct ieee80211_ht_info *)pos;
++      ht_info->control_chan =
++                      ieee80211_frequency_to_channel(channel->center_freq);
++      switch (channel_type) {
++      case NL80211_CHAN_HT40MINUS:
++              ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
++              break;
++      case NL80211_CHAN_HT40PLUS:
++              ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
++              break;
++      case NL80211_CHAN_HT20:
++      default:
++              ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_NONE;
++              break;
++      }
++      if (ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
++              ht_info->ht_param |= IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
++      ht_info->operation_mode = 0x0000;
++      ht_info->stbc_param = 0x0000;
++
++      /* It seems that Basic MCS set and Supported MCS set
++         are identical for the first 10 bytes */
++      memset(&ht_info->basic_set, 0, 16);
++      memcpy(&ht_info->basic_set, &ht_cap->mcs, 10);
++
++      return pos + sizeof(struct ieee80211_ht_info);
++}
++
++enum nl80211_channel_type ieee80211_ht_info_to_channel_type(
++                                      struct ieee80211_ht_info *ht_info)
++{
++      enum nl80211_channel_type channel_type;
++
++      if (!ht_info)
++              return NL80211_CHAN_NO_HT;
++
++      switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
++      case IEEE80211_HT_PARAM_CHA_SEC_NONE:
++              channel_type = NL80211_CHAN_HT20;
++              break;
++      case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
++              channel_type = NL80211_CHAN_HT40PLUS;
++              break;
++      case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
++              channel_type = NL80211_CHAN_HT40MINUS;
++              break;
++      default:
++              channel_type = NL80211_CHAN_NO_HT;
++      }
++
++      return channel_type;
++}
+--- a/net/mac80211/work.c
++++ b/net/mac80211/work.c
+@@ -117,7 +117,6 @@ static void ieee80211_add_ht_ie(struct s
+       u8 *pos;
+       u32 flags = channel->flags;
+       u16 cap = sband->ht_cap.cap;
+-      __le16 tmp;
+       if (!sband->ht_cap.ht_supported)
+               return;
+@@ -168,34 +167,8 @@ static void ieee80211_add_ht_ie(struct s
+       }
+       /* reserve and fill IE */
+-
+       pos = skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2);
+-      *pos++ = WLAN_EID_HT_CAPABILITY;
+-      *pos++ = sizeof(struct ieee80211_ht_cap);
+-      memset(pos, 0, sizeof(struct ieee80211_ht_cap));
+-
+-      /* capability flags */
+-      tmp = cpu_to_le16(cap);
+-      memcpy(pos, &tmp, sizeof(u16));
+-      pos += sizeof(u16);
+-
+-      /* AMPDU parameters */
+-      *pos++ = sband->ht_cap.ampdu_factor |
+-               (sband->ht_cap.ampdu_density <<
+-                      IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
+-
+-      /* MCS set */
+-      memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
+-      pos += sizeof(sband->ht_cap.mcs);
+-
+-      /* extended capabilities */
+-      pos += sizeof(__le16);
+-
+-      /* BF capabilities */
+-      pos += sizeof(__le32);
+-
+-      /* antenna selection */
+-      pos += sizeof(u8);
++      ieee80211_ie_build_ht_cap(pos, sband, cap);
+ }
+ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
+--- a/net/wireless/scan.c
++++ b/net/wireless/scan.c
+@@ -365,6 +365,18 @@ struct cfg80211_bss *cfg80211_get_bss(st
+                                     const u8 *ssid, size_t ssid_len,
+                                     u16 capa_mask, u16 capa_val)
+ {
++      return cfg80211_get_bss_ht(wiphy, channel, bssid, ssid, ssid_len,
++                                 capa_mask, capa_val, NL80211_CHAN_NO_HT);
++}
++EXPORT_SYMBOL(cfg80211_get_bss);
++
++struct cfg80211_bss *cfg80211_get_bss_ht(struct wiphy *wiphy,
++                                    struct ieee80211_channel *channel,
++                                    const u8 *bssid,
++                                    const u8 *ssid, size_t ssid_len,
++                                    u16 capa_mask, u16 capa_val,
++                                    enum nl80211_channel_type channel_type)
++{
+       struct cfg80211_registered_device *dev = wiphy_to_dev(wiphy);
+       struct cfg80211_internal_bss *bss, *res = NULL;
+       unsigned long now = jiffies;
+@@ -374,8 +386,27 @@ struct cfg80211_bss *cfg80211_get_bss(st
+       list_for_each_entry(bss, &dev->bss_list, list) {
+               if ((bss->pub.capability & capa_mask) != capa_val)
+                       continue;
+-              if (channel && bss->pub.channel != channel)
+-                      continue;
++              if (channel) {
++                      if (bss->pub.channel != channel)
++                              continue;
++                      if (channel_type == NL80211_CHAN_HT40MINUS ||
++                          channel_type == NL80211_CHAN_HT40PLUS) {
++                              struct ieee80211_ht_info *ht_info;
++                              ht_info = (struct ieee80211_ht_info *)
++                                      ieee80211_bss_get_ie(&bss->pub,
++                                                     WLAN_EID_HT_INFORMATION);
++                              if (!ht_info)
++                                      continue;
++                              if (channel_type == NL80211_CHAN_HT40MINUS &&
++                                            !(ht_info->ht_param &
++                                            IEEE80211_HT_PARAM_CHA_SEC_BELOW))
++                                      continue;
++                              if (channel_type == NL80211_CHAN_HT40PLUS &&
++                                            !(ht_info->ht_param &
++                                            IEEE80211_HT_PARAM_CHA_SEC_ABOVE))
++                                      continue;
++                      }
++              }
+               /* Don't get expired BSS structs */
+               if (time_after(now, bss->ts + IEEE80211_SCAN_RESULT_EXPIRE) &&
+                   !atomic_read(&bss->hold))
+@@ -392,7 +423,7 @@ struct cfg80211_bss *cfg80211_get_bss(st
+               return NULL;
+       return &res->pub;
+ }
+-EXPORT_SYMBOL(cfg80211_get_bss);
++EXPORT_SYMBOL(cfg80211_get_bss_ht);
+ struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy,
+                                      struct ieee80211_channel *channel,
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -4282,13 +4282,42 @@ static int nl80211_join_ibss(struct sk_b
+               ibss.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
+       }
+-      ibss.channel = ieee80211_get_channel(wiphy,
+-              nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));
++      if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {
++              enum nl80211_channel_type channel_type;
++
++              channel_type = nla_get_u32(
++                      info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]);
++              if (channel_type != NL80211_CHAN_NO_HT &&
++                  channel_type != NL80211_CHAN_HT20 &&
++                  channel_type != NL80211_CHAN_HT40PLUS &&
++                  channel_type != NL80211_CHAN_HT40MINUS)
++                      return -EINVAL;
++              ibss.channel_type = channel_type;
++      } else {
++              ibss.channel_type = NL80211_CHAN_NO_HT;
++      }
++
++      ibss.channel = rdev_freq_to_chan(rdev,
++              nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]),
++              ibss.channel_type);
++
+       if (!ibss.channel ||
++          ibss.channel->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
+           ibss.channel->flags & IEEE80211_CHAN_NO_IBSS ||
+           ibss.channel->flags & IEEE80211_CHAN_DISABLED)
+               return -EINVAL;
++#if 0
++      if ((ibss.channel_type == NL80211_CHAN_HT40PLUS ||
++           ibss.channel_type == NL80211_CHAN_HT40MINUS) &&
++          !can_beacon_sec_chan(&rdev->wiphy, ibss.chan, ibss.channel_type)) {
++              printk(KERN_DEBUG
++                     "cfg80211: Secondary channel not "
++                     "allowed to initiate communication\n");
++              return -EINVAL;
++      }
++#endif
++
+       ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED];
+       ibss.privacy = !!info->attrs[NL80211_ATTR_PRIVACY];
+--- a/net/mac80211/agg-rx.c
++++ b/net/mac80211/agg-rx.c
+@@ -178,6 +178,8 @@ static void ieee80211_send_addba_resp(st
+               memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+       else if (sdata->vif.type == NL80211_IFTYPE_WDS)
+               memcpy(mgmt->bssid, da, ETH_ALEN);
++      else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
++              memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
+       mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
+                                         IEEE80211_STYPE_ACTION);
+--- a/net/mac80211/agg-tx.c
++++ b/net/mac80211/agg-tx.c
+@@ -84,6 +84,8 @@ static void ieee80211_send_addba_request
+               memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
+       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
+               memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
++      else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
++              memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
+       mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
+                                         IEEE80211_STYPE_ACTION);
+@@ -400,7 +402,8 @@ int ieee80211_start_tx_ba_session(struct
+       if (sdata->vif.type != NL80211_IFTYPE_STATION &&
+           sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
+           sdata->vif.type != NL80211_IFTYPE_AP &&
+-          sdata->vif.type != NL80211_IFTYPE_WDS)
++          sdata->vif.type != NL80211_IFTYPE_WDS &&
++          sdata->vif.type != NL80211_IFTYPE_ADHOC)
+               return -EINVAL;
+       if (test_sta_flags(sta, WLAN_STA_BLOCK_BA)) {
+--- a/net/mac80211/ht.c
++++ b/net/mac80211/ht.c
+@@ -203,6 +203,8 @@ void ieee80211_send_delba(struct ieee802
+               memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
+       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
+               memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
++      else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
++              memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
+       mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
+                                         IEEE80211_STYPE_ACTION);
+--- a/net/mac80211/ibss.c
++++ b/net/mac80211/ibss.c
+@@ -64,6 +64,7 @@ static void ieee80211_rx_mgmt_auth_ibss(
+ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
+                                     const u8 *bssid, const int beacon_int,
+                                     struct ieee80211_channel *chan,
++                                    enum nl80211_channel_type channel_type,
+                                     const u32 basic_rates,
+                                     const u16 capability, u64 tsf)
+ {
+@@ -104,8 +105,12 @@ static void __ieee80211_sta_join_ibss(st
+       sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
++      /* entering a legacy IBSS. Use given HT configuration. */
++      if (channel_type == NL80211_CHAN_NO_HT)
++              channel_type = ifibss->channel_type;
++
+       local->oper_channel = chan;
+-      WARN_ON(!ieee80211_set_channel_type(local, sdata, NL80211_CHAN_NO_HT));
++      WARN_ON(!ieee80211_set_channel_type(local, sdata, channel_type));
+       ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
+       sband = local->hw.wiphy->bands[chan->band];
+@@ -171,6 +176,17 @@ static void __ieee80211_sta_join_ibss(st
+               memcpy(skb_put(skb, ifibss->ie_len),
+                      ifibss->ie, ifibss->ie_len);
++      if (channel_type != NL80211_CHAN_NO_HT && sband->ht_cap.ht_supported) {
++              pos = skb_put(skb, 4 +
++                                 sizeof(struct ieee80211_ht_cap) +
++                                 sizeof(struct ieee80211_ht_info));
++              pos = ieee80211_ie_build_ht_cap(pos, sband, sband->ht_cap.cap);
++              pos = ieee80211_ie_build_ht_info(pos,
++                                               &sband->ht_cap,
++                                               chan,
++                                               channel_type);
++      }
++
+       if (local->hw.queues >= 4) {
+               pos = skb_put(skb, 9);
+               *pos++ = WLAN_EID_VENDOR_SPECIFIC;
+@@ -219,6 +235,8 @@ static void ieee80211_sta_join_ibss(stru
+       u32 basic_rates;
+       int i, j;
+       u16 beacon_int = cbss->beacon_interval;
++      const u8 *ht_info_ie;
++      enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
+       lockdep_assert_held(&sdata->u.ibss.mtx);
+@@ -242,9 +260,15 @@ static void ieee80211_sta_join_ibss(stru
+               }
+       }
++      ht_info_ie = ieee80211_bss_get_ie(cbss, WLAN_EID_HT_INFORMATION);
++      if (ht_info_ie)
++              channel_type = ieee80211_ht_info_to_channel_type(
++                      (struct ieee80211_ht_info *) (ht_info_ie + 2));
++
+       __ieee80211_sta_join_ibss(sdata, cbss->bssid,
+                                 beacon_int,
+                                 cbss->channel,
++                                channel_type,
+                                 basic_rates,
+                                 cbss->capability,
+                                 cbss->tsf);
+@@ -310,11 +334,65 @@ static void ieee80211_rx_bss_info(struct
+                       } else
+                               sta = ieee80211_ibss_add_sta(sdata, mgmt->bssid,
+                                               mgmt->sa, supp_rates,
+-                                              GFP_ATOMIC);
++                                              elems->ht_cap_elem, GFP_ATOMIC);
+               }
+-              if (sta && elems->wmm_info)
+-                      set_sta_flags(sta, WLAN_STA_WME);
++              if (sta) {
++                      if (elems->wmm_info)
++                              set_sta_flags(sta, WLAN_STA_WME);
++
++                      if (elems->ht_info_elem) {
++                              struct ieee80211_supported_band *sband =
++                                      local->hw.wiphy->bands[channel->band];
++                              enum nl80211_channel_type channel_type;
++
++                              channel_type =
++                                      ieee80211_ht_info_to_channel_type(
++                                              elems->ht_info_elem);
++                              if (channel_type != local->_oper_channel_type) {
++                                      struct sk_buff *skb =
++                                                      sdata->u.ibss.presp;
++                                      struct sk_buff *nskb;
++                                      u8 *ht_ie;
++
++                                      nskb = skb_copy(skb, GFP_ATOMIC);
++                                      ht_ie = (u8 *) cfg80211_find_ie(
++                                              WLAN_EID_HT_CAPABILITY,
++                                              nskb->data + 24 +
++                                                      sizeof(mgmt->u.beacon),
++                                              nskb->len - 24 -
++                                                      sizeof(mgmt->u.beacon));
++
++                                      if (!ht_ie)
++                                              ht_ie = skb_put(nskb, 4 +
++                                            sizeof(struct ieee80211_ht_cap) +
++                                            sizeof(struct ieee80211_ht_info));
++                                      ht_ie = ieee80211_ie_build_ht_cap(ht_ie,
++                                                           sband,
++                                                           sband->ht_cap.cap);
++                                      ht_ie = ieee80211_ie_build_ht_info(
++                                                               ht_ie,
++                                                               &sband->ht_cap,
++                                                               channel,
++                                                               channel_type);
++                                      sdata->u.ibss.presp = nskb;
++                                      kfree_skb(skb);
++
++                                      local->_oper_channel_type =
++                                                              channel_type;
++                                      WARN_ON(!ieee80211_set_channel_type(
++                                                              local,
++                                                              sdata,
++                                                              channel_type));
++                                      ieee80211_hw_config(local,
++                                              IEEE80211_CONF_CHANGE_CHANNEL);
++                              }
++                              ieee80211_ht_cap_ie_to_sta_ht_cap(sband,
++                                                      elems->ht_cap_elem,
++                                                      &sta->sta.ht_cap);
++
++                      }
++              }
+               rcu_read_unlock();
+       }
+@@ -404,7 +482,7 @@ static void ieee80211_rx_bss_info(struct
+               ieee80211_sta_join_ibss(sdata, bss);
+               supp_rates = ieee80211_sta_get_rates(local, elems, band);
+               ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa,
+-                                     supp_rates, GFP_KERNEL);
++                                  supp_rates, elems->ht_cap_elem, GFP_KERNEL);
+       }
+  put_bss:
+@@ -417,7 +495,8 @@ static void ieee80211_rx_bss_info(struct
+  * must be callable in atomic context.
+  */
+ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
+-                                      u8 *bssid,u8 *addr, u32 supp_rates,
++                                      u8 *bssid, u8 *addr, u32 supp_rates,
++                                      struct ieee80211_ht_cap *ht_cap,
+                                       gfp_t gfp)
+ {
+       struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
+@@ -458,6 +537,11 @@ struct sta_info *ieee80211_ibss_add_sta(
+       sta->sta.supp_rates[band] = supp_rates |
+                       ieee80211_mandatory_rates(local, band);
++      /* fill in ht rates */
++      if (ht_cap)
++              ieee80211_ht_cap_ie_to_sta_ht_cap(local->hw.wiphy->bands[band],
++                              ht_cap, &sta->sta.ht_cap);
++
+       rate_control_rate_init(sta);
+       /* If it fails, maybe we raced another insertion? */
+@@ -556,8 +640,8 @@ static void ieee80211_sta_create_ibss(st
+               sdata->drop_unencrypted = 0;
+       __ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
+-                                ifibss->channel, ifibss->basic_rates,
+-                                capability, 0);
++                                ifibss->channel, ifibss->channel_type,
++                                ifibss->basic_rates, capability, 0);
+ }
+ /*
+@@ -594,10 +678,10 @@ static void ieee80211_sta_find_ibss(stru
+               chan = ifibss->channel;
+       if (!is_zero_ether_addr(ifibss->bssid))
+               bssid = ifibss->bssid;
+-      cbss = cfg80211_get_bss(local->hw.wiphy, chan, bssid,
++      cbss = cfg80211_get_bss_ht(local->hw.wiphy, chan, bssid,
+                               ifibss->ssid, ifibss->ssid_len,
+                               WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_PRIVACY,
+-                              capability);
++                              capability, ifibss->channel_type);
+       if (cbss) {
+               struct ieee80211_bss *bss;
+@@ -896,10 +980,15 @@ int ieee80211_ibss_join(struct ieee80211
+       struct sk_buff *skb;
+       skb = dev_alloc_skb(sdata->local->hw.extra_tx_headroom +
+-                          36 /* bitrates */ +
+-                          34 /* SSID */ +
+-                          3  /* DS params */ +
+-                          4  /* IBSS params */ +
++                          sizeof(struct ieee80211_hdr_3addr) +
++                          12 /* struct ieee80211_mgmt.u.beacon */ +
++                          2 + IEEE80211_MAX_SSID_LEN /* max SSID */ +
++                          2 + 8 /* max Supported Rates */ +
++                          3 /* max DS params */ +
++                          4 /* IBSS params */ +
++                          2 + (IEEE80211_MAX_SUPP_RATES - 8) +
++                          2 + sizeof(struct ieee80211_ht_cap) +
++                          2 + sizeof(struct ieee80211_ht_info) +
+                           params->ie_len);
+       if (!skb)
+               return -ENOMEM;
+@@ -920,13 +1009,14 @@ int ieee80211_ibss_join(struct ieee80211
+       sdata->vif.bss_conf.beacon_int = params->beacon_interval;
+       sdata->u.ibss.channel = params->channel;
++      sdata->u.ibss.channel_type = params->channel_type;
+       sdata->u.ibss.fixed_channel = params->channel_fixed;
+       /* fix ourselves to that channel now already */
+       if (params->channel_fixed) {
+               sdata->local->oper_channel = params->channel;
+               WARN_ON(!ieee80211_set_channel_type(sdata->local, sdata,
+-                                                  NL80211_CHAN_NO_HT));
++                                                  params->channel_type));
+       }
+       if (params->ie) {
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2138,7 +2138,8 @@ ieee80211_rx_h_action(struct ieee80211_r
+               if (sdata->vif.type != NL80211_IFTYPE_STATION &&
+                   sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
+                   sdata->vif.type != NL80211_IFTYPE_AP &&
+-                  sdata->vif.type != NL80211_IFTYPE_WDS)
++                  sdata->vif.type != NL80211_IFTYPE_WDS &&
++                  sdata->vif.type != NL80211_IFTYPE_ADHOC)
+                       break;
+               /* verify action_code is present */
+@@ -2654,7 +2655,8 @@ static int prepare_for_handlers(struct i
+                       else
+                               rate_idx = status->rate_idx;
+                       rx->sta = ieee80211_ibss_add_sta(sdata, bssid,
+-                                      hdr->addr2, BIT(rate_idx), GFP_ATOMIC);
++                                      hdr->addr2, BIT(rate_idx), NULL,
++                                                              GFP_ATOMIC);
+               }
+               break;
+       case NL80211_IFTYPE_MESH_POINT:
index 592c4982ea38539752a933edb028a498968eec77..767f905a7fad1bf4535642ca4988abcf1f50ba66 100644 (file)
@@ -8,7 +8,7 @@
  #include <asm/unaligned.h>
  
  #include "hw.h"
-@@ -423,8 +424,16 @@ static int ath9k_hw_init_macaddr(struct 
+@@ -443,8 +444,16 @@ static int ath9k_hw_init_macaddr(struct 
                common->macaddr[2 * i] = eeval >> 8;
                common->macaddr[2 * i + 1] = eeval & 0xff;
        }
index 73c45f933fe26736b952c193f955b8e62212c3f8..597d1515546f8a3b9651715a84936dd68231e550 100644 (file)
@@ -1,6 +1,6 @@
 --- a/net/wireless/reg.c
 +++ b/net/wireless/reg.c
-@@ -1645,6 +1645,8 @@ void regulatory_hint_11d(struct wiphy *w
+@@ -1643,6 +1643,8 @@ void regulatory_hint_11d(struct wiphy *w
        enum environment_cap env = ENVIRON_ANY;
        struct regulatory_request *request;
  
@@ -9,7 +9,7 @@
        mutex_lock(&reg_mutex);
  
        if (unlikely(!last_request))
-@@ -1851,6 +1853,8 @@ static void restore_regulatory_settings(
+@@ -1849,6 +1851,8 @@ static void restore_regulatory_settings(
  
  void regulatory_hint_disconnect(void)
  {
index d63724e90bf38dd7a1da361dff263aaa573c0b9b..fdff5dcb942c45795bbcf0ac6b1b84f6dde2573f 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1439,15 +1439,6 @@ static int ath9k_add_interface(struct ie
+@@ -1495,15 +1495,6 @@ static int ath9k_add_interface(struct ie
                }
        }
  
@@ -16,7 +16,7 @@
        ath_dbg(common, ATH_DBG_CONFIG,
                "Attach a VIF of type: %d\n", vif->type);
  
-@@ -1473,15 +1464,6 @@ static int ath9k_change_interface(struct
+@@ -1529,15 +1520,6 @@ static int ath9k_change_interface(struct
        mutex_lock(&sc->mutex);
        ath9k_ps_wakeup(sc);
  
index 59e043227f0b647f3c9d1492ba58a01ca5e4511d..a75477497f89a3f8d37a685043bb4cc2d2dd1dc8 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
 +++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
-@@ -97,13 +97,8 @@ ath5k_add_interface(struct ieee80211_hw 
+@@ -95,13 +95,8 @@ ath5k_add_interface(struct ieee80211_hw 
                goto end;
        }
  
@@ -18,7 +18,7 @@
                goto end;
 --- a/drivers/net/wireless/ath/ath5k/base.c
 +++ b/drivers/net/wireless/ath/ath5k/base.c
-@@ -1880,7 +1880,7 @@ ath5k_beacon_send(struct ath5k_softc *sc
+@@ -1883,7 +1883,7 @@ ath5k_beacon_send(struct ath5k_softc *sc
                sc->bmisscount = 0;
        }
  
@@ -27,7 +27,7 @@
                        sc->opmode == NL80211_IFTYPE_MESH_POINT) {
                u64 tsf = ath5k_hw_get_tsf64(ah);
                u32 tsftu = TSF_TO_TU(tsf);
-@@ -1958,7 +1958,7 @@ ath5k_beacon_update_timers(struct ath5k_
+@@ -1961,7 +1961,7 @@ ath5k_beacon_update_timers(struct ath5k_
        u64 hw_tsf;
  
        intval = sc->bintval & AR5K_BEACON_PERIOD;
index 4d0f861344447d567d653b79d59eebb6bb6ab1cd..f6793541f2aaa60480939a492468ca4f1ecc3858 100644 (file)
@@ -10,7 +10,7 @@
                        /* scratch buffers for virt_to_page() (crypto API) */
 --- a/net/mac80211/wpa.c
 +++ b/net/mac80211/wpa.c
-@@ -407,6 +407,13 @@ ieee80211_crypto_ccmp_encrypt(struct iee
+@@ -441,6 +441,13 @@ ieee80211_crypto_ccmp_encrypt(struct iee
        return TX_CONTINUE;
  }
  
@@ -24,7 +24,7 @@
  
  ieee80211_rx_result
  ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx)
-@@ -419,6 +426,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee
+@@ -453,6 +460,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee
        u8 pn[CCMP_PN_LEN];
        int data_len;
        int queue;
@@ -32,7 +32,7 @@
  
        hdrlen = ieee80211_hdrlen(hdr->frame_control);
  
-@@ -452,6 +460,11 @@ ieee80211_crypto_ccmp_decrypt(struct iee
+@@ -486,6 +494,11 @@ ieee80211_crypto_ccmp_decrypt(struct iee
                        return RX_DROP_UNUSABLE;
        }
  
diff --git a/package/mac80211/patches/430-ath5k_disable_fast_cc.patch b/package/mac80211/patches/430-ath5k_disable_fast_cc.patch
new file mode 100644 (file)
index 0000000..e049645
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/drivers/net/wireless/ath/ath5k/reset.c
++++ b/drivers/net/wireless/ath/ath5k/reset.c
+@@ -1035,6 +1035,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, 
+       tsf_lo = 0;
+       mode = 0;
++#if 0
+       /*
+        * Sanity check for fast flag
+        * Fast channel change only available
+@@ -1042,6 +1043,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, 
+        */
+       if (fast && (ah->ah_radio != AR5K_RF2413) &&
+       (ah->ah_radio != AR5K_RF5413))
++#endif
+               fast = 0;
+       /* Disable sleep clock operation
diff --git a/package/mac80211/patches/440-ath5k_calibrate_srev_checks.patch b/package/mac80211/patches/440-ath5k_calibrate_srev_checks.patch
new file mode 100644 (file)
index 0000000..cbfdad4
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/drivers/net/wireless/ath/ath5k/phy.c
++++ b/drivers/net/wireless/ath/ath5k/phy.c
+@@ -1604,11 +1604,13 @@ int ath5k_hw_phy_calibrate(struct ath5k_
+       int ret;
+       if (ah->ah_radio == AR5K_RF5110)
+-              ret = ath5k_hw_rf5110_calibrate(ah, channel);
+-      else {
+-              ret = ath5k_hw_rf511x_iq_calibrate(ah);
++              return ath5k_hw_rf5110_calibrate(ah, channel);
++
++      ret = ath5k_hw_rf511x_iq_calibrate(ah);
++
++      if (ah->ah_radio == AR5K_RF5112 &&
++          (channel->hw_value & (CHANNEL_5GHZ | CHANNEL_OFDM)))
+               ath5k_hw_request_rfgain_probe(ah);
+-      }
+       return ret;
+ }
diff --git a/package/mac80211/patches/441-ath5k_synth_voltage_srev_check.patch b/package/mac80211/patches/441-ath5k_synth_voltage_srev_check.patch
new file mode 100644 (file)
index 0000000..d08b823
--- /dev/null
@@ -0,0 +1,31 @@
+--- a/drivers/net/wireless/ath/ath5k/phy.c
++++ b/drivers/net/wireless/ath/ath5k/phy.c
+@@ -970,17 +970,20 @@ static int ath5k_hw_rfregs_init(struct a
+                       }
+                       /* Lower synth voltage on Rev 2 */
+-                      ath5k_hw_rfb_op(ah, rf_regs, 2,
+-                                      AR5K_RF_HIGH_VC_CP, true);
++                      if (ah->ah_radio == AR5K_RF5112 &&
++                          (ah->ah_radio_5ghz_revision & AR5K_SREV_REV) > 0) {
++                              ath5k_hw_rfb_op(ah, rf_regs, 2,
++                                              AR5K_RF_HIGH_VC_CP, true);
+-                      ath5k_hw_rfb_op(ah, rf_regs, 2,
+-                                      AR5K_RF_MID_VC_CP, true);
++                              ath5k_hw_rfb_op(ah, rf_regs, 2,
++                                              AR5K_RF_MID_VC_CP, true);
+-                      ath5k_hw_rfb_op(ah, rf_regs, 2,
+-                                      AR5K_RF_LOW_VC_CP, true);
++                              ath5k_hw_rfb_op(ah, rf_regs, 2,
++                                              AR5K_RF_LOW_VC_CP, true);
+-                      ath5k_hw_rfb_op(ah, rf_regs, 2,
+-                                      AR5K_RF_PUSH_UP, true);
++                              ath5k_hw_rfb_op(ah, rf_regs, 2,
++                                              AR5K_RF_PUSH_UP, true);
++                      }
+                       /* Decrease power consumption on 5213+ BaseBand */
+                       if (ah->ah_phy_revision >= AR5K_SREV_PHY_5212A) {
diff --git a/package/mac80211/patches/442-ath5k_spur_channel_srev_check.patch b/package/mac80211/patches/442-ath5k_spur_channel_srev_check.patch
new file mode 100644 (file)
index 0000000..1931be8
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/drivers/net/wireless/ath/ath5k/phy.c
++++ b/drivers/net/wireless/ath/ath5k/phy.c
+@@ -105,6 +105,7 @@ bool ath5k_hw_chan_has_spur_noise(struct
+       if ((ah->ah_radio == AR5K_RF5112) ||
+       (ah->ah_radio == AR5K_RF5413) ||
++      (ah->ah_radio == AR5K_RF2413) ||
+       (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4)))
+               refclk_freq = 40;
+       else
diff --git a/package/mac80211/patches/443-ath5k_initialize_clockrate.patch b/package/mac80211/patches/443-ath5k_initialize_clockrate.patch
new file mode 100644 (file)
index 0000000..fedc2f4
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/drivers/net/wireless/ath/ath5k/base.c
++++ b/drivers/net/wireless/ath/ath5k/base.c
+@@ -2422,6 +2422,7 @@ ath5k_init_softc(struct ath5k_softc *sc,
+       common->ah = sc->ah;
+       common->hw = hw;
+       common->priv = sc;
++      common->clockrate = 40;
+       /*
+        * Cache line size is used to size and align various
diff --git a/package/mac80211/patches/444-ath5k_delay_calibration.patch b/package/mac80211/patches/444-ath5k_delay_calibration.patch
new file mode 100644 (file)
index 0000000..f5dd3f2
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/drivers/net/wireless/ath/ath5k/base.c
++++ b/drivers/net/wireless/ath/ath5k/base.c
+@@ -2728,7 +2728,7 @@ ath5k_reset(struct ath5k_softc *sc, stru
+       ath5k_ani_init(ah, ani_mode);
+-      ah->ah_cal_next_full = jiffies;
++      ah->ah_cal_next_full = jiffies + msecs_to_jiffies(100);
+       ah->ah_cal_next_ani = jiffies;
+       ah->ah_cal_next_nf = jiffies;
+       ewma_init(&ah->ah_beacon_rssi_avg, 1024, 8);
diff --git a/package/mac80211/patches/445-ath5k_fix_mac_clock_restore.patch b/package/mac80211/patches/445-ath5k_fix_mac_clock_restore.patch
new file mode 100644 (file)
index 0000000..e171cd1
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/drivers/net/wireless/ath/ath5k/reset.c
++++ b/drivers/net/wireless/ath/ath5k/reset.c
+@@ -233,7 +233,7 @@ static void ath5k_hw_init_core_clock(str
+ static void ath5k_hw_set_sleep_clock(struct ath5k_hw *ah, bool enable)
+ {
+       struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
+-      u32 scal, spending;
++      u32 scal, spending, sclock;
+       /* Only set 32KHz settings if we have an external
+        * 32KHz crystal present */
+@@ -317,6 +317,15 @@ static void ath5k_hw_set_sleep_clock(str
+               /* Set up tsf increment on each cycle */
+               AR5K_REG_WRITE_BITS(ah, AR5K_TSF_PARM, AR5K_TSF_PARM_INC, 1);
++
++              if ((ah->ah_radio == AR5K_RF5112) ||
++                      (ah->ah_radio == AR5K_RF5413) ||
++                      (ah->ah_radio == AR5K_RF2316) ||
++                      (ah->ah_radio == AR5K_RF2317))
++                      sclock = 40 - 1;
++              else
++                      sclock = 32 - 1;
++              AR5K_REG_WRITE_BITS(ah, AR5K_USEC_5211, AR5K_USEC_32, sclock);
+       }
+ }
diff --git a/package/mac80211/patches/446-ath5k_disable_32khz_clock.patch b/package/mac80211/patches/446-ath5k_disable_32khz_clock.patch
new file mode 100644 (file)
index 0000000..21bf037
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/drivers/net/wireless/ath/ath5k/reset.c
++++ b/drivers/net/wireless/ath/ath5k/reset.c
+@@ -1287,15 +1287,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, 
+        */
+       ath5k_hw_dma_init(ah);
+-
+-      /* Enable 32KHz clock function for AR5212+ chips
+-       * Set clocks to 32KHz operation and use an
+-       * external 32KHz crystal when sleeping if one
+-       * exists */
+-      if (ah->ah_version == AR5K_AR5212 &&
+-          op_mode != NL80211_IFTYPE_AP)
+-              ath5k_hw_set_sleep_clock(ah, true);
+-
+       /*
+        * Disable beacons and reset the TSF
+        */
diff --git a/package/mac80211/patches/447-ath5k_fix_queue_stop_warning.patch b/package/mac80211/patches/447-ath5k_fix_queue_stop_warning.patch
new file mode 100644 (file)
index 0000000..ade0eef
--- /dev/null
@@ -0,0 +1,23 @@
+--- a/drivers/net/wireless/ath/ath5k/base.c
++++ b/drivers/net/wireless/ath/ath5k/base.c
+@@ -1555,7 +1555,8 @@ ath5k_tx_queue(struct ieee80211_hw *hw, 
+               goto drop_packet;
+       }
+-      if (txq->txq_len >= txq->txq_max)
++      if (txq->txq_len >= txq->txq_max &&
++          txq->qnum <= AR5K_TX_QUEUE_ID_DATA_MAX)
+               ieee80211_stop_queue(hw, txq->qnum);
+       spin_lock_irqsave(&sc->txbuflock, flags);
+@@ -1931,6 +1932,10 @@ ath5k_beacon_send(struct ath5k_softc *sc
+       skb = ieee80211_get_buffered_bc(sc->hw, vif);
+       while (skb) {
+               ath5k_tx_queue(sc->hw, skb, sc->cabq);
++
++              if (sc->cabq->txq_len >= sc->cabq->txq_max)
++                      break;
++
+               skb = ieee80211_get_buffered_bc(sc->hw, vif);
+       }
index 904484ef4173caf1dfa52606f2055684b2f7edba..df11fe40e787c9529041b4b0c4233996e6760145 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/debug.c
 +++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1115,6 +1115,53 @@ static const struct file_operations fops
+@@ -1181,6 +1181,53 @@ static const struct file_operations fops
        .llseek = default_llseek,/* read accesses f_pos */
  };
  
@@ -54,7 +54,7 @@
  int ath9k_init_debug(struct ath_hw *ah)
  {
        struct ath_common *common = ath9k_hw_common(ah);
-@@ -1163,6 +1210,9 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1231,6 +1278,9 @@ int ath9k_init_debug(struct ath_hw *ah)
        debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR,
                           sc->debug.debugfs_phy, &sc->sc_ah->gpio_val);
  
index 4330dd4b6a970b4b74e94418ec1db02a2c5bf400..c3e56d3f1777db91e862326c66dcda4d4f63abde 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -1450,8 +1450,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+@@ -1591,8 +1591,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
        REG_WRITE(ah, AR_OBS, 8);
  
        if (ah->config.rx_intr_mitigation) {
index d162c9bb41bb0a7d40d68034b76b8701c78d2a12..d9e996a72b9ef1435bbfec65e93cae849da726a0 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -367,7 +367,7 @@ struct ath_vif {
+@@ -363,7 +363,7 @@ struct ath_vif {
   * number of beacon intervals, the game's up.
   */
  #define BSTUCK_THRESH                 9
@@ -11,7 +11,7 @@
  #define IEEE80211_MS_TO_TU(x)           (((x) * 1000) / 1024)
 --- a/drivers/net/wireless/ath/ath9k/hw.c
 +++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -344,8 +344,8 @@ static void ath9k_hw_init_config(struct 
+@@ -364,8 +364,8 @@ static void ath9k_hw_init_config(struct 
  {
        int i;
  
diff --git a/package/mac80211/patches/512-ath9k_reduce_rxbuf.patch b/package/mac80211/patches/512-ath9k_reduce_rxbuf.patch
new file mode 100644 (file)
index 0000000..2384931
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/drivers/net/wireless/ath/ath9k/ath9k.h
++++ b/drivers/net/wireless/ath/ath9k/ath9k.h
+@@ -117,7 +117,7 @@ void ath_descdma_cleanup(struct ath_soft
+ /* RX / TX */
+ /***********/
+-#define ATH_RXBUF               512
++#define ATH_RXBUF               128
+ #define ATH_TXBUF               512
+ #define ATH_TXBUF_RESERVE       5
+ #define ATH_MAX_QDEPTH          (ATH_TXBUF / 4 - ATH_TXBUF_RESERVE)
diff --git a/package/mac80211/patches/521-mac80211_ht_change_rate_update.patch b/package/mac80211/patches/521-mac80211_ht_change_rate_update.patch
new file mode 100644 (file)
index 0000000..d2f1982
--- /dev/null
@@ -0,0 +1,35 @@
+--- a/net/mac80211/main.c
++++ b/net/mac80211/main.c
+@@ -239,7 +239,9 @@ void ieee80211_bss_info_change_notify(st
+                                     u32 changed)
+ {
+       struct ieee80211_local *local = sdata->local;
++      struct ieee80211_supported_band *sband;
+       static const u8 zero[ETH_ALEN] = { 0 };
++      struct sta_info *sta;
+       if (!changed)
+               return;
+@@ -269,6 +271,22 @@ void ieee80211_bss_info_change_notify(st
+       switch (sdata->vif.type) {
+       case NL80211_IFTYPE_AP:
++              if (!(changed & BSS_CHANGED_HT))
++                      break;
++
++              sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
++              rcu_read_lock();
++              list_for_each_entry(sta, &local->sta_list, list) {
++                      if (sta->sdata != sdata &&
++                          (!sdata->bss || sta->sdata->bss != sdata->bss))
++                              continue;
++
++                      rate_control_rate_update(local, sband, sta,
++                              IEEE80211_RC_HT_CHANGED,
++                              local->_oper_channel_type);
++              }
++              rcu_read_unlock();
++              break;
+       case NL80211_IFTYPE_ADHOC:
+       case NL80211_IFTYPE_WDS:
+       case NL80211_IFTYPE_MESH_POINT:
diff --git a/package/mac80211/patches/530-ath9k_noise_dbm_fixup.patch b/package/mac80211/patches/530-ath9k_noise_dbm_fixup.patch
new file mode 100644 (file)
index 0000000..7e41b2c
--- /dev/null
@@ -0,0 +1,99 @@
+--- a/drivers/net/wireless/ath/ath9k/calib.c
++++ b/drivers/net/wireless/ath/ath9k/calib.c
+@@ -63,6 +63,19 @@ static s16 ath9k_hw_get_default_nf(struc
+       return ath9k_hw_get_nf_limits(ah, chan)->nominal;
+ }
++s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan)
++{
++      s8 noise = ATH_DEFAULT_NOISE_FLOOR;
++
++      if (chan && chan->noisefloor) {
++              s8 delta = chan->noisefloor -
++                         ath9k_hw_get_default_nf(ah, chan);
++              if (delta > 0)
++                      noise += delta;
++      }
++      return noise;
++}
++EXPORT_SYMBOL(ath9k_hw_getchan_noise);
+ static void ath9k_hw_update_nfcal_hist_buffer(struct ath_hw *ah,
+                                             struct ath9k_hw_cal_data *cal,
+@@ -378,6 +391,7 @@ bool ath9k_hw_getnf(struct ath_hw *ah, s
+       if (!caldata) {
+               chan->noisefloor = nf;
++              ah->noise = ath9k_hw_getchan_noise(ah, chan);
+               return false;
+       }
+@@ -385,6 +399,7 @@ bool ath9k_hw_getnf(struct ath_hw *ah, s
+       caldata->nfcal_pending = false;
+       ath9k_hw_update_nfcal_hist_buffer(ah, caldata, nfarray);
+       chan->noisefloor = h[0].privNF;
++      ah->noise = ath9k_hw_getchan_noise(ah, chan);
+       return true;
+ }
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -1427,6 +1427,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+               memset(caldata, 0, sizeof(*caldata));
+               ath9k_init_nfcal_hist_buffer(ah, chan);
+       }
++      ah->noise = ath9k_hw_getchan_noise(ah, chan);
+       if (bChannelChange &&
+           (ah->chip_fullsleep != true) &&
+--- a/drivers/net/wireless/ath/ath9k/hw.h
++++ b/drivers/net/wireless/ath/ath9k/hw.h
+@@ -688,6 +688,7 @@ struct ath_hw {
+       enum nl80211_iftype opmode;
+       enum ath9k_power_mode power_mode;
++      s8 noise;
+       struct ath9k_hw_cal_data *caldata;
+       struct ath9k_pacal_info pacal_info;
+       struct ar5416Stats stats;
+--- a/drivers/net/wireless/ath/ath9k/main.c
++++ b/drivers/net/wireless/ath/ath9k/main.c
+@@ -163,7 +163,7 @@ static void ath_update_survey_nf(struct 
+       if (chan->noisefloor) {
+               survey->filled |= SURVEY_INFO_NOISE_DBM;
+-              survey->noise = chan->noisefloor;
++              survey->noise = ath9k_hw_getchan_noise(ah, chan);
+       }
+ }
+--- a/drivers/net/wireless/ath/ath9k/recv.c
++++ b/drivers/net/wireless/ath/ath9k/recv.c
+@@ -986,6 +986,8 @@ static int ath9k_rx_skb_preprocess(struc
+                                  struct ieee80211_rx_status *rx_status,
+                                  bool *decrypt_error)
+ {
++      struct ath_hw *ah = common->ah;
++
+       memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
+       /*
+@@ -1006,7 +1008,7 @@ static int ath9k_rx_skb_preprocess(struc
+       rx_status->band = hw->conf.channel->band;
+       rx_status->freq = hw->conf.channel->center_freq;
+-      rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi;
++      rx_status->signal = ah->noise + rx_stats->rs_rssi;
+       rx_status->antenna = rx_stats->rs_antenna;
+       rx_status->flag |= RX_FLAG_MACTIME_MPDU;
+--- a/drivers/net/wireless/ath/ath9k/calib.h
++++ b/drivers/net/wireless/ath/ath9k/calib.h
+@@ -108,6 +108,7 @@ void ath9k_init_nfcal_hist_buffer(struct
+ void ath9k_hw_bstuck_nfcal(struct ath_hw *ah);
+ void ath9k_hw_reset_calibration(struct ath_hw *ah,
+                               struct ath9k_cal_list *currCal);
++s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan);
+ #endif /* CALIB_H */
diff --git a/package/mac80211/patches/540-ath9k_channelbw_debugfs.patch b/package/mac80211/patches/540-ath9k_channelbw_debugfs.patch
new file mode 100644 (file)
index 0000000..9c2c014
--- /dev/null
@@ -0,0 +1,54 @@
+--- a/drivers/net/wireless/ath/ath9k/ath9k.h
++++ b/drivers/net/wireless/ath/ath9k/ath9k.h
+@@ -586,6 +586,7 @@ struct ath_softc {
+       struct ieee80211_hw *hw;
+       struct device *dev;
++      u32 chan_bw;
+       int chan_idx;
+       int chan_is_ht;
+       struct survey_info *cur_survey;
+--- a/drivers/net/wireless/ath/ath9k/debug.c
++++ b/drivers/net/wireless/ath/ath9k/debug.c
+@@ -1281,6 +1281,9 @@ int ath9k_init_debug(struct ath_hw *ah)
+       debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
+                           &fops_eeprom);
++      debugfs_create_u32("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
++                         &sc->chan_bw);
++
+       sc->debug.regidx = 0;
+       return 0;
+ }
+--- a/drivers/net/wireless/ath/ath9k/main.c
++++ b/drivers/net/wireless/ath/ath9k/main.c
+@@ -226,6 +226,7 @@ static int ath_set_channel(struct ath_so
+       bool fastcc = true, stopped;
+       struct ieee80211_channel *channel = hw->conf.channel;
+       struct ath9k_hw_cal_data *caldata = NULL;
++      u32 oldflags;
+       int r;
+       if (sc->sc_flags & SC_OP_INVALID)
+@@ -268,6 +269,21 @@ static int ath_set_channel(struct ath_so
+       if (!stopped || !(sc->sc_flags & SC_OP_OFFCHANNEL))
+               fastcc = false;
++      oldflags = hchan->channelFlags;
++      switch (sc->chan_bw) {
++      case 5:
++              hchan->channelFlags &= ~CHANNEL_HALF;
++              hchan->channelFlags |= CHANNEL_QUARTER;
++              break;
++      case 10:
++              hchan->channelFlags &= ~CHANNEL_QUARTER;
++              hchan->channelFlags |= CHANNEL_HALF;
++              break;
++      }
++
++      if (oldflags != hchan->channelFlags)
++              fastcc = false;
++
+       if (!(sc->sc_flags & SC_OP_OFFCHANNEL))
+               caldata = &sc->caldata;
diff --git a/package/mac80211/patches/540-mac80211_remove_wds_sta_flag.patch b/package/mac80211/patches/540-mac80211_remove_wds_sta_flag.patch
deleted file mode 100644 (file)
index 29c2fd7..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
---- a/net/mac80211/sta_info.h
-+++ b/net/mac80211/sta_info.h
-@@ -31,7 +31,6 @@
-  *    frames.
-  * @WLAN_STA_ASSOC_AP: We're associated to that station, it is an AP.
-  * @WLAN_STA_WME: Station is a QoS-STA.
-- * @WLAN_STA_WDS: Station is one of our WDS peers.
-  * @WLAN_STA_CLEAR_PS_FILT: Clear PS filter in hardware (using the
-  *    IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next
-  *    frame to this station is transmitted.
-@@ -54,7 +53,6 @@ enum ieee80211_sta_info_flags {
-       WLAN_STA_SHORT_PREAMBLE = 1<<4,
-       WLAN_STA_ASSOC_AP       = 1<<5,
-       WLAN_STA_WME            = 1<<6,
--      WLAN_STA_WDS            = 1<<7,
-       WLAN_STA_CLEAR_PS_FILT  = 1<<9,
-       WLAN_STA_MFP            = 1<<10,
-       WLAN_STA_BLOCK_BA       = 1<<11,
---- a/net/mac80211/debugfs_sta.c
-+++ b/net/mac80211/debugfs_sta.c
-@@ -59,7 +59,7 @@ static ssize_t sta_flags_read(struct fil
-       char buf[100];
-       struct sta_info *sta = file->private_data;
-       u32 staflags = get_sta_flags(sta);
--      int res = scnprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s",
-+      int res = scnprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s",
-               staflags & WLAN_STA_AUTH ? "AUTH\n" : "",
-               staflags & WLAN_STA_ASSOC ? "ASSOC\n" : "",
-               staflags & WLAN_STA_PS_STA ? "PS (sta)\n" : "",
-@@ -67,7 +67,6 @@ static ssize_t sta_flags_read(struct fil
-               staflags & WLAN_STA_AUTHORIZED ? "AUTHORIZED\n" : "",
-               staflags & WLAN_STA_SHORT_PREAMBLE ? "SHORT PREAMBLE\n" : "",
-               staflags & WLAN_STA_WME ? "WME\n" : "",
--              staflags & WLAN_STA_WDS ? "WDS\n" : "",
-               staflags & WLAN_STA_MFP ? "MFP\n" : "");
-       return simple_read_from_buffer(userbuf, count, ppos, buf, res);
- }
diff --git a/package/mac80211/patches/541-ath9k_pllclock_fix.patch b/package/mac80211/patches/541-ath9k_pllclock_fix.patch
new file mode 100644 (file)
index 0000000..4738159
--- /dev/null
@@ -0,0 +1,42 @@
+--- a/drivers/net/wireless/ath/ath9k/ar9002_phy.c
++++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.c
+@@ -447,26 +447,27 @@ static void ar9002_olc_init(struct ath_h
+ static u32 ar9002_hw_compute_pll_control(struct ath_hw *ah,
+                                        struct ath9k_channel *chan)
+ {
++      int ref_div = 5;
++      int pll_div = 0x2c;
+       u32 pll;
+-      pll = SM(0x5, AR_RTC_9160_PLL_REFDIV);
++      if (chan && IS_CHAN_5GHZ(chan) && !IS_CHAN_A_FAST_CLOCK(ah, chan)) {
++              if (AR_SREV_9280_20(ah)) {
++                      ref_div = 10;
++                      pll_div = 0x50;
++              } else {
++                      pll_div = 0x28;
++              }
++      }
++
++      pll = SM(ref_div, AR_RTC_9160_PLL_REFDIV);
++      pll |= SM(pll_div, AR_RTC_9160_PLL_DIV);
+       if (chan && IS_CHAN_HALF_RATE(chan))
+               pll |= SM(0x1, AR_RTC_9160_PLL_CLKSEL);
+       else if (chan && IS_CHAN_QUARTER_RATE(chan))
+               pll |= SM(0x2, AR_RTC_9160_PLL_CLKSEL);
+-      if (chan && IS_CHAN_5GHZ(chan)) {
+-              if (IS_CHAN_A_FAST_CLOCK(ah, chan))
+-                      pll = 0x142c;
+-              else if (AR_SREV_9280_20(ah))
+-                      pll = 0x2850;
+-              else
+-                      pll |= SM(0x28, AR_RTC_9160_PLL_DIV);
+-      } else {
+-              pll |= SM(0x2c, AR_RTC_9160_PLL_DIV);
+-      }
+-
+       return pll;
+ }
diff --git a/package/mac80211/patches/541-mac80211_fix_iftype_wds.patch b/package/mac80211/patches/541-mac80211_fix_iftype_wds.patch
deleted file mode 100644 (file)
index 693cdd2..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2330,13 +2330,14 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_
-       if (!ieee80211_vif_is_mesh(&sdata->vif) &&
-           sdata->vif.type != NL80211_IFTYPE_ADHOC &&
--          sdata->vif.type != NL80211_IFTYPE_STATION)
-+          sdata->vif.type != NL80211_IFTYPE_STATION &&
-+          sdata->vif.type != NL80211_IFTYPE_WDS)
-               return RX_DROP_MONITOR;
-       switch (stype) {
-       case cpu_to_le16(IEEE80211_STYPE_BEACON):
-       case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP):
--              /* process for all: mesh, mlme, ibss */
-+              /* process for all: mesh, mlme, ibss, wds */
-               break;
-       case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
-       case cpu_to_le16(IEEE80211_STYPE_DISASSOC):
-@@ -2716,7 +2717,10 @@ static int prepare_for_handlers(struct i
-               }
-               break;
-       case NL80211_IFTYPE_WDS:
--              if (bssid || !ieee80211_is_data(hdr->frame_control))
-+              if (bssid) {
-+                      if (!ieee80211_is_beacon(hdr->frame_control))
-+                              return 0;
-+              } else if (!ieee80211_is_data(hdr->frame_control))
-                       return 0;
-               if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2))
-                       return 0;
---- a/net/mac80211/iface.c
-+++ b/net/mac80211/iface.c
-@@ -178,7 +178,6 @@ static int ieee80211_do_open(struct net_
- {
-       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-       struct ieee80211_local *local = sdata->local;
--      struct sta_info *sta;
-       u32 changed = 0;
-       int res;
-       u32 hw_reconf_flags = 0;
-@@ -290,27 +289,6 @@ static int ieee80211_do_open(struct net_
-       set_bit(SDATA_STATE_RUNNING, &sdata->state);
--      if (sdata->vif.type == NL80211_IFTYPE_WDS) {
--              /* Create STA entry for the WDS peer */
--              sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
--                                   GFP_KERNEL);
--              if (!sta) {
--                      res = -ENOMEM;
--                      goto err_del_interface;
--              }
--
--              /* no locking required since STA is not live yet */
--              sta->flags |= WLAN_STA_AUTHORIZED;
--
--              res = sta_info_insert(sta);
--              if (res) {
--                      /* STA has been freed */
--                      goto err_del_interface;
--              }
--
--              rate_control_rate_init(sta);
--      }
--
-       /*
-        * set_multicast_list will be invoked by the networking core
-        * which will check whether any increments here were done in
-@@ -344,8 +322,7 @@ static int ieee80211_do_open(struct net_
-       netif_tx_start_all_queues(dev);
-       return 0;
-- err_del_interface:
--      drv_remove_interface(local, &sdata->vif);
-+
-  err_stop:
-       if (!local->open_count)
-               drv_stop(local);
-@@ -717,6 +694,70 @@ static void ieee80211_if_setup(struct ne
-       dev->destructor = free_netdev;
- }
-+static void ieee80211_wds_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
-+                                       struct sk_buff *skb)
-+{
-+      struct ieee80211_local *local = sdata->local;
-+      struct ieee80211_rx_status *rx_status;
-+      struct ieee802_11_elems elems;
-+      struct ieee80211_mgmt *mgmt;
-+      struct sta_info *sta;
-+      size_t baselen;
-+      u32 rates = 0;
-+      u16 stype;
-+      bool new = false;
-+      enum ieee80211_band band = local->hw.conf.channel->band;
-+      struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band];
-+
-+      rx_status = IEEE80211_SKB_RXCB(skb);
-+      mgmt = (struct ieee80211_mgmt *) skb->data;
-+      stype = le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE;
-+
-+      if (stype != IEEE80211_STYPE_BEACON)
-+              return;
-+
-+      baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
-+      if (baselen > skb->len)
-+              return;
-+
-+      ieee802_11_parse_elems(mgmt->u.probe_resp.variable,
-+                             skb->len - baselen, &elems);
-+
-+      rates = ieee80211_sta_get_rates(local, &elems, band);
-+
-+      rcu_read_lock();
-+
-+      sta = sta_info_get(sdata, sdata->u.wds.remote_addr);
-+
-+      if (!sta) {
-+              rcu_read_unlock();
-+              sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
-+                                   GFP_KERNEL);
-+              if (!sta)
-+                      return;
-+
-+              new = true;
-+      }
-+
-+      sta->last_rx = jiffies;
-+      sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
-+
-+      if (elems.ht_cap_elem)
-+              ieee80211_ht_cap_ie_to_sta_ht_cap(sband,
-+                              elems.ht_cap_elem, &sta->sta.ht_cap);
-+
-+      if (elems.wmm_param)
-+              set_sta_flags(sta, WLAN_STA_WME);
-+
-+      if (new) {
-+              sta->flags = WLAN_STA_AUTHORIZED;
-+              rate_control_rate_init(sta);
-+              sta_info_insert_rcu(sta);
-+      }
-+
-+      rcu_read_unlock();
-+}
-+
- static void ieee80211_iface_work(struct work_struct *work)
- {
-       struct ieee80211_sub_if_data *sdata =
-@@ -821,6 +862,9 @@ static void ieee80211_iface_work(struct 
-                               break;
-                       ieee80211_mesh_rx_queued_mgmt(sdata, skb);
-                       break;
-+              case NL80211_IFTYPE_WDS:
-+                      ieee80211_wds_rx_queued_mgmt(sdata, skb);
-+                      break;
-               default:
-                       WARN(1, "frame for unexpected interface type");
-                       break;
diff --git a/package/mac80211/patches/542-mac80211_enable_iftype_wds_aggregation.patch b/package/mac80211/patches/542-mac80211_enable_iftype_wds_aggregation.patch
deleted file mode 100644 (file)
index 953ff59..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/net/mac80211/agg-tx.c
-+++ b/net/mac80211/agg-tx.c
-@@ -79,7 +79,8 @@ static void ieee80211_send_addba_request
-       memcpy(mgmt->da, da, ETH_ALEN);
-       memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
-       if (sdata->vif.type == NL80211_IFTYPE_AP ||
--          sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
-+          sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
-+              sdata->vif.type == NL80211_IFTYPE_WDS)
-               memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
-       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
-               memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
-@@ -377,7 +378,8 @@ int ieee80211_start_tx_ba_session(struct
-        */
-       if (sdata->vif.type != NL80211_IFTYPE_STATION &&
-           sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
--          sdata->vif.type != NL80211_IFTYPE_AP)
-+          sdata->vif.type != NL80211_IFTYPE_AP &&
-+          sdata->vif.type != NL80211_IFTYPE_WDS)
-               return -EINVAL;
-       if (test_sta_flags(sta, WLAN_STA_BLOCK_BA)) {
---- a/net/mac80211/agg-rx.c
-+++ b/net/mac80211/agg-rx.c
-@@ -160,6 +160,8 @@ static void ieee80211_send_addba_resp(st
-               memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
-       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
-               memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
-+      else if (sdata->vif.type == NL80211_IFTYPE_WDS)
-+              memcpy(mgmt->bssid, da, ETH_ALEN);
-       mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
-                                         IEEE80211_STYPE_ACTION);
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2132,7 +2132,8 @@ ieee80211_rx_h_action(struct ieee80211_r
-                */
-               if (sdata->vif.type != NL80211_IFTYPE_STATION &&
-                   sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
--                  sdata->vif.type != NL80211_IFTYPE_AP)
-+                  sdata->vif.type != NL80211_IFTYPE_AP &&
-+                  sdata->vif.type != NL80211_IFTYPE_WDS)
-                       break;
-               /* verify action_code is present */
-@@ -2717,13 +2718,16 @@ static int prepare_for_handlers(struct i
-               }
-               break;
-       case NL80211_IFTYPE_WDS:
--              if (bssid) {
--                      if (!ieee80211_is_beacon(hdr->frame_control))
--                              return 0;
--              } else if (!ieee80211_is_data(hdr->frame_control))
--                      return 0;
-               if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2))
-                       return 0;
-+
-+              if (ieee80211_is_data(hdr->frame_control) ||
-+                  ieee80211_is_action(hdr->frame_control)) {
-+                      if (compare_ether_addr(sdata->vif.addr, hdr->addr1))
-+                              return 0;
-+              } else if (!ieee80211_is_beacon(hdr->frame_control))
-+                      return 0;
-+
-               break;
-       default:
-               /* should never get here */
diff --git a/package/mac80211/patches/550-ath9k_debugfs_show_xretry.patch b/package/mac80211/patches/550-ath9k_debugfs_show_xretry.patch
deleted file mode 100644 (file)
index 858f279..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/debug.c
-+++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -543,6 +543,7 @@ static ssize_t read_file_xmit(struct fil
-       PR("MPDUs Queued:    ", queued);
-       PR("MPDUs Completed: ", completed);
-+      PR("MPDUs XRetried:  ", xretries);
-       PR("Aggregates:      ", a_aggr);
-       PR("AMPDUs Queued HW:", a_queued_hw);
-       PR("AMPDUs Queued SW:", a_queued_sw);
-@@ -798,7 +799,10 @@ void ath_debug_stat_tx(struct ath_softc 
-               else
-                       TX_STAT_INC(qnum, a_completed);
-       } else {
--              TX_STAT_INC(qnum, completed);
-+              if (bf_isxretried(bf))
-+                      TX_STAT_INC(qnum, xretries);
-+              else
-+                      TX_STAT_INC(qnum, completed);
-       }
-       if (ts->ts_status & ATH9K_TXERR_FIFO)
---- a/drivers/net/wireless/ath/ath9k/debug.h
-+++ b/drivers/net/wireless/ath/ath9k/debug.h
-@@ -112,6 +112,7 @@ struct ath_tx_stats {
-       u32 tx_bytes_all;
-       u32 queued;
-       u32 completed;
-+      u32 xretries;
-       u32 a_aggr;
-       u32 a_queued_hw;
-       u32 a_queued_sw;
diff --git a/package/mac80211/patches/560-mac80211_ht_change_rate_update.patch b/package/mac80211/patches/560-mac80211_ht_change_rate_update.patch
deleted file mode 100644 (file)
index bff6a6b..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
---- a/net/mac80211/main.c
-+++ b/net/mac80211/main.c
-@@ -245,7 +245,9 @@ void ieee80211_bss_info_change_notify(st
-                                     u32 changed)
- {
-       struct ieee80211_local *local = sdata->local;
-+      struct ieee80211_supported_band *sband;
-       static const u8 zero[ETH_ALEN] = { 0 };
-+      struct sta_info *sta;
-       if (!changed)
-               return;
-@@ -275,6 +277,22 @@ void ieee80211_bss_info_change_notify(st
-       switch (sdata->vif.type) {
-       case NL80211_IFTYPE_AP:
-+              if (!(changed & BSS_CHANGED_HT))
-+                      break;
-+
-+              sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
-+              rcu_read_lock();
-+              list_for_each_entry(sta, &local->sta_list, list) {
-+                      if (sta->sdata != sdata &&
-+                          (!sdata->bss || sta->sdata->bss != sdata->bss))
-+                              continue;
-+
-+                      rate_control_rate_update(local, sband, sta,
-+                              IEEE80211_RC_HT_CHANGED,
-+                              local->_oper_channel_type);
-+              }
-+              rcu_read_unlock();
-+              break;
-       case NL80211_IFTYPE_ADHOC:
-       case NL80211_IFTYPE_WDS:
-       case NL80211_IFTYPE_MESH_POINT:
diff --git a/package/mac80211/patches/570-ath9k_noise_dbm_fixup.patch b/package/mac80211/patches/570-ath9k_noise_dbm_fixup.patch
deleted file mode 100644 (file)
index 2ba2c56..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/calib.c
-+++ b/drivers/net/wireless/ath/ath9k/calib.c
-@@ -378,6 +378,7 @@ bool ath9k_hw_getnf(struct ath_hw *ah, s
-       if (!caldata) {
-               chan->noisefloor = nf;
-+              ah->noise = ath9k_hw_getchan_noise(ah, chan);
-               return false;
-       }
-@@ -385,6 +386,7 @@ bool ath9k_hw_getnf(struct ath_hw *ah, s
-       caldata->nfcal_pending = false;
-       ath9k_hw_update_nfcal_hist_buffer(ah, caldata, nfarray);
-       chan->noisefloor = h[0].privNF;
-+      ah->noise = ath9k_hw_getchan_noise(ah, chan);
-       return true;
- }
-@@ -411,10 +413,15 @@ void ath9k_init_nfcal_hist_buffer(struct
- s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan)
- {
--      if (!ah->curchan || !ah->curchan->noisefloor)
--              return ath9k_hw_get_default_nf(ah, chan);
-+      s8 noise = ATH_DEFAULT_NOISE_FLOOR;
--      return ah->curchan->noisefloor;
-+      if (chan && chan->noisefloor) {
-+              s8 delta = chan->noisefloor -
-+                         ath9k_hw_get_default_nf(ah, chan);
-+              if (delta > 0)
-+                      noise += delta;
-+      }
-+      return noise;
- }
- EXPORT_SYMBOL(ath9k_hw_getchan_noise);
---- a/drivers/net/wireless/ath/ath9k/hw.c
-+++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -1286,6 +1286,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
-               memset(caldata, 0, sizeof(*caldata));
-               ath9k_init_nfcal_hist_buffer(ah, chan);
-       }
-+      ah->noise = ath9k_hw_getchan_noise(ah, chan);
-       if (bChannelChange &&
-           (ah->chip_fullsleep != true) &&
---- a/drivers/net/wireless/ath/ath9k/hw.h
-+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -677,6 +677,7 @@ struct ath_hw {
-       enum nl80211_iftype opmode;
-       enum ath9k_power_mode power_mode;
-+      s8 noise;
-       struct ath9k_hw_cal_data *caldata;
-       struct ath9k_pacal_info pacal_info;
-       struct ar5416Stats stats;
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -165,7 +165,7 @@ static void ath_update_survey_nf(struct 
-       if (chan->noisefloor) {
-               survey->filled |= SURVEY_INFO_NOISE_DBM;
--              survey->noise = chan->noisefloor;
-+              survey->noise = ath9k_hw_getchan_noise(ah, chan);
-       }
- }
---- a/drivers/net/wireless/ath/ath9k/recv.c
-+++ b/drivers/net/wireless/ath/ath9k/recv.c
-@@ -956,6 +956,8 @@ static int ath9k_rx_skb_preprocess(struc
-                                  struct ieee80211_rx_status *rx_status,
-                                  bool *decrypt_error)
- {
-+      struct ath_hw *ah = common->ah;
-+
-       memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
-       /*
-@@ -976,7 +978,7 @@ static int ath9k_rx_skb_preprocess(struc
-       rx_status->band = hw->conf.channel->band;
-       rx_status->freq = hw->conf.channel->center_freq;
--      rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi;
-+      rx_status->signal = ah->noise + rx_stats->rs_rssi;
-       rx_status->antenna = rx_stats->rs_antenna;
-       rx_status->flag |= RX_FLAG_MACTIME_MPDU;
diff --git a/package/mac80211/patches/580-ath9k_fix_adhoc_beacons.patch b/package/mac80211/patches/580-ath9k_fix_adhoc_beacons.patch
deleted file mode 100644 (file)
index d3eb764..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/beacon.c
-+++ b/drivers/net/wireless/ath/ath9k/beacon.c
-@@ -351,9 +351,7 @@ void ath_beacon_tasklet(unsigned long da
-       struct ath_buf *bf = NULL;
-       struct ieee80211_vif *vif;
-       int slot;
--      u32 bfaddr, bc = 0, tsftu;
--      u64 tsf;
--      u16 intval;
-+      u32 bfaddr, bc = 0;
-       /*
-        * Check if the previous beacon has gone out.  If
-@@ -388,17 +386,27 @@ void ath_beacon_tasklet(unsigned long da
-        * on the tsf to safeguard against missing an swba.
-        */
--      intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL;
--      tsf = ath9k_hw_gettsf64(ah);
--      tsf += TU_TO_USEC(ah->config.sw_beacon_response_time);
--      tsftu = TSF_TO_TU((tsf * ATH_BCBUF) >>32, tsf * ATH_BCBUF);
--      slot = (tsftu % (intval * ATH_BCBUF)) / intval;
--      vif = sc->beacon.bslot[slot];
-+      if (ah->opmode == NL80211_IFTYPE_AP) {
-+              u16 intval;
-+              u32 tsftu;
-+              u64 tsf;
-+
-+              intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL;
-+              tsf = ath9k_hw_gettsf64(ah);
-+              tsf += TU_TO_USEC(ah->config.sw_beacon_response_time);
-+              tsftu = TSF_TO_TU((tsf * ATH_BCBUF) >>32, tsf * ATH_BCBUF);
-+              slot = (tsftu % (intval * ATH_BCBUF)) / intval;
-+              vif = sc->beacon.bslot[slot];
-+
-+              ath_dbg(common, ATH_DBG_BEACON,
-+                      "slot %d [tsf %llu tsftu %u intval %u] vif %p\n",
-+                      slot, tsf, tsftu / ATH_BCBUF, intval, vif);
-+      } else {
-+              slot = 0;
-+              vif = sc->beacon.bslot[slot];
-+      }
--      ath_dbg(common, ATH_DBG_BEACON,
--              "slot %d [tsf %llu tsftu %u intval %u] vif %p\n",
--              slot, tsf, tsftu / ATH_BCBUF, intval, vif);
-       bfaddr = 0;
-       if (vif) {
diff --git a/package/mac80211/patches/581-ath9k_fix_adhoc_nexttbtt.patch b/package/mac80211/patches/581-ath9k_fix_adhoc_nexttbtt.patch
deleted file mode 100644 (file)
index 812bf8c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/beacon.c
-+++ b/drivers/net/wireless/ath/ath9k/beacon.c
-@@ -648,7 +648,7 @@ static void ath_beacon_config_adhoc(stru
-                       delta = (tsf - sc->beacon.bc_tstamp);
-               else
-                       delta = (tsf + 1 + (~0U - sc->beacon.bc_tstamp));
--              nexttbtt = tsf + roundup(delta, intval);
-+              nexttbtt = tsf + intval - (delta % intval);
-       }
-       ath_dbg(common, ATH_DBG_BEACON,
diff --git a/package/mac80211/patches/601-rt2x00-set_pci_mwi.patch b/package/mac80211/patches/601-rt2x00-set_pci_mwi.patch
new file mode 100644 (file)
index 0000000..6651a6f
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
++++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
+@@ -272,8 +272,10 @@ int rt2x00pci_probe(struct pci_dev *pci_
+       pci_set_master(pci_dev);
++#ifdef CONFIG_PCI_SET_MWI
+       if (pci_set_mwi(pci_dev))
+               ERROR_PROBE("MWI not available.\n");
++#endif
+       if (dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(32))) {
+               ERROR_PROBE("PCI DMA not supported.\n");
diff --git a/package/mac80211/patches/602-rt2x00-introduce-rt2x00_platform_h.patch b/package/mac80211/patches/602-rt2x00-introduce-rt2x00_platform_h.patch
new file mode 100644 (file)
index 0000000..2194cca
--- /dev/null
@@ -0,0 +1,32 @@
+--- /dev/null
++++ b/include/linux/rt2x00_platform.h
+@@ -0,0 +1,19 @@
++/*
++ * Platform data definition for the rt2x00 driver
++ *
++ * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#ifndef _RT2X00_PLATFORM_H
++#define _RT2X00_PLATFORM_H
++
++struct rt2x00_platform_data {
++      char *eeprom_file_name;
++};
++
++#endif /* _RT2X00_PLATFORM_H */
+--- a/drivers/net/wireless/rt2x00/rt2x00.h
++++ b/drivers/net/wireless/rt2x00/rt2x00.h
+@@ -38,6 +38,7 @@
+ #include <linux/input-polldev.h>
+ #include <linux/kfifo.h>
+ #include <linux/timer.h>
++#include <linux/rt2x00_platform.h>
+ #include <net/mac80211.h>
diff --git a/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch b/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch
new file mode 100644 (file)
index 0000000..fc58744
--- /dev/null
@@ -0,0 +1,274 @@
+--- /dev/null
++++ b/drivers/net/wireless/rt2x00/rt2x00eeprom.c
+@@ -0,0 +1,98 @@
++/*
++      Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
++      Copyright (C) 2004 - 2009 Gertjan van Wingerde <gwingerde@gmail.com>
++      <http://rt2x00.serialmonkey.com>
++
++      This program is free software; you can redistribute it and/or modify
++      it under the terms of the GNU General Public License as published by
++      the Free Software Foundation; either version 2 of the License, or
++      (at your option) any later version.
++
++      This program is distributed in the hope that it will be useful,
++      but WITHOUT ANY WARRANTY; without even the implied warranty of
++      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++      GNU General Public License for more details.
++
++      You should have received a copy of the GNU General Public License
++      along with this program; if not, write to the
++      Free Software Foundation, Inc.,
++      59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ */
++
++/*
++      Module: rt2x00lib
++      Abstract: rt2x00 eeprom file loading routines.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++
++#include "rt2x00.h"
++#include "rt2x00lib.h"
++
++static int rt2x00lib_request_eeprom_file(struct rt2x00_dev *rt2x00dev)
++{
++      const struct firmware *ee;
++      char *ee_name;
++      int retval;
++
++      ee_name = rt2x00dev->ops->lib->get_eeprom_file_name(rt2x00dev);
++      if (!ee_name) {
++              ERROR(rt2x00dev,
++                    "Invalid EEPROM filename.\n"
++                    "Please file bug report to %s.\n", DRV_PROJECT);
++              return -EINVAL;
++      }
++
++      INFO(rt2x00dev, "Loading EEPROM data from '%s'.\n", ee_name);
++
++      retval = request_firmware(&ee, ee_name, rt2x00dev->dev);
++      if (retval) {
++              ERROR(rt2x00dev, "Failed to request EEPROM.\n");
++              return retval;
++      }
++
++      if (!ee || !ee->size || !ee->data) {
++              ERROR(rt2x00dev, "Failed to read EEPROM file.\n");
++              retval = -ENOENT;
++              goto err_exit;
++      }
++
++      if (ee->size != rt2x00dev->ops->eeprom_size) {
++              ERROR(rt2x00dev,
++                    "EEPROM file size is invalid, it should be %d bytes\n",
++                    rt2x00dev->ops->eeprom_size);
++              retval = -EINVAL;
++              goto err_release_ee;
++      }
++
++      rt2x00dev->eeprom_file = ee;
++      return 0;
++
++err_release_ee:
++      release_firmware(ee);
++err_exit:
++      return retval;
++}
++
++int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev)
++{
++      int retval;
++
++      if (!test_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags))
++              return 0;
++
++      if (!rt2x00dev->eeprom_file) {
++              retval = rt2x00lib_request_eeprom_file(rt2x00dev);
++              if (retval)
++                      return retval;
++      }
++
++      return 0;
++}
++
++void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev)
++{
++      release_firmware(rt2x00dev->eeprom_file);
++      rt2x00dev->eeprom_file = NULL;
++}
+--- a/drivers/net/wireless/rt2x00/rt2x00.h
++++ b/drivers/net/wireless/rt2x00/rt2x00.h
+@@ -538,6 +538,7 @@ struct rt2x00lib_ops {
+                              const u8 *data, const size_t len);
+       int (*load_firmware) (struct rt2x00_dev *rt2x00dev,
+                             const u8 *data, const size_t len);
++      char *(*get_eeprom_file_name) (struct rt2x00_dev *rt2x00dev);
+       /*
+        * Device initialization/deinitialization handlers.
+@@ -684,6 +685,7 @@ enum rt2x00_capability_flags {
+       REQUIRE_SW_SEQNO,
+       REQUIRE_HT_TX_DESC,
+       REQUIRE_PS_AUTOWAKE,
++      REQUIRE_EEPROM_FILE,
+       /*
+        * Capabilities
+@@ -939,6 +941,11 @@ struct rt2x00_dev {
+       const struct firmware *fw;
+       /*
++       * EEPROM image.
++       */
++      const struct firmware *eeprom_file;
++
++      /*
+        * FIFO for storing tx status reports between isr and tasklet.
+        */
+       DECLARE_KFIFO_PTR(txstatus_fifo, u32);
+--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
++++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
+@@ -309,6 +309,22 @@ static inline void rt2x00lib_free_firmwa
+ #endif /* CONFIG_RT2X00_LIB_FIRMWARE */
+ /*
++ * EEPROM file handlers.
++ */
++#ifdef CONFIG_RT2X00_LIB_EEPROM
++int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev);
++void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev);
++#else
++static inline int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev)
++{
++      return 0;
++}
++static inline void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev)
++{
++}
++#endif /* CONFIG_RT2X00_LIB_EEPROM_FILE */
++
++/*
+  * Debugfs handlers.
+  */
+ #ifdef CONFIG_RT2X00_LIB_DEBUGFS
+--- a/drivers/net/wireless/rt2x00/Kconfig
++++ b/drivers/net/wireless/rt2x00/Kconfig
+@@ -60,6 +60,7 @@ config RT2800PCI
+       select RT2X00_LIB_PCI if PCI
+       select RT2X00_LIB_SOC if RALINK_RT288X || RALINK_RT305X
+       select RT2X00_LIB_FIRMWARE
++      select RT2X00_LIB_EEPROM
+       select RT2X00_LIB_CRYPTO
+       select CRC_CCITT
+       select EEPROM_93CX6
+@@ -204,6 +205,9 @@ config RT2X00_LIB_FIRMWARE
+ config RT2X00_LIB_CRYPTO
+       boolean
++config RT2X00_LIB_EEPROM
++      boolean
++
+ config RT2X00_LIB_LEDS
+       boolean
+       default y if (RT2X00_LIB=y && LEDS_CLASS=y) || (RT2X00_LIB=m && LEDS_CLASS!=n)
+--- a/drivers/net/wireless/rt2x00/Makefile
++++ b/drivers/net/wireless/rt2x00/Makefile
+@@ -7,6 +7,7 @@ rt2x00lib-$(CONFIG_RT2X00_LIB_DEBUGFS) +
+ rt2x00lib-$(CONFIG_RT2X00_LIB_CRYPTO) += rt2x00crypto.o
+ rt2x00lib-$(CONFIG_RT2X00_LIB_FIRMWARE)       += rt2x00firmware.o
+ rt2x00lib-$(CONFIG_RT2X00_LIB_LEDS)   += rt2x00leds.o
++rt2x00lib-$(CONFIG_RT2X00_LIB_EEPROM) += rt2x00eeprom.o
+ obj-$(CONFIG_RT2X00_LIB)              += rt2x00lib.o
+ obj-$(CONFIG_RT2X00_LIB_PCI)          += rt2x00pci.o
+--- a/drivers/net/wireless/rt2x00/rt2800pci.c
++++ b/drivers/net/wireless/rt2x00/rt2800pci.c
+@@ -84,20 +84,10 @@ static void rt2800pci_mcu_status(struct 
+       rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
+ }
+-#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
+ static void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
+ {
+-      void __iomem *base_addr = ioremap(0x1F040000, EEPROM_SIZE);
+-
+-      memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE);
+-
+-      iounmap(base_addr);
++      memcpy(rt2x00dev->eeprom, rt2x00dev->eeprom_file->data, EEPROM_SIZE);
+ }
+-#else
+-static inline void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
+-{
+-}
+-#endif /* CONFIG_RALINK_RT288X || CONFIG_RALINK_RT305X */
+ #ifdef CONFIG_PCI
+ static void rt2800pci_eepromregister_read(struct eeprom_93cx6 *eeprom)
+@@ -315,6 +305,20 @@ static int rt2800pci_write_firmware(stru
+ }
+ /*
++ * EEPROM file functions.
++ */
++static char *rt2800pci_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev)
++{
++      struct rt2x00_platform_data *pdata;
++
++      pdata = rt2x00dev->dev->platform_data;
++      if (pdata)
++              return pdata->eeprom_file_name;
++
++      return NULL;
++}
++
++/*
+  * Initialization functions.
+  */
+ static bool rt2800pci_get_entry_state(struct queue_entry *entry)
+@@ -1057,6 +1061,7 @@ static const struct rt2x00lib_ops rt2800
+       .get_firmware_name      = rt2800pci_get_firmware_name,
+       .check_firmware         = rt2800_check_firmware,
+       .load_firmware          = rt2800_load_firmware,
++      .get_eeprom_file_name   = rt2800pci_get_eeprom_file_name,
+       .initialize             = rt2x00pci_initialize,
+       .uninitialize           = rt2x00pci_uninitialize,
+       .get_entry_state        = rt2800pci_get_entry_state,
+--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
++++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
+@@ -1122,6 +1122,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de
+       INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled);
+       INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup);
++      retval = rt2x00lib_load_eeprom_file(rt2x00dev);
++      if (retval)
++              goto exit;
++
+       /*
+        * Let the driver probe the device to detect the capabilities.
+        */
+@@ -1223,6 +1227,11 @@ void rt2x00lib_remove_dev(struct rt2x00_
+        * Free queue structures.
+        */
+       rt2x00queue_free(rt2x00dev);
++
++      /*
++       * Free EEPROM image.
++       */
++      rt2x00lib_free_eeprom_file(rt2x00dev);
+ }
+ EXPORT_SYMBOL_GPL(rt2x00lib_remove_dev);
+--- a/drivers/net/wireless/rt2x00/rt2x00soc.c
++++ b/drivers/net/wireless/rt2x00/rt2x00soc.c
+@@ -94,6 +94,7 @@ int rt2x00soc_probe(struct platform_devi
+       rt2x00dev->hw = hw;
+       rt2x00dev->irq = platform_get_irq(pdev, 0);
+       rt2x00dev->name = pdev->dev.driver->name;
++      set_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags);
+       rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC);
diff --git a/package/mac80211/patches/604-rt2x00-add-CONFIG_RT2X00_LIB_EEPROM-option.patch b/package/mac80211/patches/604-rt2x00-add-CONFIG_RT2X00_LIB_EEPROM-option.patch
new file mode 100644 (file)
index 0000000..283a1b3
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/config.mk
++++ b/config.mk
+@@ -578,6 +578,7 @@ CONFIG_RT2X00=y
+ CONFIG_RT2X00_LIB=m
+ CONFIG_RT2800_LIB=m
+ CONFIG_RT2X00_LIB_FIRMWARE=y
++CONFIG_RT2X00_LIB_EEPROM=y
+ CONFIG_RT2X00_LIB_CRYPTO=y
+ # CONFIG_RT2X00_LIB_SOC=y
+ ifdef CONFIG_COMPAT_KERNEL_2_6_25
diff --git a/package/mac80211/patches/610-set_pci_mwi.patch b/package/mac80211/patches/610-set_pci_mwi.patch
deleted file mode 100644 (file)
index 6651a6f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/rt2x00/rt2x00pci.c
-+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
-@@ -272,8 +272,10 @@ int rt2x00pci_probe(struct pci_dev *pci_
-       pci_set_master(pci_dev);
-+#ifdef CONFIG_PCI_SET_MWI
-       if (pci_set_mwi(pci_dev))
-               ERROR_PROBE("MWI not available.\n");
-+#endif
-       if (dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(32))) {
-               ERROR_PROBE("PCI DMA not supported.\n");
index f3f3becd6aef0be4687f005904e630e029ab2c2c..c59441d581ec3810f658b40329a3da0cb2285add 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/mwl8k.c
 +++ b/drivers/net/wireless/mwl8k.c
-@@ -5165,6 +5165,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
+@@ -5194,6 +5194,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
  MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
  
  static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
index b88678bc0e88af61d3b481550c18a08a578229f3..1dee123918a8fe9639a6a8df7aabd0181159ba77 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/b43/b43.h
 +++ b/drivers/net/wireless/b43/b43.h
-@@ -718,6 +718,7 @@ struct b43_wldev {
+@@ -740,6 +740,7 @@ struct b43_wldev {
        bool qos_enabled;               /* TRUE, if QoS is used. */
        bool hwcrypto_enabled;          /* TRUE, if HW crypto acceleration is enabled. */
        bool use_pio;                   /* TRUE if next init should use PIO */
@@ -10,7 +10,7 @@
        struct b43_phy phy;
 --- a/drivers/net/wireless/b43/main.c
 +++ b/drivers/net/wireless/b43/main.c
-@@ -75,6 +75,11 @@ MODULE_FIRMWARE("b43/ucode15.fw");
+@@ -76,6 +76,11 @@ MODULE_FIRMWARE("b43/ucode16_mimo.fw");
  MODULE_FIRMWARE("b43/ucode5.fw");
  MODULE_FIRMWARE("b43/ucode9.fw");
  
@@ -22,7 +22,7 @@
  static int modparam_bad_frames_preempt;
  module_param_named(bad_frames_preempt, modparam_bad_frames_preempt, int, 0444);
  MODULE_PARM_DESC(bad_frames_preempt,
-@@ -2542,10 +2547,10 @@ static int b43_gpio_init(struct b43_wlde
+@@ -2575,10 +2580,10 @@ static int b43_gpio_init(struct b43_wlde
                    & ~B43_MACCTL_GPOUTSMSK);
  
        b43_write16(dev, B43_MMIO_GPIO_MASK, b43_read16(dev, B43_MMIO_GPIO_MASK)
        mask = 0x0000001F;
 -      set = 0x0000000F;
 +      set = modparam_gpiomask;
-       if (dev->dev->bus->chip_id == 0x4301) {
+       if (dev->dev->chip_id == 0x4301) {
                mask |= 0x0060;
                set |= 0x0060;
-@@ -5100,10 +5105,10 @@ static void b43_print_driverinfo(void)
+@@ -5137,10 +5142,10 @@ static void b43_print_driverinfo(void)
        feat_sdio = "S";
  #endif
        printk(KERN_INFO "Broadcom 43xx driver loaded "
index 037b8a37607f39384e1561cf033d7dfcb55122fa..a913b6de7a2fca96a60a91331801462f1ebe5764 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/b43/Makefile
 +++ b/drivers/net/wireless/b43/Makefile
-@@ -14,7 +14,7 @@ b43-y                                += xmit.o
+@@ -17,7 +17,7 @@ b43-y                                += xmit.o
  b43-y                         += lo.o
  b43-y                         += wa.o
  b43-y                         += dma.o
@@ -11,7 +11,7 @@
  b43-$(CONFIG_B43_PCMCIA)      += pcmcia.o
 --- a/drivers/net/wireless/b43/main.c
 +++ b/drivers/net/wireless/b43/main.c
-@@ -1812,9 +1812,11 @@ static void b43_do_interrupt_thread(stru
+@@ -1834,9 +1834,11 @@ static void b43_do_interrupt_thread(stru
                               dma_reason[4], dma_reason[5]);
                        b43err(dev->wl, "This device does not support DMA "
                               "on your system. It will now be switched to PIO.\n");