aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto/zcrypt_api.c
diff options
context:
space:
mode:
authorFelix Beck <felix.beck@de.ibm.com>2008-04-17 01:46:28 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-17 01:47:06 -0400
commit1749a81d629b1295b38071914728cc2e72066f4d (patch)
tree8918ddaa31fe27bb385fd70b8bd03cc6dbb9782a /drivers/s390/crypto/zcrypt_api.c
parent3f12ebce6a004c8e9bf639801842f67e578ee7c6 (diff)
[S390] zcrypt: Comments and kernel-doc cleanup
Comments, which suggested to be kernel-doc but were not in the right formatting, have been corrected. Additionally some minor cleanup in the comments has been done. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/zcrypt_api.c')
-rw-r--r--drivers/s390/crypto/zcrypt_api.c63
1 files changed, 46 insertions, 17 deletions
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c
index b2740ff2e615..4d36e805a234 100644
--- a/drivers/s390/crypto/zcrypt_api.c
+++ b/drivers/s390/crypto/zcrypt_api.c
@@ -40,7 +40,7 @@
40 40
41#include "zcrypt_api.h" 41#include "zcrypt_api.h"
42 42
43/** 43/*
44 * Module description. 44 * Module description.
45 */ 45 */
46MODULE_AUTHOR("IBM Corporation"); 46MODULE_AUTHOR("IBM Corporation");
@@ -56,7 +56,7 @@ static atomic_t zcrypt_open_count = ATOMIC_INIT(0);
56static int zcrypt_rng_device_add(void); 56static int zcrypt_rng_device_add(void);
57static void zcrypt_rng_device_remove(void); 57static void zcrypt_rng_device_remove(void);
58 58
59/** 59/*
60 * Device attributes common for all crypto devices. 60 * Device attributes common for all crypto devices.
61 */ 61 */
62static ssize_t zcrypt_type_show(struct device *dev, 62static ssize_t zcrypt_type_show(struct device *dev,
@@ -103,6 +103,9 @@ static struct attribute_group zcrypt_device_attr_group = {
103}; 103};
104 104
105/** 105/**
106 * __zcrypt_increase_preference(): Increase preference of a crypto device.
107 * @zdev: Pointer the crypto device
108 *
106 * Move the device towards the head of the device list. 109 * Move the device towards the head of the device list.
107 * Need to be called while holding the zcrypt device list lock. 110 * Need to be called while holding the zcrypt device list lock.
108 * Note: cards with speed_rating of 0 are kept at the end of the list. 111 * Note: cards with speed_rating of 0 are kept at the end of the list.
@@ -129,6 +132,9 @@ static void __zcrypt_increase_preference(struct zcrypt_device *zdev)
129} 132}
130 133
131/** 134/**
135 * __zcrypt_decrease_preference(): Decrease preference of a crypto device.
136 * @zdev: Pointer to a crypto device.
137 *
132 * Move the device towards the tail of the device list. 138 * Move the device towards the tail of the device list.
133 * Need to be called while holding the zcrypt device list lock. 139 * Need to be called while holding the zcrypt device list lock.
134 * Note: cards with speed_rating of 0 are kept at the end of the list. 140 * Note: cards with speed_rating of 0 are kept at the end of the list.
@@ -202,7 +208,10 @@ void zcrypt_device_free(struct zcrypt_device *zdev)
202EXPORT_SYMBOL(zcrypt_device_free); 208EXPORT_SYMBOL(zcrypt_device_free);
203 209
204/** 210/**
205 * Register a crypto device. 211 * zcrypt_device_register() - Register a crypto device.
212 * @zdev: Pointer to a crypto device
213 *
214 * Register a crypto device. Returns 0 if successful.
206 */ 215 */
207int zcrypt_device_register(struct zcrypt_device *zdev) 216int zcrypt_device_register(struct zcrypt_device *zdev)
208{ 217{
@@ -242,6 +251,9 @@ out:
242EXPORT_SYMBOL(zcrypt_device_register); 251EXPORT_SYMBOL(zcrypt_device_register);
243 252
244/** 253/**
254 * zcrypt_device_unregister(): Unregister a crypto device.
255 * @zdev: Pointer to crypto device
256 *
245 * Unregister a crypto device. 257 * Unregister a crypto device.
246 */ 258 */
247void zcrypt_device_unregister(struct zcrypt_device *zdev) 259void zcrypt_device_unregister(struct zcrypt_device *zdev)
@@ -260,7 +272,9 @@ void zcrypt_device_unregister(struct zcrypt_device *zdev)
260EXPORT_SYMBOL(zcrypt_device_unregister); 272EXPORT_SYMBOL(zcrypt_device_unregister);
261 273
262/** 274/**
263 * zcrypt_read is not be supported beyond zcrypt 1.3.1 275 * zcrypt_read (): Not supported beyond zcrypt 1.3.1.
276 *
277 * This function is not supported beyond zcrypt 1.3.1.
264 */ 278 */
265static ssize_t zcrypt_read(struct file *filp, char __user *buf, 279static ssize_t zcrypt_read(struct file *filp, char __user *buf,
266 size_t count, loff_t *f_pos) 280 size_t count, loff_t *f_pos)
@@ -269,6 +283,8 @@ static ssize_t zcrypt_read(struct file *filp, char __user *buf,
269} 283}
270 284
271/** 285/**
286 * zcrypt_write(): Not allowed.
287 *
272 * Write is is not allowed 288 * Write is is not allowed
273 */ 289 */
274static ssize_t zcrypt_write(struct file *filp, const char __user *buf, 290static ssize_t zcrypt_write(struct file *filp, const char __user *buf,
@@ -278,7 +294,9 @@ static ssize_t zcrypt_write(struct file *filp, const char __user *buf,
278} 294}
279 295
280/** 296/**
281 * Device open/close functions to count number of users. 297 * zcrypt_open(): Count number of users.
298 *
299 * Device open function to count number of users.
282 */ 300 */
283static int zcrypt_open(struct inode *inode, struct file *filp) 301static int zcrypt_open(struct inode *inode, struct file *filp)
284{ 302{
@@ -286,13 +304,18 @@ static int zcrypt_open(struct inode *inode, struct file *filp)
286 return 0; 304 return 0;
287} 305}
288 306
307/**
308 * zcrypt_release(): Count number of users.
309 *
310 * Device close function to count number of users.
311 */
289static int zcrypt_release(struct inode *inode, struct file *filp) 312static int zcrypt_release(struct inode *inode, struct file *filp)
290{ 313{
291 atomic_dec(&zcrypt_open_count); 314 atomic_dec(&zcrypt_open_count);
292 return 0; 315 return 0;
293} 316}
294 317
295/** 318/*
296 * zcrypt ioctls. 319 * zcrypt ioctls.
297 */ 320 */
298static long zcrypt_rsa_modexpo(struct ica_rsa_modexpo *mex) 321static long zcrypt_rsa_modexpo(struct ica_rsa_modexpo *mex)
@@ -302,7 +325,7 @@ static long zcrypt_rsa_modexpo(struct ica_rsa_modexpo *mex)
302 325
303 if (mex->outputdatalength < mex->inputdatalength) 326 if (mex->outputdatalength < mex->inputdatalength)
304 return -EINVAL; 327 return -EINVAL;
305 /** 328 /*
306 * As long as outputdatalength is big enough, we can set the 329 * As long as outputdatalength is big enough, we can set the
307 * outputdatalength equal to the inputdatalength, since that is the 330 * outputdatalength equal to the inputdatalength, since that is the
308 * number of bytes we will copy in any case 331 * number of bytes we will copy in any case
@@ -348,7 +371,7 @@ static long zcrypt_rsa_crt(struct ica_rsa_modexpo_crt *crt)
348 if (crt->outputdatalength < crt->inputdatalength || 371 if (crt->outputdatalength < crt->inputdatalength ||
349 (crt->inputdatalength & 1)) 372 (crt->inputdatalength & 1))
350 return -EINVAL; 373 return -EINVAL;
351 /** 374 /*
352 * As long as outputdatalength is big enough, we can set the 375 * As long as outputdatalength is big enough, we can set the
353 * outputdatalength equal to the inputdatalength, since that is the 376 * outputdatalength equal to the inputdatalength, since that is the
354 * number of bytes we will copy in any case 377 * number of bytes we will copy in any case
@@ -365,7 +388,7 @@ static long zcrypt_rsa_crt(struct ica_rsa_modexpo_crt *crt)
365 zdev->max_mod_size < crt->inputdatalength) 388 zdev->max_mod_size < crt->inputdatalength)
366 continue; 389 continue;
367 if (zdev->short_crt && crt->inputdatalength > 240) { 390 if (zdev->short_crt && crt->inputdatalength > 240) {
368 /** 391 /*
369 * Check inputdata for leading zeros for cards 392 * Check inputdata for leading zeros for cards
370 * that can't handle np_prime, bp_key, or 393 * that can't handle np_prime, bp_key, or
371 * u_mult_inv > 128 bytes. 394 * u_mult_inv > 128 bytes.
@@ -381,7 +404,7 @@ static long zcrypt_rsa_crt(struct ica_rsa_modexpo_crt *crt)
381 copy_from_user(&z3, crt->u_mult_inv, len)) 404 copy_from_user(&z3, crt->u_mult_inv, len))
382 return -EFAULT; 405 return -EFAULT;
383 copied = 1; 406 copied = 1;
384 /** 407 /*
385 * We have to restart device lookup - 408 * We have to restart device lookup -
386 * the device list may have changed by now. 409 * the device list may have changed by now.
387 */ 410 */
@@ -567,6 +590,8 @@ static int zcrypt_count_type(int type)
567} 590}
568 591
569/** 592/**
593 * zcrypt_ica_status(): Old, depracted combi status call.
594 *
570 * Old, deprecated combi status call. 595 * Old, deprecated combi status call.
571 */ 596 */
572static long zcrypt_ica_status(struct file *filp, unsigned long arg) 597static long zcrypt_ica_status(struct file *filp, unsigned long arg)
@@ -668,7 +693,7 @@ static long zcrypt_unlocked_ioctl(struct file *filp, unsigned int cmd,
668 (int __user *) arg); 693 (int __user *) arg);
669 case Z90STAT_DOMAIN_INDEX: 694 case Z90STAT_DOMAIN_INDEX:
670 return put_user(ap_domain_index, (int __user *) arg); 695 return put_user(ap_domain_index, (int __user *) arg);
671 /** 696 /*
672 * Deprecated ioctls. Don't add another device count ioctl, 697 * Deprecated ioctls. Don't add another device count ioctl,
673 * you can count them yourself in the user space with the 698 * you can count them yourself in the user space with the
674 * output of the Z90STAT_STATUS_MASK ioctl. 699 * output of the Z90STAT_STATUS_MASK ioctl.
@@ -706,7 +731,7 @@ static long zcrypt_unlocked_ioctl(struct file *filp, unsigned int cmd,
706} 731}
707 732
708#ifdef CONFIG_COMPAT 733#ifdef CONFIG_COMPAT
709/** 734/*
710 * ioctl32 conversion routines 735 * ioctl32 conversion routines
711 */ 736 */
712struct compat_ica_rsa_modexpo { 737struct compat_ica_rsa_modexpo {
@@ -857,7 +882,7 @@ static long zcrypt_compat_ioctl(struct file *filp, unsigned int cmd,
857} 882}
858#endif 883#endif
859 884
860/** 885/*
861 * Misc device file operations. 886 * Misc device file operations.
862 */ 887 */
863static const struct file_operations zcrypt_fops = { 888static const struct file_operations zcrypt_fops = {
@@ -872,7 +897,7 @@ static const struct file_operations zcrypt_fops = {
872 .release = zcrypt_release 897 .release = zcrypt_release
873}; 898};
874 899
875/** 900/*
876 * Misc device. 901 * Misc device.
877 */ 902 */
878static struct miscdevice zcrypt_misc_device = { 903static struct miscdevice zcrypt_misc_device = {
@@ -881,7 +906,7 @@ static struct miscdevice zcrypt_misc_device = {
881 .fops = &zcrypt_fops, 906 .fops = &zcrypt_fops,
882}; 907};
883 908
884/** 909/*
885 * Deprecated /proc entry support. 910 * Deprecated /proc entry support.
886 */ 911 */
887static struct proc_dir_entry *zcrypt_entry; 912static struct proc_dir_entry *zcrypt_entry;
@@ -1075,7 +1100,7 @@ static int zcrypt_status_write(struct file *file, const char __user *buffer,
1075 } 1100 }
1076 1101
1077 for (j = 0; j < 64 && *ptr; ptr++) { 1102 for (j = 0; j < 64 && *ptr; ptr++) {
1078 /** 1103 /*
1079 * '0' for no device, '1' for PCICA, '2' for PCICC, 1104 * '0' for no device, '1' for PCICA, '2' for PCICC,
1080 * '3' for PCIXCC_MCL2, '4' for PCIXCC_MCL3, 1105 * '3' for PCIXCC_MCL2, '4' for PCIXCC_MCL3,
1081 * '5' for CEX2C and '6' for CEX2A' 1106 * '5' for CEX2C and '6' for CEX2A'
@@ -1103,7 +1128,7 @@ static int zcrypt_rng_data_read(struct hwrng *rng, u32 *data)
1103{ 1128{
1104 int rc; 1129 int rc;
1105 1130
1106 /** 1131 /*
1107 * We don't need locking here because the RNG API guarantees serialized 1132 * We don't need locking here because the RNG API guarantees serialized
1108 * read method calls. 1133 * read method calls.
1109 */ 1134 */
@@ -1162,6 +1187,8 @@ static void zcrypt_rng_device_remove(void)
1162} 1187}
1163 1188
1164/** 1189/**
1190 * zcrypt_api_init(): Module initialization.
1191 *
1165 * The module initialization code. 1192 * The module initialization code.
1166 */ 1193 */
1167int __init zcrypt_api_init(void) 1194int __init zcrypt_api_init(void)
@@ -1196,6 +1223,8 @@ out:
1196} 1223}
1197 1224
1198/** 1225/**
1226 * zcrypt_api_exit(): Module termination.
1227 *
1199 * The module termination code. 1228 * The module termination code.
1200 */ 1229 */
1201void zcrypt_api_exit(void) 1230void zcrypt_api_exit(void)