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
33 DESCRIPTION
:=Ralink GPL Drivers for rt2x00 cards
34 VERSION
:=$(LINUX_VERSION
)+$(PKG_VERSION
)-$(BOARD
)-$(LINUX_RELEASE
)
37 define KernelPackage
/rt2x00-lib
38 $(call KernelPackage
/rt2x00
/Default
)
39 DEPENDS
+= +kmod-mac80211
+kmod-crypto
41 FILES
:=$(PKG_BUILD_DIR
)/rt2x00lib.
$(LINUX_KMOD_SUFFIX
)
42 AUTOLOAD
:=$(call AutoLoad
,25,blkcipher ecb arc4 rt2x00lib
)
45 define KernelPackage
/rt2x00-pci
46 $(call KernelPackage
/rt2x00
/Default
)
47 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-lib
+kmod-eeprom-93cx6
49 FILES
:=$(PKG_BUILD_DIR
)/rt2x00pci.
$(LINUX_KMOD_SUFFIX
)
50 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00pci
)
53 define KernelPackage
/rt2x00-usb
54 $(call KernelPackage
/rt2x00
/Default
)
55 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-lib
+kmod-usb-core
57 FILES
:=$(PKG_BUILD_DIR
)/rt2x00usb.
$(LINUX_KMOD_SUFFIX
)
58 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00usb
)
61 define KernelPackage
/rt2400-pci
62 $(call KernelPackage
/rt2x00
/Default
)
63 DEPENDS
+= +kmod-rt2x00-pci
65 FILES
:=$(PKG_BUILD_DIR
)/rt2400pci.
$(LINUX_KMOD_SUFFIX
)
66 AUTOLOAD
:=$(call AutoLoad
,27,rt2400pci
)
69 define KernelPackage
/rt2500-pci
70 $(call KernelPackage
/rt2x00
/Default
)
71 DEPENDS
+= +kmod-rt2x00-pci
73 FILES
:=$(PKG_BUILD_DIR
)/rt2500pci.
$(LINUX_KMOD_SUFFIX
)
74 AUTOLOAD
:=$(call AutoLoad
,27,rt2500pci
)
77 define KernelPackage
/rt2500-usb
78 $(call KernelPackage
/rt2x00
/Default
)
79 DEPENDS
+= +kmod-rt2x00-usb
+kmod-crc-itu-t
81 FILES
:=$(PKG_BUILD_DIR
)/rt2500usb.
$(LINUX_KMOD_SUFFIX
)
82 AUTOLOAD
:=$(call AutoLoad
,27,rt2500usb
)
85 define KernelPackage
/rt61-pci
86 $(call KernelPackage
/rt2x00
/Default
)
87 DEPENDS
+= +kmod-rt2x00-pci
+kmod-crc-itu-t
89 FILES
:=$(PKG_BUILD_DIR
)/rt61pci.
$(LINUX_KMOD_SUFFIX
)
90 AUTOLOAD
:=$(call AutoLoad
,27,rt61pci
)
93 define KernelPackage
/rt73-usb
94 $(call KernelPackage
/rt2x00
/Default
)
95 DEPENDS
+= +kmod-rt2x00-usb
97 FILES
:=$(PKG_BUILD_DIR
)/rt73usb.
$(LINUX_KMOD_SUFFIX
)
98 AUTOLOAD
:=$(call AutoLoad
,27,rt73usb
)
101 $(STAMP_PREPARED
): $(DL_DIR
)/$(PKG_FW6X_NAME
) $(DL_DIR
)/$(PKG_FW7X_NAME
)
103 $(DL_DIR
)/$(PKG_FW6X_NAME
):
104 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_FW6X_NAME)" "$(PKG_FW6X_MD5SUM)" $(PKG_FW6X_URL
)
106 $(DL_DIR
)/$(PKG_FW7X_NAME
):
107 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_FW7X_NAME)" "$(PKG_FW7X_MD5SUM)" $(PKG_FW7X_URL
)
109 # only try to build if the kernel is recent enough (has in-kernel mac80211)
110 ifndef ($(CONFIG_MAC80211
),)
112 PKG_EXTRA_KCONFIG
:= \
114 CONFIG_RT2X00_DEBUG
=y \
116 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci
),)
117 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00PCI
=y
119 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb
),)
120 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00USB
=y
122 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci
),)
123 PKG_EXTRA_KCONFIG
+= CONFIG_RT2400PCI
=y
125 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci
),)
126 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500PCI
=y
128 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb
),)
129 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500USB
=y
131 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci
),)
132 PKG_EXTRA_KCONFIG
+= CONFIG_RT61PCI
=y
134 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb
),)
135 PKG_EXTRA_KCONFIG
+= CONFIG_RT73USB
=y
139 -I
$(STAGING_DIR
)/usr
/include/mac80211 \
140 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=m
,%,$(filter %=m
,$(PKG_EXTRA_KCONFIG
)))) \
141 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=y
,%,$(filter %=y
,$(PKG_EXTRA_KCONFIG
)))) \
143 define Build
/Compile
/it
144 $(MAKE
) -C
"$(LINUX_DIR)" \
145 ARCH
="$(LINUX_KARCH)" \
146 CROSS_COMPILE
="$(TARGET_CROSS)" \
147 SUBDIRS
="$(PKG_BUILD_DIR)" \
148 $(PKG_EXTRA_KCONFIG
) \
149 EXTRA_CFLAGS
="$(PKG_EXTRA_CFLAGS)" \
157 $(call Build
/Prepare
/Default
)
158 $(CP
) -r src
/* $(PKG_BUILD_DIR
)/
159 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(PKG_FW6X_NAME
)
160 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(PKG_FW7X_NAME
)
163 define Build
/Configure
164 touch
$(PKG_BUILD_DIR
)/rt2x00_config.h
168 $(call Build
/Compile
/it
)
171 define KernelPackage
/rt61-pci
/install
172 $(INSTALL_DIR
) $(1)/lib
/firmware
173 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt2?
61*.bin
$(1)/lib
/firmware
/
176 define KernelPackage
/rt73-usb
/install
177 $(INSTALL_DIR
) $(1)/lib
/firmware
178 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt73.bin
$(1)/lib
/firmware
/
181 $(eval
$(call KernelPackage
,rt2x00-lib
))
182 $(eval
$(call KernelPackage
,rt2x00-pci
))
183 $(eval
$(call KernelPackage
,rt2x00-usb
))
184 $(eval
$(call KernelPackage
,rt2400-pci
))
185 $(eval
$(call KernelPackage
,rt2500-pci
))
186 $(eval
$(call KernelPackage
,rt2500-usb
))
187 $(eval
$(call KernelPackage
,rt61-pci
))
188 $(eval
$(call KernelPackage
,rt73-usb
))