Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=946fef4e14ebc2f14ab05f54789843621fe87f60
Commit:     946fef4e14ebc2f14ab05f54789843621fe87f60
Parent:     2d94dfc8c38edf63e91e48fd55c3a8822b6a9ced
Author:     Herbert Xu <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 09:48:44 2008 +1100
Committer:  Herbert Xu <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 09:48:44 2008 +1100

    [CRYPTO] hifn795x: Disallow built-in hifn795x when HW_RANDOM is m
    
    Currently it is possible to select HW_RANDOM as a module and have
    hifn795x built-in.  This causes a build problem because hifn795x
    will then call hwrng_register which isn't built-in.
    
    This patch introduces a new config option to control the hifn795x
    RNG which lets us avoid this problem.
    
    Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
---
 drivers/crypto/Kconfig     |    8 +++++++-
 drivers/crypto/hifn_795x.c |    6 +++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 74bd599..8a70a9e 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -88,10 +88,16 @@ config CRYPTO_DEV_HIFN_795X
        select CRYPTO_DES
        select CRYPTO_ALGAPI
        select CRYPTO_BLKCIPHER
+       select HW_RANDOM if CRYPTO_DEV_HIFN_795X_RNG
        depends on PCI
        help
          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
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index 16413e5..dfbf24c 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -463,7 +463,7 @@ struct hifn_device
 
        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;
        ktime_t                 rngtime;
        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)
 {
        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",
                        dev->name);
 
-#if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE)
+#ifdef CRYPTO_DEV_HIFN_795X_RNG
        /* First value must be discarded */
        hifn_read_1(dev, HIFN_1_RNG_DATA);
        dev->rngtime = ktime_get();
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to