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