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
16 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
17 PKG_SOURCE_URL
:=@SF
/$(PKG_NAME
)
18 PKG_MD5SUM
:=bf5509fccd3852e22551826063b1b61e
21 PKG_BUILD_DIR
:=$(KERNEL_BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
23 include $(INCLUDE_DIR
)/package.mk
28 HAL_TARGET
:=mips-be-elf
31 HAL_TARGET
:=mips-le-elf
37 HAL_TARGET
:=xscale-be-elf
39 ifeq ($(ARCH
),powerpc
)
40 HAL_TARGET
:=powerpc-be-elf
44 ifneq ($(CONFIG_LINUX_2_6_AR531X
),)
48 ifneq ($(CONFIG_LINUX_2_6_ARUBA
),)
49 BUS
:=PCI AHB
# no suitable HAL for AHB yet.
53 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
54 BUS_MODULES
+=$(PKG_BUILD_DIR
)/ath
/ath_ahb.
$(LINUX_KMOD_SUFFIX
)
56 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
57 BUS_MODULES
+=$(PKG_BUILD_DIR
)/ath
/ath_pci.
$(LINUX_KMOD_SUFFIX
)
65 ath_rate_
$(RATE_CONTROL
) \
72 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
73 MADWIFI_AUTOLOAD
+= ath_ahb
75 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
76 MADWIFI_AUTOLOAD
+= ath_pci
79 define KernelPackage
/madwifi
80 SUBMENU
:=Wireless Drivers
81 TITLE
:=Driver for Atheros wireless chipsets
82 DEPENDS
:=+wireless-tools
84 This package contains a driver for Atheros
802.11a
/b
/g chipsets.
85 URL
:=http
://madwifi.org
/
86 VERSION
:=$(LINUX_VERSION
)+$(PKG_VERSION
)-$(BOARD
)-$(PKG_RELEASE
)
88 $(PKG_BUILD_DIR
)/ath
/ath_hal.
$(LINUX_KMOD_SUFFIX
) \
90 $(PKG_BUILD_DIR
)/ath_rate
/$(RATE_CONTROL
)/ath_rate_
$(RATE_CONTROL
).
$(LINUX_KMOD_SUFFIX
) \
91 $(PKG_BUILD_DIR
)/net80211
/wlan
*.
$(LINUX_KMOD_SUFFIX
)
92 AUTOLOAD
:=$(call AutoLoad
,50,$(MADWIFI_AUTOLOAD
))
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)" \
104 ATH_RATE
="ath_rate/$(RATE_CONTROL)" \
107 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
108 define Build
/Compile
/ahb
109 $(MAKE
) $(MADWIFI_MAKEOPTS
) BUS
="AHB" LDOPTS
="--no-warn-mismatch" modules
113 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
114 define Build
/Compile
/pci
115 $(MAKE
) $(MADWIFI_MAKEOPTS
) BUS
="PCI" LDOPTS
="--no-warn-mismatch" modules
119 define Build
/Configure
120 $(SED
) 's,-E[LB] ,,g' $(PKG_BUILD_DIR
)/hal
/public
/*.inc
124 $(call Build
/Compile
/ahb
)
125 $(call Build
/Compile
/pci
)
126 $(MAKE
) $(MADWIFI_MAKEOPTS
) \
127 CFLAGS
="$(TARGET_CFLAGS)" \
131 define Build
/InstallDev
132 mkdir
-p
$(STAGING_DIR
)/usr
/include/madwifi
133 $(CP
) $(PKG_BUILD_DIR
)/include $(STAGING_DIR
)/usr
/include/madwifi
/
134 mkdir
-p
$(STAGING_DIR
)/usr
/include/madwifi
/net80211
135 $(CP
) $(PKG_BUILD_DIR
)/net80211
/*.h
$(STAGING_DIR
)/usr
/include/madwifi
/net80211
/
138 define Build
/UninstallDev
139 rm -rf
$(STAGING_DIR
)/usr
/include/madwifi
142 define KernelPackage
/madwifi
/install
143 $(INSTALL_DIR
) $(1)/etc
/init.d
144 $(INSTALL_BIN
) .
/files
/madwifi.init
$(1)/etc
/init.d
/madwifi
145 $(INSTALL_DIR
) $(1)/usr
/sbin
146 $(CP
) $(PKG_BUILD_DIR
)/tools
/{madwifi_multi
,80211debug
,80211stats
,athchans
,athctrl
,athdebug
,athkey
,athstats
,wlanconfig
} $(1)/usr
/sbin
/
149 $(eval
$(call KernelPackage
,madwifi
))