linux: convert CompareKernelPatchVer to version tagged symbols
[openwrt/svn-archive/archive.git] / package / kernel / linux / modules / crypto.mk
index 4f9517f4f945f8645d199b819c4273fd2765bc62..4df2d7393acb27265c0d1e6c2c1668ed3b00e4d6 100644 (file)
@@ -7,11 +7,8 @@
 
 CRYPTO_MENU:=Cryptographic API modules
 
-CRYPTO_MODULES = ALGAPI2=crypto_algapi
-
-CRYPTOMGR_MODULES = \
-       AEAD2=aead \
-       MANAGER2=cryptomgr \
+CRYPTO_MODULES = \
+       ALGAPI2=crypto_algapi \
        BLKCIPHER2=crypto_blkcipher
 
 crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1)))
@@ -24,11 +21,12 @@ define KernelPackage/crypto-core
   KCONFIG:= \
        CONFIG_CRYPTO=y \
        CONFIG_CRYPTO_HW=y \
+       CONFIG_CRYPTO_BLKCIPHER \
        CONFIG_CRYPTO_ALGAPI \
        $(foreach mod,$(CRYPTO_MODULES),$(call crypto_confvar,$(mod)))
   FILES:=$(foreach mod,$(CRYPTO_MODULES),$(call crypto_file,$(mod)))
-  AUTOLOAD:=$(call AutoLoad,01,$(foreach mod,$(CRYPTO_MODULES),$(call crypto_name,$(mod))),1)
 endef
+
 $(eval $(call KernelPackage,crypto-core))
 
 
@@ -37,29 +35,43 @@ define AddDepends/crypto
   DEPENDS+=+kmod-crypto-core $(1)
 endef
 
+define KernelPackage/crypto-aead
+  TITLE:=CryptoAPI AEAD support
+  KCONFIG:= \
+       CONFIG_CRYPTO_AEAD \
+       CONFIG_CRYPTO_AEAD2
+  FILES:=$(LINUX_DIR)/crypto/aead.ko
+  AUTOLOAD:=$(call AutoLoad,09,crypto_aead,1)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-aead))
+
+
 define KernelPackage/crypto-hash
   TITLE:=CryptoAPI hash support
-  KCONFIG:=CONFIG_CRYPTO_HASH2
+  KCONFIG:=CONFIG_CRYPTO_HASH
   FILES:=$(LINUX_DIR)/crypto/crypto_hash.ko
   AUTOLOAD:=$(call AutoLoad,02,crypto_hash,1)
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-hash))
 
+
 define KernelPackage/crypto-manager
   TITLE:=CryptoAPI algorithm manager
-  DEPENDS:=+kmod-crypto-hash
+  DEPENDS:=+kmod-crypto-aead +kmod-crypto-hash +kmod-crypto-pcompress
   KCONFIG:= \
-       CONFIG_CRYPTO_AEAD \
-       CONFIG_CRYPTO_BLKCIPHER \
        CONFIG_CRYPTO_MANAGER \
-       $(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_confvar,$(mod)))
-  FILES:=$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_file,$(mod)))
-  AUTOLOAD:=$(call AutoLoad,03,$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_name,$(mod))))
+       CONFIG_CRYPTO_MANAGER2
+  FILES:=$(LINUX_DIR)/crypto/cryptomgr.ko
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-manager))
 
+
 define KernelPackage/crypto-pcompress
   TITLE:=CryptoAPI Partial (de)compression operations
   KCONFIG:= \
@@ -69,8 +81,10 @@ define KernelPackage/crypto-pcompress
   AUTOLOAD:=$(call AutoLoad,09,pcompress)
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-pcompress))
 
+
 define KernelPackage/crypto-user
   TITLE:=CryptoAPI userspace interface
   DEPENDS:=+kmod-crypto-hash +kmod-crypto-manager
@@ -85,8 +99,10 @@ define KernelPackage/crypto-user
   AUTOLOAD:=$(call AutoLoad,09,af_alg algif_hash algif_skcipher)
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-user))
 
+
 define KernelPackage/crypto-wq
   TITLE:=CryptoAPI work queue handling
   KCONFIG:=CONFIG_CRYPTO_WORKQUEUE
@@ -105,8 +121,10 @@ define KernelPackage/crypto-rng
   AUTOLOAD:=$(call AutoLoad,09,rng krng)
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-rng))
 
+
 define KernelPackage/crypto-iv
   TITLE:=CryptoAPI initialization vectors
   DEPENDS:=+kmod-crypto-manager +kmod-crypto-rng +kmod-crypto-wq
@@ -117,11 +135,24 @@ define KernelPackage/crypto-iv
   AUTOLOAD:=$(call AutoLoad,10,eseqiv chainiv)
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-iv))
 
+define KernelPackage/crypto-seqiv
+  TITLE:=CryptoAPI Sequence Number IV Generator
+  DEPENDS:=+kmod-crypto-aead +kmod-crypto-rng
+  KCONFIG:=CONFIG_CRYPTO_SEQIV
+  FILES:=$(LINUX_DIR)/crypto/seqiv.ko
+  AUTOLOAD:=$(call AutoLoad,09,seqiv)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-seqiv))
+
+
 define KernelPackage/crypto-hw-talitos
   TITLE:=Freescale integrated security engine (SEC) driver
-  DEPENDS:=+kmod-crypto-aes +kmod-crypto-manager +kmod-crypto-hash +kmod-random-core
+  DEPENDS:=+kmod-crypto-aes +kmod-crypto-manager +kmod-crypto-hash +kmod-random-core +kmod-crypto-authenc
   KCONFIG:= \
        CONFIG_CRYPTO_DEV_TALITOS
   FILES:= \
@@ -194,6 +225,35 @@ endef
 $(eval $(call KernelPackage,crypto-hw-ppc4xx))
 
 
+define KernelPackage/crypto-hw-omap
+  TITLE:=TI OMAP hardware crypto modules
+  DEPENDS:=@TARGET_omap
+  KCONFIG:= \
+       CONFIG_CRYPTO_DEV_OMAP_AES \
+       CONFIG_CRYPTO_DEV_OMAP_DES \
+       CONFIG_CRYPTO_DEV_OMAP_SHAM
+ifneq ($(wildcard $(LINUX_DIR)/drivers/crypto/omap-des.ko),)
+  FILES:= \
+       $(LINUX_DIR)/drivers/crypto/omap-aes.ko \
+       $(LINUX_DIR)/drivers/crypto/omap-des.ko \
+       $(LINUX_DIR)/drivers/crypto/omap-sham.ko
+  AUTOLOAD:=$(call AutoLoad,90,omap-aes omap-des omap-sham)
+else
+  FILES:= \
+       $(LINUX_DIR)/drivers/crypto/omap-aes.ko \
+       $(LINUX_DIR)/drivers/crypto/omap-sham.ko
+  AUTOLOAD:=$(call AutoLoad,90,omap-aes omap-sham)
+endif
+  $(call AddDepends/crypto,+kmod-crypto-manager +kmod-crypto-hash)
+endef
+
+define KernelPackage/crypto-hw-omap/description
+  Kernel support for the TI OMAP HW crypto engine.
+endef
+
+$(eval $(call KernelPackage,crypto-hw-omap))
+
+
 define KernelPackage/crypto-aes
   TITLE:=AES cipher CryptoAPI module
   KCONFIG:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
@@ -204,7 +264,7 @@ endef
 
 define KernelPackage/crypto-aes/x86
   FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.ko
-  AUTOLOAD:=$(call AutoLoad,09,aes_generic aes-i586)
+  AUTOLOAD:=$(call AutoLoad,09,aes-i586)
 endef
 
 $(eval $(call KernelPackage,crypto-aes))
@@ -215,7 +275,7 @@ define KernelPackage/crypto-arc4
   KCONFIG:=CONFIG_CRYPTO_ARC4
   FILES:=$(LINUX_DIR)/crypto/arc4.ko
   AUTOLOAD:=$(call AutoLoad,09,arc4)
-  $(call AddDepends/crypto,+!LINUX_3_3:kmod-crypto-manager)
+  $(call AddDepends/crypto)
 endef
 
 $(eval $(call KernelPackage,crypto-arc4))
@@ -243,17 +303,42 @@ endef
 
 $(eval $(call KernelPackage,crypto-cbc))
 
+define KernelPackage/crypto-ctr
+  TITLE:=Counter Mode CryptoAPI module
+  DEPENDS:=+kmod-crypto-manager +kmod-crypto-seqiv
+  KCONFIG:=CONFIG_CRYPTO_CTR
+  FILES:=$(LINUX_DIR)/crypto/ctr.ko
+  AUTOLOAD:=$(call AutoLoad,09,ctr)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-ctr))
+
+define KernelPackage/crypto-pcbc
+  TITLE:=Propagating Cipher Block Chaining CryptoAPI module
+  DEPENDS:=+kmod-crypto-manager
+  KCONFIG:=CONFIG_CRYPTO_PCBC
+  FILES:=$(LINUX_DIR)/crypto/pcbc.ko
+  AUTOLOAD:=$(call AutoLoad,09,pcbc)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-pcbc))
+
 define KernelPackage/crypto-crc32c
   TITLE:=CRC32c CRC module
   DEPENDS:=+kmod-crypto-hash
   KCONFIG:=CONFIG_CRYPTO_CRC32C
-  FILES:=$(LINUX_DIR)/crypto/crc32c.ko
-  AUTOLOAD:=$(call AutoLoad,04,crc32c,1)
+  FILES:= \
+       $(LINUX_DIR)/crypto/crc32c.ko@lt3.15 \
+       $(LINUX_DIR)/crypto/crc32c_generic.ko@ge3.15
+  AUTOLOAD:=$(call AutoLoad,04,crc32c@lt3.15 crc32c_generic@ge3.15,1)
   $(call AddDepends/crypto)
 endef
 
 $(eval $(call KernelPackage,crypto-crc32c))
 
+
 define KernelPackage/crypto-des
   TITLE:=DES/3DES cipher CryptoAPI module
   KCONFIG:=CONFIG_CRYPTO_DES
@@ -264,6 +349,7 @@ endef
 
 $(eval $(call KernelPackage,crypto-des))
 
+
 define KernelPackage/crypto-deflate
   TITLE:=Deflate compression CryptoAPI module
   DEPENDS:=+kmod-lib-zlib
@@ -275,6 +361,17 @@ endef
 
 $(eval $(call KernelPackage,crypto-deflate))
 
+
+define KernelPackage/crypto-fcrypt
+  TITLE:=FCRYPT cipher CryptoAPI module
+  KCONFIG:=CONFIG_CRYPTO_FCRYPT
+  FILES:=$(LINUX_DIR)/crypto/fcrypt.ko
+  AUTOLOAD:=$(call AutoLoad,09,fcrypt)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-fcrypt))
+
 define KernelPackage/crypto-ecb
   TITLE:=Electronic CodeBook CryptoAPI module
   DEPENDS:=+kmod-crypto-manager
@@ -300,6 +397,41 @@ endef
 $(eval $(call KernelPackage,crypto-hmac))
 
 
+define KernelPackage/crypto-gcm
+  TITLE:=GCM/GMAC CryptoAPI module
+  DEPENDS:=+kmod-crypto-ctr +kmod-crypto-ghash +kmod-crypto-null
+  KCONFIG:=CONFIG_CRYPTO_GCM
+  FILES:=$(LINUX_DIR)/crypto/gcm.ko
+  AUTOLOAD:=$(call AutoLoad,09,gcm)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-gcm))
+
+
+define KernelPackage/crypto-gf128
+  TITLE:=GF(2^128) multiplication functions CryptoAPI module
+  KCONFIG:=CONFIG_CRYPTO_GF128MUL
+  FILES:=$(LINUX_DIR)/crypto/gf128mul.ko
+  AUTOLOAD:=$(call AutoLoad,09,gf128mul)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-gf128))
+
+
+define KernelPackage/crypto-ghash
+  TITLE:=GHASH digest CryptoAPI module
+  DEPENDS:=+kmod-crypto-gf128 +kmod-crypto-hash
+  KCONFIG:=CONFIG_CRYPTO_GHASH
+  FILES:=$(LINUX_DIR)/crypto/ghash-generic.ko
+  AUTOLOAD:=$(call AutoLoad,09,ghash-generic)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-ghash))
+
+
 define KernelPackage/crypto-md4
   TITLE:=MD4 digest CryptoAPI module
   DEPENDS:=+kmod-crypto-hash
@@ -347,6 +479,7 @@ endef
 
 $(eval $(call KernelPackage,crypto-sha1))
 
+
 define KernelPackage/crypto-sha256
   TITLE:=SHA224 SHA256 digest CryptoAPI module
   DEPENDS:=+kmod-crypto-hash
@@ -358,12 +491,6 @@ endef
 
 $(eval $(call KernelPackage,crypto-sha256))
 
-ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.6.0)),1)
-camellia_mod_suffix=_generic
-endif
-ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.7.0)),1)
-cast56_mod_suffix=_generic
-endif
 
 define KernelPackage/crypto-misc
   TITLE:=Other CryptoAPI modules
@@ -386,11 +513,10 @@ define KernelPackage/crypto-misc
        CONFIG_CRYPTO_WP512
   FILES:= \
        $(LINUX_DIR)/crypto/anubis.ko \
-       $(LINUX_DIR)/crypto/camellia$(camellia_mod_suffix).ko \
-       $(if $(call kernel_patchver_ge,3.7),$(LINUX_DIR)/crypto/cast_common.ko) \
-       $(LINUX_DIR)/crypto/cast5$(cast56_mod_suffix).ko \
-       $(LINUX_DIR)/crypto/cast6$(cast56_mod_suffix).ko \
-       $(LINUX_DIR)/crypto/fcrypt.ko \
+       $(LINUX_DIR)/crypto/camellia_generic.ko \
+       $(LINUX_DIR)/crypto/cast_common.ko \
+       $(LINUX_DIR)/crypto/cast5_generic.ko \
+       $(LINUX_DIR)/crypto/cast6_generic.ko \
        $(LINUX_DIR)/crypto/khazad.ko \
        $(LINUX_DIR)/crypto/sha512_generic.ko \
        $(LINUX_DIR)/crypto/tea.ko \
@@ -404,7 +530,6 @@ define KernelPackage/crypto-misc
   $(call AddDepends/crypto)
 endef
 
-
 define KernelPackage/crypto-misc/x86
   FILES+=$(LINUX_DIR)/arch/x86/crypto/twofish-i586.ko
 endef
@@ -483,22 +608,16 @@ $(eval $(call KernelPackage,crypto-test))
 
 define KernelPackage/crypto-xts
   TITLE:=XTS cipher CryptoAPI module
-  DEPENDS:=+kmod-crypto-manager
-  KCONFIG:= \
-       CONFIG_CRYPTO_GF128MUL \
-       CONFIG_CRYPTO_XTS
-  FILES:= \
-       $(LINUX_DIR)/crypto/xts.ko \
-       $(LINUX_DIR)/crypto/gf128mul.ko
-  AUTOLOAD:=$(call AutoLoad,09, \
-       gf128mul \
-       xts \
-  )
+  DEPENDS:=+kmod-crypto-gf128 +kmod-crypto-manager
+  KCONFIG:=CONFIG_CRYPTO_XTS
+  FILES:=$(LINUX_DIR)/crypto/xts.ko
+  AUTOLOAD:=$(call AutoLoad,09,xts)
   $(call AddDepends/crypto)
 endef
 
 $(eval $(call KernelPackage,crypto-xts))
 
+
 define KernelPackage/crypto-mv-cesa
   TITLE:=Marvell crypto engine
   DEPENDS:=+kmod-crypto-manager +kmod-crypto-aes @TARGET_kirkwood||TARGET_orion||TARGET_mvebu