+ MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
+ MADWIFI_AUTOLOAD+= ath_pci
+endif
+
+MADWIFI_APPLETS:=80211stats athchans athctrl athkey athstats wlanconfig $(if $(CONFIG_MADWIFI_TESTING),ath_info/)ath_info
+ifdef CONFIG_MADWIFI_DEBUG
+ MADWIFI_APPLETS += athdebug 80211debug
+endif
+ifndef CONFIG_MADWIFI_UPSTREAM
+ MADWIFI_APPLETS += madwifi_multi
+endif
+
+define KernelPackage/madwifi
+ SUBMENU:=Wireless Drivers
+ TITLE:=Driver for Atheros wireless chipsets
+ URL:=http://madwifi.org/
+ DEPENDS:=+wireless-tools @PCI_SUPPORT||TARGET_atheros @!TARGET_ar7 @!TARGET_avr32 @!TARGET_etrax @!TARGET_uml
+ FILES:=$(MADWIFI_FILES)
+ AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD))
+endef
+
+define KernelPackage/madwifi/description
+ This package contains a driver for Atheros 802.11a/b/g chipsets.
+endef
+
+define KernelPackage/madwifi/config
+ source "$(SOURCE)/Config.in"
+endef
+
+MAKE_ARGS:= \
+ PATH="$(TARGET_PATH)" \
+ ARCH="$(LINUX_KARCH)" \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ TARGET="$(HAL_TARGET)" \
+ TOOLPREFIX="$(KERNEL_CROSS)" \
+ TOOLPATH="$(KERNEL_CROSS)" \
+ KERNELPATH="$(LINUX_DIR)" \
+ LDOPTS="--no-warn-mismatch " \
+ ATH_RATE="ath_rate/$(RATE_CONTROL)" \
+ DO_MULTI=1
+
+ifneq ($(CONFIG_MADWIFI_TESTING),)
+ MAKE_ARGS += $(if $(CONFIG_MADWIFI_DEBUG),,ATH_DEBUG=)
+else
+ MAKE_ARGS += $(if $(CONFIG_MADWIFI_DEBUG),,DEBUG=) WARNINGS="-Wno-unused"
+endif
+
+MAKE_VARS:= \
+ COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"' -DATH_REVERSE_ENGINEERING=1" \
+
+ifeq ($(CONFIG_MADWIFI_UPSTREAM),)
+ HALFILE:=$(lastword $(sort $(wildcard ./ath_hal-*.tgz)))