2009-02-01 00:08:57 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006-2009 OpenWrt.org
|
2006-06-27 08:35:46 +08:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2006-05-31 22:32:17 +08:00
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
2006-06-21 10:32:39 +08:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
2006-05-31 22:32:17 +08:00
|
|
|
|
|
|
|
PKG_NAME:=madwifi
|
2008-08-01 01:27:55 +08:00
|
|
|
|
2009-08-19 23:16:11 +08:00
|
|
|
PKG_REV:=3314
|
|
|
|
PKG_VERSION:=r$(PKG_REV)
|
2010-07-15 15:37:00 +08:00
|
|
|
PKG_RELEASE:=5
|
2008-08-01 01:27:55 +08:00
|
|
|
|
2009-08-19 23:16:11 +08: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://madwifi-project.org/svn/madwifi/$(if $(PKG_BRANCH),branches/$(PKG_BRANCH),trunk)
|
|
|
|
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
|
2008-08-01 01:27:55 +08:00
|
|
|
|
2009-08-19 23:16:11 +08:00
|
|
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
|
2008-07-17 10:30:08 +08:00
|
|
|
|
2009-05-09 00:08:31 +08:00
|
|
|
HAL_VERSION:=20090508
|
|
|
|
HAL_FILE:=ath_hal-$(HAL_VERSION).tgz
|
|
|
|
HAL_MD5SUM:=4ab7ae8bdb96c0be388c98bf8f92d5ca
|
|
|
|
|
2009-03-27 04:56:58 +08:00
|
|
|
PKG_BUILD_DEPENDS:=wprobe
|
|
|
|
|
2007-09-17 00:27:49 +08:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2006-08-30 00:20:00 +08:00
|
|
|
|
2009-07-02 01:07:52 +08:00
|
|
|
ifdef CONFIG_MADWIFI_COMPRESSION
|
|
|
|
COMPRESSION:=1
|
|
|
|
else
|
|
|
|
COMPRESSION:=0
|
|
|
|
endif
|
2009-05-21 05:32:05 +08:00
|
|
|
|
2009-05-09 00:08:31 +08:00
|
|
|
define Download/hal
|
|
|
|
FILE:=$(HAL_FILE)
|
|
|
|
URL:=http://mirror2.openwrt.org/sources
|
|
|
|
MD5SUM:=$(HAL_MD5SUM)
|
|
|
|
endef
|
|
|
|
$(eval $(call Download,hal))
|
|
|
|
|
|
|
|
|
2008-06-01 11:00:32 +08:00
|
|
|
ifneq ($(CONFIG_TARGET_atheros),)
|
|
|
|
BUS:=AHB
|
2008-05-15 08:59:34 +08:00
|
|
|
else
|
2008-06-01 11:00:32 +08:00
|
|
|
ifneq ($(CONFIG_PCI_SUPPORT),)
|
2008-05-15 08:59:34 +08:00
|
|
|
BUS:=PCI
|
|
|
|
endif
|
2008-04-28 01:03:01 +08:00
|
|
|
endif
|
2006-05-31 22:32:17 +08:00
|
|
|
|
2008-08-30 17:59:00 +08: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)
|
2009-08-19 23:16:11 +08:00
|
|
|
HAL_TARGET:=mips32-be-elf
|
2008-08-30 17:59:00 +08:00
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),mipsel)
|
2009-08-19 23:16:11 +08:00
|
|
|
HAL_TARGET:=mips32-le-elf
|
2008-08-30 17:59:00 +08:00
|
|
|
endif
|
2008-06-01 11:00:32 +08:00
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),i386)
|
|
|
|
HAL_TARGET:=i386-elf
|
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),i686)
|
|
|
|
HAL_TARGET:=i386-elf
|
|
|
|
endif
|
2011-03-07 21:07:17 +08:00
|
|
|
ifeq ($(ARCH),armeb)
|
2011-03-07 20:59:19 +08:00
|
|
|
HAL_TARGET:=xscale-be-elfgnueabi
|
2008-06-01 11:00:32 +08:00
|
|
|
endif
|
2011-03-08 03:21:25 +08:00
|
|
|
ifeq ($(ARCH),arm)
|
2011-03-07 20:59:19 +08:00
|
|
|
HAL_TARGET:=xscale-le-elfgnueabi
|
2011-03-07 21:07:17 +08:00
|
|
|
ifeq ($(BOARD),cns21xx)
|
|
|
|
HAL_TARGET:=armv4-le-elfgnueabi
|
|
|
|
endif
|
|
|
|
ifeq ($(BOARD),cns3xxx)
|
|
|
|
HAL_TARGET:=arm11-le-elfgnueabi
|
|
|
|
endif
|
|
|
|
ifeq ($(BOARD),gemini)
|
|
|
|
HAL_TARGET:=armv4-le-elfgnueabi
|
|
|
|
endif
|
2010-07-21 19:20:53 +08:00
|
|
|
endif
|
2008-06-01 11:00:32 +08:00
|
|
|
ifeq ($(ARCH),powerpc)
|
|
|
|
HAL_TARGET:=powerpc-be-elf
|
|
|
|
endif
|
|
|
|
ifneq ($(CONFIG_TARGET_atheros),)
|
|
|
|
HAL_TARGET:=wisoc
|
2008-05-15 08:59:34 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_RCA_MINSTREL
|
|
|
|
RATE_CONTROL:=minstrel
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_MADWIFI_RCA_ONOE
|
|
|
|
RATE_CONTROL:=onoe
|
2006-05-31 22:32:17 +08:00
|
|
|
endif
|
|
|
|
|
2008-05-15 08:59:34 +08:00
|
|
|
ifdef CONFIG_MADWIFI_RCA_AMRR
|
|
|
|
RATE_CONTROL:=amrr
|
2007-09-20 15:11:52 +08:00
|
|
|
endif
|
|
|
|
|
2008-05-15 08:59:34 +08:00
|
|
|
ifdef CONFIG_MADWIFI_RCA_SAMPLERATE
|
|
|
|
RATE_CONTROL:=sample
|
|
|
|
endif
|
2007-09-17 00:27:49 +08:00
|
|
|
|
2009-08-19 23:13:00 +08:00
|
|
|
ifneq ($(CONFIG_MADWIFI_SINGLE_MODULE),)
|
2010-07-12 22:06:13 +08:00
|
|
|
MADWIFI_FILES:= $(PKG_BUILD_DIR)/ath_hal/ath_hal.ko
|
2009-08-19 23:13:00 +08:00
|
|
|
else
|
2007-09-17 00:27:49 +08:00
|
|
|
MADWIFI_FILES:= \
|
2010-07-12 22:06:13 +08:00
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan.ko \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_scan_ap.ko \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_scan_sta.ko \
|
|
|
|
$(PKG_BUILD_DIR)/ath_hal/ath_hal.ko \
|
|
|
|
$(PKG_BUILD_DIR)/ath_rate/$(RATE_CONTROL)/ath_rate_$(RATE_CONTROL).ko \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_acl.ko \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_ccmp.ko \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_tkip.ko \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_wep.ko \
|
|
|
|
$(PKG_BUILD_DIR)/net80211/wlan_xauth.ko
|
2009-08-19 23:13:00 +08:00
|
|
|
endif
|
2006-05-31 22:32:17 +08:00
|
|
|
|
2009-08-19 23:13:00 +08:00
|
|
|
ifneq ($(CONFIG_MADWIFI_SINGLE_MODULE),)
|
|
|
|
MADWIFI_AUTOLOAD:= ath_hal
|
|
|
|
else
|
|
|
|
MADWIFI_AUTOLOAD:= \
|
2006-10-18 00:13:10 +08:00
|
|
|
wlan \
|
|
|
|
wlan_scan_ap \
|
|
|
|
wlan_scan_sta \
|
|
|
|
ath_hal \
|
|
|
|
ath_rate_$(RATE_CONTROL) \
|
|
|
|
wlan_acl \
|
|
|
|
wlan_ccmp \
|
|
|
|
wlan_tkip \
|
|
|
|
wlan_wep \
|
2009-08-19 23:13:00 +08:00
|
|
|
wlan_xauth
|
|
|
|
endif
|
2006-10-18 00:13:10 +08:00
|
|
|
|
|
|
|
ifeq ($(findstring AHB,$(BUS)),AHB)
|
2010-07-12 22:06:13 +08:00
|
|
|
MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_ahb.ko
|
2008-01-26 04:24:25 +08:00
|
|
|
MADWIFI_AUTOLOAD+= ath_ahb
|
2006-10-18 00:13:10 +08:00
|
|
|
endif
|
|
|
|
ifeq ($(findstring PCI,$(BUS)),PCI)
|
2010-07-12 22:06:13 +08:00
|
|
|
MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_pci.ko
|
2008-01-26 04:24:25 +08:00
|
|
|
MADWIFI_AUTOLOAD+= ath_pci
|
|
|
|
endif
|
|
|
|
|
2009-08-19 23:16:11 +08:00
|
|
|
MADWIFI_APPLETS:=80211stats athchans athkey athstats wlanconfig ath_info madwifi_multi
|
2008-05-15 08:59:34 +08:00
|
|
|
ifdef CONFIG_MADWIFI_DEBUG
|
2008-08-01 01:27:55 +08:00
|
|
|
MADWIFI_APPLETS += athdebug 80211debug
|
|
|
|
endif
|
2008-01-26 04:24:25 +08:00
|
|
|
|
2006-10-18 00:13:10 +08:00
|
|
|
define KernelPackage/madwifi
|
2006-10-18 04:52:40 +08:00
|
|
|
SUBMENU:=Wireless Drivers
|
2006-10-18 00:13:10 +08:00
|
|
|
TITLE:=Driver for Atheros wireless chipsets
|
2009-06-14 00:47:22 +08:00
|
|
|
URL:=http://madwifi-project.org/
|
2010-01-31 20:24:55 +08:00
|
|
|
MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
|
2011-02-13 22:18:13 +08:00
|
|
|
DEPENDS:=+wireless-tools @PCI_SUPPORT @(!(TARGET_avr32||TARGET_cobalt||TARGET_ep93xx||TARGET_etrax||TARGET_octeon||TARGET_pxcab||TARGET_sibyte)||BROKEN) +@DRIVER_WEXT_SUPPORT
|
2007-09-17 00:27:49 +08:00
|
|
|
FILES:=$(MADWIFI_FILES)
|
2006-10-18 00:13:10 +08:00
|
|
|
AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD))
|
2010-04-16 18:34:21 +08:00
|
|
|
MENU:=1
|
2006-10-18 00:13:10 +08:00
|
|
|
endef
|
|
|
|
|
2007-09-07 16:34:51 +08:00
|
|
|
define KernelPackage/madwifi/description
|
|
|
|
This package contains a driver for Atheros 802.11a/b/g chipsets.
|
|
|
|
endef
|
|
|
|
|
2008-05-15 08:59:34 +08:00
|
|
|
define KernelPackage/madwifi/config
|
2008-06-01 14:00:25 +08:00
|
|
|
source "$(SOURCE)/Config.in"
|
2008-05-15 08:59:34 +08:00
|
|
|
endef
|
|
|
|
|
2009-03-27 04:56:58 +08: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 \
|
2009-04-23 22:55:11 +08:00
|
|
|
-I$(STAGING_DIR)/usr/include/wprobe \
|
2009-03-27 04:56:58 +08:00
|
|
|
-include $(PKG_BUILD_DIR)/include/compat.h
|
|
|
|
|
2007-09-17 00:27:49 +08:00
|
|
|
MAKE_ARGS:= \
|
|
|
|
PATH="$(TARGET_PATH)" \
|
|
|
|
ARCH="$(LINUX_KARCH)" \
|
2009-05-12 05:22:11 +08:00
|
|
|
ARCH-y="$(LINUX_KARCH)" \
|
2007-09-17 00:27:49 +08:00
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
|
|
|
TARGET="$(HAL_TARGET)" \
|
|
|
|
TOOLPREFIX="$(KERNEL_CROSS)" \
|
|
|
|
TOOLPATH="$(KERNEL_CROSS)" \
|
|
|
|
KERNELPATH="$(LINUX_DIR)" \
|
|
|
|
LDOPTS="--no-warn-mismatch " \
|
2009-08-19 23:13:00 +08:00
|
|
|
ATH_RATE="$(RATE_CONTROL)" \
|
2009-05-21 05:32:05 +08:00
|
|
|
ATH_CAP_SUPERG_COMP="$(COMPRESSION)" \
|
2008-10-17 05:06:30 +08:00
|
|
|
DO_MULTI=1 \
|
2009-08-19 23:13:00 +08:00
|
|
|
SINGLE_MODULE=$(if $(CONFIG_MADWIFI_SINGLE_MODULE),1) \
|
2009-03-27 04:56:58 +08:00
|
|
|
INCS="$(MADWIFI_INC)" \
|
2008-10-17 05:06:30 +08:00
|
|
|
$(if $(CONFIG_MADWIFI_DEBUG),,DEBUG=) WARNINGS="-Wno-unused"
|
2008-07-17 10:30:08 +08:00
|
|
|
|
2007-09-17 00:27:49 +08:00
|
|
|
MAKE_VARS:= \
|
2009-08-19 23:13:00 +08:00
|
|
|
COPTS="-DATH_REVERSE_ENGINEERING=1" \
|
2006-05-31 22:32:17 +08:00
|
|
|
|
2009-08-19 23:16:11 +08:00
|
|
|
define Build/Prepare/HAL
|
2008-03-20 14:57:01 +08:00
|
|
|
rm -rf $(PKG_BUILD_DIR)/tmp
|
|
|
|
mkdir -p $(PKG_BUILD_DIR)/tmp
|
2009-05-09 00:08:31 +08:00
|
|
|
tar xvzf $(DL_DIR)/$(HAL_FILE) -C $(PKG_BUILD_DIR)/tmp
|
2008-03-20 14:57:01 +08:00
|
|
|
$(CP) $(PKG_BUILD_DIR)/tmp/ath_hal*/* $(PKG_BUILD_DIR)/hal/
|
|
|
|
rm -rf $(PKG_BUILD_DIR)/tmp
|
2009-08-19 23:16:11 +08:00
|
|
|
endef
|
2008-08-01 01:27:55 +08:00
|
|
|
|
|
|
|
define Build/Prepare
|
|
|
|
$(call Build/Prepare/Default)
|
|
|
|
$(call Build/Prepare/HAL)
|
2008-06-01 11:00:32 +08:00
|
|
|
# patch cflags
|
|
|
|
$(SED) 's, -E[LB],,' \
|
2008-06-01 20:08:02 +08:00
|
|
|
-e 's, -mips2,,' \
|
2008-06-01 11:00:32 +08:00
|
|
|
-e 's, -mapcs-32,,' \
|
2009-07-13 22:56:44 +08:00
|
|
|
-e 's, -mlong-calls,,' \
|
2008-06-01 11:00:32 +08:00
|
|
|
$(PKG_BUILD_DIR)/hal/public/*.inc
|
|
|
|
$(SED) 's,march=armv4,march=armv5te,' \
|
|
|
|
$(PKG_BUILD_DIR)/hal/public/xscale*.inc
|
2008-08-01 01:27:55 +08:00
|
|
|
endef
|
2008-03-20 14:57:01 +08:00
|
|
|
|
2006-05-31 22:32:17 +08:00
|
|
|
ifeq ($(findstring AHB,$(BUS)),AHB)
|
2006-09-24 03:27:45 +08:00
|
|
|
define Build/Compile/ahb
|
2007-09-17 00:27:49 +08: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-24 03:27:45 +08:00
|
|
|
endef
|
2006-05-31 22:32:17 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(findstring PCI,$(BUS)),PCI)
|
2006-09-24 03:27:45 +08:00
|
|
|
define Build/Compile/pci
|
2007-09-17 00:27:49 +08: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-24 03:27:45 +08:00
|
|
|
endef
|
2006-05-31 22:32:17 +08:00
|
|
|
endif
|
|
|
|
|
2006-12-16 08:39:57 +08:00
|
|
|
define Build/Configure
|
|
|
|
$(SED) 's,-E[LB] ,,g' $(PKG_BUILD_DIR)/hal/public/*.inc
|
|
|
|
endef
|
|
|
|
|
2006-05-31 22:32:17 +08:00
|
|
|
define Build/Compile
|
2006-09-24 03:27:45 +08:00
|
|
|
$(call Build/Compile/ahb)
|
|
|
|
$(call Build/Compile/pci)
|
2006-05-31 22:32:17 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/InstallDev
|
2007-09-28 09:45:11 +08: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 22:32:17 +08:00
|
|
|
endef
|
|
|
|
|
2006-10-18 00:13:10 +08:00
|
|
|
define KernelPackage/madwifi/install
|
2006-12-17 03:57:11 +08:00
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2008-07-30 13:22:16 +08:00
|
|
|
$(CP) ./files/* $(1)/
|
2008-08-01 01:27:55 +08:00
|
|
|
$(CP) $(foreach applet,$(MADWIFI_APPLETS),$(PKG_BUILD_DIR)/tools/$(applet)) $(1)/usr/sbin/
|
2006-05-31 22:32:17 +08:00
|
|
|
endef
|
|
|
|
|
2006-10-18 00:13:10 +08:00
|
|
|
$(eval $(call KernelPackage,madwifi))
|