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
:=d4c690c93b470bc9a681297c2adc6281
19 PKG_FW7X_NAME
:=RT71W_Firmware_V1.8.zip
20 PKG_FW7X_URL
:=http
://www.ralinktech.com.tw
/data
/
21 PKG_FW7X_MD5SUM
:=1e7a5dc574e0268574fcda3fd5cf52f7
23 include $(INCLUDE_DIR
)/package.mk
25 include $(LINUX_DIR
)/.config
28 # XXX: remove @!TARGET_* later when we have PCI & USB support properly detected on all targets
29 define KernelPackage
/rt2x00
/Default
30 SUBMENU
:=Wireless Drivers
31 TITLE
:=Ralink Drivers for RT2x00 cards
32 DEPENDS
:=@LINUX_2_6 @
!TARGET_atheros @
!TARGET_uml
33 KCONFIG
:=CONFIG_MAC80211
36 define KernelPackage
/rt2x00-lib
37 $(call KernelPackage
/rt2x00
/Default
)
38 DEPENDS
+= @PCI_SUPPORT||USB_SUPPORT
+kmod-mac80211
40 FILES
:=$(PKG_BUILD_DIR
)/rt2x00lib.
$(LINUX_KMOD_SUFFIX
)
41 AUTOLOAD
:=$(call AutoLoad
,25,blkcipher ecb arc4 rt2x00lib
)
44 define KernelPackage
/rt2x00-pci
45 $(call KernelPackage
/rt2x00
/Default
)
46 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-lib
+kmod-eeprom-93cx6
48 FILES
:=$(PKG_BUILD_DIR
)/rt2x00pci.
$(LINUX_KMOD_SUFFIX
)
49 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00pci
)
52 define KernelPackage
/rt2x00-usb
53 $(call KernelPackage
/rt2x00
/Default
)
54 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-lib
+kmod-usb-core
56 FILES
:=$(PKG_BUILD_DIR
)/rt2x00usb.
$(LINUX_KMOD_SUFFIX
)
57 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00usb
)
60 define KernelPackage
/rt2400-pci
61 $(call KernelPackage
/rt2x00
/Default
)
62 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
64 FILES
:=$(PKG_BUILD_DIR
)/rt2400pci.
$(LINUX_KMOD_SUFFIX
)
65 AUTOLOAD
:=$(call AutoLoad
,27,rt2400pci
)
68 define KernelPackage
/rt2500-pci
69 $(call KernelPackage
/rt2x00
/Default
)
70 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
72 FILES
:=$(PKG_BUILD_DIR
)/rt2500pci.
$(LINUX_KMOD_SUFFIX
)
73 AUTOLOAD
:=$(call AutoLoad
,27,rt2500pci
)
76 define KernelPackage
/rt2500-usb
77 $(call KernelPackage
/rt2x00
/Default
)
78 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
+kmod-crc-itu-t
80 FILES
:=$(PKG_BUILD_DIR
)/rt2500usb.
$(LINUX_KMOD_SUFFIX
)
81 AUTOLOAD
:=$(call AutoLoad
,27,rt2500usb
)
84 define KernelPackage
/rt61-pci
85 $(call KernelPackage
/rt2x00
/Default
)
86 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
+kmod-crc-itu-t
88 FILES
:=$(PKG_BUILD_DIR
)/rt61pci.
$(LINUX_KMOD_SUFFIX
)
89 AUTOLOAD
:=$(call AutoLoad
,27,rt61pci
)
92 define KernelPackage
/rt73-usb
93 $(call KernelPackage
/rt2x00
/Default
)
94 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
96 FILES
:=$(PKG_BUILD_DIR
)/rt73usb.
$(LINUX_KMOD_SUFFIX
)
97 AUTOLOAD
:=$(call AutoLoad
,27,rt73usb
)
100 $(STAMP_PREPARED
): $(DL_DIR
)/$(PKG_FW6X_NAME
) $(DL_DIR
)/$(PKG_FW7X_NAME
)
102 $(DL_DIR
)/$(PKG_FW6X_NAME
):
103 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_FW6X_NAME)" "$(PKG_FW6X_MD5SUM)" $(PKG_FW6X_URL
)
105 $(DL_DIR
)/$(PKG_FW7X_NAME
):
106 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_FW7X_NAME)" "$(PKG_FW7X_MD5SUM)" $(PKG_FW7X_URL
)
108 # only try to build if the kernel is recent enough (has in-kernel mac80211)
109 ifndef ($(CONFIG_MAC80211
),)
111 PKG_EXTRA_KCONFIG
:= \
113 CONFIG_RT2X00_DEBUG
=y \
115 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci
),)
116 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00PCI
=y
118 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb
),)
119 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00USB
=y
121 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci
),)
122 PKG_EXTRA_KCONFIG
+= CONFIG_RT2400PCI
=y
124 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci
),)
125 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500PCI
=y
127 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb
),)
128 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500USB
=y
130 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci
),)
131 PKG_EXTRA_KCONFIG
+= CONFIG_RT61PCI
=y
133 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb
),)
134 PKG_EXTRA_KCONFIG
+= CONFIG_RT73USB
=y
138 -I
$(STAGING_DIR
)/usr
/include/mac80211 \
139 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=m
,%,$(filter %=m
,$(PKG_EXTRA_KCONFIG
)))) \
140 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=y
,%,$(filter %=y
,$(PKG_EXTRA_KCONFIG
)))) \
142 define Build
/Compile
/it
143 $(MAKE
) -C
"$(LINUX_DIR)" \
144 ARCH
="$(LINUX_KARCH)" \
145 CROSS_COMPILE
="$(TARGET_CROSS)" \
146 SUBDIRS
="$(PKG_BUILD_DIR)" \
147 $(PKG_EXTRA_KCONFIG
) \
148 EXTRA_CFLAGS
="$(PKG_EXTRA_CFLAGS)" \
156 $(call Build
/Prepare
/Default
)
157 $(CP
) -r src
/* $(PKG_BUILD_DIR
)/
158 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(PKG_FW6X_NAME
)
159 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(PKG_FW7X_NAME
)
162 define Build
/Configure
163 touch
$(PKG_BUILD_DIR
)/rt2x00_config.h
167 $(call Build
/Compile
/it
)
170 define KernelPackage
/rt61-pci
/install
171 $(INSTALL_DIR
) $(1)/lib
/firmware
172 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt2?
61*.bin
$(1)/lib
/firmware
/
175 define KernelPackage
/rt73-usb
/install
176 $(INSTALL_DIR
) $(1)/lib
/firmware
177 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt73.bin
$(1)/lib
/firmware
/
180 $(eval
$(call KernelPackage
,rt2x00-lib
))
181 $(eval
$(call KernelPackage
,rt2x00-pci
))
182 $(eval
$(call KernelPackage
,rt2x00-usb
))
183 $(eval
$(call KernelPackage
,rt2400-pci
))
184 $(eval
$(call KernelPackage
,rt2500-pci
))
185 $(eval
$(call KernelPackage
,rt2500-usb
))
186 $(eval
$(call KernelPackage
,rt61-pci
))
187 $(eval
$(call KernelPackage
,rt73-usb
))