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.
9 include $(TOPDIR
)/rules.mk
10 include $(INCLUDE_DIR
)/kernel.mk
13 PKG_VERSION
:=cvs-20070712
15 PKG_FW6X_NAME
:=RT61_Firmware_V1.2.zip
16 PKG_FW6X_URL
:=http
://www.ralinktech.com.tw
/data
/
17 PKG_FW6X_MD5SUM
:=fe64f389f0863ef349a8c97e0fbc8838
19 PKG_FW7X_NAME
:=RT71W_Firmware_V1.8.zip
20 PKG_FW7X_URL
:=http
://www.ralinktech.com.tw
/data
/
21 PKG_FW7X_MD5SUM
:=db4ef70b61e483f34db496738507b275
23 include $(INCLUDE_DIR
)/package.mk
25 include $(LINUX_DIR
)/.config
28 define KernelPackage
/rt2x00
/Default
29 SUBMENU
:=Wireless Drivers
30 TITLE
:=Ralink Drivers for RT2x00 cards
32 KCONFIG
:=CONFIG_MAC80211
35 define KernelPackage
/rt2x00-lib
36 $(call KernelPackage
/rt2x00
/Default
)
37 DEPENDS
+= +kmod-mac80211
+kmod-crypto
39 FILES
:=$(PKG_BUILD_DIR
)/rt2x00lib.
$(LINUX_KMOD_SUFFIX
)
40 AUTOLOAD
:=$(call AutoLoad
,25,blkcipher ecb arc4 rt2x00lib
)
43 define KernelPackage
/rt2x00-pci
44 $(call KernelPackage
/rt2x00
/Default
)
45 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-lib
+kmod-eeprom-93cx6
47 FILES
:=$(PKG_BUILD_DIR
)/rt2x00pci.
$(LINUX_KMOD_SUFFIX
)
48 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00pci
)
51 define KernelPackage
/rt2x00-usb
52 $(call KernelPackage
/rt2x00
/Default
)
53 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-lib
+kmod-usb-core
55 FILES
:=$(PKG_BUILD_DIR
)/rt2x00usb.
$(LINUX_KMOD_SUFFIX
)
56 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00usb
)
59 define KernelPackage
/rt2400-pci
60 $(call KernelPackage
/rt2x00
/Default
)
61 DEPENDS
+= +kmod-rt2x00-pci
63 FILES
:=$(PKG_BUILD_DIR
)/rt2400pci.
$(LINUX_KMOD_SUFFIX
)
64 AUTOLOAD
:=$(call AutoLoad
,27,rt2400pci
)
67 define KernelPackage
/rt2500-pci
68 $(call KernelPackage
/rt2x00
/Default
)
69 DEPENDS
+= +kmod-rt2x00-pci
71 FILES
:=$(PKG_BUILD_DIR
)/rt2500pci.
$(LINUX_KMOD_SUFFIX
)
72 AUTOLOAD
:=$(call AutoLoad
,27,rt2500pci
)
75 define KernelPackage
/rt2500-usb
76 $(call KernelPackage
/rt2x00
/Default
)
77 DEPENDS
+= +kmod-rt2x00-usb
+kmod-crc-itu-t
79 FILES
:=$(PKG_BUILD_DIR
)/rt2500usb.
$(LINUX_KMOD_SUFFIX
)
80 AUTOLOAD
:=$(call AutoLoad
,27,rt2500usb
)
83 define KernelPackage
/rt61-pci
84 $(call KernelPackage
/rt2x00
/Default
)
85 DEPENDS
+= +kmod-rt2x00-pci
+kmod-crc-itu-t
87 FILES
:=$(PKG_BUILD_DIR
)/rt61pci.
$(LINUX_KMOD_SUFFIX
)
88 AUTOLOAD
:=$(call AutoLoad
,27,rt61pci
)
91 define KernelPackage
/rt73-usb
92 $(call KernelPackage
/rt2x00
/Default
)
93 DEPENDS
+= +kmod-rt2x00-usb
95 FILES
:=$(PKG_BUILD_DIR
)/rt73usb.
$(LINUX_KMOD_SUFFIX
)
96 AUTOLOAD
:=$(call AutoLoad
,27,rt73usb
)
99 $(STAMP_PREPARED
): $(DL_DIR
)/$(PKG_FW6X_NAME
) $(DL_DIR
)/$(PKG_FW7X_NAME
)
101 $(DL_DIR
)/$(PKG_FW6X_NAME
):
102 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_FW6X_NAME)" "$(PKG_FW6X_MD5SUM)" $(PKG_FW6X_URL
)
104 $(DL_DIR
)/$(PKG_FW7X_NAME
):
105 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_FW7X_NAME)" "$(PKG_FW7X_MD5SUM)" $(PKG_FW7X_URL
)
107 # only try to build if the kernel is recent enough (has in-kernel mac80211)
108 ifndef ($(CONFIG_MAC80211
),)
110 PKG_EXTRA_KCONFIG
:= \
112 CONFIG_RT2X00_DEBUG
=y \
114 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci
),)
115 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00PCI
=y
117 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb
),)
118 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00USB
=y
120 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci
),)
121 PKG_EXTRA_KCONFIG
+= CONFIG_RT2400PCI
=y
123 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci
),)
124 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500PCI
=y
126 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb
),)
127 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500USB
=y
129 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci
),)
130 PKG_EXTRA_KCONFIG
+= CONFIG_RT61PCI
=y
132 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb
),)
133 PKG_EXTRA_KCONFIG
+= CONFIG_RT73USB
=y
137 -I
$(STAGING_DIR
)/usr
/include/mac80211 \
138 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=m
,%,$(filter %=m
,$(PKG_EXTRA_KCONFIG
)))) \
139 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=y
,%,$(filter %=y
,$(PKG_EXTRA_KCONFIG
)))) \
141 define Build
/Compile
/it
142 $(MAKE
) -C
"$(LINUX_DIR)" \
143 ARCH
="$(LINUX_KARCH)" \
144 CROSS_COMPILE
="$(TARGET_CROSS)" \
145 SUBDIRS
="$(PKG_BUILD_DIR)" \
146 $(PKG_EXTRA_KCONFIG
) \
147 EXTRA_CFLAGS
="$(PKG_EXTRA_CFLAGS)" \
155 $(call Build
/Prepare
/Default
)
156 $(CP
) -r src
/* $(PKG_BUILD_DIR
)/
157 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(PKG_FW6X_NAME
)
158 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(PKG_FW7X_NAME
)
161 define Build
/Configure
162 touch
$(PKG_BUILD_DIR
)/rt2x00_config.h
166 $(call Build
/Compile
/it
)
169 define KernelPackage
/rt61-pci
/install
170 $(INSTALL_DIR
) $(1)/lib
/firmware
171 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt2?
61*.bin
$(1)/lib
/firmware
/
174 define KernelPackage
/rt73-usb
/install
175 $(INSTALL_DIR
) $(1)/lib
/firmware
176 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt73.bin
$(1)/lib
/firmware
/
179 $(eval
$(call KernelPackage
,rt2x00-lib
))
180 $(eval
$(call KernelPackage
,rt2x00-pci
))
181 $(eval
$(call KernelPackage
,rt2x00-usb
))
182 $(eval
$(call KernelPackage
,rt2400-pci
))
183 $(eval
$(call KernelPackage
,rt2500-pci
))
184 $(eval
$(call KernelPackage
,rt2500-usb
))
185 $(eval
$(call KernelPackage
,rt61-pci
))
186 $(eval
$(call KernelPackage
,rt73-usb
))