kernel: make sure that packages are generated for built-in crypto modules to avoid...
[openwrt/svn-archive/archive.git] / package / kernel / modules / crypto.mk
1 #
2 # Copyright (C) 2006-2011 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 CRYPTO_MODULES = ALGAPI2=crypto_algapi
11
12 CRYPTOMGR_MODULES = \
13 AEAD2=aead \
14 MANAGER2=cryptomgr \
15 BLKCIPHER2=crypto_blkcipher
16
17 crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1)))
18 crypto_file=$(LINUX_DIR)/crypto/$(word 2,$(subst =,$(space),$(1))).ko
19 crypto_name=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(word 2,$(subst =,$(space),$(1))))
20
21 define KernelPackage/crypto-core
22 SUBMENU:=$(CRYPTO_MENU)
23 TITLE:=Core CryptoAPI modules
24 KCONFIG:= \
25 CONFIG_CRYPTO=y \
26 CONFIG_CRYPTO_HW=y \
27 CONFIG_CRYPTO_ALGAPI \
28 $(foreach mod,$(CRYPTO_MODULES),$(call crypto_confvar,$(mod)))
29 FILES:=$(foreach mod,$(CRYPTO_MODULES),$(call crypto_file,$(mod)))
30 AUTOLOAD:=$(call AutoLoad,01,$(foreach mod,$(CRYPTO_MODULES),$(call crypto_name,$(mod))),1)
31 endef
32 $(eval $(call KernelPackage,crypto-core))
33
34
35 define AddDepends/crypto
36 SUBMENU:=$(CRYPTO_MENU)
37 DEPENDS+=+kmod-crypto-core $(1)
38 endef
39
40 define KernelPackage/crypto-hash
41 TITLE:=CryptoAPI hash support
42 KCONFIG:=CONFIG_CRYPTO_HASH2
43 FILES:=$(LINUX_DIR)/crypto/crypto_hash.ko
44 AUTOLOAD:=$(call AutoLoad,02,crypto_hash,1)
45 $(call AddDepends/crypto)
46 endef
47 $(eval $(call KernelPackage,crypto-hash))
48
49 define KernelPackage/crypto-manager
50 TITLE:=CryptoAPI algorithm manager
51 DEPENDS:=+kmod-crypto-hash
52 KCONFIG:= \
53 CONFIG_CRYPTO_AEAD \
54 CONFIG_CRYPTO_BLKCIPHER \
55 CONFIG_CRYPTO_MANAGER \
56 $(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_confvar,$(mod)))
57 FILES:=$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_file,$(mod)))
58 AUTOLOAD:=$(call AutoLoad,03,$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_name,$(mod))))
59 $(call AddDepends/crypto)
60 endef
61 $(eval $(call KernelPackage,crypto-manager))
62
63 define KernelPackage/crypto-pcompress
64 TITLE:=CryptoAPI Partial (de)compression operations
65 KCONFIG:= \
66 CONFIG_CRYPTO_PCOMP=y \
67 CONFIG_CRYPTO_PCOMP2
68 FILES:=$(LINUX_DIR)/crypto/pcompress.ko
69 AUTOLOAD:=$(call AutoLoad,09,pcompress)
70 $(call AddDepends/crypto)
71 endef
72 $(eval $(call KernelPackage,crypto-pcompress))
73
74 define KernelPackage/crypto-user
75 TITLE:=CryptoAPI userspace interface
76 DEPENDS:=+kmod-crypto-hash +kmod-crypto-manager
77 KCONFIG:= \
78 CONFIG_CRYPTO_USER_API \
79 CONFIG_CRYPTO_USER_API_HASH \
80 CONFIG_CRYPTO_USER_API_SKCIPHER
81 FILES:= \
82 $(LINUX_DIR)/crypto/af_alg.ko \
83 $(LINUX_DIR)/crypto/algif_hash.ko \
84 $(LINUX_DIR)/crypto/algif_skcipher.ko
85 AUTOLOAD:=$(call AutoLoad,09,af_alg algif_hash algif_skcipher)
86 $(call AddDepends/crypto)
87 endef
88 $(eval $(call KernelPackage,crypto-user))
89
90 define KernelPackage/crypto-wq
91 TITLE:=CryptoAPI work queue handling
92 KCONFIG:=CONFIG_CRYPTO_WORKQUEUE
93 FILES:=$(LINUX_DIR)/crypto/crypto_wq.ko
94 AUTOLOAD:=$(call AutoLoad,09,crypto_wq)
95 $(call AddDepends/crypto)
96 endef
97 $(eval $(call KernelPackage,crypto-wq))
98
99 define KernelPackage/crypto-rng
100 TITLE:=CryptoAPI random number generation
101 KCONFIG:=CONFIG_CRYPTO_RNG2
102 FILES:= \
103 $(LINUX_DIR)/crypto/rng.ko \
104 $(LINUX_DIR)/crypto/krng.ko
105 AUTOLOAD:=$(call AutoLoad,09,rng krng)
106 $(call AddDepends/crypto)
107 endef
108 $(eval $(call KernelPackage,crypto-rng))
109
110 define KernelPackage/crypto-iv
111 TITLE:=CryptoAPI initialization vectors
112 DEPENDS:=+kmod-crypto-manager +kmod-crypto-rng +kmod-crypto-wq
113 KCONFIG:= CONFIG_CRYPTO_BLKCIPHER2
114 FILES:= \
115 $(LINUX_DIR)/crypto/eseqiv.ko \
116 $(LINUX_DIR)/crypto/chainiv.ko
117 AUTOLOAD:=$(call AutoLoad,10,eseqiv chainiv)
118 $(call AddDepends/crypto)
119 endef
120 $(eval $(call KernelPackage,crypto-iv))
121
122 define KernelPackage/crypto-hw-padlock
123 TITLE:=VIA PadLock ACE with AES/SHA hw crypto module
124 DEPENDS:=+kmod-crypto-aes
125 KCONFIG:= \
126 CONFIG_CRYPTO_DEV_PADLOCK \
127 CONFIG_CRYPTO_DEV_PADLOCK_AES \
128 CONFIG_CRYPTO_DEV_PADLOCK_SHA
129 FILES:= \
130 $(LINUX_DIR)/drivers/crypto/padlock-aes.ko \
131 $(LINUX_DIR)/drivers/crypto/padlock-sha.ko
132 AUTOLOAD:=$(call AutoLoad,09,padlock-aes padlock-sha)
133 $(call AddDepends/crypto)
134 endef
135
136 $(eval $(call KernelPackage,crypto-hw-padlock))
137
138
139 define KernelPackage/crypto-hw-geode
140 TITLE:=AMD Geode hardware crypto module
141 KCONFIG:= \
142 CONFIG_CRYPTO_DEV_GEODE
143 FILES:=$(LINUX_DIR)/drivers/crypto/geode-aes.ko
144 AUTOLOAD:=$(call AutoLoad,09,geode-aes)
145 $(call AddDepends/crypto)
146 endef
147
148 $(eval $(call KernelPackage,crypto-hw-geode))
149
150
151 define KernelPackage/crypto-hw-hifn-795x
152 TITLE:=HIFN 795x crypto accelerator
153 KCONFIG:= \
154 CONFIG_HW_RANDOM=y \
155 CONFIG_CRYPTO_DEV_HIFN_795X \
156 CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
157 FILES:=$(LINUX_DIR)/drivers/crypto/hifn_795x.ko
158 AUTOLOAD:=$(call AutoLoad,09,hifn_795x)
159 $(call AddDepends/crypto,+kmod-crypto-des)
160 endef
161
162 $(eval $(call KernelPackage,crypto-hw-hifn-795x))
163
164
165 define KernelPackage/crypto-hw-ppc4xx
166 TITLE:=AMCC PPC4xx hardware crypto module
167 DEPENDS:=@TARGET_ppc40x||TARGET_ppc44x
168 KCONFIG:= \
169 CONFIG_CRYPTO_DEV_PPC4XX
170 FILES:=$(LINUX_DIR)/drivers/crypto/amcc/crypto4xx.ko
171 AUTOLOAD:=$(call AutoLoad,90,crypto4xx)
172 $(call AddDepends/crypto)
173 endef
174
175 define KernelPackage/crypto-hw-ppc4xx/description
176 Kernel support for the AMCC PPC4xx HW crypto engine.
177 endef
178
179 $(eval $(call KernelPackage,crypto-hw-ppc4xx))
180
181
182 define KernelPackage/crypto-aes
183 TITLE:=AES cipher CryptoAPI module
184 KCONFIG:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
185 FILES:=$(LINUX_DIR)/crypto/aes_generic.ko
186 AUTOLOAD:=$(call AutoLoad,09,aes_generic)
187 $(call AddDepends/crypto)
188 endef
189
190 define KernelPackage/crypto-aes/x86
191 FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.ko
192 AUTOLOAD:=$(call AutoLoad,09,aes_generic aes-i586)
193 endef
194
195 $(eval $(call KernelPackage,crypto-aes))
196
197
198 define KernelPackage/crypto-arc4
199 TITLE:=ARC4 (RC4) cipher CryptoAPI module
200 KCONFIG:=CONFIG_CRYPTO_ARC4
201 FILES:=$(LINUX_DIR)/crypto/arc4.ko
202 AUTOLOAD:=$(call AutoLoad,09,arc4)
203 $(call AddDepends/crypto,+!LINUX_3_3:kmod-crypto-manager)
204 endef
205
206 $(eval $(call KernelPackage,crypto-arc4))
207
208
209 define KernelPackage/crypto-authenc
210 TITLE:=Combined mode wrapper for IPsec
211 DEPENDS:=+kmod-crypto-manager
212 KCONFIG:=CONFIG_CRYPTO_AUTHENC
213 FILES:=$(LINUX_DIR)/crypto/authenc.ko
214 AUTOLOAD:=$(call AutoLoad,09,authenc)
215 $(call AddDepends/crypto)
216 endef
217
218 $(eval $(call KernelPackage,crypto-authenc))
219
220 define KernelPackage/crypto-cbc
221 TITLE:=Cipher Block Chaining CryptoAPI module
222 DEPENDS:=+kmod-crypto-manager
223 KCONFIG:=CONFIG_CRYPTO_CBC
224 FILES:=$(LINUX_DIR)/crypto/cbc.ko
225 AUTOLOAD:=$(call AutoLoad,09,cbc)
226 $(call AddDepends/crypto)
227 endef
228
229 $(eval $(call KernelPackage,crypto-cbc))
230
231 define KernelPackage/crypto-crc32c
232 TITLE:=CRC32c CRC module
233 DEPENDS:=+kmod-crypto-hash
234 KCONFIG:=CONFIG_CRYPTO_CRC32C
235 FILES:=$(LINUX_DIR)/crypto/crc32c.ko
236 AUTOLOAD:=$(call AutoLoad,04,crc32c,1)
237 $(call AddDepends/crypto)
238 endef
239
240 $(eval $(call KernelPackage,crypto-crc32c))
241
242 define KernelPackage/crypto-des
243 TITLE:=DES/3DES cipher CryptoAPI module
244 KCONFIG:=CONFIG_CRYPTO_DES
245 FILES:=$(LINUX_DIR)/crypto/des_generic.ko
246 AUTOLOAD:=$(call AutoLoad,09,des_generic)
247 $(call AddDepends/crypto)
248 endef
249
250 $(eval $(call KernelPackage,crypto-des))
251
252 define KernelPackage/crypto-deflate
253 TITLE:=Deflate compression CryptoAPI module
254 DEPENDS:=+kmod-lib-zlib
255 KCONFIG:=CONFIG_CRYPTO_DEFLATE
256 FILES:=$(LINUX_DIR)/crypto/deflate.ko
257 AUTOLOAD:=$(call AutoLoad,09,deflate)
258 $(call AddDepends/crypto)
259 endef
260
261 $(eval $(call KernelPackage,crypto-deflate))
262
263 define KernelPackage/crypto-ecb
264 TITLE:=Electronic CodeBook CryptoAPI module
265 DEPENDS:=+kmod-crypto-manager
266 KCONFIG:=CONFIG_CRYPTO_ECB
267 FILES:=$(LINUX_DIR)/crypto/ecb.ko
268 AUTOLOAD:=$(call AutoLoad,09,ecb)
269 $(call AddDepends/crypto)
270 endef
271
272 $(eval $(call KernelPackage,crypto-ecb))
273
274
275 define KernelPackage/crypto-hmac
276 TITLE:=HMAC digest CryptoAPI module
277 DEPENDS:=+kmod-crypto-hash
278 KCONFIG:=CONFIG_CRYPTO_HMAC
279 FILES:=$(LINUX_DIR)/crypto/hmac.ko
280 DEPENDS:=+kmod-crypto-manager
281 AUTOLOAD:=$(call AutoLoad,09,hmac)
282 $(call AddDepends/crypto)
283 endef
284
285 $(eval $(call KernelPackage,crypto-hmac))
286
287
288 define KernelPackage/crypto-md4
289 TITLE:=MD4 digest CryptoAPI module
290 DEPENDS:=+kmod-crypto-hash
291 KCONFIG:=CONFIG_CRYPTO_MD4
292 FILES:=$(LINUX_DIR)/crypto/md4.ko
293 AUTOLOAD:=$(call AutoLoad,09,md4)
294 $(call AddDepends/crypto)
295 endef
296
297 $(eval $(call KernelPackage,crypto-md4))
298
299
300 define KernelPackage/crypto-md5
301 TITLE:=MD5 digest CryptoAPI module
302 DEPENDS:=+kmod-crypto-hash
303 KCONFIG:=CONFIG_CRYPTO_MD5
304 FILES:=$(LINUX_DIR)/crypto/md5.ko
305 AUTOLOAD:=$(call AutoLoad,09,md5)
306 $(call AddDepends/crypto)
307 endef
308
309 $(eval $(call KernelPackage,crypto-md5))
310
311
312 define KernelPackage/crypto-michael-mic
313 TITLE:=Michael MIC keyed digest CryptoAPI module
314 DEPENDS:=+kmod-crypto-hash
315 KCONFIG:=CONFIG_CRYPTO_MICHAEL_MIC
316 FILES:=$(LINUX_DIR)/crypto/michael_mic.ko
317 AUTOLOAD:=$(call AutoLoad,09,michael_mic)
318 $(call AddDepends/crypto)
319 endef
320
321 $(eval $(call KernelPackage,crypto-michael-mic))
322
323
324 define KernelPackage/crypto-sha1
325 TITLE:=SHA1 digest CryptoAPI module
326 DEPENDS:=+kmod-crypto-hash
327 KCONFIG:=CONFIG_CRYPTO_SHA1
328 FILES:=$(LINUX_DIR)/crypto/sha1_generic.ko
329 AUTOLOAD:=$(call AutoLoad,09,sha1_generic)
330 $(call AddDepends/crypto)
331 endef
332
333 $(eval $(call KernelPackage,crypto-sha1))
334
335 define KernelPackage/crypto-sha256
336 TITLE:=SHA224 SHA256 digest CryptoAPI module
337 DEPENDS:=+kmod-crypto-hash
338 KCONFIG:=CONFIG_CRYPTO_SHA256
339 FILES:=$(LINUX_DIR)/crypto/sha256_generic.ko
340 AUTOLOAD:=$(call AutoLoad,09,sha256_generic)
341 $(call AddDepends/crypto)
342 endef
343
344 $(eval $(call KernelPackage,crypto-sha256))
345
346 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.6.0)),1)
347 camellia_mod_suffix=_generic
348 endif
349 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.7.0)),1)
350 cast56_mod_suffix=_generic
351 endif
352
353 define KernelPackage/crypto-misc
354 TITLE:=Other CryptoAPI modules
355 DEPENDS:=+kmod-crypto-manager
356 KCONFIG:= \
357 CONFIG_CRYPTO_ANUBIS \
358 CONFIG_CRYPTO_BLOWFISH \
359 CONFIG_CRYPTO_CAMELLIA \
360 CONFIG_CRYPTO_CAST5 \
361 CONFIG_CRYPTO_CAST6 \
362 CONFIG_CRYPTO_FCRYPT \
363 CONFIG_CRYPTO_KHAZAD \
364 CONFIG_CRYPTO_SERPENT \
365 CONFIG_CRYPTO_SHA512 \
366 CONFIG_CRYPTO_TEA \
367 CONFIG_CRYPTO_TGR192 \
368 CONFIG_CRYPTO_TWOFISH \
369 CONFIG_CRYPTO_TWOFISH_COMMON \
370 CONFIG_CRYPTO_TWOFISH_586 \
371 CONFIG_CRYPTO_WP512
372 FILES:= \
373 $(LINUX_DIR)/crypto/anubis.ko \
374 $(LINUX_DIR)/crypto/camellia$(camellia_mod_suffix).ko \
375 $(LINUX_DIR)/crypto/cast5$(cast56_mod_suffix).ko \
376 $(LINUX_DIR)/crypto/cast6$(cast56_mod_suffix).ko \
377 $(LINUX_DIR)/crypto/fcrypt.ko \
378 $(LINUX_DIR)/crypto/khazad.ko \
379 $(LINUX_DIR)/crypto/sha512_generic.ko \
380 $(LINUX_DIR)/crypto/tea.ko \
381 $(LINUX_DIR)/crypto/tgr192.ko \
382 $(LINUX_DIR)/crypto/twofish_common.ko \
383 $(LINUX_DIR)/crypto/wp512.ko \
384 $(LINUX_DIR)/crypto/twofish_generic.ko
385 FILES += \
386 $(LINUX_DIR)/crypto/blowfish_common.ko \
387 $(LINUX_DIR)/crypto/blowfish_generic.ko \
388 $(LINUX_DIR)/crypto/serpent_generic.ko
389 $(call AddDepends/crypto)
390 endef
391
392
393 define KernelPackage/crypto-misc/x86
394 FILES+=$(LINUX_DIR)/arch/x86/crypto/twofish-i586.ko
395 endef
396
397 $(eval $(call KernelPackage,crypto-misc))
398
399
400 define KernelPackage/crypto-ocf
401 TITLE:=OCF modules
402 DEPENDS:=+@OPENSSL_ENGINE_CRYPTO @!TARGET_uml +kmod-crypto-manager
403 KCONFIG:= \
404 CONFIG_OCF_OCF \
405 CONFIG_OCF_CRYPTODEV \
406 CONFIG_OCF_CRYPTOSOFT \
407 CONFIG_OCF_FIPS=y \
408 CONFIG_OCF_RANDOMHARVEST=y
409 FILES:= \
410 $(LINUX_DIR)/crypto/ocf/ocf.ko \
411 $(LINUX_DIR)/crypto/ocf/cryptodev.ko \
412 $(LINUX_DIR)/crypto/ocf/cryptosoft.ko
413 AUTOLOAD:=$(call AutoLoad,09, \
414 ocf \
415 cryptodev \
416 cryptosoft \
417 )
418 $(call AddDepends/crypto)
419 endef
420
421 $(eval $(call KernelPackage,crypto-ocf))
422
423
424 define KernelPackage/crypto-ocf-hifn7751
425 TITLE:=OCF support for Hifn 6500/7751/7811/795x, Invertex AEON and NetSec 7751 devices
426 DEPENDS:=+@OPENSSL_ENGINE_CRYPTO @PCI_SUPPORT @!TARGET_uml kmod-crypto-ocf
427 KCONFIG:=CONFIG_OCF_HIFN
428 FILES:=$(LINUX_DIR)/crypto/ocf/hifn/hifn7751.ko
429 AUTOLOAD:=$(call AutoLoad,10,hifn7751)
430 $(call AddDepends/crypto)
431 endef
432
433 $(eval $(call KernelPackage,crypto-ocf-hifn7751))
434
435
436 define KernelPackage/crypto-ocf-hifnhipp
437 TITLE:=OCF support for Hifn 7855/8155 devices
438 DEPENDS:=+@OPENSSL_ENGINE_CRYPTO @PCI_SUPPORT @!TARGET_uml kmod-crypto-ocf
439 KCONFIG:=CONFIG_OCF_HIFNHIPP
440 FILES:=$(LINUX_DIR)/crypto/ocf/hifn/hifnHIPP.ko
441 AUTOLOAD:=$(call AutoLoad,10,hifnHIPP)
442 $(call AddDepends/crypto)
443 endef
444
445 $(eval $(call KernelPackage,crypto-ocf-hifnhipp))
446
447
448 define KernelPackage/crypto-null
449 TITLE:=Null CryptoAPI module
450 KCONFIG:=CONFIG_CRYPTO_NULL
451 FILES:=$(LINUX_DIR)/crypto/crypto_null.ko
452 AUTOLOAD:=$(call AutoLoad,09,crypto_null)
453 $(call AddDepends/crypto)
454 endef
455
456 $(eval $(call KernelPackage,crypto-null))
457
458
459 define KernelPackage/crypto-test
460 TITLE:=Test CryptoAPI module
461 KCONFIG:=CONFIG_CRYPTO_TEST
462 FILES:=$(LINUX_DIR)/crypto/tcrypt.ko
463 $(call AddDepends/crypto)
464 endef
465
466 $(eval $(call KernelPackage,crypto-test))
467
468
469 define KernelPackage/crypto-xts
470 TITLE:=XTS cipher CryptoAPI module
471 DEPENDS:=+kmod-crypto-manager
472 KCONFIG:= \
473 CONFIG_CRYPTO_GF128MUL \
474 CONFIG_CRYPTO_XTS
475 FILES:= \
476 $(LINUX_DIR)/crypto/xts.ko \
477 $(LINUX_DIR)/crypto/gf128mul.ko
478 AUTOLOAD:=$(call AutoLoad,09, \
479 gf128mul \
480 xts \
481 )
482 $(call AddDepends/crypto)
483 endef
484
485 $(eval $(call KernelPackage,crypto-xts))
486
487 define KernelPackage/crypto-mv-cesa
488 TITLE:=Marvell crypto engine
489 DEPENDS:=+kmod-crypto-manager +kmod-crypto-aes @TARGET_kirkwood||TARGET_orion||TARGET_mvebu
490 KCONFIG:=CONFIG_CRYPTO_DEV_MV_CESA
491 FILES:=$(LINUX_DIR)/drivers/crypto/mv_cesa.ko
492 AUTOLOAD:=$(call AutoLoad,09,mv_cesa)
493 $(call AddDepends/crypto)
494 endef
495
496 $(eval $(call KernelPackage,crypto-mv-cesa))