remove handling of older unsupported kernels
[openwrt/svn-archive/archive.git] / package / kernel / modules / crypto.mk
1 #
2 # Copyright (C) 2006-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 CRYPTO_MENU:=Cryptographic API modules
9
10 # XXX: added workarounds for modules renamed in 2.6 series:
11 # - aes > aes_generic (2.6.24)
12 # - blkcipher -> crypto_blkcipher (2.6.25)
13 # - des > des_generic (2.6.24)
14 # - sha1 > sha1_generic (2.6.24)
15 # - sha256 > sha256_generic (2.6.24)
16 # - sha512 > sha512_generic (2.6.26)
17 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.25)),1)
18 CRYPTO_PREFIX:=crypto_
19 BLKCIPHER_PREFIX:=$(CRYPTO_PREFIX)
20 endif
21 AEAD_CONF:=AEAD
22 MANAGER_CONF:=MANAGER
23 BLKCIPHER_CONF:=BLKCIPHER
24 HASH_CONF:=HASH
25 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.30)),1)
26 CRYPTO_MODULE_PCOMPRESS:=PCOMP=pcompress
27 AEAD_CONF:=AEAD2
28 MANAGER_CONF:=MANAGER2
29 BLKCIPHER_CONF:=BLKCIPHER2
30 HASH_CONF:=HASH2
31 endif
32
33 CRYPTO_MODULES = \
34 ALGAPI=crypto_algapi \
35 $(AEAD_CONF)=aead \
36 $(CRYPTO_MODULE_PCOMPRESS) \
37 $(BLKCIPHER_CONF)=$(BLKCIPHER_PREFIX)blkcipher \
38 $(HASH_CONF)=crypto_hash \
39 $(MANAGER_CONF)=cryptomgr \
40 CBC=cbc \
41 ECB=ecb \
42 DEFLATE=deflate
43
44 crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1)))
45 crypto_file=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(LINUX_DIR)/crypto/$(word 2,$(subst =,$(space),$(1))).$(LINUX_KMOD_SUFFIX))
46 crypto_name=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(word 2,$(subst =,$(space),$(1))))
47
48 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
49 # always set, even if no hash modules are selected
50 define KernelPackage/crypto-core
51 SUBMENU:=$(CRYPTO_MENU)
52 TITLE:=Core CryptoAPI modules
53 KCONFIG:=CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC $(foreach mod,$(CRYPTO_MODULES),$(call crypto_confvar,$(mod)))
54 FILES:=$(foreach mod,$(CRYPTO_MODULES),$(call crypto_file,$(mod)))
55 AUTOLOAD:=$(call AutoLoad,01,$(foreach mod,$(CRYPTO_MODULES),$(call crypto_name,$(mod))))
56 endef
57
58 define KernelPackage/crypto-core/2.4
59 FILES:=$(LINUX_DIR)/crypto/deflate.$(LINUX_KMOD_SUFFIX)
60 AUTOLOAD:=$(call AutoLoad,01, deflate)
61 endef
62
63 $(eval $(call KernelPackage,crypto-core))
64
65
66 define KernelPackage/crypto-hw-padlock
67 SUBMENU:=$(CRYPTO_MENU)
68 TITLE:=VIA PadLock ACE with AES/SHA hw crypto module
69 DEPENDS:=+kmod-crypto-core
70 KCONFIG:= \
71 CONFIG_CRYPTO_HW=y \
72 CONFIG_CRYPTO_DEV_PADLOCK \
73 CONFIG_CRYPTO_DEV_PADLOCK_AES \
74 CONFIG_CRYPTO_DEV_PADLOCK_SHA
75 FILES:= \
76 $(LINUX_DIR)/drivers/crypto/padlock-aes.$(LINUX_KMOD_SUFFIX) \
77 $(LINUX_DIR)/drivers/crypto/padlock-sha.$(LINUX_KMOD_SUFFIX)
78 AUTOLOAD:=$(call AutoLoad,09,padlock-aes padlock-sha)
79 endef
80
81 $(eval $(call KernelPackage,crypto-hw-padlock))
82
83
84 define KernelPackage/crypto-hw-geode
85 SUBMENU:=$(CRYPTO_MENU)
86 TITLE:=AMD Geode hardware crypto module
87 DEPENDS:=+kmod-crypto-core
88 KCONFIG:= \
89 CONFIG_CRYPTO_HW=y \
90 CONFIG_CRYPTO_DEV_GEODE
91 FILES:=$(LINUX_DIR)/drivers/crypto/geode-aes.$(LINUX_KMOD_SUFFIX)
92 AUTOLOAD:=$(call AutoLoad,09,geode-aes)
93 endef
94
95 $(eval $(call KernelPackage,crypto-hw-geode))
96
97
98 define KernelPackage/crypto-hw-hifn-795x
99 SUBMENU:=$(CRYPTO_MENU)
100 TITLE:=HIFN 795x crypto accelerator
101 DEPENDS:=+kmod-crypto-core +kmod-crypto-des @!TARGET_ubicom32
102 KCONFIG:= \
103 CONFIG_CRYPTO_HW=y \
104 CONFIG_CRYPTO_DEV_HIFN_795X \
105 CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
106 FILES:=$(LINUX_DIR)/drivers/crypto/hifn_795x.$(LINUX_KMOD_SUFFIX)
107 AUTOLOAD:=$(call AutoLoad,09,hifn_795x)
108 endef
109
110 $(eval $(call KernelPackage,crypto-hw-hifn-795x))
111
112
113 define KernelPackage/crypto-hw-ixp4xx
114 SUBMENU:=$(CRYPTO_MENU)
115 TITLE:=Intel IXP4xx hardware crypto module
116 DEPENDS:= \
117 @TARGET_ixp4xx +kmod-crypto-core +kmod-crypto-des +kmod-crypto-authenc
118 KCONFIG:= \
119 CONFIG_CRYPTO_HW=y \
120 CONFIG_CRYPTO_DEV_IXP4XX
121 FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.$(LINUX_KMOD_SUFFIX)
122 AUTOLOAD:=$(call AutoLoad,90,ixp4xx_crypto)
123 endef
124
125 define KernelPackage/crypto-hw-ixp4xx/description
126 Kernel support for the Intel IXP4xx HW crypto engine.
127 endef
128
129 $(eval $(call KernelPackage,crypto-hw-ixp4xx))
130
131
132 define KernelPackage/crypto-hw-ppc4xx
133 SUBMENU:=$(CRYPTO_MENU)
134 TITLE:=AMCC PPC4xx hardware crypto module
135 DEPENDS:= \
136 @TARGET_ppc40x||TARGET_ppc44x +kmod-crypto-core
137 KCONFIG:= \
138 CONFIG_CRYPTO_HW=y \
139 CONFIG_CRYPTO_DEV_PPC4XX
140 FILES:=$(LINUX_DIR)/drivers/crypto/amcc/crypto4xx.$(LINUX_KMOD_SUFFIX)
141 AUTOLOAD:=$(call AutoLoad,90,crypto4xx)
142 endef
143
144 define KernelPackage/crypto-hw-ppc4xx/description
145 Kernel support for the AMCC PPC4xx HW crypto engine.
146 endef
147
148 $(eval $(call KernelPackage,crypto-hw-ppc4xx))
149
150
151 define KernelPackage/crypto-aes
152 SUBMENU:=$(CRYPTO_MENU)
153 TITLE:=AES cipher CryptoAPI module
154 DEPENDS:=+kmod-crypto-core
155 KCONFIG:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
156 FILES:=$(LINUX_DIR)/crypto/aes$(AES_SUFFIX).$(LINUX_KMOD_SUFFIX)
157 AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX))
158 endef
159
160 define KernelPackage/crypto-aes/x86-2.6
161 FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.$(LINUX_KMOD_SUFFIX)
162 AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX) aes-i586)
163 endef
164
165 $(eval $(call KernelPackage,crypto-aes))
166
167
168 define KernelPackage/crypto-arc4
169 SUBMENU:=$(CRYPTO_MENU)
170 TITLE:=ARC4 (RC4) cipher CryptoAPI module
171 DEPENDS:=+kmod-crypto-core
172 KCONFIG:=CONFIG_CRYPTO_ARC4
173 FILES:=$(LINUX_DIR)/crypto/arc4.$(LINUX_KMOD_SUFFIX)
174 AUTOLOAD:=$(call AutoLoad,09,arc4)
175 endef
176
177 $(eval $(call KernelPackage,crypto-arc4))
178
179
180 define KernelPackage/crypto-authenc
181 SUBMENU:=$(CRYPTO_MENU)
182 TITLE:=Combined mode wrapper for IPsec
183 DEPENDS:=+kmod-crypto-core
184 KCONFIG:=CONFIG_CRYPTO_AUTHENC
185 FILES:=$(LINUX_DIR)/crypto/authenc.$(LINUX_KMOD_SUFFIX)
186 AUTOLOAD:=$(call AutoLoad,09,authenc)
187 endef
188
189 $(eval $(call KernelPackage,crypto-authenc))
190
191 define KernelPackage/crypto-des
192 SUBMENU:=$(CRYPTO_MENU)
193 TITLE:=DES/3DES cipher CryptoAPI module
194 DEPENDS:=+kmod-crypto-core
195 KCONFIG:=CONFIG_CRYPTO_DES
196 FILES:=$(LINUX_DIR)/crypto/des$(DES_SUFFIX).$(LINUX_KMOD_SUFFIX)
197 AUTOLOAD:=$(call AutoLoad,09,des$(DES_SUFFIX))
198 endef
199
200 $(eval $(call KernelPackage,crypto-des))
201
202
203 define KernelPackage/crypto-hmac
204 SUBMENU:=$(CRYPTO_MENU)
205 TITLE:=HMAC digest CryptoAPI module
206 DEPENDS:=+kmod-crypto-core
207 KCONFIG:=CONFIG_CRYPTO_HMAC
208 FILES:=$(LINUX_DIR)/crypto/hmac.$(LINUX_KMOD_SUFFIX)
209 AUTOLOAD:=$(call AutoLoad,09,hmac)
210 endef
211
212 $(eval $(call KernelPackage,crypto-hmac))
213
214
215 define KernelPackage/crypto-md5
216 SUBMENU:=$(CRYPTO_MENU)
217 TITLE:=MD5 digest CryptoAPI module
218 DEPENDS:=+kmod-crypto-core
219 KCONFIG:=CONFIG_CRYPTO_MD5
220 FILES:=$(LINUX_DIR)/crypto/md5.$(LINUX_KMOD_SUFFIX)
221 AUTOLOAD:=$(call AutoLoad,09,md5)
222 endef
223
224 $(eval $(call KernelPackage,crypto-md5))
225
226
227 define KernelPackage/crypto-michael-mic
228 SUBMENU:=$(CRYPTO_MENU)
229 TITLE:=Michael MIC keyed digest CryptoAPI module
230 DEPENDS:=+kmod-crypto-core
231 KCONFIG:=CONFIG_CRYPTO_MICHAEL_MIC
232 FILES:=$(LINUX_DIR)/crypto/michael_mic.$(LINUX_KMOD_SUFFIX)
233 AUTOLOAD:=$(call AutoLoad,09,michael_mic)
234 endef
235
236 $(eval $(call KernelPackage,crypto-michael-mic))
237
238
239 define KernelPackage/crypto-sha1
240 SUBMENU:=$(CRYPTO_MENU)
241 TITLE:=SHA1 digest CryptoAPI module
242 DEPENDS:=+kmod-crypto-core
243 KCONFIG:=CONFIG_CRYPTO_SHA1
244 FILES:=$(LINUX_DIR)/crypto/sha1$(SHA1_SUFFIX).$(LINUX_KMOD_SUFFIX)
245 AUTOLOAD:=$(call AutoLoad,09,sha1$(SHA1_SUFFIX))
246 endef
247
248 $(eval $(call KernelPackage,crypto-sha1))
249
250
251 define KernelPackage/crypto-misc
252 SUBMENU:=$(CRYPTO_MENU)
253 TITLE:=Other CryptoAPI modules
254 DEPENDS:=+kmod-crypto-core
255 KCONFIG:= \
256 CONFIG_CRYPTO_ANUBIS \
257 CONFIG_CRYPTO_BLOWFISH \
258 CONFIG_CRYPTO_CAMELLIA \
259 CONFIG_CRYPTO_CAST5 \
260 CONFIG_CRYPTO_CAST6 \
261 CONFIG_CRYPTO_CRC32C \
262 CONFIG_CRYPTO_FCRYPT \
263 CONFIG_CRYPTO_KHAZAD \
264 CONFIG_CRYPTO_MD4 \
265 CONFIG_CRYPTO_SERPENT \
266 CONFIG_CRYPTO_SHA256 \
267 CONFIG_CRYPTO_SHA512 \
268 CONFIG_CRYPTO_TEA \
269 CONFIG_CRYPTO_TGR192 \
270 CONFIG_CRYPTO_TWOFISH \
271 CONFIG_CRYPTO_TWOFISH_586 \
272 CONFIG_CRYPTO_WP512
273 FILES:= \
274 $(LINUX_DIR)/crypto/anubis.$(LINUX_KMOD_SUFFIX) \
275 $(LINUX_DIR)/crypto/blowfish.$(LINUX_KMOD_SUFFIX) \
276 $(LINUX_DIR)/crypto/cast5.$(LINUX_KMOD_SUFFIX) \
277 $(LINUX_DIR)/crypto/cast6.$(LINUX_KMOD_SUFFIX) \
278 $(LINUX_DIR)/crypto/khazad.$(LINUX_KMOD_SUFFIX) \
279 $(LINUX_DIR)/crypto/md4.$(LINUX_KMOD_SUFFIX) \
280 $(LINUX_DIR)/crypto/serpent.$(LINUX_KMOD_SUFFIX) \
281 $(LINUX_DIR)/crypto/sha256$(SHA256_SUFFIX).$(LINUX_KMOD_SUFFIX) \
282 $(LINUX_DIR)/crypto/sha512$(SHA512_SUFFIX).$(LINUX_KMOD_SUFFIX) \
283 $(LINUX_DIR)/crypto/tea.$(LINUX_KMOD_SUFFIX) \
284 $(LINUX_DIR)/crypto/twofish.$(LINUX_KMOD_SUFFIX) \
285 $(LINUX_DIR)/crypto/wp512.$(LINUX_KMOD_SUFFIX)
286 endef
287
288 define KernelPackage/crypto-misc/2.6
289 FILES+= \
290 $(LINUX_DIR)/crypto/camellia.$(LINUX_KMOD_SUFFIX) \
291 $(LINUX_DIR)/crypto/crc32c.$(LINUX_KMOD_SUFFIX) \
292 $(LINUX_DIR)/crypto/fcrypt.$(LINUX_KMOD_SUFFIX) \
293 $(LINUX_DIR)/crypto/tgr192.$(LINUX_KMOD_SUFFIX)
294 endef
295
296 $(eval $(call KernelPackage,crypto-misc))
297
298 define KernelPackage/crypto-ocf
299 SUBMENU:=$(CRYPTO_MENU)
300 TITLE:=OCF modules
301 DEPENDS:=+kmod-crypto-core @!TARGET_uml
302 KCONFIG:= \
303 CONFIG_OCF_OCF \
304 CONFIG_OCF_CRYPTODEV \
305 CONFIG_OCF_CRYPTOSOFT \
306 CONFIG_OCF_FIPS=y \
307 CONFIG_OCF_RANDOMHARVEST=y
308 FILES:= \
309 $(LINUX_DIR)/crypto/ocf/ocf.$(LINUX_KMOD_SUFFIX) \
310 $(LINUX_DIR)/crypto/ocf/cryptodev.$(LINUX_KMOD_SUFFIX) \
311 $(LINUX_DIR)/crypto/ocf/cryptosoft.$(LINUX_KMOD_SUFFIX)
312 AUTOLOAD:=$(call AutoLoad,09, \
313 ocf \
314 cryptodev \
315 cryptosoft \
316 )
317 endef
318
319 $(eval $(call KernelPackage,crypto-ocf))
320
321
322 define KernelPackage/crypto-null
323 SUBMENU:=$(CRYPTO_MENU)
324 TITLE:=Null CryptoAPI module
325 DEPENDS:=+kmod-crypto-core
326 KCONFIG:=CONFIG_CRYPTO_NULL
327 FILES:=$(LINUX_DIR)/crypto/crypto_null.$(LINUX_KMOD_SUFFIX)
328 AUTOLOAD:=$(call AutoLoad,09,crypto_null)
329 endef
330
331 $(eval $(call KernelPackage,crypto-null))
332
333
334 define KernelPackage/crypto-test
335 SUBMENU:=$(CRYPTO_MENU)
336 TITLE:=Test CryptoAPI module
337 DEPENDS:=+kmod-crypto-core
338 KCONFIG:=CONFIG_CRYPTO_TEST
339 FILES:=$(LINUX_DIR)/crypto/tcrypt.$(LINUX_KMOD_SUFFIX)
340 endef
341
342 $(eval $(call KernelPackage,crypto-test))
343