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
:=r2756-20071018
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_MD5SUM
:=6141c846fec12b3d0c80409c81eebc39
21 PKG_BUILD_DIR
:=$(KERNEL_BUILD_DIR
)/$(PKG_BRANCH
)-$(PKG_VERSION
)
23 include $(INCLUDE_DIR
)/package.mk
26 HAL_TARGET
:=mips-be-elf
29 HAL_TARGET
:=mips-le-elf
35 HAL_TARGET
:=xscale-be-elf
38 HAL_TARGET
:=xscale-le-elf
40 ifeq ($(ARCH
),powerpc
)
41 HAL_TARGET
:=powerpc-be-elf
44 ifneq ($(CONFIG_TARGET_atheros
),)
48 ifneq ($(CONFIG_PCI_SUPPORT
),)
53 # XXX: remove this check later when we have PCI support properly detected on all targets
54 ifneq ($(CONFIG_TARGET_uml
),)
58 RATE_CONTROL
:=minstrel
61 $(PKG_BUILD_DIR
)/net80211
/wlan.
$(LINUX_KMOD_SUFFIX
) \
62 $(PKG_BUILD_DIR
)/net80211
/wlan_scan_ap.
$(LINUX_KMOD_SUFFIX
) \
63 $(PKG_BUILD_DIR
)/net80211
/wlan_scan_sta.
$(LINUX_KMOD_SUFFIX
) \
64 $(PKG_BUILD_DIR
)/ath_hal
/ath_hal.
$(LINUX_KMOD_SUFFIX
) \
65 $(PKG_BUILD_DIR
)/ath_rate
/$(RATE_CONTROL
)/ath_rate_
$(RATE_CONTROL
).
$(LINUX_KMOD_SUFFIX
) \
66 $(PKG_BUILD_DIR
)/net80211
/wlan_acl.
$(LINUX_KMOD_SUFFIX
) \
67 $(PKG_BUILD_DIR
)/net80211
/wlan_ccmp.
$(LINUX_KMOD_SUFFIX
) \
68 $(PKG_BUILD_DIR
)/net80211
/wlan_tkip.
$(LINUX_KMOD_SUFFIX
) \
69 $(PKG_BUILD_DIR
)/net80211
/wlan_wep.
$(LINUX_KMOD_SUFFIX
) \
70 $(PKG_BUILD_DIR
)/net80211
/wlan_xauth.
$(LINUX_KMOD_SUFFIX
) \
77 ath_rate_
$(RATE_CONTROL
) \
84 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
85 MADWIFI_FILES
+= $(PKG_BUILD_DIR
)/ath
/ath_ahb.
$(LINUX_KMOD_SUFFIX
)
86 MADWIFI_AUTOLOAD
+= ath_ahb
88 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
89 MADWIFI_FILES
+= $(PKG_BUILD_DIR
)/ath
/ath_pci.
$(LINUX_KMOD_SUFFIX
)
90 MADWIFI_AUTOLOAD
+= ath_pci
93 define KernelPackage
/madwifi
94 SUBMENU
:=Wireless Drivers
95 TITLE
:=Driver for Atheros wireless chipsets
96 URL
:=http
://madwifi.org
/
97 DEPENDS
:=+wireless-tools @PCI_SUPPORT||TARGET_atheros @
!TARGET_avr32 @
!TARGET_etrax @
!TARGET_uml
98 FILES
:=$(MADWIFI_FILES
)
99 AUTOLOAD
:=$(call AutoLoad
,50,$(MADWIFI_AUTOLOAD
))
102 define KernelPackage
/madwifi
/description
103 This package contains a driver for Atheros
802.11a
/b
/g chipsets.
107 PATH
="$(TARGET_PATH)" \
108 ARCH
="$(LINUX_KARCH)" \
109 CROSS_COMPILE
="$(TARGET_CROSS)" \
110 TARGET
="$(HAL_TARGET)" \
111 TOOLPREFIX
="$(KERNEL_CROSS)" \
112 TOOLPATH
="$(KERNEL_CROSS)" \
113 KERNELPATH
="$(LINUX_DIR)" \
114 LDOPTS
="--no-warn-mismatch " \
115 ATH_RATE
="ath_rate/$(RATE_CONTROL)" \
120 COPTS
="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" \
122 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
123 define Build
/Compile
/ahb
124 $(MAKE_VARS
) $(MAKE
) -C
$(PKG_BUILD_DIR
) $(MAKE_ARGS
) BUS
="AHB" modules
125 $(MAKE
) -C
$(PKG_BUILD_DIR
) $(MAKE_ARGS
) CFLAGS
="$(TARGET_CFLAGS)" tools
129 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
130 define Build
/Compile
/pci
131 $(MAKE_VARS
) $(MAKE
) -C
$(PKG_BUILD_DIR
) $(MAKE_ARGS
) BUS
="PCI" modules
132 $(MAKE
) -C
$(PKG_BUILD_DIR
) $(MAKE_ARGS
) CFLAGS
="$(TARGET_CFLAGS)" tools
136 define Build
/Configure
137 $(SED
) 's,-E[LB] ,,g' $(PKG_BUILD_DIR
)/hal
/public
/*.inc
141 $(call Build
/Compile
/ahb
)
142 $(call Build
/Compile
/pci
)
145 define Build
/InstallDev
146 mkdir
-p
$(1)/usr
/include/madwifi
147 $(CP
) $(PKG_BUILD_DIR
)/include $(1)/usr
/include/madwifi
/
148 mkdir
-p
$(1)/usr
/include/madwifi
/net80211
149 $(CP
) $(PKG_BUILD_DIR
)/net80211
/*.h
$(1)/usr
/include/madwifi
/net80211
/
152 define Build
/UninstallDev
153 rm -rf
$(1)/usr
/include/madwifi
156 define KernelPackage
/madwifi
/install
157 $(INSTALL_DIR
) $(1)/lib
/wifi
158 $(INSTALL_DATA
) .
/files
/lib
/wifi
/madwifi.sh
$(1)/lib
/wifi
159 $(INSTALL_DIR
) $(1)/usr
/sbin
160 $(CP
) $(PKG_BUILD_DIR
)/tools
/{madwifi_multi
,80211stats
,athchans
,athctrl
,athkey
,athstats
,wlanconfig
} $(1)/usr
/sbin
/
163 $(eval
$(call KernelPackage
,madwifi
))