[kernel] modules/crypto: package AMCC ppc4xx hardware crypto driver
[openwrt.git] / package / kernel / modules / crypto.mk
index 99a80bf..f75ebe9 100644 (file)
@@ -4,7 +4,6 @@
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-# $Id$
 
 CRYPTO_MENU:=Cryptographic API modules
 
@@ -29,16 +28,27 @@ endif
 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.26)),1)
   SHA512_SUFFIX:=$(CRYPTO_GENERIC)
 endif
+AEAD_CONF:=AEAD
+MANAGER_CONF:=MANAGER
+BLKCIPHER_CONF:=BLKCIPHER
+HASH_CONF:=HASH
+ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.30)),1)
+  CRYPTO_MODULE_PCOMPRESS:=PCOMP=pcompress
+  AEAD_CONF:=AEAD2
+  MANAGER_CONF:=MANAGER2
+  BLKCIPHER_CONF:=BLKCIPHER2
+  HASH_CONF:=HASH2
+endif
 
 CRYPTO_MODULES = \
        ALGAPI=crypto_algapi \
-       AEAD=aead \
-       BLKCIPHER=$(BLKCIPHER_PREFIX)blkcipher \
-       MANAGER=cryptomgr \
-       HASH=crypto_hash \
+       $(AEAD_CONF)=aead \
+       $(CRYPTO_MODULE_PCOMPRESS) \
+       $(BLKCIPHER_CONF)=$(BLKCIPHER_PREFIX)blkcipher \
+       $(HASH_CONF)=crypto_hash \
+       $(MANAGER_CONF)=cryptomgr \
        CBC=cbc \
        ECB=ecb \
-       HMAC=hmac \
        DEFLATE=deflate
 
 crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1)))
@@ -50,7 +60,7 @@ crypto_name=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(word 2,$(subs
 define KernelPackage/crypto-core
   SUBMENU:=$(CRYPTO_MENU)
   TITLE:=Core CryptoAPI modules
-  KCONFIG:=CONFIG_CRYPTO=y $(foreach mod,$(CRYPTO_MODULES),$(call crypto_confvar,$(mod)))
+  KCONFIG:=CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC $(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))))
 endef
@@ -115,7 +125,9 @@ define KernelPackage/crypto-hw-ixp4xx
   TITLE:=Intel IXP4xx hardware crypto module
   DEPENDS:= \
        @TARGET_ixp4xx +kmod-crypto-core +kmod-crypto-des +kmod-crypto-authenc
-  KCONFIG:= CONFIG_CRYPTO_DEV_IXP4XX
+  KCONFIG:= \
+       CONFIG_CRYPTO_HW=y \
+       CONFIG_CRYPTO_DEV_IXP4XX
   FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.$(LINUX_KMOD_SUFFIX)
   AUTOLOAD:=$(call AutoLoad,90,ixp4xx_crypto)
 endef
@@ -127,17 +139,35 @@ endef
 $(eval $(call KernelPackage,crypto-hw-ixp4xx))
 
 
+define KernelPackage/crypto-hw-ppc4xx
+  SUBMENU:=$(CRYPTO_MENU)
+  TITLE:=AMCC PPC4xx hardware crypto module
+  DEPENDS:= \
+       @TARGET_ppc40x||TARGET_ppc44x +kmod-crypto-core
+  KCONFIG:= \
+       CONFIG_CRYPTO_HW=y \
+       CONFIG_CRYPTO_DEV_PPC4XX
+  FILES:=$(LINUX_DIR)/drivers/crypto/amcc/crypto4xx.$(LINUX_KMOD_SUFFIX)
+  AUTOLOAD:=$(call AutoLoad,90,crypto4xx)
+endef
+
+define KernelPackage/crypto-hw-ppc4xx/description
+  Kernel support for the AMCC PPC4xx HW crypto engine.
+endef
+
+$(eval $(call KernelPackage,crypto-hw-ppc4xx))
+
+
 define KernelPackage/crypto-aes
   SUBMENU:=$(CRYPTO_MENU)
   TITLE:=AES cipher CryptoAPI module
   DEPENDS:=+kmod-crypto-core
-  KCONFIG:=CONFIG_CRYPTO_AES
+  KCONFIG:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
   FILES:=$(LINUX_DIR)/crypto/aes$(AES_SUFFIX).$(LINUX_KMOD_SUFFIX)
   AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX))
 endef
 
 define KernelPackage/crypto-aes/x86-2.6
-  KCONFIG+=CONFIG_CRYPTO_AES_586
   FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.$(LINUX_KMOD_SUFFIX)
   AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX) aes-i586)
 endef