source: trunk/package/madwifi/Makefile @ 7341

Last change on this file since 7341 was 7341, checked in by nbd, 9 years ago

update madwifi to latest trunk - performance enhancements

  • Property svn:copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1#
2# Copyright (C) 2006 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7# $Id$
8
9include $(TOPDIR)/rules.mk
10include $(INCLUDE_DIR)/kernel.mk
11
12PKG_NAME:=madwifi
13PKG_VERSION:=r2377-20070526
14PKG_BRANCH:=madwifi-ng
15PKG_RELEASE:=1
16
17PKG_SOURCE:=$(PKG_BRANCH)-$(PKG_VERSION).tar.gz
18PKG_SOURCE_URL:=http://snapshots.madwifi.org/$(PKG_BRANCH)
19PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BRANCH)-$(PKG_VERSION)
20PKG_MD5SUM:=92f73015caa4584580fb0ec474783c7b
21
22include $(INCLUDE_DIR)/package.mk
23
24RATE_CONTROL:=minstrel
25
26ifeq ($(ARCH),mips)
27  HAL_TARGET:=mips-be-elf
28endif
29ifeq ($(ARCH),mipsel)
30  HAL_TARGET:=mips-le-elf
31endif
32ifeq ($(ARCH),i386)
33  HAL_TARGET:=i386-elf
34endif
35ifeq ($(ARCH),armeb)
36  HAL_TARGET:=xscale-be-elf
37endif
38ifeq ($(ARCH),arm)
39  HAL_TARGET:=xscale-le-elf
40endif
41ifeq ($(ARCH),powerpc)
42  HAL_TARGET:=powerpc-be-elf
43endif
44
45BUS:=PCI
46ifneq ($(CONFIG_LINUX_2_6_ATHEROS),)
47  BUS:=AHB
48  HAL_TARGET:=ap51
49endif
50ifneq ($(CONFIG_LINUX_2_6_ARUBA),)
51  BUS:=PCI AHB  # no suitable HAL for AHB yet.
52endif
53
54BUS_MODULES:=
55ifeq ($(findstring AHB,$(BUS)),AHB)
56  BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX)
57endif
58ifeq ($(findstring PCI,$(BUS)),PCI)
59  BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
60endif
61
62MADWIFI_AUTOLOAD:= \
63        wlan \
64        wlan_scan_ap \
65        wlan_scan_sta \
66        ath_hal \
67        ath_rate_$(RATE_CONTROL) \
68        wlan_acl \
69        wlan_ccmp \
70        wlan_tkip \
71        wlan_wep \
72        wlan_xauth
73
74ifeq ($(findstring AHB,$(BUS)),AHB)
75        MADWIFI_AUTOLOAD += ath_ahb
76endif
77ifeq ($(findstring PCI,$(BUS)),PCI)
78        MADWIFI_AUTOLOAD += ath_pci
79endif
80
81define KernelPackage/madwifi
82  SUBMENU:=Wireless Drivers
83  TITLE:=Driver for Atheros wireless chipsets
84  DEPENDS:=+wireless-tools
85  DESCRIPTION:=\
86        This package contains a driver for Atheros 802.11a/b/g chipsets.
87  URL:=http://madwifi.org/
88  VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
89  FILES:= \
90                $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \
91                $(BUS_MODULES) \
92                $(PKG_BUILD_DIR)/ath_rate/$(RATE_CONTROL)/ath_rate_$(RATE_CONTROL).$(LINUX_KMOD_SUFFIX) \
93                $(PKG_BUILD_DIR)/net80211/wlan*.$(LINUX_KMOD_SUFFIX)
94  AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD))
95endef
96
97MADWIFI_MAKEOPTS= -C $(PKG_BUILD_DIR) \
98                PATH="$(TARGET_PATH)" \
99                ARCH="$(LINUX_KARCH)" \
100                CROSS_COMPILE="$(TARGET_CROSS)" \
101                TARGET="$(HAL_TARGET)" \
102                TOOLPREFIX="$(KERNEL_CROSS)" \
103                TOOLPATH="$(KERNEL_CROSS)" \
104                KERNELPATH="$(LINUX_DIR)" \
105                LDOPTS="--no-warn-mismatch " \
106                ATH_RATE="ath_rate/$(RATE_CONTROL)" \
107                WARNINGS="" \
108                DOMULTI=1
109
110ifeq ($(findstring AHB,$(BUS)),AHB)
111  define Build/Compile/ahb
112        COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" $(MAKE) $(MADWIFI_MAKEOPTS) BUS="AHB" modules
113  endef
114endif
115
116ifeq ($(findstring PCI,$(BUS)),PCI)
117  define Build/Compile/pci
118        COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" $(MAKE) $(MADWIFI_MAKEOPTS) BUS="PCI" modules
119  endef
120endif
121
122define Build/Configure
123        $(SED) 's,-E[LB] ,,g' $(PKG_BUILD_DIR)/hal/public/*.inc
124endef
125
126define Build/Compile
127        $(call Build/Compile/ahb)
128        $(call Build/Compile/pci)
129        $(MAKE) $(MADWIFI_MAKEOPTS) \
130                CFLAGS="$(TARGET_CFLAGS)" \
131                tools
132endef
133
134define Build/InstallDev
135        mkdir -p $(STAGING_DIR)/usr/include/madwifi
136        $(CP) $(PKG_BUILD_DIR)/include $(STAGING_DIR)/usr/include/madwifi/
137        mkdir -p $(STAGING_DIR)/usr/include/madwifi/net80211
138        $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(STAGING_DIR)/usr/include/madwifi/net80211/
139endef
140
141define Build/UninstallDev
142        rm -rf  $(STAGING_DIR)/usr/include/madwifi
143endef
144
145define KernelPackage/madwifi/install
146        $(INSTALL_DIR) $(1)/lib/wifi
147        $(INSTALL_DATA) ./files/lib/wifi/madwifi.sh $(1)/lib/wifi
148        $(INSTALL_DIR) $(1)/usr/sbin
149        $(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,80211stats,athchans,athctrl,athkey,athstats,wlanconfig} $(1)/usr/sbin/
150endef
151
152$(eval $(call KernelPackage,madwifi))
Note: See TracBrowser for help on using the repository browser.