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
35 ifeq ($(ARCH
),powerpc
)
36 HAL_TARGET
:=powerpc-be-elf
40 ifneq ($(CONFIG_LINUX_2_4_AR531X
),)
43 ifneq ($(CONFIG_LINUX_2_6_ARUBA
),)
44 BUS
:= PCI AHB
# no suitable HAL for AHB yet.
48 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
49 BUS_MODULES
+=$(PKG_BUILD_DIR
)/ath
/ath_ahb.
$(LINUX_KMOD_SUFFIX
)
51 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
52 BUS_MODULES
+=$(PKG_BUILD_DIR
)/ath
/ath_pci.
$(LINUX_KMOD_SUFFIX
)
55 MADWIFI_MAKEOPTS
= -C
$(PKG_BUILD_DIR
) \
56 ARCH
="$(LINUX_KARCH)" \
57 CROSS_COMPILE
="$(TARGET_CROSS)" \
59 TARGET
="$(HAL_TARGET)" \
60 TOOLPREFIX
="$(KERNEL_CROSS)" \
61 TOOLPATH
="$(KERNEL_CROSS)" \
62 KERNELPATH
="$(LINUX_DIR)" \
66 include $(INCLUDE_DIR
)/package.mk
68 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
69 define Build
/Compile
/ahb
70 $(MAKE
) $(MADWIFI_MAKEOPTS
) BUS
="AHB" all
74 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
75 define Build
/Compile
/pci
76 $(MAKE
) $(MADWIFI_MAKEOPTS
) BUS
="PCI" all
81 $(call Build
/Compile
/ahb
)
82 $(call Build
/Compile
/pci
)
85 define Build
/InstallDev
86 mkdir
-p
$(STAGING_DIR
)/usr
/include/madwifi
87 $(CP
) $(PKG_BUILD_DIR
)/include $(STAGING_DIR
)/usr
/include/madwifi
/
88 mkdir
-p
$(STAGING_DIR
)/usr
/include/madwifi
/net80211
89 $(CP
) $(PKG_BUILD_DIR
)/net80211
/*.h
$(STAGING_DIR
)/usr
/include/madwifi
/net80211
/
92 define Build
/UninstallDev
93 rm -rf
$(STAGING_DIR
)/usr
/include/madwifi
96 define Package
/kmod-madwifi
99 DEFAULT
:=y if LINUX_2_6_BRCM || LINUX_2_6_ARUBA || LINUX_2_4_AR531X || LINUX_2_6_XSCALE
, m if ALL
100 TITLE
:=Driver for Atheros wireless chipsets
101 DESCRIPTION
:=Driver for Atheros
802.11a
/b
/g chipsets
102 URL
:=http
://madwifi.org
/
103 VERSION
:=$(LINUX_VERSION
)+$(PKG_VERSION
)-$(BOARD
)-$(PKG_RELEASE
)
106 define Package
/kmod-madwifi
/install
107 mkdir
-p
$(1)/etc
/modules.d
108 mkdir
-p
$(1)/etc
/init.d
109 mkdir
-p
$(1)/lib
/modules
/$(LINUX_VERSION
)
110 mkdir
-p
$(1)/usr
/sbin
111 install -m0644 .
/files
/madwifi.modules
$(1)/etc
/modules.d
/20-madwifi
112 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
113 echo ath_ahb
>> $(1)/etc
/modules.d
/20-madwifi
115 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
116 echo ath_pci
>> $(1)/etc
/modules.d
/20-madwifi
118 install -m0755 .
/files
/madwifi.init
$(1)/etc
/init.d
/S20madwifi
120 $(PKG_BUILD_DIR
)/ath_hal
/ath_hal.
$(LINUX_KMOD_SUFFIX
) \
122 $(PKG_BUILD_DIR
)/ath_rate
/sample
/ath_rate_sample.
$(LINUX_KMOD_SUFFIX
) \
123 $(PKG_BUILD_DIR
)/net80211
/wlan
*.
$(LINUX_KMOD_SUFFIX
) \
124 $(1)/lib
/modules
/$(LINUX_VERSION
)/
125 $(CP
) $(PKG_BUILD_DIR
)/tools
/{madwifi_multi
,80211debug
,80211stats
,athchans
,athctrl
,athdebug
,athkey
,athstats
,wlanconfig
} $(1)/usr
/sbin
/
128 $(eval
$(call BuildPackage
,kmod-madwifi
))