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
:=r2313-20070505
16 PKG_SOURCE
:=madwifi-ng-refcount-
$(PKG_VERSION
).
tar.gz
17 PKG_SOURCE_URL
:=http
://snapshots.madwifi.org
/madwifi-ng-refcount
18 PKG_MD5SUM
:=01ee9dfb1f174be6e009f9697f7267b8
19 PKG_BUILD_DIR
:=$(KERNEL_BUILD_DIR
)/madwifi-ng-refcount-r2313-20070505
21 include $(INCLUDE_DIR
)/package.mk
23 RATE_CONTROL
:=minstrel
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
45 ifneq ($(CONFIG_LINUX_2_6_ATHEROS
),)
49 ifneq ($(CONFIG_LINUX_2_6_ARUBA
),)
50 BUS
:=PCI AHB
# no suitable HAL for AHB yet.
54 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
55 BUS_MODULES
+=$(PKG_BUILD_DIR
)/ath
/ath_ahb.
$(LINUX_KMOD_SUFFIX
)
57 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
58 BUS_MODULES
+=$(PKG_BUILD_DIR
)/ath
/ath_pci.
$(LINUX_KMOD_SUFFIX
)
66 ath_rate_
$(RATE_CONTROL
) \
73 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
74 MADWIFI_AUTOLOAD
+= ath_ahb
76 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
77 MADWIFI_AUTOLOAD
+= ath_pci
80 define KernelPackage
/madwifi
81 SUBMENU
:=Wireless Drivers
82 TITLE
:=Driver for Atheros wireless chipsets
83 DEPENDS
:=+wireless-tools
85 This package contains a driver for Atheros
802.11a
/b
/g chipsets.
86 URL
:=http
://madwifi.org
/
87 VERSION
:=$(LINUX_VERSION
)+$(PKG_VERSION
)-$(BOARD
)-$(PKG_RELEASE
)
89 $(PKG_BUILD_DIR
)/ath_hal
/ath_hal.
$(LINUX_KMOD_SUFFIX
) \
91 $(PKG_BUILD_DIR
)/ath_rate
/$(RATE_CONTROL
)/ath_rate_
$(RATE_CONTROL
).
$(LINUX_KMOD_SUFFIX
) \
92 $(PKG_BUILD_DIR
)/net80211
/wlan
*.
$(LINUX_KMOD_SUFFIX
)
93 AUTOLOAD
:=$(call AutoLoad
,50,$(MADWIFI_AUTOLOAD
))
96 MADWIFI_MAKEOPTS
= -C
$(PKG_BUILD_DIR
) \
97 PATH
="$(TARGET_PATH)" \
98 ARCH
="$(LINUX_KARCH)" \
99 CROSS_COMPILE
="$(TARGET_CROSS)" \
100 TARGET
="$(HAL_TARGET)" \
101 TOOLPREFIX
="$(KERNEL_CROSS)" \
102 TOOLPATH
="$(KERNEL_CROSS)" \
103 KERNELPATH
="$(LINUX_DIR)" \
104 LDOPTS
="--no-warn-mismatch " \
105 ATH_RATE
="ath_rate/$(RATE_CONTROL)" \
109 ifeq ($(findstring AHB
,$(BUS
)),AHB
)
110 define Build
/Compile
/ahb
111 COPTS
="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" $(MAKE
) $(MADWIFI_MAKEOPTS
) BUS
="AHB" modules
115 ifeq ($(findstring PCI
,$(BUS
)),PCI
)
116 define Build
/Compile
/pci
117 COPTS
="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" $(MAKE
) $(MADWIFI_MAKEOPTS
) BUS
="PCI" modules
121 define Build
/Configure
122 $(SED
) 's,-E[LB] ,,g' $(PKG_BUILD_DIR
)/hal
/public
/*.inc
126 $(call Build
/Compile
/ahb
)
127 $(call Build
/Compile
/pci
)
128 $(MAKE
) $(MADWIFI_MAKEOPTS
) \
129 CFLAGS
="$(TARGET_CFLAGS)" \
133 define Build
/InstallDev
134 mkdir
-p
$(STAGING_DIR
)/usr
/include/madwifi
135 $(CP
) $(PKG_BUILD_DIR
)/include $(STAGING_DIR
)/usr
/include/madwifi
/
136 mkdir
-p
$(STAGING_DIR
)/usr
/include/madwifi
/net80211
137 $(CP
) $(PKG_BUILD_DIR
)/net80211
/*.h
$(STAGING_DIR
)/usr
/include/madwifi
/net80211
/
140 define Build
/UninstallDev
141 rm -rf
$(STAGING_DIR
)/usr
/include/madwifi
144 define KernelPackage
/madwifi
/install
145 $(INSTALL_DIR
) $(1)/lib
/wifi
146 $(INSTALL_DATA
) .
/files
/lib
/wifi
/madwifi.sh
$(1)/lib
/wifi
147 $(INSTALL_DIR
) $(1)/usr
/sbin
148 $(CP
) $(PKG_BUILD_DIR
)/tools
/{madwifi_multi
,80211stats
,athchans
,athctrl
,athkey
,athstats
,wlanconfig
} $(1)/usr
/sbin
/
151 $(eval
$(call KernelPackage
,madwifi
))