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
:=$(KERNEL_VERSION
)
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 \
112 CONFIG_RT2X00_LIB_FIRMWARE
=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
)))) \
142 $(call Build
/Prepare
/Default
)
143 $(CP
) src
/* $(PKG_BUILD_DIR
)/
144 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(RT61FW
)
145 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(RT71FW
)
148 define Build
/Configure
149 touch
$(PKG_BUILD_DIR
)/rt2x00_config.h
153 $(MAKE
) -C
"$(LINUX_DIR)" \
154 ARCH
="$(LINUX_KARCH)" \
155 CROSS_COMPILE
="$(TARGET_CROSS)" \
156 SUBDIRS
="$(PKG_BUILD_DIR)" \
157 $(PKG_EXTRA_KCONFIG
) \
158 EXTRA_CFLAGS
="$(PKG_EXTRA_CFLAGS)" \
163 define KernelPackage
/rt61-pci
/install
164 $(INSTALL_DIR
) $(1)/lib
/firmware
165 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt2?
61*.bin
$(1)/lib
/firmware
/
168 define KernelPackage
/rt73-usb
/install
169 $(INSTALL_DIR
) $(1)/lib
/firmware
170 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt73.bin
$(1)/lib
/firmware
/
173 $(eval
$(call KernelPackage
,rt2x00-lib
))
174 $(eval
$(call KernelPackage
,rt2x00-pci
))
175 $(eval
$(call KernelPackage
,rt2x00-usb
))
176 $(eval
$(call KernelPackage
,rt2400-pci
))
177 $(eval
$(call KernelPackage
,rt2500-pci
))
178 $(eval
$(call KernelPackage
,rt2500-usb
))
179 $(eval
$(call KernelPackage
,rt61-pci
))
180 $(eval
$(call KernelPackage
,rt73-usb
))