aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/padlock-aes.c
diff options
context:
space:
mode:
authorMichal Ludvig <michal@logix.cz>2006-08-06 08:46:20 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2006-09-20 21:40:21 -0400
commit1191f0a49390caf16f4a2831a4fc373757471ad6 (patch)
tree8b92255ab82b777feade49a68cc0dc9691f1c665 /drivers/crypto/padlock-aes.c
parentb14cdd6704c96474ba5c74b5959487beaa5ee1cd (diff)
[CRYPTO] padlock: Get rid of padlock-generic.c
Merge padlock-generic.c into padlock-aes.c and compile AES as a standalone module. We won't make a monolithic padlock.ko with all supported algorithms, instead we'll compile each driver into its own module. Signed-off-by: Michal Ludvig <michal@logix.cz> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/padlock-aes.c')
-rw-r--r--drivers/crypto/padlock-aes.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c
index b643d71298a9..ee33bd6c1b77 100644
--- a/drivers/crypto/padlock-aes.c
+++ b/drivers/crypto/padlock-aes.c
@@ -495,15 +495,41 @@ static struct crypto_alg aes_alg = {
495 } 495 }
496}; 496};
497 497
498int __init padlock_init_aes(void) 498static int __init padlock_init(void)
499{ 499{
500 printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n"); 500 int ret;
501
502 if (!cpu_has_xcrypt) {
503 printk(KERN_ERR PFX "VIA PadLock not detected.\n");
504 return -ENODEV;
505 }
506
507 if (!cpu_has_xcrypt_enabled) {
508 printk(KERN_ERR PFX "VIA PadLock detected, but not enabled. Hmm, strange...\n");
509 return -ENODEV;
510 }
501 511
502 gen_tabs(); 512 gen_tabs();
503 return crypto_register_alg(&aes_alg); 513 if ((ret = crypto_register_alg(&aes_alg))) {
514 printk(KERN_ERR PFX "VIA PadLock AES initialization failed.\n");
515 return ret;
516 }
517
518 printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n");
519
520 return ret;
504} 521}
505 522
506void __exit padlock_fini_aes(void) 523static void __exit padlock_fini(void)
507{ 524{
508 crypto_unregister_alg(&aes_alg); 525 crypto_unregister_alg(&aes_alg);
509} 526}
527
528module_init(padlock_init);
529module_exit(padlock_fini);
530
531MODULE_DESCRIPTION("VIA PadLock AES algorithm support");
532MODULE_LICENSE("GPL");
533MODULE_AUTHOR("Michal Ludvig");
534
535MODULE_ALIAS("aes-padlock");