2006-06-27 00:35:46 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# 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
|
2007-07-11 21:13:50 +00:00
|
|
|
PKG_VERSION:=r2568-20070710
|
2007-05-23 14:54:18 +00:00
|
|
|
PKG_BRANCH:=madwifi-ng
|
2007-08-01 18:39:29 +00:00
|
|
|
PKG_RELEASE:=2
|
2006-05-31 14:32:17 +00:00
|
|
|
|
2007-05-21 06:25:34 +00:00
|
|
|
PKG_SOURCE:=$(PKG_BRANCH)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=http://snapshots.madwifi.org/$(PKG_BRANCH)
|
2007-07-11 21:13:50 +00:00
|
|
|
PKG_MD5SUM:=fe5d41acd085d2c46934be3f8839e694
|
2006-05-31 14:32:17 +00:00
|
|
|
|
2007-09-16 16:27:49 +00:00
|
|
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BRANCH)-$(PKG_VERSION)
|
2006-09-23 19:27:45 +00:00
|
|
|
|
2007-09-16 16:27:49 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2006-08-29 16:20:00 +00:00
|
|
|
|
2006-05-31 14:32:17 +00:00
|
|
|
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),armeb)
|
|
|
|
HAL_TARGET:=xscale-be-elf
|
|
|
|
endif
|
2007-03-11 19:49:50 +00:00
|
|
|
ifeq ($(ARCH),arm)
|
|
|
|
HAL_TARGET:=xscale-le-elf
|
|
|
|
endif
|
2006-08-25 21:53:54 +00:00
|
|
|
ifeq ($(ARCH),powerpc)
|
|
|
|
HAL_TARGET:=powerpc-be-elf
|
|
|
|
endif
|
2006-05-31 14:32:17 +00:00
|
|
|
|
2007-09-09 22:59:46 +00:00
|
|
|
ifneq ($(CONFIG_TARGET_atheros),)
|
2006-09-23 19:27:45 +00:00
|
|
|
BUS:=AHB
|
2006-12-16 00:39:57 +00:00
|
|
|
HAL_TARGET:=ap51
|
2007-09-16 16:27:49 +00:00
|
|
|
else
|
|
|
|
ifneq ($(CONFIG_PCI_SUPPORT),)
|
|
|
|
BUS:=PCI
|
|
|
|
endif
|
2006-05-31 14:32:17 +00:00
|
|
|
endif
|
|
|
|
|
2007-09-20 07:11:52 +00:00
|
|
|
# XXX: remove this check later when we have PCI support properly detected on all targets
|
|
|
|
ifneq ($(CONFIG_TARGET_uml),)
|
|
|
|
BUS:=
|
|
|
|
endif
|
|
|
|
|
2007-09-16 16:27:49 +00:00
|
|
|
RATE_CONTROL:=minstrel
|
|
|
|
|
|
|
|
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)
|
2007-09-16 16:27:49 +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)
|
2007-09-16 16:27:49 +00:00
|
|
|
MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
|
|
|
|
MADWIFI_AUTOLOAD+= ath_pci
|
2006-10-17 16:13:10 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
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/
|
2007-09-20 07:11:52 +00:00
|
|
|
DEPENDS:=+wireless-tools @PCI_SUPPORT||TARGET_atheros @!TARGET_avr32 @!TARGET_etrax @!TARGET_uml
|
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
|
|
|
|
|
2007-10-14 11:42:09 +00:00
|
|
|
define KernelPackage/madwifi-karma
|
|
|
|
$(call KernelPackage/madwifi)
|
|
|
|
TITLE:=Madwifi for Karma support
|
|
|
|
URL:=http://www.digininja.org/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define KernelPackage/madwifi-karma/description
|
|
|
|
This package contains a modified driver to be used with
|
|
|
|
the Karma software for Atheros 802.11a/b/g chipsets.
|
|
|
|
endef
|
|
|
|
|
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)" \
|
|
|
|
WARNINGS="" \
|
|
|
|
DOMULTI=1
|
|
|
|
|
|
|
|
MAKE_VARS:= \
|
|
|
|
COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" \
|
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
|
2007-10-14 11:42:09 +00:00
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-madwifi-karma),)
|
|
|
|
$(PATCH) $(PKG_BUILD_DIR) ./files
|
|
|
|
endif
|
2006-12-16 00:39:57 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
define Build/UninstallDev
|
2007-09-28 01:45:11 +00:00
|
|
|
rm -rf $(1)/usr/include/madwifi
|
2006-05-31 14:32:17 +00:00
|
|
|
endef
|
|
|
|
|
2006-10-17 16:13:10 +00:00
|
|
|
define KernelPackage/madwifi/install
|
2006-12-22 08:02:59 +00:00
|
|
|
$(INSTALL_DIR) $(1)/lib/wifi
|
|
|
|
$(INSTALL_DATA) ./files/lib/wifi/madwifi.sh $(1)/lib/wifi
|
2006-12-16 19:57:11 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2007-02-20 13:16:51 +00:00
|
|
|
$(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,80211stats,athchans,athctrl,athkey,athstats,wlanconfig} $(1)/usr/sbin/
|
2006-05-31 14:32:17 +00:00
|
|
|
endef
|
|
|
|
|
2007-10-14 11:42:09 +00:00
|
|
|
define KernelPackage/madwifi-karma/install
|
|
|
|
$(INSTALL_DIR) $(1)/lib/wifi
|
|
|
|
$(INSTALL_DATA) ./files/lib/wifi/madwifi.sh $(1)/lib/wifi
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,80211stats,athchans,athctrl,athkey,athstats,wlanconfig} $(1)/usr/sbin/
|
|
|
|
endef
|
|
|
|
|
2006-10-17 16:13:10 +00:00
|
|
|
$(eval $(call KernelPackage,madwifi))
|
2007-10-14 11:42:09 +00:00
|
|
|
$(eval $(call KernelPackage,madwifi-karma))
|