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 | |
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')
-rw-r--r-- | drivers/isdn/gigaset/asyncdata.c | 28 | ||||
-rw-r--r-- | drivers/isdn/gigaset/common.c | 126 | ||||
-rw-r--r-- | drivers/isdn/gigaset/ev-layer.c | 9 | ||||
-rw-r--r-- | drivers/isdn/gigaset/i4l.c | 17 | ||||
-rw-r--r-- | drivers/isdn/gigaset/interface.c | 9 | ||||
-rw-r--r-- | drivers/isdn/gigaset/isocdata.c | 21 |
6 files changed, 166 insertions, 44 deletions
diff --git a/drivers/isdn/gigaset/asyncdata.c b/drivers/isdn/gigaset/asyncdata.c index 234cc5d53312..44a58e6f8f65 100644 --- a/drivers/isdn/gigaset/asyncdata.c +++ b/drivers/isdn/gigaset/asyncdata.c | |||
@@ -334,7 +334,14 @@ static inline int iraw_loop(unsigned char c, unsigned char *src, int numbytes, | |||
334 | return startbytes - numbytes; | 334 | return startbytes - numbytes; |
335 | } | 335 | } |
336 | 336 | ||
337 | /* process a block of data received from the device | 337 | /** |
338 | * gigaset_m10x_input() - process a block of data received from the device | ||
339 | * @inbuf: received data and device descriptor structure. | ||
340 | * | ||
341 | * Called by hardware module {ser,usb}_gigaset with a block of received | ||
342 | * bytes. Separates the bytes received over the serial data channel into | ||
343 | * user data and command replies (locked/unlocked) according to the | ||
344 | * current state of the interface. | ||
338 | */ | 345 | */ |
339 | void gigaset_m10x_input(struct inbuf_t *inbuf) | 346 | void gigaset_m10x_input(struct inbuf_t *inbuf) |
340 | { | 347 | { |
@@ -543,16 +550,17 @@ static struct sk_buff *iraw_encode(struct sk_buff *skb, int head, int tail) | |||
543 | return iraw_skb; | 550 | return iraw_skb; |
544 | } | 551 | } |
545 | 552 | ||
546 | /* gigaset_send_skb | 553 | /** |
547 | * called by common.c to queue an skb for sending | 554 | * gigaset_m10x_send_skb() - queue an skb for sending |
548 | * and start transmission if necessary | 555 | * @bcs: B channel descriptor structure. |
549 | * parameters: | 556 | * @skb: data to send. |
550 | * B Channel control structure | 557 | * |
551 | * skb | 558 | * Called by i4l.c to encode and queue an skb for sending, and start |
559 | * transmission if necessary. | ||
560 | * | ||
552 | * Return value: | 561 | * Return value: |
553 | * number of bytes accepted for sending | 562 | * number of bytes accepted for sending (skb->len) if ok, |
554 | * (skb->len if ok, 0 if out of buffer space) | 563 | * error code < 0 (eg. -ENOMEM) on error |
555 | * or error code (< 0, eg. -EINVAL) | ||
556 | */ | 564 | */ |
557 | int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb) | 565 | int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb) |
558 | { | 566 | { |
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; |
diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c index 926370a74981..cc768caa38f5 100644 --- a/drivers/isdn/gigaset/ev-layer.c +++ b/drivers/isdn/gigaset/ev-layer.c | |||
@@ -473,8 +473,13 @@ static int cid_of_response(char *s) | |||
473 | //FIXME is ;<digit>+ at end of non-CID response really impossible? | 473 | //FIXME is ;<digit>+ at end of non-CID response really impossible? |
474 | } | 474 | } |
475 | 475 | ||
476 | /* This function will be called via task queue from the callback handler. | 476 | /** |
477 | * We received a modem response and have to handle it.. | 477 | * gigaset_handle_modem_response() - process received modem response |
478 | * @cs: device descriptor structure. | ||
479 | * | ||
480 | * Called by asyncdata/isocdata if a block of data received from the | ||
481 | * device must be processed as a modem command response. The data is | ||
482 | * already in the cs structure. | ||
478 | */ | 483 | */ |
479 | void gigaset_handle_modem_response(struct cardstate *cs) | 484 | void gigaset_handle_modem_response(struct cardstate *cs) |
480 | { | 485 | { |
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c index 322f16ebc6ec..654489d836cd 100644 --- a/drivers/isdn/gigaset/i4l.c +++ b/drivers/isdn/gigaset/i4l.c | |||
@@ -85,6 +85,14 @@ static int writebuf_from_LL(int driverID, int channel, int ack, | |||
85 | return cs->ops->send_skb(bcs, skb); | 85 | return cs->ops->send_skb(bcs, skb); |
86 | } | 86 | } |
87 | 87 | ||
88 | /** | ||
89 | * gigaset_skb_sent() - acknowledge sending an skb | ||
90 | * @bcs: B channel descriptor structure. | ||
91 | * @skb: sent data. | ||
92 | * | ||
93 | * Called by hardware module {bas,ser,usb}_gigaset when the data in a | ||
94 | * skb has been successfully sent, for signalling completion to the LL. | ||
95 | */ | ||
88 | void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb) | 96 | void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb) |
89 | { | 97 | { |
90 | unsigned len; | 98 | unsigned len; |
@@ -461,6 +469,15 @@ int gigaset_isdn_setup_accept(struct at_state_t *at_state) | |||
461 | return 0; | 469 | return 0; |
462 | } | 470 | } |
463 | 471 | ||
472 | /** | ||
473 | * gigaset_isdn_icall() - signal incoming call | ||
474 | * @at_state: connection state structure. | ||
475 | * | ||
476 | * Called by main module to notify the LL that an incoming call has been | ||
477 | * received. @at_state contains the parameters of the call. | ||
478 | * | ||
479 | * Return value: call disposition (ICALL_*) | ||
480 | */ | ||
464 | int gigaset_isdn_icall(struct at_state_t *at_state) | 481 | int gigaset_isdn_icall(struct at_state_t *at_state) |
465 | { | 482 | { |
466 | struct cardstate *cs = at_state->cs; | 483 | struct cardstate *cs = at_state->cs; |
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index f33ac27de643..6a8e1384e7bd 100644 --- a/drivers/isdn/gigaset/interface.c +++ b/drivers/isdn/gigaset/interface.c | |||
@@ -616,6 +616,15 @@ void gigaset_if_free(struct cardstate *cs) | |||
616 | tty_unregister_device(drv->tty, cs->minor_index); | 616 | tty_unregister_device(drv->tty, cs->minor_index); |
617 | } | 617 | } |
618 | 618 | ||
619 | /** | ||
620 | * gigaset_if_receive() - pass a received block of data to the tty device | ||
621 | * @cs: device descriptor structure. | ||
622 | * @buffer: received data. | ||
623 | * @len: number of bytes received. | ||
624 | * | ||
625 | * Called by asyncdata/isocdata if a block of data received from the | ||
626 | * device must be sent to userspace through the ttyG* device. | ||
627 | */ | ||
619 | void gigaset_if_receive(struct cardstate *cs, | 628 | void gigaset_if_receive(struct cardstate *cs, |
620 | unsigned char *buffer, size_t len) | 629 | unsigned char *buffer, size_t len) |
621 | { | 630 | { |
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c index 7fd32f07fb47..9f3ef7b4248c 100644 --- a/drivers/isdn/gigaset/isocdata.c +++ b/drivers/isdn/gigaset/isocdata.c | |||
@@ -976,16 +976,17 @@ void gigaset_isoc_input(struct inbuf_t *inbuf) | |||
976 | 976 | ||
977 | /* == data output ========================================================== */ | 977 | /* == data output ========================================================== */ |
978 | 978 | ||
979 | /* gigaset_send_skb | 979 | /** |
980 | * called by common.c to queue an skb for sending | 980 | * gigaset_isoc_send_skb() - queue an skb for sending |
981 | * and start transmission if necessary | 981 | * @bcs: B channel descriptor structure. |
982 | * parameters: | 982 | * @skb: data to send. |
983 | * B Channel control structure | 983 | * |
984 | * skb | 984 | * Called by i4l.c to queue an skb for sending, and start transmission if |
985 | * return value: | 985 | * necessary. |
986 | * number of bytes accepted for sending | 986 | * |
987 | * (skb->len if ok, 0 if out of buffer space) | 987 | * Return value: |
988 | * or error code (< 0, eg. -EINVAL) | 988 | * number of bytes accepted for sending (skb->len) if ok, |
989 | * error code < 0 (eg. -ENODEV) on error | ||
989 | */ | 990 | */ |
990 | int gigaset_isoc_send_skb(struct bc_state *bcs, struct sk_buff *skb) | 991 | int gigaset_isoc_send_skb(struct bc_state *bcs, struct sk_buff *skb) |
991 | { | 992 | { |