2009-01-31 16:08:57 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006-2009 OpenWrt.org
|
2006-06-27 00:35:46 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2006-05-31 14:32:17 +00:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
2006-06-21 02:32:39 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
2006-05-31 14:32:17 +00:00
|
|
|
|
|
|
|
PKG_NAME:=madwifi
|
2008-07-31 17:27:55 +00:00
|
|
|
|
|
|
|
ifneq ($(CONFIG_MADWIFI_UPSTREAM),)
|
|
|
|
PKG_VERSION:=0.9.4
|
2009-01-31 16:08:57 +00:00
|
|
|
PKG_RELEASE:=2
|
2008-07-31 17:27:55 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=madwifi-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=http://downloads.sourceforge.net/madwifi/
|
|
|
|
PKG_MD5SUM:=399d20de8d855a59f20058857c2178ad
|
|
|
|
|
|
|
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/madwifi-$(PKG_VERSION)
|
|
|
|
|
|
|
|
PATCH_DIR=./patches-upstream
|
|
|
|
else
|
2008-01-28 18:34:06 +00:00
|
|
|
# PKG_BRANCH:=madwifi-dfs
|
2008-10-16 21:06:30 +00:00
|
|
|
PKG_REV:=3314
|
2008-07-31 17:27:55 +00:00
|
|
|
PKG_VERSION:=r$(PKG_REV)
|
2009-01-31 16:08:57 +00:00
|
|
|
PKG_RELEASE:=2
|
2006-05-31 14:32:17 +00:00
|
|
|
|
2008-07-31 17:27:55 +00:00
|
|
|
PKG_SOURCE_PROTO:=svn
|
|
|
|
PKG_SOURCE_VERSION:=$(PKG_REV)
|
|
|
|
PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
|
|
|
|
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 14:32:17 +00:00
|
|
|
|
2008-07-31 17:27:55 +00:00
|
|
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
|
2006-09-23 19:27:45 +00:00
|
|
|
|
2008-10-16 21:06:30 +00:00
|
|
|
PATCH_DIR=./patches
|
2008-07-31 17:27:55 +00:00
|
|
|
endif
|
2008-07-17 02:30:08 +00:00
|
|
|
|
2009-03-26 20:56:58 +00:00
|
|
|
PKG_BUILD_DEPENDS:=wprobe
|
|
|
|
|
2007-09-16 16:27:49 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2006-08-29 16:20:00 +00:00
|
|
|
|
2008-06-01 03:00:32 +00:00
|
|
|
ifneq ($(CONFIG_TARGET_atheros),)
|
|
|
|
BUS:=AHB
|
2008-05-15 00:59:34 +00:00
|
|
|
else
|
2008-06-01 03:00:32 +00:00
|
|
|
ifneq ($(CONFIG_PCI_SUPPORT),)
|
2008-05-15 00:59:34 +00:00
|
|
|
BUS:=PCI
|
|
|
|
endif
|
2008-04-27 17:03:01 +00:00
|
|
|
endif
|
2006-05-31 14:32:17 +00:00
|
|
|
|
2008-06-01 03:00:32 +00: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
|
2008-05-15 00:59:34 +00:00
|
|
|
|
2008-08-30 09:59:00 +00:00
|
|
|
ifneq ($(CONFIG_CPU_MIPS32_R2),)
|
|
|
|
ifeq ($(ARCH),mips)
|
|
|
|
HAL_TARGET:=mips32r2-be-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),mipsel)
|
|
|
|
HAL_TARGET:=mips32r2-le-elf
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
ifeq ($(ARCH),mips)
|
2008-09-02 09:44:50 +00:00
|
|
|
HAL_TARGET:=$(if $(CONFIG_MADWIFI_UPSTREAM),mips-be-elf,mips32-be-elf)
|
2008-08-30 09:59:00 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),mipsel)
|
2008-09-02 09:44:50 +00:00
|
|
|
HAL_TARGET:=$(if $(CONFIG_MADWIFI_UPSTREAM),mips-le-elf,mips32-le-elf)
|
2008-08-30 09:59:00 +00:00
|
|
|
endif
|
2008-06-01 03:00:32 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),i386)
|
|
|
|
HAL_TARGET:=i386-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),i686)
|
|
|
|
HAL_TARGET:=i386-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(BOARD),ixp4xx)
|
2008-09-05 23:27:27 +00:00
|
|
|
HAL_TARGET:=xscale-be-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
|
2008-06-01 03:00:32 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(BOARD),iop32x)
|
2008-09-05 23:27:27 +00:00
|
|
|
HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
|
2008-06-01 03:00:32 +00:00
|
|
|
endif
|
2008-06-04 13:51:17 +00:00
|
|
|
ifeq ($(BOARD),orion)
|
2008-09-05 23:27:27 +00:00
|
|
|
HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
|
2008-06-04 13:51:17 +00:00
|
|
|
endif
|
2008-06-01 03:00:32 +00:00
|
|
|
ifeq ($(ARCH),powerpc)
|
|
|
|
HAL_TARGET:=powerpc-be-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(BOARD),storm)
|
2008-09-05 23:27:27 +00:00
|
|
|
HAL_TARGET:=armv4-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
|
2008-06-01 03:00:32 +00:00
|
|
|
endif
|
|
|
|
ifneq ($(CONFIG_TARGET_atheros),)
|
|
|
|
HAL_TARGET:=wisoc
|
2008-05-15 00:59:34 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_RCA_MINSTREL
|
|
|
|
RATE_CONTROL:=minstrel
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_RCA_ONOE
|
|
|
|
RATE_CONTROL:=onoe
|
2006-05-31 14:32:17 +00:00
|
|
|
endif
|
|
|
|
|
2008-05-15 00:59:34 +00:00
|
|
|
ifdef CONFIG_MADWIFI_RCA_AMRR
|
|
|
|
RATE_CONTROL:=amrr
|
2007-09-20 07:11:52 +00:00
|
|
|
endif
|
|
|
|
|
2008-05-15 00:59:34 +00:00
|
|
|
ifdef CONFIG_MADWIFI_RCA_SAMPLERATE
|
|
|
|
RATE_CONTROL:=sample
|
|
|
|
endif
|
2007-09-16 16:27:49 +00: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 14:32:17 +00:00
|
|
|
|
2006-10-17 16:13:10 +00: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 16:27:49 +00:00
|
|
|
wlan_xauth \
|
2006-10-17 16:13:10 +00:00
|
|
|
|
|
|
|
ifeq ($(findstring AHB,$(BUS)),AHB)
|
2008-01-25 20:24:25 +00:00
|
|
|
MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX)
|
|
|
|
MADWIFI_AUTOLOAD+= ath_ahb
|
2006-10-17 16:13:10 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(findstring PCI,$(BUS)),PCI)
|
2008-01-25 20:24:25 +00:00
|
|
|
MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
|
|
|
|
MADWIFI_AUTOLOAD+= ath_pci
|
|
|
|
endif
|
|
|
|
|
2008-10-16 21:06:30 +00:00
|
|
|
MADWIFI_APPLETS:=80211stats athchans athctrl athkey athstats wlanconfig ath_info
|
2008-05-15 00:59:34 +00:00
|
|
|
ifdef CONFIG_MADWIFI_DEBUG
|
2008-07-31 17:27:55 +00:00
|
|
|
MADWIFI_APPLETS += athdebug 80211debug
|
|
|
|
endif
|
|
|
|
ifndef CONFIG_MADWIFI_UPSTREAM
|
|
|
|
MADWIFI_APPLETS += madwifi_multi
|
2006-10-17 16:13:10 +00:00
|
|
|
endif
|
2008-01-25 20:24:25 +00:00
|
|
|
|
2006-10-17 16:13:10 +00:00
|
|
|
define KernelPackage/madwifi
|
2006-10-17 20:52:40 +00:00
|
|
|
SUBMENU:=Wireless Drivers
|
2006-10-17 16:13:10 +00:00
|
|
|
TITLE:=Driver for Atheros wireless chipsets
|
|
|
|
URL:=http://madwifi.org/
|
2009-03-26 21:10:08 +00:00
|
|
|
DEPENDS:=+wireless-tools @PCI_SUPPORT||TARGET_atheros @!TARGET_ar7 @!TARGET_avr32 @!TARGET_etrax @!TARGET_uml @LINUX_2_6
|
2007-09-16 16:27:49 +00:00
|
|
|
FILES:=$(MADWIFI_FILES)
|
2006-10-17 16:13:10 +00:00
|
|
|
AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD))
|
|
|
|
endef
|
|
|
|
|
2007-09-07 08:34:51 +00:00
|
|
|
define KernelPackage/madwifi/description
|
|
|
|
This package contains a driver for Atheros 802.11a/b/g chipsets.
|
|
|
|
endef
|
|
|
|
|
2008-05-15 00:59:34 +00:00
|
|
|
define KernelPackage/madwifi/config
|
2008-06-01 06:00:25 +00:00
|
|
|
source "$(SOURCE)/Config.in"
|
2008-05-15 00:59:34 +00:00
|
|
|
endef
|
|
|
|
|
2009-03-26 20:56:58 +00:00
|
|
|
MADWIFI_INC = \
|
|
|
|
-I$(PKG_BUILD_DIR) \
|
|
|
|
-I$(PKG_BUILD_DIR)/include \
|
|
|
|
-I$(PKG_BUILD_DIR)/hal \
|
|
|
|
-I$(PKG_BUILD_DIR)/ath \
|
|
|
|
-I$(PKG_BUILD_DIR)/ath_hal \
|
|
|
|
-I$(PKG_BUILD_DIR)/net80211 \
|
|
|
|
-I$(STAGING_DIR)/usr/include \
|
|
|
|
-include $(PKG_BUILD_DIR)/include/compat.h
|
|
|
|
|
2007-09-16 16:27:49 +00: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-10-16 21:06:30 +00:00
|
|
|
DO_MULTI=1 \
|
2009-03-26 20:56:58 +00:00
|
|
|
INCS="$(MADWIFI_INC)" \
|
2008-10-16 21:06:30 +00:00
|
|
|
$(if $(CONFIG_MADWIFI_DEBUG),,DEBUG=) WARNINGS="-Wno-unused"
|
2008-07-17 02:30:08 +00:00
|
|
|
|
2007-09-16 16:27:49 +00:00
|
|
|
MAKE_VARS:= \
|
2008-06-01 03:00:32 +00:00
|
|
|
COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"' -DATH_REVERSE_ENGINEERING=1" \
|
2006-05-31 14:32:17 +00:00
|
|
|
|
2008-07-31 17:27:55 +00:00
|
|
|
ifeq ($(CONFIG_MADWIFI_UPSTREAM),)
|
|
|
|
HALFILE:=$(lastword $(sort $(wildcard ./ath_hal-*.tgz)))
|
|
|
|
endif
|
|
|
|
|
2008-03-20 06:57:01 +00:00
|
|
|
ifneq ($(HALFILE),)
|
2008-07-31 17:27:55 +00:00
|
|
|
define Build/Prepare/HAL
|
2008-03-20 06:57:01 +00:00
|
|
|
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
|
2008-07-31 17:27:55 +00:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
define Build/Prepare
|
|
|
|
$(call Build/Prepare/Default)
|
|
|
|
$(call Build/Prepare/HAL)
|
2008-06-01 03:00:32 +00:00
|
|
|
# patch cflags
|
|
|
|
$(SED) 's, -E[LB],,' \
|
2008-06-01 12:08:02 +00:00
|
|
|
-e 's, -mips2,,' \
|
2008-06-01 03:00:32 +00:00
|
|
|
-e 's, -mapcs-32,,' \
|
|
|
|
$(PKG_BUILD_DIR)/hal/public/*.inc
|
|
|
|
$(SED) 's,march=armv4,march=armv5te,' \
|
|
|
|
$(PKG_BUILD_DIR)/hal/public/xscale*.inc
|
2008-07-31 17:27:55 +00:00
|
|
|
endef
|
2008-03-20 06:57:01 +00:00
|
|
|
|
2006-05-31 14:32:17 +00:00
|
|
|
ifeq ($(findstring AHB,$(BUS)),AHB)
|
2006-09-23 19:27:45 +00:00
|
|
|
define Build/Compile/ahb
|
2007-09-16 16:27:49 +00: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 19:27:45 +00:00
|
|
|
endef
|
2006-05-31 14:32:17 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(findstring PCI,$(BUS)),PCI)
|
2006-09-23 19:27:45 +00:00
|
|
|
define Build/Compile/pci
|
2007-09-16 16:27:49 +00: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 19:27:45 +00:00
|
|
|
endef
|
2006-05-31 14:32:17 +00:00
|
|
|
endif
|
|
|
|
|
2006-12-16 00:39:57 +00:00
|
|
|
define Build/Configure
|
|
|
|
$(SED) 's,-E[LB] ,,g' $(PKG_BUILD_DIR)/hal/public/*.inc
|
|
|
|
endef
|
|
|
|
|
2006-05-31 14:32:17 +00:00
|
|
|
define Build/Compile
|
2006-09-23 19:27:45 +00:00
|
|
|
$(call Build/Compile/ahb)
|
|
|
|
$(call Build/Compile/pci)
|
2006-05-31 14:32:17 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/InstallDev
|
2007-09-28 01:45:11 +00: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 14:32:17 +00:00
|
|
|
endef
|
|
|
|
|
2006-10-17 16:13:10 +00:00
|
|
|
define KernelPackage/madwifi/install
|
2006-12-16 19:57:11 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2008-07-30 05:22:16 +00:00
|
|
|
$(CP) ./files/* $(1)/
|
2008-07-31 17:27:55 +00:00
|
|
|
$(CP) $(foreach applet,$(MADWIFI_APPLETS),$(PKG_BUILD_DIR)/tools/$(applet)) $(1)/usr/sbin/
|
2006-05-31 14:32:17 +00:00
|
|
|
endef
|
|
|
|
|
2006-10-17 16:13:10 +00:00
|
|
|
$(eval $(call KernelPackage,madwifi))
|