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
14 PKG_VERSION
:=r
$(PKG_REV
)
15 PKG_BRANCH
:=madwifi-dfs
19 PKG_SOURCE_VERSION
:=$(PKG_REV
)
20 PKG_SOURCE_SUBDIR
:=$(if
$(PKG_BRANCH
),$(PKG_BRANCH
),madwifi
)-$(PKG_VERSION
)
21 PKG_SOURCE_URL
:=http
://svn.madwifi.org
/madwifi
/$(if
$(PKG_BRANCH
),branches
/$(PKG_BRANCH
),trunk
)
22 PKG_SOURCE
:=$(PKG_SOURCE_SUBDIR
).
tar.gz
24 PKG_BUILD_DIR
:=$(KERNEL_BUILD_DIR
)/$(PKG_BRANCH
)-$(PKG_VERSION
)
26 include $(INCLUDE_DIR
)/package.mk
29 HAL_TARGET
:=mips-be-elf
32 HAL_TARGET
:=mips-le-elf
41 HAL_TARGET
:=xscale-be-elf
44 HAL_TARGET
:=xscale-le-elf
46 ifeq ($(ARCH
),powerpc
)
47 HAL_TARGET
:=powerpc-be-elf
50 ifneq ($(CONFIG_TARGET_atheros
),)
54 ifneq ($(CONFIG_PCI_SUPPORT
),)
59 # XXX: remove this check later when we have PCI support properly detected on all targets
60 ifneq ($(CONFIG_TARGET_uml
),)
64 RATE_CONTROL
:=minstrel
67 $(PKG_BUILD_DIR
)/net80211
/wlan.
$(LINUX_KMOD_SUFFIX
) \
68 $(PKG_BUILD_DIR
)/net80211
/wlan_scan_ap.
$(LINUX_KMOD_SUFFIX
) \
69 $(PKG_BUILD_DIR
)/net80211
/wlan_scan_sta.
$(LINUX_KMOD_SUFFIX
) \
70 $(PKG_BUILD_DIR
)/ath_hal
/ath_hal.
$(LINUX_KMOD_SUFFIX
) \
71 $(PKG_BUILD_DIR
)/ath_rate
/$(RATE_CONTROL
)/ath_rate_
$(RATE_CONTROL
).
$(LINUX_KMOD_SUFFIX
) \
72 $(PKG_BUILD_DIR
)/net80211
/wlan_acl.
$(LINUX_KMOD_SUFFIX
) \
73 $(PKG_BUILD_DIR
)/net80211
/wlan_ccmp.
$(LINUX_KMOD_SUFFIX
) \
74 $(PKG_BUILD_DIR
)/net80211
/wlan_tkip.
$(LINUX_KMOD_SUFFIX
) \
75 $(PKG_BUILD_DIR
)/net80211
/wlan_wep.
$(LINUX_KMOD_SUFFIX
) \
76 $(PKG_BUILD_DIR
)/net80211
/wlan_xauth.
$(LINUX_KMOD_SUFFIX
) \
83 ath_rate_
$(RATE_CONTROL
) \
90 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
91 MADWIFI_FILES
+= $(PKG_BUILD_DIR
)/ath
/ath_ahb.
$(LINUX_KMOD_SUFFIX
)
92 MADWIFI_AUTOLOAD
+= ath_ahb
94 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
95 MADWIFI_FILES
+= $(PKG_BUILD_DIR
)/ath
/ath_pci.
$(LINUX_KMOD_SUFFIX
)
96 MADWIFI_AUTOLOAD
+= ath_pci
99 define KernelPackage
/madwifi
100 SUBMENU
:=Wireless Drivers
101 TITLE
:=Driver for Atheros wireless chipsets
102 URL
:=http
://madwifi.org
/
103 DEPENDS
:=+wireless-tools @PCI_SUPPORT||TARGET_atheros @
!TARGET_avr32 @
!TARGET_etrax @
!TARGET_uml
104 FILES
:=$(MADWIFI_FILES
)
105 AUTOLOAD
:=$(call AutoLoad
,50,$(MADWIFI_AUTOLOAD
))
108 define KernelPackage
/madwifi
/description
109 This package contains a driver for Atheros
802.11a
/b
/g chipsets.
113 PATH
="$(TARGET_PATH)" \
114 ARCH
="$(LINUX_KARCH)" \
115 CROSS_COMPILE
="$(TARGET_CROSS)" \
116 TARGET
="$(HAL_TARGET)" \
117 TOOLPREFIX
="$(KERNEL_CROSS)" \
118 TOOLPATH
="$(KERNEL_CROSS)" \
119 KERNELPATH
="$(LINUX_DIR)" \
120 LDOPTS
="--no-warn-mismatch " \
121 ATH_RATE
="ath_rate/$(RATE_CONTROL)" \
126 COPTS
="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" \
128 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
129 define Build
/Compile
/ahb
130 $(MAKE_VARS
) $(MAKE
) -C
$(PKG_BUILD_DIR
) $(MAKE_ARGS
) BUS
="AHB" modules
131 $(MAKE
) -C
$(PKG_BUILD_DIR
) $(MAKE_ARGS
) CFLAGS
="$(TARGET_CFLAGS)" tools
135 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
136 define Build
/Compile
/pci
137 $(MAKE_VARS
) $(MAKE
) -C
$(PKG_BUILD_DIR
) $(MAKE_ARGS
) BUS
="PCI" modules
138 $(MAKE
) -C
$(PKG_BUILD_DIR
) $(MAKE_ARGS
) CFLAGS
="$(TARGET_CFLAGS)" tools
142 define Build
/Configure
143 $(SED
) 's,-E[LB] ,,g' $(PKG_BUILD_DIR
)/hal
/public
/*.inc
147 $(call Build
/Compile
/ahb
)
148 $(call Build
/Compile
/pci
)
151 define Build
/InstallDev
152 mkdir
-p
$(1)/usr
/include/madwifi
153 $(CP
) $(PKG_BUILD_DIR
)/include $(1)/usr
/include/madwifi
/
154 mkdir
-p
$(1)/usr
/include/madwifi
/net80211
155 $(CP
) $(PKG_BUILD_DIR
)/net80211
/*.h
$(1)/usr
/include/madwifi
/net80211
/
158 define Build
/UninstallDev
159 rm -rf
$(1)/usr
/include/madwifi
162 define KernelPackage
/madwifi
/install
163 $(INSTALL_DIR
) $(1)/lib
/wifi
164 $(INSTALL_DATA
) .
/files
/lib
/wifi
/madwifi.sh
$(1)/lib
/wifi
165 $(INSTALL_DIR
) $(1)/usr
/sbin
166 $(CP
) $(PKG_BUILD_DIR
)/tools
/{madwifi_multi
,80211stats
,athchans
,athctrl
,athkey
,athstats
,wlanconfig
} $(1)/usr
/sbin
/
169 $(eval
$(call KernelPackage
,madwifi
))