updated iproute2 to 2.6.23 + latest debian patches + latest esfq. deleted patches...
[openwrt.git] / package / rt2x00 / Makefile
1 #
2 # Copyright (C) 2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id: $
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=rt2x00
13 PKG_VERSION:=cvs-20070712
14
15 include $(INCLUDE_DIR)/package.mk
16
17
18 RT61FW:=RT61_Firmware_V1.2.zip
19 RT71FW:=RT71W_Firmware_V1.8.zip
20
21 define Download/rt61
22 FILE:=$(RT61FW)
23 URL:=http://www.ralinktech.com.tw/data/
24 MD5SUM:=d4c690c93b470bc9a681297c2adc6281
25 endef
26 $(eval $(call Download,rt61))
27
28 define Download/rt71w
29 FILE:=$(RT71FW)
30 URL:=http://www.ralinktech.com.tw/data/
31 MD5SUM:=1e7a5dc574e0268574fcda3fd5cf52f7
32 endef
33 $(eval $(call Download,rt71w))
34
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
40 endef
41
42 define KernelPackage/rt2x00-lib
43 $(call KernelPackage/rt2x00/Default)
44 DEPENDS+= @PCI_SUPPORT||USB_SUPPORT +kmod-mac80211
45 TITLE+= (LIB)
46 FILES:=$(PKG_BUILD_DIR)/rt2x00lib.$(LINUX_KMOD_SUFFIX)
47 AUTOLOAD:=$(call AutoLoad,25,blkcipher ecb arc4 rt2x00lib)
48 endef
49
50 define KernelPackage/rt2x00-pci
51 $(call KernelPackage/rt2x00/Default)
52 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-lib +kmod-eeprom-93cx6
53 TITLE+= (PCI)
54 FILES:=$(PKG_BUILD_DIR)/rt2x00pci.$(LINUX_KMOD_SUFFIX)
55 AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
56 endef
57
58 define KernelPackage/rt2x00-usb
59 $(call KernelPackage/rt2x00/Default)
60 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
61 TITLE+= (USB)
62 FILES:=$(PKG_BUILD_DIR)/rt2x00usb.$(LINUX_KMOD_SUFFIX)
63 AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
64 endef
65
66 define KernelPackage/rt2400-pci
67 $(call KernelPackage/rt2x00/Default)
68 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
69 TITLE+= (RT2400 PCI)
70 FILES:=$(PKG_BUILD_DIR)/rt2400pci.$(LINUX_KMOD_SUFFIX)
71 AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
72 endef
73
74 define KernelPackage/rt2500-pci
75 $(call KernelPackage/rt2x00/Default)
76 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
77 TITLE+= (RT2500 PCI)
78 FILES:=$(PKG_BUILD_DIR)/rt2500pci.$(LINUX_KMOD_SUFFIX)
79 AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
80 endef
81
82 define KernelPackage/rt2500-usb
83 $(call KernelPackage/rt2x00/Default)
84 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-crc-itu-t
85 TITLE+= (RT2500 USB)
86 FILES:=$(PKG_BUILD_DIR)/rt2500usb.$(LINUX_KMOD_SUFFIX)
87 AUTOLOAD:=$(call AutoLoad,27,rt2500usb)
88 endef
89
90 define KernelPackage/rt61-pci
91 $(call KernelPackage/rt2x00/Default)
92 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-crc-itu-t
93 TITLE+= (RT2x61 PCI)
94 FILES:=$(PKG_BUILD_DIR)/rt61pci.$(LINUX_KMOD_SUFFIX)
95 AUTOLOAD:=$(call AutoLoad,27,rt61pci)
96 endef
97
98 define KernelPackage/rt73-usb
99 $(call KernelPackage/rt2x00/Default)
100 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
101 TITLE+= (RT73 USB)
102 FILES:=$(PKG_BUILD_DIR)/rt73usb.$(LINUX_KMOD_SUFFIX)
103 AUTOLOAD:=$(call AutoLoad,27,rt73usb)
104 endef
105
106 $(STAMP_PREPARED): $(DL_DIR)/$(PKG_FW6X_NAME) $(DL_DIR)/$(PKG_FW7X_NAME)
107
108 PKG_EXTRA_KCONFIG:= \
109 CONFIG_MAC80211=y \
110 CONFIG_RT2X00=y \
111 CONFIG_RT2X00_DEBUG=y \
112
113 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci),)
114 PKG_EXTRA_KCONFIG+= CONFIG_RT2X00PCI=y
115 endif
116 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb),)
117 PKG_EXTRA_KCONFIG+= CONFIG_RT2X00USB=y
118 endif
119 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci),)
120 PKG_EXTRA_KCONFIG+= CONFIG_RT2400PCI=y
121 endif
122 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci),)
123 PKG_EXTRA_KCONFIG+= CONFIG_RT2500PCI=y
124 endif
125 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb),)
126 PKG_EXTRA_KCONFIG+= CONFIG_RT2500USB=y
127 endif
128 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci),)
129 PKG_EXTRA_KCONFIG+= CONFIG_RT61PCI=y
130 endif
131 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb),)
132 PKG_EXTRA_KCONFIG+= CONFIG_RT73USB=y
133 endif
134
135 PKG_EXTRA_CFLAGS:= \
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)))) \
139
140 define Build/Prepare
141 $(call Build/Prepare/Default)
142 $(CP) src/* $(PKG_BUILD_DIR)/
143 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT61FW)
144 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT71FW)
145 endef
146
147 define Build/Configure
148 touch $(PKG_BUILD_DIR)/rt2x00_config.h
149 endef
150
151 define Build/Compile
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)" \
158 V="$(V)" \
159 modules
160 endef
161
162 define KernelPackage/rt61-pci/install
163 $(INSTALL_DIR) $(1)/lib/firmware
164 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
165 endef
166
167 define KernelPackage/rt73-usb/install
168 $(INSTALL_DIR) $(1)/lib/firmware
169 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
170 endef
171
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))
This page took 0.049147 seconds and 5 git commands to generate.