diff options
author | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2011-07-24 14:17:58 +0000 |
---|---|---|
committer | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2011-07-24 14:17:58 +0000 |
commit | 32dec7075aae5cc6ef1e4394dc94fed1767b848e (patch) | |
tree | d7b0162875a7ae451eed4ae42321f3f4d912c788 /target/linux/generic/files/crypto/ocf/hifn | |
parent | c3cc5459ecb9da60a4f90550d9031d7a67478f7a (diff) |
ocf-linux: version bump to 20110720
Fixes problem with TFM allocation in cryptosoft.c
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Hauke:
* remove ubsec_ssb package and take it from ocf-linux
* use patches from ocf-linux package
* refresh all patches
* readd some build fixes for OpenWrt.
* readd CRYPTO_MANAGER dependency
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27753 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/files/crypto/ocf/hifn')
-rw-r--r-- | target/linux/generic/files/crypto/ocf/hifn/hifn7751.c | 37 | ||||
-rw-r--r-- | target/linux/generic/files/crypto/ocf/hifn/hifn7751var.h | 1 | ||||
-rw-r--r-- | target/linux/generic/files/crypto/ocf/hifn/hifnHIPP.c | 9 |
3 files changed, 9 insertions, 38 deletions
diff --git a/target/linux/generic/files/crypto/ocf/hifn/hifn7751.c b/target/linux/generic/files/crypto/ocf/hifn/hifn7751.c index ad704c7fa..4803a83a5 100644 --- a/target/linux/generic/files/crypto/ocf/hifn/hifn7751.c +++ b/target/linux/generic/files/crypto/ocf/hifn/hifn7751.c @@ -47,10 +47,8 @@ __FBSDID("$FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.40 2007/03/21 03:42:49 sam E * Driver for various Hifn encryption processors. */ #include <linux/version.h> -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) -#include <generated/autoconf.h> -#else -#include <linux/autoconf.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +#include <linux/config.h> #endif #include <linux/module.h> #include <linux/init.h> @@ -63,7 +61,6 @@ __FBSDID("$FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.40 2007/03/21 03:42:49 sam E #include <linux/interrupt.h> #include <linux/spinlock.h> #include <linux/random.h> -#include <linux/version.h> #include <linux/skbuff.h> #include <asm/io.h> @@ -437,7 +434,7 @@ hifn_probe(struct pci_dev *dev, const struct pci_device_id *ent) if (pci_enable_device(dev) < 0) return(-ENODEV); -#ifdef CONFIG_HAVE_PCI_SET_MWI +#ifdef HAVE_PCI_SET_MWI if (pci_set_mwi(dev)) return(-ENODEV); #endif @@ -873,7 +870,7 @@ hifn_set_retry(struct hifn_softc *sc) DPRINTF("%s()\n", __FUNCTION__); /* NB: RETRY only responds to 8-bit reads/writes */ pci_write_config_byte(sc->sc_pcidev, HIFN_RETRY_TIMEOUT, 0); - pci_write_config_dword(sc->sc_pcidev, HIFN_TRDY_TIMEOUT, 0); + pci_write_config_byte(sc->sc_pcidev, HIFN_TRDY_TIMEOUT, 0); /* piggy back the cache line setting here */ pci_write_config_byte(sc->sc_pcidev, PCI_CACHE_LINE_SIZE, hifn_cache_linesize); } @@ -2380,11 +2377,6 @@ hifn_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri) case CRYPTO_DES_CBC: case CRYPTO_3DES_CBC: case CRYPTO_AES_CBC: - /* XXX this may read fewer, does it matter? */ - read_random(ses->hs_iv, - c->cri_alg == CRYPTO_AES_CBC ? - HIFN_AES_IV_LENGTH : HIFN_IV_LENGTH); - /*FALLTHROUGH*/ case CRYPTO_ARC4: if (cry) { DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__); @@ -2580,8 +2572,7 @@ hifn_process(device_t dev, struct cryptop *crp, int hint) if (enccrd->crd_flags & CRD_F_IV_EXPLICIT) bcopy(enccrd->crd_iv, cmd->iv, ivlen); else - bcopy(sc->sc_sessions[session].hs_iv, - cmd->iv, ivlen); + read_random(cmd->iv, ivlen); if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0) { @@ -2786,7 +2777,7 @@ hifn_callback(struct hifn_softc *sc, struct hifn_command *cmd, u_int8_t *macbuf) struct hifn_dma *dma = sc->sc_dma; struct cryptop *crp = cmd->crp; struct cryptodesc *crd; - int i, u, ivlen; + int i, u; DPRINTF("%s()\n", __FUNCTION__); @@ -2851,22 +2842,6 @@ hifn_callback(struct hifn_softc *sc, struct hifn_command *cmd, u_int8_t *macbuf) hifnstats.hst_obytes += cmd->dst_mapsize; - if ((cmd->base_masks & (HIFN_BASE_CMD_CRYPT | HIFN_BASE_CMD_DECODE)) == - HIFN_BASE_CMD_CRYPT) { - for (crd = crp->crp_desc; crd; crd = crd->crd_next) { - if (crd->crd_alg != CRYPTO_DES_CBC && - crd->crd_alg != CRYPTO_3DES_CBC && - crd->crd_alg != CRYPTO_AES_CBC) - continue; - ivlen = ((crd->crd_alg == CRYPTO_AES_CBC) ? - HIFN_AES_IV_LENGTH : HIFN_IV_LENGTH); - crypto_copydata(crp->crp_flags, crp->crp_buf, - crd->crd_skip + crd->crd_len - ivlen, ivlen, - cmd->softc->sc_sessions[cmd->session_num].hs_iv); - break; - } - } - if (macbuf != NULL) { for (crd = crp->crp_desc; crd; crd = crd->crd_next) { int len; diff --git a/target/linux/generic/files/crypto/ocf/hifn/hifn7751var.h b/target/linux/generic/files/crypto/ocf/hifn/hifn7751var.h index 9a5f2319d..c5d30f962 100644 --- a/target/linux/generic/files/crypto/ocf/hifn/hifn7751var.h +++ b/target/linux/generic/files/crypto/ocf/hifn/hifn7751var.h @@ -113,7 +113,6 @@ struct hifn_dma { struct hifn_session { int hs_used; int hs_mlen; - u_int8_t hs_iv[HIFN_MAX_IV_LENGTH]; }; #define HIFN_RING_SYNC(sc, r, i, f) \ diff --git a/target/linux/generic/files/crypto/ocf/hifn/hifnHIPP.c b/target/linux/generic/files/crypto/ocf/hifn/hifnHIPP.c index cdc23e926..5bb560256 100644 --- a/target/linux/generic/files/crypto/ocf/hifn/hifnHIPP.c +++ b/target/linux/generic/files/crypto/ocf/hifn/hifnHIPP.c @@ -33,10 +33,8 @@ * Driver for various Hifn encryption processors. */ #include <linux/version.h> -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) -#include <generated/autoconf.h> -#else -#include <linux/autoconf.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED) +#include <linux/config.h> #endif #include <linux/module.h> #include <linux/init.h> @@ -49,7 +47,6 @@ #include <linux/interrupt.h> #include <linux/spinlock.h> #include <linux/random.h> -#include <linux/version.h> #include <linux/skbuff.h> #include <linux/uio.h> #include <linux/sysfs.h> @@ -211,7 +208,7 @@ hipp_probe(struct pci_dev *dev, const struct pci_device_id *ent) if (pci_enable_device(dev) < 0) return(-ENODEV); -#ifdef CONFIG_HAVE_PCI_SET_MWI +#ifdef HAVE_PCI_SET_MWI if (pci_set_mwi(dev)) return(-ENODEV); #endif |