diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:15:23 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:15:23 -0500 |
| commit | 50d9a126240f9961cfdd063336bbeb91f77a7dce (patch) | |
| tree | 7e9c306cc49ad11e9e23cd4616591f323d9ff5cc | |
| parent | 29bd17af7d8ffc16bb5eb286947495c166ea826e (diff) | |
| parent | 946fef4e14ebc2f14ab05f54789843621fe87f60 (diff) | |
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
| -rw-r--r-- | drivers/crypto/Kconfig | 8 | ||||
| -rw-r--r-- | drivers/crypto/hifn_795x.c | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 74bd599dfb0c..8a70a9edabda 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig | |||
| @@ -88,10 +88,16 @@ config CRYPTO_DEV_HIFN_795X | |||
| 88 | select CRYPTO_DES | 88 | select CRYPTO_DES |
| 89 | select CRYPTO_ALGAPI | 89 | select CRYPTO_ALGAPI |
| 90 | select CRYPTO_BLKCIPHER | 90 | select CRYPTO_BLKCIPHER |
| 91 | select HW_RANDOM if CRYPTO_DEV_HIFN_795X_RNG | ||
| 91 | depends on PCI | 92 | depends on PCI |
| 92 | help | 93 | help |
| 93 | This option allows you to have support for HIFN 795x crypto adapters. | 94 | This option allows you to have support for HIFN 795x crypto adapters. |
| 94 | 95 | ||
| 95 | 96 | config CRYPTO_DEV_HIFN_795X_RNG | |
| 97 | bool "HIFN 795x random number generator" | ||
| 98 | depends on CRYPTO_DEV_HIFN_795X | ||
| 99 | help | ||
| 100 | Select this option if you want to enable the random number generator | ||
| 101 | on the HIFN 795x crypto adapters. | ||
| 96 | 102 | ||
| 97 | endif # CRYPTO_HW | 103 | endif # CRYPTO_HW |
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index 16413e57597c..dfbf24c4033c 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c | |||
| @@ -463,7 +463,7 @@ struct hifn_device | |||
| 463 | 463 | ||
| 464 | unsigned int pk_clk_freq; | 464 | unsigned int pk_clk_freq; |
| 465 | 465 | ||
| 466 | #if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE) | 466 | #ifdef CRYPTO_DEV_HIFN_795X_RNG |
| 467 | unsigned int rng_wait_time; | 467 | unsigned int rng_wait_time; |
| 468 | ktime_t rngtime; | 468 | ktime_t rngtime; |
| 469 | struct hwrng rng; | 469 | struct hwrng rng; |
| @@ -795,7 +795,7 @@ static struct pci2id { | |||
| 795 | } | 795 | } |
| 796 | }; | 796 | }; |
| 797 | 797 | ||
| 798 | #if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE) | 798 | #ifdef CRYPTO_DEV_HIFN_795X_RNG |
| 799 | static int hifn_rng_data_present(struct hwrng *rng, int wait) | 799 | static int hifn_rng_data_present(struct hwrng *rng, int wait) |
| 800 | { | 800 | { |
| 801 | struct hifn_device *dev = (struct hifn_device *)rng->priv; | 801 | struct hifn_device *dev = (struct hifn_device *)rng->priv; |
| @@ -880,7 +880,7 @@ static int hifn_init_pubrng(struct hifn_device *dev) | |||
| 880 | dprintk("Chip %s: RNG engine has been successfully initialised.\n", | 880 | dprintk("Chip %s: RNG engine has been successfully initialised.\n", |
| 881 | dev->name); | 881 | dev->name); |
| 882 | 882 | ||
| 883 | #if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE) | 883 | #ifdef CRYPTO_DEV_HIFN_795X_RNG |
| 884 | /* First value must be discarded */ | 884 | /* First value must be discarded */ |
| 885 | hifn_read_1(dev, HIFN_1_RNG_DATA); | 885 | hifn_read_1(dev, HIFN_1_RNG_DATA); |
| 886 | dev->rngtime = ktime_get(); | 886 | dev->rngtime = ktime_get(); |
