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 # XXX: remove @!TARGET_* later when we have PCI & USB support properly detected on all targets
26 define KernelPackage
/rt2x00
/Default
27 SUBMENU
:=Wireless Drivers
28 TITLE
:=Ralink Drivers for RT2x00 cards
29 DEPENDS
:=@LINUX_2_6 @
!TARGET_atheros @
!TARGET_uml
32 define KernelPackage
/rt2x00-lib
33 $(call KernelPackage
/rt2x00
/Default
)
34 DEPENDS
+= @PCI_SUPPORT||USB_SUPPORT
+kmod-mac80211
36 FILES
:=$(PKG_BUILD_DIR
)/rt2x00lib.
$(LINUX_KMOD_SUFFIX
)
37 AUTOLOAD
:=$(call AutoLoad
,25,blkcipher ecb arc4 rt2x00lib
)
40 define KernelPackage
/rt2x00-pci
41 $(call KernelPackage
/rt2x00
/Default
)
42 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-lib
+kmod-eeprom-93cx6
44 FILES
:=$(PKG_BUILD_DIR
)/rt2x00pci.
$(LINUX_KMOD_SUFFIX
)
45 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00pci
)
48 define KernelPackage
/rt2x00-usb
49 $(call KernelPackage
/rt2x00
/Default
)
50 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-lib
+kmod-usb-core
52 FILES
:=$(PKG_BUILD_DIR
)/rt2x00usb.
$(LINUX_KMOD_SUFFIX
)
53 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00usb
)
56 define KernelPackage
/rt2400-pci
57 $(call KernelPackage
/rt2x00
/Default
)
58 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
60 FILES
:=$(PKG_BUILD_DIR
)/rt2400pci.
$(LINUX_KMOD_SUFFIX
)
61 AUTOLOAD
:=$(call AutoLoad
,27,rt2400pci
)
64 define KernelPackage
/rt2500-pci
65 $(call KernelPackage
/rt2x00
/Default
)
66 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
68 FILES
:=$(PKG_BUILD_DIR
)/rt2500pci.
$(LINUX_KMOD_SUFFIX
)
69 AUTOLOAD
:=$(call AutoLoad
,27,rt2500pci
)
72 define KernelPackage
/rt2500-usb
73 $(call KernelPackage
/rt2x00
/Default
)
74 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
+kmod-crc-itu-t
76 FILES
:=$(PKG_BUILD_DIR
)/rt2500usb.
$(LINUX_KMOD_SUFFIX
)
77 AUTOLOAD
:=$(call AutoLoad
,27,rt2500usb
)
80 define KernelPackage
/rt61-pci
81 $(call KernelPackage
/rt2x00
/Default
)
82 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
+kmod-crc-itu-t
84 FILES
:=$(PKG_BUILD_DIR
)/rt61pci.
$(LINUX_KMOD_SUFFIX
)
85 AUTOLOAD
:=$(call AutoLoad
,27,rt61pci
)
88 define KernelPackage
/rt73-usb
89 $(call KernelPackage
/rt2x00
/Default
)
90 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
92 FILES
:=$(PKG_BUILD_DIR
)/rt73usb.
$(LINUX_KMOD_SUFFIX
)
93 AUTOLOAD
:=$(call AutoLoad
,27,rt73usb
)
96 $(STAMP_PREPARED
): $(DL_DIR
)/$(PKG_FW6X_NAME
) $(DL_DIR
)/$(PKG_FW7X_NAME
)
98 $(DL_DIR
)/$(PKG_FW6X_NAME
):
99 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_FW6X_NAME)" "$(PKG_FW6X_MD5SUM)" $(PKG_FW6X_URL
)
101 $(DL_DIR
)/$(PKG_FW7X_NAME
):
102 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_FW7X_NAME)" "$(PKG_FW7X_MD5SUM)" $(PKG_FW7X_URL
)
104 PKG_EXTRA_KCONFIG
:= \
106 CONFIG_RT2X00_DEBUG
=y \
108 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci
),)
109 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00PCI
=y
111 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb
),)
112 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00USB
=y
114 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci
),)
115 PKG_EXTRA_KCONFIG
+= CONFIG_RT2400PCI
=y
117 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci
),)
118 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500PCI
=y
120 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb
),)
121 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500USB
=y
123 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci
),)
124 PKG_EXTRA_KCONFIG
+= CONFIG_RT61PCI
=y
126 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb
),)
127 PKG_EXTRA_KCONFIG
+= CONFIG_RT73USB
=y
131 -I
$(STAGING_DIR
)/usr
/include/mac80211 \
132 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=m
,%,$(filter %=m
,$(PKG_EXTRA_KCONFIG
)))) \
133 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=y
,%,$(filter %=y
,$(PKG_EXTRA_KCONFIG
)))) \
136 $(call Build
/Prepare
/Default
)
137 $(CP
) -r src
/* $(PKG_BUILD_DIR
)/
138 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(PKG_FW6X_NAME
)
139 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(PKG_FW7X_NAME
)
142 define Build
/Configure
143 touch
$(PKG_BUILD_DIR
)/rt2x00_config.h
147 $(MAKE
) -C
"$(LINUX_DIR)" \
148 ARCH
="$(LINUX_KARCH)" \
149 CROSS_COMPILE
="$(TARGET_CROSS)" \
150 SUBDIRS
="$(PKG_BUILD_DIR)" \
151 $(PKG_EXTRA_KCONFIG
) \
152 EXTRA_CFLAGS
="$(PKG_EXTRA_CFLAGS)" \
157 define KernelPackage
/rt61-pci
/install
158 $(INSTALL_DIR
) $(1)/lib
/firmware
159 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt2?
61*.bin
$(1)/lib
/firmware
/
162 define KernelPackage
/rt73-usb
/install
163 $(INSTALL_DIR
) $(1)/lib
/firmware
164 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt73.bin
$(1)/lib
/firmware
/
167 $(eval
$(call KernelPackage
,rt2x00-lib
))
168 $(eval
$(call KernelPackage
,rt2x00-pci
))
169 $(eval
$(call KernelPackage
,rt2x00-usb
))
170 $(eval
$(call KernelPackage
,rt2400-pci
))
171 $(eval
$(call KernelPackage
,rt2500-pci
))
172 $(eval
$(call KernelPackage
,rt2500-usb
))
173 $(eval
$(call KernelPackage
,rt61-pci
))
174 $(eval
$(call KernelPackage
,rt73-usb
))