diff options
author | Tilman Schmidt <tilman@imap.cc> | 2009-10-25 05:30:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-29 04:37:12 -0400 |
commit | d9ba9c9125d89e246dc0a0702446528acceb6ddb (patch) | |
tree | 9ae300165556afc86d9b54cb915dca0d0d4304da /drivers/isdn | |
parent | 2032e2c2309de02cd67b1d26aa701c2a57c4639f (diff) |
gigaset: checkpatch cleanup
Dum sanctis checkpatch.pl'ae legibus obsequimur.
Impact: cosmetic
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/common.c | 33 | ||||
-rw-r--r-- | drivers/isdn/gigaset/gigaset.h | 60 | ||||
-rw-r--r-- | drivers/isdn/gigaset/i4l.c | 29 | ||||
-rw-r--r-- | drivers/isdn/gigaset/interface.c | 39 | ||||
-rw-r--r-- | drivers/isdn/gigaset/proc.c | 2 |
5 files changed, 74 insertions, 89 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c index 690ac74c82a8..c438cfcb7c6d 100644 --- a/drivers/isdn/gigaset/common.c +++ b/drivers/isdn/gigaset/common.c | |||
@@ -108,7 +108,7 @@ int gigaset_enterconfigmode(struct cardstate *cs) | |||
108 | { | 108 | { |
109 | int i, r; | 109 | int i, r; |
110 | 110 | ||
111 | cs->control_state = TIOCM_RTS; //FIXME | 111 | cs->control_state = TIOCM_RTS; |
112 | 112 | ||
113 | r = setflags(cs, TIOCM_DTR, 200); | 113 | r = setflags(cs, TIOCM_DTR, 200); |
114 | if (r < 0) | 114 | if (r < 0) |
@@ -132,10 +132,10 @@ int gigaset_enterconfigmode(struct cardstate *cs) | |||
132 | 132 | ||
133 | error: | 133 | error: |
134 | dev_err(cs->dev, "error %d on setuartbits\n", -r); | 134 | dev_err(cs->dev, "error %d on setuartbits\n", -r); |
135 | cs->control_state = TIOCM_RTS|TIOCM_DTR; // FIXME is this a good value? | 135 | cs->control_state = TIOCM_RTS|TIOCM_DTR; |
136 | cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS|TIOCM_DTR); | 136 | cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS|TIOCM_DTR); |
137 | 137 | ||
138 | return -1; //r | 138 | return -1; |
139 | } | 139 | } |
140 | 140 | ||
141 | static int test_timeout(struct at_state_t *at_state) | 141 | static int test_timeout(struct at_state_t *at_state) |
@@ -150,10 +150,9 @@ static int test_timeout(struct at_state_t *at_state) | |||
150 | } | 150 | } |
151 | 151 | ||
152 | if (!gigaset_add_event(at_state->cs, at_state, EV_TIMEOUT, NULL, | 152 | if (!gigaset_add_event(at_state->cs, at_state, EV_TIMEOUT, NULL, |
153 | at_state->timer_index, NULL)) { | 153 | at_state->timer_index, NULL)) |
154 | //FIXME what should we do? | 154 | dev_err(at_state->cs->dev, "%s: out of memory\n", |
155 | } | 155 | __func__); |
156 | |||
157 | return 1; | 156 | return 1; |
158 | } | 157 | } |
159 | 158 | ||
@@ -393,9 +392,8 @@ static void gigaset_freebcs(struct bc_state *bcs) | |||
393 | int i; | 392 | int i; |
394 | 393 | ||
395 | gig_dbg(DEBUG_INIT, "freeing bcs[%d]->hw", bcs->channel); | 394 | gig_dbg(DEBUG_INIT, "freeing bcs[%d]->hw", bcs->channel); |
396 | if (!bcs->cs->ops->freebcshw(bcs)) { | 395 | if (!bcs->cs->ops->freebcshw(bcs)) |
397 | gig_dbg(DEBUG_INIT, "failed"); | 396 | gig_dbg(DEBUG_INIT, "failed"); |
398 | } | ||
399 | 397 | ||
400 | gig_dbg(DEBUG_INIT, "clearing bcs[%d]->at_state", bcs->channel); | 398 | gig_dbg(DEBUG_INIT, "clearing bcs[%d]->at_state", bcs->channel); |
401 | clear_at_state(&bcs->at_state); | 399 | clear_at_state(&bcs->at_state); |
@@ -503,8 +501,6 @@ void gigaset_freecs(struct cardstate *cs) | |||
503 | gig_dbg(DEBUG_INIT, "clearing hw"); | 501 | gig_dbg(DEBUG_INIT, "clearing hw"); |
504 | cs->ops->freecshw(cs); | 502 | cs->ops->freecshw(cs); |
505 | 503 | ||
506 | //FIXME cmdbuf | ||
507 | |||
508 | /* fall through */ | 504 | /* fall through */ |
509 | case 2: /* error in initcshw */ | 505 | case 2: /* error in initcshw */ |
510 | /* Deregister from LL */ | 506 | /* Deregister from LL */ |
@@ -622,7 +618,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs, | |||
622 | { | 618 | { |
623 | int i; | 619 | int i; |
624 | 620 | ||
625 | bcs->tx_skb = NULL; //FIXME -> hw part | 621 | bcs->tx_skb = NULL; |
626 | 622 | ||
627 | skb_queue_head_init(&bcs->squeue); | 623 | skb_queue_head_init(&bcs->squeue); |
628 | 624 | ||
@@ -696,12 +692,13 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, | |||
696 | int onechannel, int ignoreframes, | 692 | int onechannel, int ignoreframes, |
697 | int cidmode, const char *modulename) | 693 | int cidmode, const char *modulename) |
698 | { | 694 | { |
699 | struct cardstate *cs = NULL; | 695 | struct cardstate *cs; |
700 | unsigned long flags; | 696 | unsigned long flags; |
701 | int i; | 697 | int i; |
702 | 698 | ||
703 | gig_dbg(DEBUG_INIT, "allocating cs"); | 699 | gig_dbg(DEBUG_INIT, "allocating cs"); |
704 | if (!(cs = alloc_cs(drv))) { | 700 | cs = alloc_cs(drv); |
701 | if (!cs) { | ||
705 | pr_err("maximum number of devices exceeded\n"); | 702 | pr_err("maximum number of devices exceeded\n"); |
706 | return NULL; | 703 | return NULL; |
707 | } | 704 | } |
@@ -931,15 +928,13 @@ int gigaset_start(struct cardstate *cs) | |||
931 | cs->ops->baud_rate(cs, B115200); | 928 | cs->ops->baud_rate(cs, B115200); |
932 | cs->ops->set_line_ctrl(cs, CS8); | 929 | cs->ops->set_line_ctrl(cs, CS8); |
933 | cs->control_state = TIOCM_DTR|TIOCM_RTS; | 930 | cs->control_state = TIOCM_DTR|TIOCM_RTS; |
934 | } else { | ||
935 | //FIXME use some saved values? | ||
936 | } | 931 | } |
937 | 932 | ||
938 | cs->waiting = 1; | 933 | cs->waiting = 1; |
939 | 934 | ||
940 | if (!gigaset_add_event(cs, &cs->at_state, EV_START, NULL, 0, NULL)) { | 935 | if (!gigaset_add_event(cs, &cs->at_state, EV_START, NULL, 0, NULL)) { |
941 | cs->waiting = 0; | 936 | cs->waiting = 0; |
942 | //FIXME what should we do? | 937 | dev_err(cs->dev, "%s: out of memory\n", __func__); |
943 | goto error; | 938 | goto error; |
944 | } | 939 | } |
945 | 940 | ||
@@ -979,7 +974,7 @@ int gigaset_shutdown(struct cardstate *cs) | |||
979 | cs->waiting = 1; | 974 | cs->waiting = 1; |
980 | 975 | ||
981 | if (!gigaset_add_event(cs, &cs->at_state, EV_SHUTDOWN, NULL, 0, NULL)) { | 976 | if (!gigaset_add_event(cs, &cs->at_state, EV_SHUTDOWN, NULL, 0, NULL)) { |
982 | //FIXME what should we do? | 977 | dev_err(cs->dev, "%s: out of memory\n", __func__); |
983 | goto exit; | 978 | goto exit; |
984 | } | 979 | } |
985 | 980 | ||
@@ -1010,7 +1005,7 @@ void gigaset_stop(struct cardstate *cs) | |||
1010 | cs->waiting = 1; | 1005 | cs->waiting = 1; |
1011 | 1006 | ||
1012 | if (!gigaset_add_event(cs, &cs->at_state, EV_STOP, NULL, 0, NULL)) { | 1007 | if (!gigaset_add_event(cs, &cs->at_state, EV_STOP, NULL, 0, NULL)) { |
1013 | //FIXME what should we do? | 1008 | dev_err(cs->dev, "%s: out of memory\n", __func__); |
1014 | goto exit; | 1009 | goto exit; |
1015 | } | 1010 | } |
1016 | 1011 | ||
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h index 18bff9f80727..3c74cd164019 100644 --- a/drivers/isdn/gigaset/gigaset.h +++ b/drivers/isdn/gigaset/gigaset.h | |||
@@ -34,8 +34,8 @@ | |||
34 | #include <linux/list.h> | 34 | #include <linux/list.h> |
35 | #include <asm/atomic.h> | 35 | #include <asm/atomic.h> |
36 | 36 | ||
37 | #define GIG_VERSION {0,5,0,0} | 37 | #define GIG_VERSION {0, 5, 0, 0} |
38 | #define GIG_COMPAT {0,4,0,0} | 38 | #define GIG_COMPAT {0, 4, 0, 0} |
39 | 39 | ||
40 | #define MAX_REC_PARAMS 10 /* Max. number of params in response string */ | 40 | #define MAX_REC_PARAMS 10 /* Max. number of params in response string */ |
41 | #define MAX_RESP_SIZE 512 /* Max. size of a response string */ | 41 | #define MAX_RESP_SIZE 512 /* Max. size of a response string */ |
@@ -133,35 +133,32 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg, | |||
133 | #define OUT_VENDOR_REQ (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT) | 133 | #define OUT_VENDOR_REQ (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT) |
134 | #define IN_VENDOR_REQ (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT) | 134 | #define IN_VENDOR_REQ (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT) |
135 | 135 | ||
136 | /* int-in-events 3070 */ | 136 | /* interrupt pipe messages */ |
137 | #define HD_B1_FLOW_CONTROL 0x80 | 137 | #define HD_B1_FLOW_CONTROL 0x80 |
138 | #define HD_B2_FLOW_CONTROL 0x81 | 138 | #define HD_B2_FLOW_CONTROL 0x81 |
139 | #define HD_RECEIVEATDATA_ACK (0x35) // 3070 | 139 | #define HD_RECEIVEATDATA_ACK (0x35) /* 3070 */ |
140 | // att: HD_RECEIVE>>AT<<DATA_ACK | 140 | #define HD_READY_SEND_ATDATA (0x36) /* 3070 */ |
141 | #define HD_READY_SEND_ATDATA (0x36) // 3070 | 141 | #define HD_OPEN_ATCHANNEL_ACK (0x37) /* 3070 */ |
142 | #define HD_OPEN_ATCHANNEL_ACK (0x37) // 3070 | 142 | #define HD_CLOSE_ATCHANNEL_ACK (0x38) /* 3070 */ |
143 | #define HD_CLOSE_ATCHANNEL_ACK (0x38) // 3070 | 143 | #define HD_DEVICE_INIT_OK (0x11) /* ISurf USB + 3070 */ |
144 | #define HD_DEVICE_INIT_OK (0x11) // ISurf USB + 3070 | 144 | #define HD_OPEN_B1CHANNEL_ACK (0x51) /* ISurf USB + 3070 */ |
145 | #define HD_OPEN_B1CHANNEL_ACK (0x51) // ISurf USB + 3070 | 145 | #define HD_OPEN_B2CHANNEL_ACK (0x52) /* ISurf USB + 3070 */ |
146 | #define HD_OPEN_B2CHANNEL_ACK (0x52) // ISurf USB + 3070 | 146 | #define HD_CLOSE_B1CHANNEL_ACK (0x53) /* ISurf USB + 3070 */ |
147 | #define HD_CLOSE_B1CHANNEL_ACK (0x53) // ISurf USB + 3070 | 147 | #define HD_CLOSE_B2CHANNEL_ACK (0x54) /* ISurf USB + 3070 */ |
148 | #define HD_CLOSE_B2CHANNEL_ACK (0x54) // ISurf USB + 3070 | 148 | #define HD_SUSPEND_END (0x61) /* ISurf USB */ |
149 | // Powermangment | 149 | #define HD_RESET_INTERRUPT_PIPE_ACK (0xFF) /* ISurf USB + 3070 */ |
150 | #define HD_SUSPEND_END (0x61) // ISurf USB | 150 | |
151 | // Configuration | 151 | /* control requests */ |
152 | #define HD_RESET_INTERRUPT_PIPE_ACK (0xFF) // ISurf USB + 3070 | 152 | #define HD_OPEN_B1CHANNEL (0x23) /* ISurf USB + 3070 */ |
153 | 153 | #define HD_CLOSE_B1CHANNEL (0x24) /* ISurf USB + 3070 */ | |
154 | /* control requests 3070 */ | 154 | #define HD_OPEN_B2CHANNEL (0x25) /* ISurf USB + 3070 */ |
155 | #define HD_OPEN_B1CHANNEL (0x23) // ISurf USB + 3070 | 155 | #define HD_CLOSE_B2CHANNEL (0x26) /* ISurf USB + 3070 */ |
156 | #define HD_CLOSE_B1CHANNEL (0x24) // ISurf USB + 3070 | 156 | #define HD_RESET_INTERRUPT_PIPE (0x27) /* ISurf USB + 3070 */ |
157 | #define HD_OPEN_B2CHANNEL (0x25) // ISurf USB + 3070 | 157 | #define HD_DEVICE_INIT_ACK (0x34) /* ISurf USB + 3070 */ |
158 | #define HD_CLOSE_B2CHANNEL (0x26) // ISurf USB + 3070 | 158 | #define HD_WRITE_ATMESSAGE (0x12) /* 3070 */ |
159 | #define HD_RESET_INTERRUPT_PIPE (0x27) // ISurf USB + 3070 | 159 | #define HD_READ_ATMESSAGE (0x13) /* 3070 */ |
160 | #define HD_DEVICE_INIT_ACK (0x34) // ISurf USB + 3070 | 160 | #define HD_OPEN_ATCHANNEL (0x28) /* 3070 */ |
161 | #define HD_WRITE_ATMESSAGE (0x12) // 3070 | 161 | #define HD_CLOSE_ATCHANNEL (0x29) /* 3070 */ |
162 | #define HD_READ_ATMESSAGE (0x13) // 3070 | ||
163 | #define HD_OPEN_ATCHANNEL (0x28) // 3070 | ||
164 | #define HD_CLOSE_ATCHANNEL (0x29) // 3070 | ||
165 | 162 | ||
166 | /* number of B channels supported by base driver */ | 163 | /* number of B channels supported by base driver */ |
167 | #define BAS_CHANNELS 2 | 164 | #define BAS_CHANNELS 2 |
@@ -631,7 +628,8 @@ struct gigaset_ops { | |||
631 | 628 | ||
632 | }; | 629 | }; |
633 | 630 | ||
634 | /* = Common structures and definitions ======================================= */ | 631 | /* = Common structures and definitions ======================================= |
632 | */ | ||
635 | 633 | ||
636 | /* Parser states for DLE-Event: | 634 | /* Parser states for DLE-Event: |
637 | * <DLE-EVENT>: <DLE_FLAG> "X" <EVENT> <DLE_FLAG> "." | 635 | * <DLE-EVENT>: <DLE_FLAG> "X" <EVENT> <DLE_FLAG> "." |
@@ -776,7 +774,7 @@ struct event_t *gigaset_add_event(struct cardstate *cs, | |||
776 | void *ptr, int parameter, void *arg); | 774 | void *ptr, int parameter, void *arg); |
777 | 775 | ||
778 | /* Called on CONFIG1 command from frontend. */ | 776 | /* Called on CONFIG1 command from frontend. */ |
779 | int gigaset_enterconfigmode(struct cardstate *cs); //0: success <0: errorcode | 777 | int gigaset_enterconfigmode(struct cardstate *cs); |
780 | 778 | ||
781 | /* cs->lock must not be locked */ | 779 | /* cs->lock must not be locked */ |
782 | static inline void gigaset_schedule_event(struct cardstate *cs) | 780 | static inline void gigaset_schedule_event(struct cardstate *cs) |
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c index 828824f905c4..c129ee47a8fb 100644 --- a/drivers/isdn/gigaset/i4l.c +++ b/drivers/isdn/gigaset/i4l.c | |||
@@ -39,12 +39,12 @@ | |||
39 | static int writebuf_from_LL(int driverID, int channel, int ack, | 39 | static int writebuf_from_LL(int driverID, int channel, int ack, |
40 | struct sk_buff *skb) | 40 | struct sk_buff *skb) |
41 | { | 41 | { |
42 | struct cardstate *cs; | 42 | struct cardstate *cs = gigaset_get_cs_by_id(driverID); |
43 | struct bc_state *bcs; | 43 | struct bc_state *bcs; |
44 | unsigned char *ack_header; | 44 | unsigned char *ack_header; |
45 | unsigned len; | 45 | unsigned len; |
46 | 46 | ||
47 | if (!(cs = gigaset_get_cs_by_id(driverID))) { | 47 | if (!cs) { |
48 | pr_err("%s: invalid driver ID (%d)\n", __func__, driverID); | 48 | pr_err("%s: invalid driver ID (%d)\n", __func__, driverID); |
49 | return -ENODEV; | 49 | return -ENODEV; |
50 | } | 50 | } |
@@ -391,22 +391,19 @@ static int command_from_LL(isdn_ctrl *cntrl) | |||
391 | 391 | ||
392 | break; | 392 | break; |
393 | case ISDN_CMD_PROCEED: | 393 | case ISDN_CMD_PROCEED: |
394 | gig_dbg(DEBUG_ANY, "ISDN_CMD_PROCEED"); //FIXME | 394 | gig_dbg(DEBUG_ANY, "ISDN_CMD_PROCEED"); |
395 | break; | 395 | break; |
396 | case ISDN_CMD_ALERT: | 396 | case ISDN_CMD_ALERT: |
397 | gig_dbg(DEBUG_ANY, "ISDN_CMD_ALERT"); //FIXME | 397 | gig_dbg(DEBUG_ANY, "ISDN_CMD_ALERT"); |
398 | if (cntrl->arg >= cs->channels) { | 398 | if (cntrl->arg >= cs->channels) { |
399 | dev_err(cs->dev, | 399 | dev_err(cs->dev, |
400 | "ISDN_CMD_ALERT: invalid channel (%d)\n", | 400 | "ISDN_CMD_ALERT: invalid channel (%d)\n", |
401 | (int) cntrl->arg); | 401 | (int) cntrl->arg); |
402 | return -EINVAL; | 402 | return -EINVAL; |
403 | } | 403 | } |
404 | //bcs = cs->bcs + cntrl->arg; | ||
405 | //bcs->proto2 = -1; | ||
406 | // FIXME | ||
407 | break; | 404 | break; |
408 | case ISDN_CMD_REDIR: | 405 | case ISDN_CMD_REDIR: |
409 | gig_dbg(DEBUG_ANY, "ISDN_CMD_REDIR"); //FIXME | 406 | gig_dbg(DEBUG_ANY, "ISDN_CMD_REDIR"); |
410 | break; | 407 | break; |
411 | case ISDN_CMD_PROT_IO: | 408 | case ISDN_CMD_PROT_IO: |
412 | gig_dbg(DEBUG_ANY, "ISDN_CMD_PROT_IO"); | 409 | gig_dbg(DEBUG_ANY, "ISDN_CMD_PROT_IO"); |
@@ -486,7 +483,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state) | |||
486 | /* fill ICALL structure */ | 483 | /* fill ICALL structure */ |
487 | response.parm.setup.si1 = 0; /* default: unknown */ | 484 | response.parm.setup.si1 = 0; /* default: unknown */ |
488 | response.parm.setup.si2 = 0; | 485 | response.parm.setup.si2 = 0; |
489 | response.parm.setup.screen = 0; //FIXME how to set these? | 486 | response.parm.setup.screen = 0; |
490 | response.parm.setup.plan = 0; | 487 | response.parm.setup.plan = 0; |
491 | if (!at_state->str_var[STR_ZBC]) { | 488 | if (!at_state->str_var[STR_ZBC]) { |
492 | /* no BC (internal call): assume speech, A-law */ | 489 | /* no BC (internal call): assume speech, A-law */ |
@@ -507,26 +504,24 @@ int gigaset_isdn_icall(struct at_state_t *at_state) | |||
507 | return ICALL_IGNORE; | 504 | return ICALL_IGNORE; |
508 | } | 505 | } |
509 | if (at_state->str_var[STR_NMBR]) { | 506 | if (at_state->str_var[STR_NMBR]) { |
510 | strncpy(response.parm.setup.phone, at_state->str_var[STR_NMBR], | 507 | strlcpy(response.parm.setup.phone, at_state->str_var[STR_NMBR], |
511 | sizeof response.parm.setup.phone - 1); | 508 | sizeof response.parm.setup.phone); |
512 | response.parm.setup.phone[sizeof response.parm.setup.phone - 1] = 0; | ||
513 | } else | 509 | } else |
514 | response.parm.setup.phone[0] = 0; | 510 | response.parm.setup.phone[0] = 0; |
515 | if (at_state->str_var[STR_ZCPN]) { | 511 | if (at_state->str_var[STR_ZCPN]) { |
516 | strncpy(response.parm.setup.eazmsn, at_state->str_var[STR_ZCPN], | 512 | strlcpy(response.parm.setup.eazmsn, at_state->str_var[STR_ZCPN], |
517 | sizeof response.parm.setup.eazmsn - 1); | 513 | sizeof response.parm.setup.eazmsn); |
518 | response.parm.setup.eazmsn[sizeof response.parm.setup.eazmsn - 1] = 0; | ||
519 | } else | 514 | } else |
520 | response.parm.setup.eazmsn[0] = 0; | 515 | response.parm.setup.eazmsn[0] = 0; |
521 | 516 | ||
522 | if (!bcs) { | 517 | if (!bcs) { |
523 | dev_notice(cs->dev, "no channel for incoming call\n"); | 518 | dev_notice(cs->dev, "no channel for incoming call\n"); |
524 | response.command = ISDN_STAT_ICALLW; | 519 | response.command = ISDN_STAT_ICALLW; |
525 | response.arg = 0; //FIXME | 520 | response.arg = 0; |
526 | } else { | 521 | } else { |
527 | gig_dbg(DEBUG_CMD, "Sending ICALL"); | 522 | gig_dbg(DEBUG_CMD, "Sending ICALL"); |
528 | response.command = ISDN_STAT_ICALL; | 523 | response.command = ISDN_STAT_ICALL; |
529 | response.arg = bcs->channel; //FIXME | 524 | response.arg = bcs->channel; |
530 | } | 525 | } |
531 | response.driver = cs->myid; | 526 | response.driver = cs->myid; |
532 | retval = iif->statcallb(&response); | 527 | retval = iif->statcallb(&response); |
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index 6a8e1384e7bd..577809c03aed 100644 --- a/drivers/isdn/gigaset/interface.c +++ b/drivers/isdn/gigaset/interface.c | |||
@@ -162,7 +162,7 @@ static int if_open(struct tty_struct *tty, struct file *filp) | |||
162 | return -ENODEV; | 162 | return -ENODEV; |
163 | 163 | ||
164 | if (mutex_lock_interruptible(&cs->mutex)) | 164 | if (mutex_lock_interruptible(&cs->mutex)) |
165 | return -ERESTARTSYS; // FIXME -EINTR? | 165 | return -ERESTARTSYS; |
166 | tty->driver_data = cs; | 166 | tty->driver_data = cs; |
167 | 167 | ||
168 | ++cs->open_count; | 168 | ++cs->open_count; |
@@ -171,7 +171,7 @@ static int if_open(struct tty_struct *tty, struct file *filp) | |||
171 | spin_lock_irqsave(&cs->lock, flags); | 171 | spin_lock_irqsave(&cs->lock, flags); |
172 | cs->tty = tty; | 172 | cs->tty = tty; |
173 | spin_unlock_irqrestore(&cs->lock, flags); | 173 | spin_unlock_irqrestore(&cs->lock, flags); |
174 | tty->low_latency = 1; //FIXME test | 174 | tty->low_latency = 1; |
175 | } | 175 | } |
176 | 176 | ||
177 | mutex_unlock(&cs->mutex); | 177 | mutex_unlock(&cs->mutex); |
@@ -228,7 +228,7 @@ static int if_ioctl(struct tty_struct *tty, struct file *file, | |||
228 | gig_dbg(DEBUG_IF, "%u: %s(0x%x)", cs->minor_index, __func__, cmd); | 228 | gig_dbg(DEBUG_IF, "%u: %s(0x%x)", cs->minor_index, __func__, cmd); |
229 | 229 | ||
230 | if (mutex_lock_interruptible(&cs->mutex)) | 230 | if (mutex_lock_interruptible(&cs->mutex)) |
231 | return -ERESTARTSYS; // FIXME -EINTR? | 231 | return -ERESTARTSYS; |
232 | 232 | ||
233 | if (!cs->connected) { | 233 | if (!cs->connected) { |
234 | gig_dbg(DEBUG_IF, "not connected"); | 234 | gig_dbg(DEBUG_IF, "not connected"); |
@@ -299,9 +299,8 @@ static int if_tiocmget(struct tty_struct *tty, struct file *file) | |||
299 | gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); | 299 | gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); |
300 | 300 | ||
301 | if (mutex_lock_interruptible(&cs->mutex)) | 301 | if (mutex_lock_interruptible(&cs->mutex)) |
302 | return -ERESTARTSYS; // FIXME -EINTR? | 302 | return -ERESTARTSYS; |
303 | 303 | ||
304 | // FIXME read from device? | ||
305 | retval = cs->control_state & (TIOCM_RTS|TIOCM_DTR); | 304 | retval = cs->control_state & (TIOCM_RTS|TIOCM_DTR); |
306 | 305 | ||
307 | mutex_unlock(&cs->mutex); | 306 | mutex_unlock(&cs->mutex); |
@@ -326,7 +325,7 @@ static int if_tiocmset(struct tty_struct *tty, struct file *file, | |||
326 | cs->minor_index, __func__, set, clear); | 325 | cs->minor_index, __func__, set, clear); |
327 | 326 | ||
328 | if (mutex_lock_interruptible(&cs->mutex)) | 327 | if (mutex_lock_interruptible(&cs->mutex)) |
329 | return -ERESTARTSYS; // FIXME -EINTR? | 328 | return -ERESTARTSYS; |
330 | 329 | ||
331 | if (!cs->connected) { | 330 | if (!cs->connected) { |
332 | gig_dbg(DEBUG_IF, "not connected"); | 331 | gig_dbg(DEBUG_IF, "not connected"); |
@@ -356,7 +355,7 @@ static int if_write(struct tty_struct *tty, const unsigned char *buf, int count) | |||
356 | gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); | 355 | gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); |
357 | 356 | ||
358 | if (mutex_lock_interruptible(&cs->mutex)) | 357 | if (mutex_lock_interruptible(&cs->mutex)) |
359 | return -ERESTARTSYS; // FIXME -EINTR? | 358 | return -ERESTARTSYS; |
360 | 359 | ||
361 | if (!cs->connected) { | 360 | if (!cs->connected) { |
362 | gig_dbg(DEBUG_IF, "not connected"); | 361 | gig_dbg(DEBUG_IF, "not connected"); |
@@ -390,7 +389,7 @@ static int if_write_room(struct tty_struct *tty) | |||
390 | gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); | 389 | gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); |
391 | 390 | ||
392 | if (mutex_lock_interruptible(&cs->mutex)) | 391 | if (mutex_lock_interruptible(&cs->mutex)) |
393 | return -ERESTARTSYS; // FIXME -EINTR? | 392 | return -ERESTARTSYS; |
394 | 393 | ||
395 | if (!cs->connected) { | 394 | if (!cs->connected) { |
396 | gig_dbg(DEBUG_IF, "not connected"); | 395 | gig_dbg(DEBUG_IF, "not connected"); |
@@ -455,9 +454,8 @@ static void if_throttle(struct tty_struct *tty) | |||
455 | gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */ | 454 | gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */ |
456 | else if (!cs->open_count) | 455 | else if (!cs->open_count) |
457 | dev_warn(cs->dev, "%s: device not opened\n", __func__); | 456 | dev_warn(cs->dev, "%s: device not opened\n", __func__); |
458 | else { | 457 | else |
459 | //FIXME | 458 | gig_dbg(DEBUG_ANY, "%s: not implemented\n", __func__); |
460 | } | ||
461 | 459 | ||
462 | mutex_unlock(&cs->mutex); | 460 | mutex_unlock(&cs->mutex); |
463 | } | 461 | } |
@@ -480,9 +478,8 @@ static void if_unthrottle(struct tty_struct *tty) | |||
480 | gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */ | 478 | gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */ |
481 | else if (!cs->open_count) | 479 | else if (!cs->open_count) |
482 | dev_warn(cs->dev, "%s: device not opened\n", __func__); | 480 | dev_warn(cs->dev, "%s: device not opened\n", __func__); |
483 | else { | 481 | else |
484 | //FIXME | 482 | gig_dbg(DEBUG_ANY, "%s: not implemented\n", __func__); |
485 | } | ||
486 | 483 | ||
487 | mutex_unlock(&cs->mutex); | 484 | mutex_unlock(&cs->mutex); |
488 | } | 485 | } |
@@ -515,10 +512,9 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old) | |||
515 | goto out; | 512 | goto out; |
516 | } | 513 | } |
517 | 514 | ||
518 | // stolen from mct_u232.c | ||
519 | iflag = tty->termios->c_iflag; | 515 | iflag = tty->termios->c_iflag; |
520 | cflag = tty->termios->c_cflag; | 516 | cflag = tty->termios->c_cflag; |
521 | old_cflag = old ? old->c_cflag : cflag; //FIXME? | 517 | old_cflag = old ? old->c_cflag : cflag; |
522 | gig_dbg(DEBUG_IF, "%u: iflag %x cflag %x old %x", | 518 | gig_dbg(DEBUG_IF, "%u: iflag %x cflag %x old %x", |
523 | cs->minor_index, iflag, cflag, old_cflag); | 519 | cs->minor_index, iflag, cflag, old_cflag); |
524 | 520 | ||
@@ -632,7 +628,8 @@ void gigaset_if_receive(struct cardstate *cs, | |||
632 | struct tty_struct *tty; | 628 | struct tty_struct *tty; |
633 | 629 | ||
634 | spin_lock_irqsave(&cs->lock, flags); | 630 | spin_lock_irqsave(&cs->lock, flags); |
635 | if ((tty = cs->tty) == NULL) | 631 | tty = cs->tty; |
632 | if (tty == NULL) | ||
636 | gig_dbg(DEBUG_ANY, "receive on closed device"); | 633 | gig_dbg(DEBUG_ANY, "receive on closed device"); |
637 | else { | 634 | else { |
638 | tty_buffer_request_room(tty, len); | 635 | tty_buffer_request_room(tty, len); |
@@ -659,9 +656,9 @@ void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname, | |||
659 | 656 | ||
660 | drv->have_tty = 0; | 657 | drv->have_tty = 0; |
661 | 658 | ||
662 | if ((drv->tty = alloc_tty_driver(minors)) == NULL) | 659 | drv->tty = tty = alloc_tty_driver(minors); |
660 | if (tty == NULL) | ||
663 | goto enomem; | 661 | goto enomem; |
664 | tty = drv->tty; | ||
665 | 662 | ||
666 | tty->magic = TTY_DRIVER_MAGIC, | 663 | tty->magic = TTY_DRIVER_MAGIC, |
667 | tty->major = GIG_MAJOR, | 664 | tty->major = GIG_MAJOR, |
@@ -676,8 +673,8 @@ void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname, | |||
676 | 673 | ||
677 | tty->owner = THIS_MODULE; | 674 | tty->owner = THIS_MODULE; |
678 | 675 | ||
679 | tty->init_termios = tty_std_termios; //FIXME | 676 | tty->init_termios = tty_std_termios; |
680 | tty->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; //FIXME | 677 | tty->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; |
681 | tty_set_operations(tty, &if_ops); | 678 | tty_set_operations(tty, &if_ops); |
682 | 679 | ||
683 | ret = tty_register_driver(tty); | 680 | ret = tty_register_driver(tty); |
diff --git a/drivers/isdn/gigaset/proc.c b/drivers/isdn/gigaset/proc.c index 9715aad9c3f0..758a00c1d2e2 100644 --- a/drivers/isdn/gigaset/proc.c +++ b/drivers/isdn/gigaset/proc.c | |||
@@ -39,7 +39,7 @@ static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr, | |||
39 | return -EINVAL; | 39 | return -EINVAL; |
40 | 40 | ||
41 | if (mutex_lock_interruptible(&cs->mutex)) | 41 | if (mutex_lock_interruptible(&cs->mutex)) |
42 | return -ERESTARTSYS; // FIXME -EINTR? | 42 | return -ERESTARTSYS; |
43 | 43 | ||
44 | cs->waiting = 1; | 44 | cs->waiting = 1; |
45 | if (!gigaset_add_event(cs, &cs->at_state, EV_PROC_CIDMODE, | 45 | if (!gigaset_add_event(cs, &cs->at_state, EV_PROC_CIDMODE, |