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
30 KCONFIG
:=CONFIG_MAC80211
33 define KernelPackage
/rt2x00-lib
34 $(call KernelPackage
/rt2x00
/Default
)
35 DEPENDS
+= @PCI_SUPPORT||USB_SUPPORT
+kmod-mac80211
37 FILES
:=$(PKG_BUILD_DIR
)/rt2x00lib.
$(LINUX_KMOD_SUFFIX
)
38 AUTOLOAD
:=$(call AutoLoad
,25,blkcipher ecb arc4 rt2x00lib
)
41 define KernelPackage
/rt2x00-pci
42 $(call KernelPackage
/rt2x00
/Default
)
43 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-lib
+kmod-eeprom-93cx6
45 FILES
:=$(PKG_BUILD_DIR
)/rt2x00pci.
$(LINUX_KMOD_SUFFIX
)
46 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00pci
)
49 define KernelPackage
/rt2x00-usb
50 $(call KernelPackage
/rt2x00
/Default
)
51 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-lib
+kmod-usb-core
53 FILES
:=$(PKG_BUILD_DIR
)/rt2x00usb.
$(LINUX_KMOD_SUFFIX
)
54 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00usb
)
57 define KernelPackage
/rt2400-pci
58 $(call KernelPackage
/rt2x00
/Default
)
59 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
61 FILES
:=$(PKG_BUILD_DIR
)/rt2400pci.
$(LINUX_KMOD_SUFFIX
)
62 AUTOLOAD
:=$(call AutoLoad
,27,rt2400pci
)
65 define KernelPackage
/rt2500-pci
66 $(call KernelPackage
/rt2x00
/Default
)
67 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
69 FILES
:=$(PKG_BUILD_DIR
)/rt2500pci.
$(LINUX_KMOD_SUFFIX
)
70 AUTOLOAD
:=$(call AutoLoad
,27,rt2500pci
)
73 define KernelPackage
/rt2500-usb
74 $(call KernelPackage
/rt2x00
/Default
)
75 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
+kmod-crc-itu-t
77 FILES
:=$(PKG_BUILD_DIR
)/rt2500usb.
$(LINUX_KMOD_SUFFIX
)
78 AUTOLOAD
:=$(call AutoLoad
,27,rt2500usb
)
81 define KernelPackage
/rt61-pci
82 $(call KernelPackage
/rt2x00
/Default
)
83 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
+kmod-crc-itu-t
85 FILES
:=$(PKG_BUILD_DIR
)/rt61pci.
$(LINUX_KMOD_SUFFIX
)
86 AUTOLOAD
:=$(call AutoLoad
,27,rt61pci
)
89 define KernelPackage
/rt73-usb
90 $(call KernelPackage
/rt2x00
/Default
)
91 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
93 FILES
:=$(PKG_BUILD_DIR
)/rt73usb.
$(LINUX_KMOD_SUFFIX
)
94 AUTOLOAD
:=$(call AutoLoad
,27,rt73usb
)
97 $(STAMP_PREPARED
): $(DL_DIR
)/$(PKG_FW6X_NAME
) $(DL_DIR
)/$(PKG_FW7X_NAME
)
99 $(DL_DIR
)/$(PKG_FW6X_NAME
):
100 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_FW6X_NAME)" "$(PKG_FW6X_MD5SUM)" $(PKG_FW6X_URL
)
102 $(DL_DIR
)/$(PKG_FW7X_NAME
):
103 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_FW7X_NAME)" "$(PKG_FW7X_MD5SUM)" $(PKG_FW7X_URL
)
105 # only try to build if the kernel is recent enough (has in-kernel mac80211)
106 ifndef ($(CONFIG_MAC80211
),)
108 PKG_EXTRA_KCONFIG
:= \
110 CONFIG_RT2X00_DEBUG
=y \
112 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci
),)
113 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00PCI
=y
115 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb
),)
116 PKG_EXTRA_KCONFIG
+= CONFIG_RT2X00USB
=y
118 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci
),)
119 PKG_EXTRA_KCONFIG
+= CONFIG_RT2400PCI
=y
121 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci
),)
122 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500PCI
=y
124 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb
),)
125 PKG_EXTRA_KCONFIG
+= CONFIG_RT2500USB
=y
127 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci
),)
128 PKG_EXTRA_KCONFIG
+= CONFIG_RT61PCI
=y
130 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb
),)
131 PKG_EXTRA_KCONFIG
+= CONFIG_RT73USB
=y
135 -I
$(STAGING_DIR
)/usr
/include/mac80211 \
136 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=m
,%,$(filter %=m
,$(PKG_EXTRA_KCONFIG
)))) \
137 $(patsubst CONFIG_
%, -DCONFIG_
%=1, $(patsubst %=y
,%,$(filter %=y
,$(PKG_EXTRA_KCONFIG
)))) \
139 define Build
/Compile
/it
140 $(MAKE
) -C
"$(LINUX_DIR)" \
141 ARCH
="$(LINUX_KARCH)" \
142 CROSS_COMPILE
="$(TARGET_CROSS)" \
143 SUBDIRS
="$(PKG_BUILD_DIR)" \
144 $(PKG_EXTRA_KCONFIG
) \
145 EXTRA_CFLAGS
="$(PKG_EXTRA_CFLAGS)" \
153 $(call Build
/Prepare
/Default
)
154 $(CP
) -r src
/* $(PKG_BUILD_DIR
)/
155 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(PKG_FW6X_NAME
)
156 unzip
-jod
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(PKG_FW7X_NAME
)
159 define Build
/Configure
160 touch
$(PKG_BUILD_DIR
)/rt2x00_config.h
164 $(call Build
/Compile
/it
)
167 define KernelPackage
/rt61-pci
/install
168 $(INSTALL_DIR
) $(1)/lib
/firmware
169 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt2?
61*.bin
$(1)/lib
/firmware
/
172 define KernelPackage
/rt73-usb
/install
173 $(INSTALL_DIR
) $(1)/lib
/firmware
174 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt73.bin
$(1)/lib
/firmware
/
177 $(eval
$(call KernelPackage
,rt2x00-lib
))
178 $(eval
$(call KernelPackage
,rt2x00-pci
))
179 $(eval
$(call KernelPackage
,rt2x00-usb
))
180 $(eval
$(call KernelPackage
,rt2400-pci
))
181 $(eval
$(call KernelPackage
,rt2500-pci
))
182 $(eval
$(call KernelPackage
,rt2500-usb
))
183 $(eval
$(call KernelPackage
,rt61-pci
))
184 $(eval
$(call KernelPackage
,rt73-usb
))