Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: [CRYPTO] hifn795x: Disallow built-in hifn795x when HW_RANDOM is m
This commit is contained in:
commit
50d9a12624
|
@ -88,10 +88,16 @@ config CRYPTO_DEV_HIFN_795X
|
||||||
select CRYPTO_DES
|
select CRYPTO_DES
|
||||||
select CRYPTO_ALGAPI
|
select CRYPTO_ALGAPI
|
||||||
select CRYPTO_BLKCIPHER
|
select CRYPTO_BLKCIPHER
|
||||||
|
select HW_RANDOM if CRYPTO_DEV_HIFN_795X_RNG
|
||||||
depends on PCI
|
depends on PCI
|
||||||
help
|
help
|
||||||
This option allows you to have support for HIFN 795x crypto adapters.
|
This option allows you to have support for HIFN 795x crypto adapters.
|
||||||
|
|
||||||
|
config CRYPTO_DEV_HIFN_795X_RNG
|
||||||
|
bool "HIFN 795x random number generator"
|
||||||
|
depends on CRYPTO_DEV_HIFN_795X
|
||||||
|
help
|
||||||
|
Select this option if you want to enable the random number generator
|
||||||
|
on the HIFN 795x crypto adapters.
|
||||||
|
|
||||||
endif # CRYPTO_HW
|
endif # CRYPTO_HW
|
||||||
|
|
|
@ -463,7 +463,7 @@ struct hifn_device
|
||||||
|
|
||||||
unsigned int pk_clk_freq;
|
unsigned int pk_clk_freq;
|
||||||
|
|
||||||
#if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE)
|
#ifdef CRYPTO_DEV_HIFN_795X_RNG
|
||||||
unsigned int rng_wait_time;
|
unsigned int rng_wait_time;
|
||||||
ktime_t rngtime;
|
ktime_t rngtime;
|
||||||
struct hwrng rng;
|
struct hwrng rng;
|
||||||
|
@ -795,7 +795,7 @@ static struct pci2id {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE)
|
#ifdef CRYPTO_DEV_HIFN_795X_RNG
|
||||||
static int hifn_rng_data_present(struct hwrng *rng, int wait)
|
static int hifn_rng_data_present(struct hwrng *rng, int wait)
|
||||||
{
|
{
|
||||||
struct hifn_device *dev = (struct hifn_device *)rng->priv;
|
struct hifn_device *dev = (struct hifn_device *)rng->priv;
|
||||||
|
@ -880,7 +880,7 @@ static int hifn_init_pubrng(struct hifn_device *dev)
|
||||||
dprintk("Chip %s: RNG engine has been successfully initialised.\n",
|
dprintk("Chip %s: RNG engine has been successfully initialised.\n",
|
||||||
dev->name);
|
dev->name);
|
||||||
|
|
||||||
#if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE)
|
#ifdef CRYPTO_DEV_HIFN_795X_RNG
|
||||||
/* First value must be discarded */
|
/* First value must be discarded */
|
||||||
hifn_read_1(dev, HIFN_1_RNG_DATA);
|
hifn_read_1(dev, HIFN_1_RNG_DATA);
|
||||||
dev->rngtime = ktime_get();
|
dev->rngtime = ktime_get();
|
||||||
|
|
Loading…
Reference in a new issue