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
15 PKG_MD5SUM
:=9b558d1df84cab2b0006c595feee0fba
17 PKG_SOURCE_URL
:=@SF
/$(PKG_NAME
)
18 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
21 PKG_BUILD_DIR
:=$(KERNEL_BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
24 HAL_TARGET
:=mips-be-elf
27 HAL_TARGET
:=mips-le-elf
33 HAL_TARGET
:=xscale-be-elf
37 ifneq ($(CONFIG_LINUX_2_4_AR531X
),)
40 ifneq ($(CONFIG_LINUX_2_6_ARUBA
),)
41 BUS
:= PCI AHB
# no suitable HAL for AHB yet.
45 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
46 BUS_MODULES
+=$(PKG_BUILD_DIR
)/ath
/ath_ahb.
$(LINUX_KMOD_SUFFIX
)
48 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
49 BUS_MODULES
+=$(PKG_BUILD_DIR
)/ath
/ath_pci.
$(LINUX_KMOD_SUFFIX
)
52 MADWIFI_MAKEOPTS
= -C
$(PKG_BUILD_DIR
) \
53 ARCH
="$(LINUX_KARCH)" \
54 CROSS_COMPILE
="$(TARGET_CROSS)" \
56 TARGET
="$(HAL_TARGET)" \
57 TOOLPREFIX
="$(KERNEL_CROSS)" \
58 TOOLPATH
="$(KERNEL_CROSS)" \
59 KERNELPATH
="$(LINUX_DIR)" \
63 include $(INCLUDE_DIR
)/package.mk
65 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
66 define Build
/Compile
/ahb
67 $(MAKE
) $(MADWIFI_MAKEOPTS
) BUS
="AHB" all
71 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
72 define Build
/Compile
/pci
73 $(MAKE
) $(MADWIFI_MAKEOPTS
) BUS
="PCI" all
78 $(call Build
/Compile
/ahb
)
79 $(call Build
/Compile
/pci
)
82 define Build
/InstallDev
83 mkdir
-p
$(STAGING_DIR
)/usr
/include/madwifi
84 $(CP
) $(PKG_BUILD_DIR
)/include $(STAGING_DIR
)/usr
/include/madwifi
/
85 mkdir
-p
$(STAGING_DIR
)/usr
/include/madwifi
/net80211
86 $(CP
) $(PKG_BUILD_DIR
)/net80211
/*.h
$(STAGING_DIR
)/usr
/include/madwifi
/net80211
/
89 define Build
/UninstallDev
90 rm -rf
$(STAGING_DIR
)/usr
/include/madwifi
93 define Package
/kmod-madwifi
96 DEFAULT
:=y if LINUX_2_6_BRCM || LINUX_2_6_ARUBA || LINUX_2_4_AR531X || LINUX_2_6_XSCALE
, m if ALL
97 TITLE
:=Driver for Atheros wireless chipsets
98 DESCRIPTION
:=Driver for Atheros
802.11a
/b
/g chipsets
99 URL
:=http
://madwifi.org
/
100 VERSION
:=$(LINUX_VERSION
)+$(PKG_VERSION
)-$(BOARD
)-$(PKG_RELEASE
)
103 define Package
/kmod-madwifi
/install
104 mkdir
-p
$(1)/etc
/modules.d
105 mkdir
-p
$(1)/etc
/init.d
106 mkdir
-p
$(1)/lib
/modules
/$(LINUX_VERSION
)
107 mkdir
-p
$(1)/usr
/sbin
108 install -m0644 .
/files
/madwifi.modules
$(1)/etc
/modules.d
/20-madwifi
109 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
110 echo ath_ahb
>> $(1)/etc
/modules.d
/20-madwifi
112 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
113 echo ath_pci
>> $(1)/etc
/modules.d
/20-madwifi
115 install -m0755 .
/files
/madwifi.init
$(1)/etc
/init.d
/S20madwifi
117 $(PKG_BUILD_DIR
)/ath_hal
/ath_hal.
$(LINUX_KMOD_SUFFIX
) \
119 $(PKG_BUILD_DIR
)/ath_rate
/sample
/ath_rate_sample.
$(LINUX_KMOD_SUFFIX
) \
120 $(PKG_BUILD_DIR
)/net80211
/*.
$(LINUX_KMOD_SUFFIX
) \
121 $(1)/lib
/modules
/$(LINUX_VERSION
)/
122 $(CP
) $(PKG_BUILD_DIR
)/tools
/{madwifi_multi
,80211debug
,80211stats
,athchans
,athctrl
,athdebug
,athkey
,athstats
,wlanconfig
} $(1)/usr
/sbin
/
125 $(eval
$(call BuildPackage
,kmod-madwifi
))