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 include $(INCLUDE_DIR
)/package.mk
18 RT61FW
:=RT61_Firmware_V1.2.zip
19 RT71FW
:=RT71W_Firmware_V1.8.zip
23 URL
:=http
://www.ralinktech.com.tw
/data
/
24 MD5SUM
:=d4c690c93b470bc9a681297c2adc6281
26 $(eval
$(call Download
,rt61
))
30 URL
:=http
://www.ralinktech.com.tw
/data
/
31 MD5SUM
:=1e7a5dc574e0268574fcda3fd5cf52f7
33 $(eval
$(call Download
,rt71w
))
35 # XXX: remove @!TARGET_* later when we have PCI & USB support properly detected on all targets
36 define KernelPackage
/rt2x00
/Default
37 SUBMENU
:=Wireless Drivers
38 TITLE
:=Ralink Drivers for RT2x00 cards
39 DEPENDS
:=@LINUX_2_6 @
!TARGET_atheros @
!TARGET_uml
42 define KernelPackage
/rt2x00-lib
43 $(call KernelPackage
/rt2x00
/Default
)
44 DEPENDS
+= @PCI_SUPPORT||USB_SUPPORT
+kmod-mac80211
46 FILES
:=$(PKG_BUILD_DIR
)/rt2x00lib.
$(LINUX_KMOD_SUFFIX
)
47 AUTOLOAD
:=$(call AutoLoad
,25,blkcipher ecb arc4 rt2x00lib
)
50 define KernelPackage
/rt2x00-pci
51 $(call KernelPackage
/rt2x00
/Default
)
52 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-lib
+kmod-eeprom-93cx6
54 FILES
:=$(PKG_BUILD_DIR
)/rt2x00pci.
$(LINUX_KMOD_SUFFIX
)
55 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00pci
)
58 define KernelPackage
/rt2x00-usb
59 $(call KernelPackage
/rt2x00
/Default
)
60 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-lib
+kmod-usb-core
62 FILES
:=$(PKG_BUILD_DIR
)/rt2x00usb.
$(LINUX_KMOD_SUFFIX
)
63 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00usb
)
66 define KernelPackage
/rt2400-pci
67 $(call KernelPackage
/rt2x00
/Default
)
68 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
70 FILES
:=$(PKG_BUILD_DIR
)/rt2400pci.
$(LINUX_KMOD_SUFFIX
)
71 AUTOLOAD
:=$(call AutoLoad
,27,rt2400pci
)
74 define KernelPackage
/rt2500-pci
75 $(call KernelPackage
/rt2x00
/Default
)
76 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
78 FILES
:=$(PKG_BUILD_DIR
)/rt2500pci.
$(LINUX_KMOD_SUFFIX
)
79 AUTOLOAD
:=$(call AutoLoad
,27,rt2500pci
)
82 define KernelPackage
/rt2500-usb
83 $(call KernelPackage
/rt2x00
/Default
)
84 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
+kmod-crc-itu-t
86 FILES
:=$(PKG_BUILD_DIR
)/rt2500usb.
$(LINUX_KMOD_SUFFIX
)
87 AUTOLOAD
:=$(call AutoLoad
,27,rt2500usb
)
90 define KernelPackage
/rt61-pci
91 $(call KernelPackage
/rt2x00
/Default
)
92 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
+kmod-crc-itu-t
94 FILES
:=$(PKG_BUILD_DIR
)/rt61pci.
$(LINUX_KMOD_SUFFIX
)
95 AUTOLOAD
:=$(call AutoLoad
,27,rt61pci
)
98 define KernelPackage
/rt73-usb
99 $(call KernelPackage
/rt2x00
/Default
)
100 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
102 FILES
:=$(PKG_BUILD_DIR
)/rt73usb.
$(LINUX_KMOD_SUFFIX
)
103 AUTOLOAD
:=$(call AutoLoad
,27,rt73usb
)
106 $(STAMP_PREPARED
): $(DL_DIR
)/$(PKG_FW6X_NAME
) $(DL_DIR
)/$(PKG_FW7X_NAME
)
108 PKG_EXTRA_KCONFIG
:= \
111 CONFIG_RT2X00_DEBUG
=y \
113 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci
),)
114 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00PCI
=y
116 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb
),)
117 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00USB
=y
119 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci
),)
120 PKG_EXTRA_KCONFIG
+= CONFIG_RT2400PCI
=y
122 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci
),)
123 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500PCI
=y
125 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb
),)
126 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500USB
=y
128 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci
),)
129 PKG_EXTRA_KCONFIG
+= CONFIG_RT61PCI
=y
131 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb
),)
132 PKG_EXTRA_KCONFIG
+= CONFIG_RT73USB
=y
136 -I
$(STAGING_DIR
)/usr
/include/mac80211 \
137 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=m
,%,$(filter %=m
,$(PKG_EXTRA_KCONFIG
)))) \
138 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=y
,%,$(filter %=y
,$(PKG_EXTRA_KCONFIG
)))) \
141 $(call Build
/Prepare
/Default
)
142 $(CP
) -r src
/* $(PKG_BUILD_DIR
)/
143 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(RT61FW
)
144 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(RT71FW
)
147 define Build
/Configure
148 touch
$(PKG_BUILD_DIR
)/rt2x00_config.h
152 $(MAKE
) -C
"$(LINUX_DIR)" \
153 ARCH
="$(LINUX_KARCH)" \
154 CROSS_COMPILE
="$(TARGET_CROSS)" \
155 SUBDIRS
="$(PKG_BUILD_DIR)" \
156 $(PKG_EXTRA_KCONFIG
) \
157 EXTRA_CFLAGS
="$(PKG_EXTRA_CFLAGS)" \
162 define KernelPackage
/rt61-pci
/install
163 $(INSTALL_DIR
) $(1)/lib
/firmware
164 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt2?
61*.bin
$(1)/lib
/firmware
/
167 define KernelPackage
/rt73-usb
/install
168 $(INSTALL_DIR
) $(1)/lib
/firmware
169 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt73.bin
$(1)/lib
/firmware
/
172 $(eval
$(call KernelPackage
,rt2x00-lib
))
173 $(eval
$(call KernelPackage
,rt2x00-pci
))
174 $(eval
$(call KernelPackage
,rt2x00-usb
))
175 $(eval
$(call KernelPackage
,rt2400-pci
))
176 $(eval
$(call KernelPackage
,rt2500-pci
))
177 $(eval
$(call KernelPackage
,rt2500-usb
))
178 $(eval
$(call KernelPackage
,rt61-pci
))
179 $(eval
$(call KernelPackage
,rt73-usb
))