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:=fe64f389f0863ef349a8c97e0fbc8838
19 PKG_FW7X_NAME:=RT71W_Firmware_V1.8.zip
20 PKG_FW7X_URL:=http://www.ralinktech.com.tw/data/
21 PKG_FW7X_MD5SUM:=db4ef70b61e483f34db496738507b275
23 include $(INCLUDE_DIR)/package.mk
25 include $(LINUX_DIR)/.config
28 define KernelPackage/rt2x00/Default
29 SUBMENU:=Wireless Drivers
30 TITLE:=Ralink Drivers for RT2x00 cards
32 KCONFIG:=CONFIG_MAC80211
33 DESCRIPTION:=Ralink GPL Drivers for rt2x00 cards
34 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(LINUX_RELEASE)
37 define KernelPackage/rt2x00-lib
38 $(call KernelPackage/rt2x00/Default)
39 DEPENDS+= +kmod-mac80211 +kmod-crypto
41 FILES:=$(PKG_BUILD_DIR)/rt2x00lib.$(LINUX_KMOD_SUFFIX)
42 AUTOLOAD:=$(call AutoLoad,25,ecb arc4 rt2x00lib)
45 define KernelPackage/rt2x00-pci
46 $(call KernelPackage/rt2x00/Default)
47 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-lib
49 FILES:=$(PKG_BUILD_DIR)/rt2x00pci.$(LINUX_KMOD_SUFFIX)
50 AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
53 define KernelPackage/rt2x00-usb
54 $(call KernelPackage/rt2x00/Default)
55 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
57 FILES:=$(PKG_BUILD_DIR)/rt2x00usb.$(LINUX_KMOD_SUFFIX)
58 AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
61 define KernelPackage/rt2400-pci
62 $(call KernelPackage/rt2x00/Default)
63 DEPENDS+= +kmod-rt2x00-pci
65 FILES:=$(PKG_BUILD_DIR)/rt2400pci.$(LINUX_KMOD_SUFFIX)
66 AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
69 define KernelPackage/rt2500-pci
70 $(call KernelPackage/rt2x00/Default)
71 DEPENDS+= +kmod-rt2x00-pci
73 FILES:=$(PKG_BUILD_DIR)/rt2500pci.$(LINUX_KMOD_SUFFIX)
74 AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
77 define KernelPackage/rt2500-usb
78 $(call KernelPackage/rt2x00/Default)
79 DEPENDS+= +kmod-rt2x00-usb
81 FILES:=$(PKG_BUILD_DIR)/rt2500usb.$(LINUX_KMOD_SUFFIX)
82 AUTOLOAD:=$(call AutoLoad,27,rt2500usb)
85 define KernelPackage/rt61-pci
86 $(call KernelPackage/rt2x00/Default)
87 DEPENDS+= +kmod-rt2x00-pci
89 FILES:=$(PKG_BUILD_DIR)/rt61pci.$(LINUX_KMOD_SUFFIX)
90 AUTOLOAD:=$(call AutoLoad,27,rt61pci)
93 define KernelPackage/rt73-usb
94 $(call KernelPackage/rt2x00/Default)
95 DEPENDS+= +kmod-rt2x00-usb
97 FILES:=$(PKG_BUILD_DIR)/rt73usb.$(LINUX_KMOD_SUFFIX)
98 AUTOLOAD:=$(call AutoLoad,27,rt73usb)
101 $(STAMP_PREPARED): $(DL_DIR)/$(PKG_FW6X_NAME) $(DL_DIR)/$(PKG_FW7X_NAME)
103 $(DL_DIR)/$(PKG_FW6X_NAME):
104 $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_FW6X_NAME)" "$(PKG_FW6X_MD5SUM)" $(PKG_FW6X_URL)
106 $(DL_DIR)/$(PKG_FW7X_NAME):
107 $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_FW7X_NAME)" "$(PKG_FW7X_MD5SUM)" $(PKG_FW7X_URL)
109 ifndef ($(CONFIG_MAC80211),)
111 PKG_EXTRA_KCONFIG:= \
113 CONFIG_RT2X00_DEBUG=y \
115 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci),)
116 PKG_EXTRA_KCONFIG+= CONFIG_RT2400PCI=y
118 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci),)
119 PKG_EXTRA_KCONFIG+= CONFIG_RT2500PCI=y
121 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb),)
122 PKG_EXTRA_KCONFIG+= CONFIG_RT2500USB=y
124 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci),)
125 PKG_EXTRA_KCONFIG+= CONFIG_RT61PCI=y
127 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb),)
128 PKG_EXTRA_KCONFIG+= CONFIG_RT73USB=y
132 -I$(STAGING_DIR)/usr/include/mac80211 \
133 $(patsubst CONFIG_%, -DCONFIG_%=1, $(filter %=m,$(PKG_EXTRA_KCONFIG))) \
134 $(patsubst CONFIG_%, -DCONFIG_%=1, $(filter %=y,$(PKG_EXTRA_KCONFIG))) \
136 define Build/Compile/it
137 $(MAKE) -C "$(LINUX_DIR)" \
138 ARCH="$(LINUX_KARCH)" \
139 CROSS_COMPILE="$(TARGET_CROSS)" \
140 SUBDIRS="$(PKG_BUILD_DIR)" \
141 $(PKG_EXTRA_KCONFIG) \
142 EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS)" \
150 $(call Build/Prepare/Default)
151 $(CP) -r src/* $(PKG_BUILD_DIR)/
152 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_FW6X_NAME)
153 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_FW7X_NAME)
156 define Build/Configure
157 touch $(PKG_BUILD_DIR)/rt2x00_config.h
161 $(call Build/Compile/it)
164 define KernelPackage/rt61-pci/install
165 $(INSTALL_DIR) $(1)/lib/firmware
166 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
169 define KernelPackage/rt73-usb/install
170 $(INSTALL_DIR) $(1)/lib/firmware
171 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
174 $(eval $(call KernelPackage,rt2x00-lib))
175 $(eval $(call KernelPackage,rt2x00-pci))
176 $(eval $(call KernelPackage,rt2x00-usb))
177 $(eval $(call KernelPackage,rt2400-pci))
178 $(eval $(call KernelPackage,rt2500-pci))
179 $(eval $(call KernelPackage,rt2500-usb))
180 $(eval $(call KernelPackage,rt61-pci))
181 $(eval $(call KernelPackage,rt73-usb))