2 # Copyright (C) 2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 # $Id: Makefile 7440 2007-06-02 02:22:01Z nbd $
9 include $(TOPDIR
)/rules.mk
10 include $(INCLUDE_DIR
)/kernel.mk
15 PKG_VERSION
:=2008-04-07
16 PKG_SOURCE
:=compat-wireless-
$(PKG_VERSION
).
tar.bz2
17 PKG_SOURCE_URL
:=http
://linuxwireless.org
/download
/compat-wireless-2.6
/
18 PKG_BUILD_DIR
:=$(BUILD_DIR
)/compat-wireless-
$(PKG_VERSION
)
20 include $(INCLUDE_DIR
)/package.mk
22 define KernelPackage
/mac80211
23 SUBMENU
:=Wireless Drivers
24 TITLE
:=Linux
802.11 Wireless Networking Stack
25 DEPENDS
:=@LINUX_2_6_23||LINUX_2_6_24
+kmod-crypto-arc4
+kmod-crypto-aes
+wireless-tools
27 $(PKG_BUILD_DIR
)/net
/mac80211
/mac80211.
$(LINUX_KMOD_SUFFIX
) \
28 $(PKG_BUILD_DIR
)/net
/wireless
/cfg80211.
$(LINUX_KMOD_SUFFIX
)
29 AUTOLOAD
:=$(call AutoLoad
,20,cfg80211 mac80211
)
32 define KernelPackage
/mac80211
/description
33 Linux
802.11 Wireless Networking Stack
36 # Ralink rt2x00 drivers
37 RT61FW
:=RT61_Firmware_V1.2.zip
38 RT71FW
:=RT71W_Firmware_V1.8.zip
42 URL
:=http
://www.ralinktech.com.tw
/data
/
43 MD5SUM
:=d4c690c93b470bc9a681297c2adc6281
45 $(eval
$(call Download
,rt61
))
49 URL
:=http
://www.ralinktech.com.tw
/data
/
50 MD5SUM
:=1e7a5dc574e0268574fcda3fd5cf52f7
52 $(eval
$(call Download
,rt71w
))
54 define KernelPackage
/rt2x00
/Default
55 SUBMENU
:=Wireless Drivers
56 TITLE
:=Ralink Drivers for RT2x00 cards
57 DEPENDS
:=@LINUX_2_6_24 @
!TARGET_atheros @
!TARGET_uml
60 define KernelPackage
/rt2x00-lib
61 $(call KernelPackage
/rt2x00
/Default
)
62 DEPENDS
+= @PCI_SUPPORT||USB_SUPPORT
+kmod-mac80211
64 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2x00lib.
$(LINUX_KMOD_SUFFIX
)
65 AUTOLOAD
:=$(call AutoLoad
,25,blkcipher ecb arc4 rt2x00lib
)
68 define KernelPackage
/rt2x00-pci
69 $(call KernelPackage
/rt2x00
/Default
)
70 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-lib
+kmod-eeprom-93cx6
72 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2x00pci.
$(LINUX_KMOD_SUFFIX
)
73 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00pci
)
76 define KernelPackage
/rt2x00-usb
77 $(call KernelPackage
/rt2x00
/Default
)
78 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-lib
+kmod-usb-core
80 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2x00usb.
$(LINUX_KMOD_SUFFIX
)
81 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00usb
)
84 define KernelPackage
/rt2400-pci
85 $(call KernelPackage
/rt2x00
/Default
)
86 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
88 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2400pci.
$(LINUX_KMOD_SUFFIX
)
89 AUTOLOAD
:=$(call AutoLoad
,27,rt2400pci
)
92 define KernelPackage
/rt2500-pci
93 $(call KernelPackage
/rt2x00
/Default
)
94 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
96 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2500pci.
$(LINUX_KMOD_SUFFIX
)
97 AUTOLOAD
:=$(call AutoLoad
,27,rt2500pci
)
100 define KernelPackage
/rt2500-usb
101 $(call KernelPackage
/rt2x00
/Default
)
102 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
+kmod-crc-itu-t
104 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2500usb.
$(LINUX_KMOD_SUFFIX
)
105 AUTOLOAD
:=$(call AutoLoad
,27,rt2500usb
)
108 define KernelPackage
/rt61-pci
109 $(call KernelPackage
/rt2x00
/Default
)
110 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
+kmod-crc-itu-t
112 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt61pci.
$(LINUX_KMOD_SUFFIX
)
113 AUTOLOAD
:=$(call AutoLoad
,27,rt61pci
)
116 define KernelPackage
/rt73-usb
117 $(call KernelPackage
/rt2x00
/Default
)
118 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
120 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt73usb.
$(LINUX_KMOD_SUFFIX
)
121 AUTOLOAD
:=$(call AutoLoad
,27,rt73usb
)
124 RT2X00_CONFOPTS
:=CONFIG_RT2X00
=y \
125 CONFIG_RT2X00_DEBUG
=y \
126 CONFIG_RT2X00_LIB_FIRMWARE
=y \
127 CONFIG_RT2X00_LIB_LEDS
=y
129 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci
),)
130 RT2X00_CONFOPTS
+= CONFIG_RT2X00_LIB_PCI
=y
132 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb
),)
133 RT2X00_CONFOPTS
+= CONFIG_RT2X00_LIB_USB
=y
135 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci
),)
136 RT2X00_CONFOPTS
+= CONFIG_RT2400PCI
=y
138 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci
),)
139 RT2X00_CONFOPTS
+= CONFIG_RT2500PCI
=y
141 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb
),)
142 RT2X00_CONFOPTS
+= CONFIG_RT2500USB
=y
144 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci
),)
145 RT2X00_CONFOPTS
+= CONFIG_RT61PCI
=y
147 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb
),)
148 RT2X00_CONFOPTS
+= CONFIG_RT73USB
=y
152 CONFOPTS
:=MAC80211 CFG80211 NL80211 MAC80211_RC_DEFAULT_PID MAC80211_RC_PID \
155 $(foreach opt
,$(CONFOPTS
),-DCONFIG_
$(opt
)) \
156 $(if
$(CONFIG_LEDS_TRIGGERS
), -DCONFIG_MAC80211_LEDS
-DCONFIG_LEDS_TRIGGERS
) \
157 -D__CONFIG_MAC80211_RC_DEFAULT
=pid \
160 CROSS_COMPILE
="$(TARGET_CROSS)" \
161 ARCH
="$(LINUX_KARCH)" \
162 EXTRA_CFLAGS
="$(BUILDFLAGS)" \
163 $(foreach opt
,$(CONFOPTS
),CONFIG_
$(opt
)=m
) \
165 CONFIG_MAC80211_RC_PID
=y \
166 CONFIG_MAC80211_LEDS
=$(CONFIG_LEDS_TRIGGERS
) \
167 LINUXINCLUDE
="-I$(PKG_BUILD_DIR)/include -I$(LINUX_DIR)/include -include linux/autoconf.h" \
168 KLIB_BUILD
="$(LINUX_DIR)" \
171 rm -rf
$(PKG_BUILD_DIR
)
172 mkdir
-p
$(PKG_BUILD_DIR
)
175 $(if
$(QUILT
),touch
$(PKG_BUILD_DIR
)/.quilt_used
)
176 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(RT61FW
)
177 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(RT71FW
)
181 $(MAKE
) -C
"$(PKG_BUILD_DIR)" $(MAKE_OPTS
) all
184 define Build
/InstallDev
185 mkdir
-p
$(1)/usr
/include/mac80211
186 $(CP
) $(PKG_BUILD_DIR
)/net
/mac80211
/*.h
$(PKG_BUILD_DIR
)/include/* $(1)/usr
/include/mac80211
/
189 define KernelPackage
/mac80211
/install
190 $(INSTALL_DIR
) $(1)/lib
/wifi
191 $(INSTALL_DATA
) .
/files
/lib
/wifi
/mac80211.sh
$(1)/lib
/wifi
194 define KernelPackage
/rt61-pci
/install
195 $(INSTALL_DIR
) $(1)/lib
/firmware
196 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt2?
61*.bin
$(1)/lib
/firmware
/
199 define KernelPackage
/rt73-usb
/install
200 $(INSTALL_DIR
) $(1)/lib
/firmware
201 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt73.bin
$(1)/lib
/firmware
/
205 $(eval
$(call KernelPackage
,mac80211
))
206 $(eval
$(call KernelPackage
,rt2x00-lib
))
207 $(eval
$(call KernelPackage
,rt2x00-pci
))
208 $(eval
$(call KernelPackage
,rt2x00-usb
))
209 $(eval
$(call KernelPackage
,rt2400-pci
))
210 $(eval
$(call KernelPackage
,rt2500-pci
))
211 $(eval
$(call KernelPackage
,rt2500-usb
))
212 $(eval
$(call KernelPackage
,rt61-pci
))
213 $(eval
$(call KernelPackage
,rt73-usb
))