diff options
author | Tilman Schmidt <tilman@imap.cc> | 2009-10-06 08:19:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-07 01:21:07 -0400 |
commit | 1cec9727fbfd7baff2034796154be1a0297bcedd (patch) | |
tree | 6e396500c1e91aff545bd5dcd8711608a5abedd8 /drivers/isdn/gigaset/common.c | |
parent | cd7f50e25156711f16ce253c49c91adc4368849c (diff) |
gigaset: add kerneldoc comments
Add kerneldoc comments to some functions in the Gigaset driver.
Impact: documentation
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset/common.c')
-rw-r--r-- | drivers/isdn/gigaset/common.c | 126 |
1 files changed, 104 insertions, 22 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c index edbcaa3887f1..33dcd8d72b7c 100644 --- a/drivers/isdn/gigaset/common.c +++ b/drivers/isdn/gigaset/common.c | |||
@@ -38,6 +38,17 @@ MODULE_PARM_DESC(debug, "debug level"); | |||
38 | #define VALID_MINOR 0x01 | 38 | #define VALID_MINOR 0x01 |
39 | #define VALID_ID 0x02 | 39 | #define VALID_ID 0x02 |
40 | 40 | ||
41 | /** | ||
42 | * gigaset_dbg_buffer() - dump data in ASCII and hex for debugging | ||
43 | * @level: debugging level. | ||
44 | * @msg: message prefix. | ||
45 | * @len: number of bytes to dump. | ||
46 | * @buf: data to dump. | ||
47 | * | ||
48 | * If the current debugging level includes one of the bits set in @level, | ||
49 | * @len bytes starting at @buf are logged to dmesg at KERN_DEBUG prio, | ||
50 | * prefixed by the text @msg. | ||
51 | */ | ||
41 | void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg, | 52 | void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg, |
42 | size_t len, const unsigned char *buf) | 53 | size_t len, const unsigned char *buf) |
43 | { | 54 | { |
@@ -280,6 +291,20 @@ static void clear_events(struct cardstate *cs) | |||
280 | spin_unlock_irqrestore(&cs->ev_lock, flags); | 291 | spin_unlock_irqrestore(&cs->ev_lock, flags); |
281 | } | 292 | } |
282 | 293 | ||
294 | /** | ||
295 | * gigaset_add_event() - add event to device event queue | ||
296 | * @cs: device descriptor structure. | ||
297 | * @at_state: connection state structure. | ||
298 | * @type: event type. | ||
299 | * @ptr: pointer parameter for event. | ||
300 | * @parameter: integer parameter for event. | ||
301 | * @arg: pointer parameter for event. | ||
302 | * | ||
303 | * Allocate an event queue entry from the device's event queue, and set it up | ||
304 | * with the parameters given. | ||
305 | * | ||
306 | * Return value: added event | ||
307 | */ | ||
283 | struct event_t *gigaset_add_event(struct cardstate *cs, | 308 | struct event_t *gigaset_add_event(struct cardstate *cs, |
284 | struct at_state_t *at_state, int type, | 309 | struct at_state_t *at_state, int type, |
285 | void *ptr, int parameter, void *arg) | 310 | void *ptr, int parameter, void *arg) |
@@ -404,6 +429,15 @@ static void make_invalid(struct cardstate *cs, unsigned mask) | |||
404 | spin_unlock_irqrestore(&drv->lock, flags); | 429 | spin_unlock_irqrestore(&drv->lock, flags); |
405 | } | 430 | } |
406 | 431 | ||
432 | /** | ||
433 | * gigaset_freecs() - free all associated ressources of a device | ||
434 | * @cs: device descriptor structure. | ||
435 | * | ||
436 | * Stops all tasklets and timers, unregisters the device from all | ||
437 | * subsystems it was registered to, deallocates the device structure | ||
438 | * @cs and all structures referenced from it. | ||
439 | * Operations on the device should be stopped before calling this. | ||
440 | */ | ||
407 | void gigaset_freecs(struct cardstate *cs) | 441 | void gigaset_freecs(struct cardstate *cs) |
408 | { | 442 | { |
409 | int i; | 443 | int i; |
@@ -512,7 +546,12 @@ static void gigaset_inbuf_init(struct inbuf_t *inbuf, struct bc_state *bcs, | |||
512 | inbuf->inputstate = inputstate; | 546 | inbuf->inputstate = inputstate; |
513 | } | 547 | } |
514 | 548 | ||
515 | /* append received bytes to inbuf */ | 549 | /** |
550 | * gigaset_fill_inbuf() - append received data to input buffer | ||
551 | * @inbuf: buffer structure. | ||
552 | * @src: received data. | ||
553 | * @numbytes: number of bytes received. | ||
554 | */ | ||
516 | int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src, | 555 | int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src, |
517 | unsigned numbytes) | 556 | unsigned numbytes) |
518 | { | 557 | { |
@@ -612,20 +651,22 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs, | |||
612 | return NULL; | 651 | return NULL; |
613 | } | 652 | } |
614 | 653 | ||
615 | /* gigaset_initcs | 654 | /** |
655 | * gigaset_initcs() - initialize device structure | ||
656 | * @drv: hardware driver the device belongs to | ||
657 | * @channels: number of B channels supported by device | ||
658 | * @onechannel: !=0 if B channel data and AT commands share one | ||
659 | * communication channel (M10x), | ||
660 | * ==0 if B channels have separate communication channels (base) | ||
661 | * @ignoreframes: number of frames to ignore after setting up B channel | ||
662 | * @cidmode: !=0: start in CallID mode | ||
663 | * @modulename: name of driver module for LL registration | ||
664 | * | ||
616 | * Allocate and initialize cardstate structure for Gigaset driver | 665 | * Allocate and initialize cardstate structure for Gigaset driver |
617 | * Calls hardware dependent gigaset_initcshw() function | 666 | * Calls hardware dependent gigaset_initcshw() function |
618 | * Calls B channel initialization function gigaset_initbcs() for each B channel | 667 | * Calls B channel initialization function gigaset_initbcs() for each B channel |
619 | * parameters: | 668 | * |
620 | * drv hardware driver the device belongs to | 669 | * Return value: |
621 | * channels number of B channels supported by device | ||
622 | * onechannel !=0: B channel data and AT commands share one | ||
623 | * communication channel | ||
624 | * ==0: B channels have separate communication channels | ||
625 | * ignoreframes number of frames to ignore after setting up B channel | ||
626 | * cidmode !=0: start in CallID mode | ||
627 | * modulename name of driver module (used for I4L registration) | ||
628 | * return value: | ||
629 | * pointer to cardstate structure | 670 | * pointer to cardstate structure |
630 | */ | 671 | */ |
631 | struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, | 672 | struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, |
@@ -843,6 +884,17 @@ static void cleanup_cs(struct cardstate *cs) | |||
843 | } | 884 | } |
844 | 885 | ||
845 | 886 | ||
887 | /** | ||
888 | * gigaset_start() - start device operations | ||
889 | * @cs: device descriptor structure. | ||
890 | * | ||
891 | * Prepares the device for use by setting up communication parameters, | ||
892 | * scheduling an EV_START event to initiate device initialization, and | ||
893 | * waiting for completion of the initialization. | ||
894 | * | ||
895 | * Return value: | ||
896 | * 1 - success, 0 - error | ||
897 | */ | ||
846 | int gigaset_start(struct cardstate *cs) | 898 | int gigaset_start(struct cardstate *cs) |
847 | { | 899 | { |
848 | unsigned long flags; | 900 | unsigned long flags; |
@@ -885,9 +937,15 @@ error: | |||
885 | } | 937 | } |
886 | EXPORT_SYMBOL_GPL(gigaset_start); | 938 | EXPORT_SYMBOL_GPL(gigaset_start); |
887 | 939 | ||
888 | /* gigaset_shutdown | 940 | /** |
889 | * check if a device is associated to the cardstate structure and stop it | 941 | * gigaset_shutdown() - shut down device operations |
890 | * return value: 0 if ok, -1 if no device was associated | 942 | * @cs: device descriptor structure. |
943 | * | ||
944 | * Deactivates the device by scheduling an EV_SHUTDOWN event and | ||
945 | * waiting for completion of the shutdown. | ||
946 | * | ||
947 | * Return value: | ||
948 | * 0 - success, -1 - error (no device associated) | ||
891 | */ | 949 | */ |
892 | int gigaset_shutdown(struct cardstate *cs) | 950 | int gigaset_shutdown(struct cardstate *cs) |
893 | { | 951 | { |
@@ -918,6 +976,13 @@ exit: | |||
918 | } | 976 | } |
919 | EXPORT_SYMBOL_GPL(gigaset_shutdown); | 977 | EXPORT_SYMBOL_GPL(gigaset_shutdown); |
920 | 978 | ||
979 | /** | ||
980 | * gigaset_stop() - stop device operations | ||
981 | * @cs: device descriptor structure. | ||
982 | * | ||
983 | * Stops operations on the device by scheduling an EV_STOP event and | ||
984 | * waiting for completion of the shutdown. | ||
985 | */ | ||
921 | void gigaset_stop(struct cardstate *cs) | 986 | void gigaset_stop(struct cardstate *cs) |
922 | { | 987 | { |
923 | mutex_lock(&cs->mutex); | 988 | mutex_lock(&cs->mutex); |
@@ -1026,6 +1091,14 @@ struct cardstate *gigaset_get_cs_by_tty(struct tty_struct *tty) | |||
1026 | return gigaset_get_cs_by_minor(tty->index + tty->driver->minor_start); | 1091 | return gigaset_get_cs_by_minor(tty->index + tty->driver->minor_start); |
1027 | } | 1092 | } |
1028 | 1093 | ||
1094 | /** | ||
1095 | * gigaset_freedriver() - free all associated ressources of a driver | ||
1096 | * @drv: driver descriptor structure. | ||
1097 | * | ||
1098 | * Unregisters the driver from the system and deallocates the driver | ||
1099 | * structure @drv and all structures referenced from it. | ||
1100 | * All devices should be shut down before calling this. | ||
1101 | */ | ||
1029 | void gigaset_freedriver(struct gigaset_driver *drv) | 1102 | void gigaset_freedriver(struct gigaset_driver *drv) |
1030 | { | 1103 | { |
1031 | unsigned long flags; | 1104 | unsigned long flags; |
@@ -1041,14 +1114,16 @@ void gigaset_freedriver(struct gigaset_driver *drv) | |||
1041 | } | 1114 | } |
1042 | EXPORT_SYMBOL_GPL(gigaset_freedriver); | 1115 | EXPORT_SYMBOL_GPL(gigaset_freedriver); |
1043 | 1116 | ||
1044 | /* gigaset_initdriver | 1117 | /** |
1118 | * gigaset_initdriver() - initialize driver structure | ||
1119 | * @minor: First minor number | ||
1120 | * @minors: Number of minors this driver can handle | ||
1121 | * @procname: Name of the driver | ||
1122 | * @devname: Name of the device files (prefix without minor number) | ||
1123 | * | ||
1045 | * Allocate and initialize gigaset_driver structure. Initialize interface. | 1124 | * Allocate and initialize gigaset_driver structure. Initialize interface. |
1046 | * parameters: | 1125 | * |
1047 | * minor First minor number | 1126 | * Return value: |
1048 | * minors Number of minors this driver can handle | ||
1049 | * procname Name of the driver | ||
1050 | * devname Name of the device files (prefix without minor number) | ||
1051 | * return value: | ||
1052 | * Pointer to the gigaset_driver structure on success, NULL on failure. | 1127 | * Pointer to the gigaset_driver structure on success, NULL on failure. |
1053 | */ | 1128 | */ |
1054 | struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors, | 1129 | struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors, |
@@ -1101,6 +1176,13 @@ error: | |||
1101 | } | 1176 | } |
1102 | EXPORT_SYMBOL_GPL(gigaset_initdriver); | 1177 | EXPORT_SYMBOL_GPL(gigaset_initdriver); |
1103 | 1178 | ||
1179 | /** | ||
1180 | * gigaset_blockdriver() - block driver | ||
1181 | * @drv: driver descriptor structure. | ||
1182 | * | ||
1183 | * Prevents the driver from attaching new devices, in preparation for | ||
1184 | * deregistration. | ||
1185 | */ | ||
1104 | void gigaset_blockdriver(struct gigaset_driver *drv) | 1186 | void gigaset_blockdriver(struct gigaset_driver *drv) |
1105 | { | 1187 | { |
1106 | drv->blocked = 1; | 1188 | drv->blocked = 1; |