2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
10 include $(INCLUDE_DIR
)/kernel.mk
13 PKG_VERSION
:=r2568-20070710
14 PKG_BRANCH
:=madwifi-ng
17 PKG_SOURCE
:=$(PKG_BRANCH
)-$(PKG_VERSION
).
tar.gz
18 PKG_SOURCE_URL
:=http
://snapshots.madwifi.org
/$(PKG_BRANCH
)
19 PKG_BUILD_DIR
:=$(KERNEL_BUILD_DIR
)/$(PKG_BRANCH
)-$(PKG_VERSION
)
20 PKG_MD5SUM
:=fe5d41acd085d2c46934be3f8839e694
22 include $(INCLUDE_DIR
)/package.mk
24 RATE_CONTROL
:=minstrel
27 HAL_TARGET
:=mips-be-elf
30 HAL_TARGET
:=mips-le-elf
36 HAL_TARGET
:=xscale-be-elf
39 HAL_TARGET
:=xscale-le-elf
41 ifeq ($(ARCH
),powerpc
)
42 HAL_TARGET
:=powerpc-be-elf
46 ifneq ($(CONFIG_TARGET_atheros
),)
52 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
53 BUS_MODULES
+=$(PKG_BUILD_DIR
)/ath
/ath_ahb.
$(LINUX_KMOD_SUFFIX
)
55 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
56 BUS_MODULES
+=$(PKG_BUILD_DIR
)/ath
/ath_pci.
$(LINUX_KMOD_SUFFIX
)
64 ath_rate_
$(RATE_CONTROL
) \
71 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
72 MADWIFI_AUTOLOAD
+= ath_ahb
74 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
75 MADWIFI_AUTOLOAD
+= ath_pci
78 define KernelPackage
/madwifi
79 SUBMENU
:=Wireless Drivers
80 TITLE
:=Driver for Atheros wireless chipsets
81 DEPENDS
:=+wireless-tools @
!LINUX_2_6_AVR32 @
!LINUX_2_6_ETRAX
82 URL
:=http
://madwifi.org
/
84 $(PKG_BUILD_DIR
)/ath_hal
/ath_hal.
$(LINUX_KMOD_SUFFIX
) \
86 $(PKG_BUILD_DIR
)/ath_rate
/$(RATE_CONTROL
)/ath_rate_
$(RATE_CONTROL
).
$(LINUX_KMOD_SUFFIX
) \
87 $(PKG_BUILD_DIR
)/net80211
/wlan
*.
$(LINUX_KMOD_SUFFIX
)
88 AUTOLOAD
:=$(call AutoLoad
,50,$(MADWIFI_AUTOLOAD
))
91 define KernelPackage
/madwifi
/description
92 This package contains a driver for Atheros
802.11a
/b
/g chipsets.
95 MADWIFI_MAKEOPTS
= -C
$(PKG_BUILD_DIR
) \
96 PATH
="$(TARGET_PATH)" \
97 ARCH
="$(LINUX_KARCH)" \
98 CROSS_COMPILE
="$(TARGET_CROSS)" \
99 TARGET
="$(HAL_TARGET)" \
100 TOOLPREFIX
="$(KERNEL_CROSS)" \
101 TOOLPATH
="$(KERNEL_CROSS)" \
102 KERNELPATH
="$(LINUX_DIR)" \
103 LDOPTS
="--no-warn-mismatch " \
104 ATH_RATE
="ath_rate/$(RATE_CONTROL)" \
108 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
109 define Build
/Compile
/ahb
110 COPTS
="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" $(MAKE
) $(MADWIFI_MAKEOPTS
) BUS
="AHB" modules
114 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
115 define Build
/Compile
/pci
116 COPTS
="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" $(MAKE
) $(MADWIFI_MAKEOPTS
) BUS
="PCI" modules
120 define Build
/Configure
121 $(SED
) 's,-E[LB] ,,g' $(PKG_BUILD_DIR
)/hal
/public
/*.inc
125 $(call Build
/Compile
/ahb
)
126 $(call Build
/Compile
/pci
)
127 $(MAKE
) $(MADWIFI_MAKEOPTS
) \
128 CFLAGS
="$(TARGET_CFLAGS)" \
132 define Build
/InstallDev
133 mkdir
-p
$(STAGING_DIR
)/usr
/include/madwifi
134 $(CP
) $(PKG_BUILD_DIR
)/include $(STAGING_DIR
)/usr
/include/madwifi
/
135 mkdir
-p
$(STAGING_DIR
)/usr
/include/madwifi
/net80211
136 $(CP
) $(PKG_BUILD_DIR
)/net80211
/*.h
$(STAGING_DIR
)/usr
/include/madwifi
/net80211
/
139 define Build
/UninstallDev
140 rm -rf
$(STAGING_DIR
)/usr
/include/madwifi
143 define KernelPackage
/madwifi
/install
144 $(INSTALL_DIR
) $(1)/lib
/wifi
145 $(INSTALL_DATA
) .
/files
/lib
/wifi
/madwifi.sh
$(1)/lib
/wifi
146 $(INSTALL_DIR
) $(1)/usr
/sbin
147 $(CP
) $(PKG_BUILD_DIR
)/tools
/{madwifi_multi
,80211stats
,athchans
,athctrl
,athkey
,athstats
,wlanconfig
} $(1)/usr
/sbin
/
150 $(eval
$(call KernelPackage
,madwifi
))