2006-06-27 03:35:46 +03:00
|
|
|
#
|
2008-04-15 05:08:11 +03:00
|
|
|
# Copyright (C) 2006-2008 OpenWrt.org
|
2006-06-27 03:35:46 +03:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2006-05-31 17:32:17 +03:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
2006-06-21 05:32:39 +03:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
2006-05-31 17:32:17 +03:00
|
|
|
|
|
|
|
PKG_NAME:=madwifi
|
2008-01-31 06:09:54 +02:00
|
|
|
PKG_REV:=3314
|
2007-12-03 00:28:14 +02:00
|
|
|
PKG_VERSION:=r$(PKG_REV)
|
2008-01-28 20:34:06 +02:00
|
|
|
# PKG_BRANCH:=madwifi-dfs
|
2007-10-24 07:35:02 +03:00
|
|
|
PKG_RELEASE:=1
|
2006-05-31 17:32:17 +03:00
|
|
|
|
2007-12-03 00:28:14 +02:00
|
|
|
PKG_SOURCE_PROTO:=svn
|
|
|
|
PKG_SOURCE_VERSION:=$(PKG_REV)
|
2008-01-28 20:34:06 +02:00
|
|
|
PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
|
2007-12-03 00:28:14 +02:00
|
|
|
PKG_SOURCE_URL:=http://svn.madwifi.org/madwifi/$(if $(PKG_BRANCH),branches/$(PKG_BRANCH),trunk)
|
|
|
|
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
|
2006-05-31 17:32:17 +03:00
|
|
|
|
2008-01-28 20:34:06 +02:00
|
|
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
|
2006-09-23 22:27:45 +03:00
|
|
|
|
2007-09-16 19:27:49 +03:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2006-08-29 19:20:00 +03:00
|
|
|
|
2008-05-15 03:59:34 +03:00
|
|
|
ifdef CONFIG_MADWIFI_BUS_DEFAULT
|
|
|
|
ifneq ($(CONFIG_TARGET_atheros),)
|
|
|
|
BUS:=AHB
|
|
|
|
else
|
|
|
|
ifneq ($(CONFIG_PCI_SUPPORT),)
|
|
|
|
BUS:=PCI
|
|
|
|
endif
|
|
|
|
endif
|
2008-01-25 22:24:25 +02:00
|
|
|
|
2008-05-15 03:59:34 +03:00
|
|
|
# XXX: remove this check later when we have PCI support properly detected on all targets
|
|
|
|
ifneq ($(CONFIG_TARGET_ar7)$(CONFIG_TARGET_uml),)
|
|
|
|
BUS:=
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
ifdef CONFIG_MADWIFI_BUS_PCI
|
|
|
|
BUS:=PCI
|
|
|
|
else
|
|
|
|
ifdef CONFIG_MADWIFI_BUS_AHB
|
|
|
|
BUS:=AHB
|
|
|
|
endif
|
|
|
|
endif
|
2008-04-27 20:03:01 +03:00
|
|
|
endif
|
2006-05-31 17:32:17 +03:00
|
|
|
|
2008-05-15 03:59:34 +03:00
|
|
|
ifdef CONFIG_MADWIFI_HAL_DEFAULT
|
|
|
|
ifeq ($(ARCH),mips)
|
|
|
|
HAL_TARGET:=mips-be-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),mipsel)
|
|
|
|
HAL_TARGET:=mips-le-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),i386)
|
|
|
|
HAL_TARGET:=i386-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),i686)
|
|
|
|
HAL_TARGET:=i386-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(BOARD),ixp4xx)
|
|
|
|
HAL_TARGET:=xscale-be-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(BOARD),iop32x)
|
|
|
|
HAL_TARGET:=xscale-le-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),powerpc)
|
|
|
|
HAL_TARGET:=powerpc-be-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(BOARD),storm)
|
|
|
|
HAL_TARGET:=armv4-le-elf
|
|
|
|
endif
|
|
|
|
ifneq ($(CONFIG_TARGET_atheros),)
|
|
|
|
HAL_TARGET:=ap51
|
|
|
|
endif
|
2007-09-16 19:27:49 +03:00
|
|
|
else
|
2008-05-15 03:59:34 +03:00
|
|
|
ifdef CONFIG_MADWIFI_HAL_MIPS_BE_ELF
|
|
|
|
HAL_TARGET:=mips-be-elf
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_HAL_MIPS_LE_ELF
|
|
|
|
HAL_TARGET:=mips-le-elf
|
2007-09-16 19:27:49 +03:00
|
|
|
endif
|
2008-05-15 03:59:34 +03:00
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_HAL_I386_ELF
|
|
|
|
HAL_TARGET:=i386-elf
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_HAL_XSCALE_BE_ELF
|
|
|
|
HAL_TARGET:=xscale-be-elf
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_HAL_XSCALE_LE_ELF
|
|
|
|
HAL_TARGET:=xscale-le-elf
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_HAL_ARMV4_LE_ELF
|
|
|
|
HAL_TARGET:=armv4-le-elf
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_HAL_AP30
|
|
|
|
HAL_TARGET:=ap30
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_HAL_AP43
|
|
|
|
HAL_TARGET:=ap43
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_HAL_AP51
|
|
|
|
HAL_TARGET:=ap51
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_HAL_AP61
|
|
|
|
HAL_TARGET:=ap61
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_RCA_MINSTREL
|
|
|
|
RATE_CONTROL:=minstrel
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_RCA_ONOE
|
|
|
|
RATE_CONTROL:=onoe
|
2006-05-31 17:32:17 +03:00
|
|
|
endif
|
|
|
|
|
2008-05-15 03:59:34 +03:00
|
|
|
ifdef CONFIG_MADWIFI_RCA_AMRR
|
|
|
|
RATE_CONTROL:=amrr
|
2007-09-20 10:11:52 +03:00
|
|
|
endif
|
|
|
|
|
2008-05-15 03:59:34 +03:00
|
|
|
ifdef CONFIG_MADWIFI_RCA_SAMPLERATE
|
|
|
|
RATE_CONTROL:=sample
|
|
|
|
endif
|
2007-09-16 19:27:49 +03:00
|
|
|
|
|
|
|
MADWIFI_FILES:= \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan.$(LINUX_KMOD_SUFFIX) \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_scan_ap.$(LINUX_KMOD_SUFFIX) \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_scan_sta.$(LINUX_KMOD_SUFFIX) \
|
|
|
|
$(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \
|
|
|
|
$(PKG_BUILD_DIR)/ath_rate/$(RATE_CONTROL)/ath_rate_$(RATE_CONTROL).$(LINUX_KMOD_SUFFIX) \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_acl.$(LINUX_KMOD_SUFFIX) \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_ccmp.$(LINUX_KMOD_SUFFIX) \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_tkip.$(LINUX_KMOD_SUFFIX) \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_wep.$(LINUX_KMOD_SUFFIX) \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_xauth.$(LINUX_KMOD_SUFFIX) \
|
2006-05-31 17:32:17 +03:00
|
|
|
|
2006-10-17 19:13:10 +03:00
|
|
|
MADWIFI_AUTOLOAD:= \
|
|
|
|
wlan \
|
|
|
|
wlan_scan_ap \
|
|
|
|
wlan_scan_sta \
|
|
|
|
ath_hal \
|
|
|
|
ath_rate_$(RATE_CONTROL) \
|
|
|
|
wlan_acl \
|
|
|
|
wlan_ccmp \
|
|
|
|
wlan_tkip \
|
|
|
|
wlan_wep \
|
2007-09-16 19:27:49 +03:00
|
|
|
wlan_xauth \
|
2006-10-17 19:13:10 +03:00
|
|
|
|
|
|
|
ifeq ($(findstring AHB,$(BUS)),AHB)
|
2008-01-25 22:24:25 +02:00
|
|
|
MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX)
|
|
|
|
MADWIFI_AUTOLOAD+= ath_ahb
|
2006-10-17 19:13:10 +03:00
|
|
|
endif
|
|
|
|
ifeq ($(findstring PCI,$(BUS)),PCI)
|
2008-01-25 22:24:25 +02:00
|
|
|
MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
|
|
|
|
MADWIFI_AUTOLOAD+= ath_pci
|
|
|
|
endif
|
|
|
|
|
|
|
|
MADWIFI_APPLETS:=80211stats,athchans,athctrl,athkey,athstats,wlanconfig
|
2008-05-15 03:59:34 +03:00
|
|
|
ifdef CONFIG_MADWIFI_DEBUG
|
2008-01-25 22:24:25 +02:00
|
|
|
MADWIFI_APPLETS:=$(strip $(MADWIFI_APPLETS)),athdebug,80211debug
|
2006-10-17 19:13:10 +03:00
|
|
|
endif
|
|
|
|
|
2008-01-25 22:24:25 +02:00
|
|
|
|
2006-10-17 19:13:10 +03:00
|
|
|
define KernelPackage/madwifi
|
2006-10-17 23:52:40 +03:00
|
|
|
SUBMENU:=Wireless Drivers
|
2006-10-17 19:13:10 +03:00
|
|
|
TITLE:=Driver for Atheros wireless chipsets
|
|
|
|
URL:=http://madwifi.org/
|
2008-04-15 05:08:11 +03:00
|
|
|
DEPENDS:=+wireless-tools @PCI_SUPPORT||TARGET_atheros @!TARGET_ar7 @!TARGET_avr32 @!TARGET_etrax @!TARGET_uml
|
2007-09-16 19:27:49 +03:00
|
|
|
FILES:=$(MADWIFI_FILES)
|
2006-10-17 19:13:10 +03:00
|
|
|
AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD))
|
|
|
|
endef
|
|
|
|
|
2007-09-07 11:34:51 +03:00
|
|
|
define KernelPackage/madwifi/description
|
|
|
|
This package contains a driver for Atheros 802.11a/b/g chipsets.
|
|
|
|
endef
|
|
|
|
|
2008-05-15 03:59:34 +03:00
|
|
|
define KernelPackage/madwifi/config
|
|
|
|
menu "MadWifi Configuration"
|
|
|
|
depends on PACKAGE_kmod-madwifi
|
|
|
|
source "$(SOURCE)/Config.in"
|
|
|
|
endmenu
|
|
|
|
endef
|
|
|
|
|
2007-09-16 19:27:49 +03:00
|
|
|
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)" \
|
2008-01-25 22:24:25 +02:00
|
|
|
WARNINGS="-Wno-unused" \
|
2008-05-17 23:13:29 +03:00
|
|
|
$(if $(CONFIG_MADWIFI_DEBUG),,DEBUG="") \
|
2007-09-16 19:27:49 +03:00
|
|
|
DOMULTI=1
|
|
|
|
|
|
|
|
MAKE_VARS:= \
|
|
|
|
COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" \
|
2006-05-31 17:32:17 +03:00
|
|
|
|
2008-03-20 08:57:01 +02:00
|
|
|
HALFILE:=$(lastword $(sort $(wildcard ./ath_hal-*.tgz)))
|
|
|
|
ifneq ($(HALFILE),)
|
|
|
|
define Build/Prepare
|
|
|
|
$(call Build/Prepare/Default)
|
|
|
|
rm -rf $(PKG_BUILD_DIR)/tmp
|
|
|
|
mkdir -p $(PKG_BUILD_DIR)/tmp
|
|
|
|
tar xvzf $(HALFILE) -C $(PKG_BUILD_DIR)/tmp
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/tmp/ath_hal*/* $(PKG_BUILD_DIR)/hal/
|
|
|
|
rm -rf $(PKG_BUILD_DIR)/tmp
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2006-05-31 17:32:17 +03:00
|
|
|
ifeq ($(findstring AHB,$(BUS)),AHB)
|
2006-09-23 22:27:45 +03:00
|
|
|
define Build/Compile/ahb
|
2007-09-16 19:27:49 +03:00
|
|
|
$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="AHB" modules
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
|
2006-09-23 22:27:45 +03:00
|
|
|
endef
|
2006-05-31 17:32:17 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(findstring PCI,$(BUS)),PCI)
|
2006-09-23 22:27:45 +03:00
|
|
|
define Build/Compile/pci
|
2007-09-16 19:27:49 +03:00
|
|
|
$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="PCI" modules
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
|
2006-09-23 22:27:45 +03:00
|
|
|
endef
|
2006-05-31 17:32:17 +03:00
|
|
|
endif
|
|
|
|
|
2006-12-16 02:39:57 +02:00
|
|
|
define Build/Configure
|
|
|
|
$(SED) 's,-E[LB] ,,g' $(PKG_BUILD_DIR)/hal/public/*.inc
|
|
|
|
endef
|
|
|
|
|
2006-05-31 17:32:17 +03:00
|
|
|
define Build/Compile
|
2006-09-23 22:27:45 +03:00
|
|
|
$(call Build/Compile/ahb)
|
|
|
|
$(call Build/Compile/pci)
|
2006-05-31 17:32:17 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/InstallDev
|
2007-09-28 04:45:11 +03:00
|
|
|
mkdir -p $(1)/usr/include/madwifi
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/include $(1)/usr/include/madwifi/
|
|
|
|
mkdir -p $(1)/usr/include/madwifi/net80211
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/net80211/*.h $(1)/usr/include/madwifi/net80211/
|
2006-05-31 17:32:17 +03:00
|
|
|
endef
|
|
|
|
|
2006-10-17 19:13:10 +03:00
|
|
|
define KernelPackage/madwifi/install
|
2006-12-22 10:02:59 +02:00
|
|
|
$(INSTALL_DIR) $(1)/lib/wifi
|
|
|
|
$(INSTALL_DATA) ./files/lib/wifi/madwifi.sh $(1)/lib/wifi
|
2006-12-16 21:57:11 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2008-01-25 22:24:25 +02:00
|
|
|
$(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,$(MADWIFI_APPLETS)} $(1)/usr/sbin/
|
2006-05-31 17:32:17 +03:00
|
|
|
endef
|
|
|
|
|
2006-10-17 19:13:10 +03:00
|
|
|
$(eval $(call KernelPackage,madwifi))
|