diff options
Diffstat (limited to 'drivers/isdn/gigaset/interface.c')
-rw-r--r-- | drivers/isdn/gigaset/interface.c | 39 |
1 files changed, 18 insertions, 21 deletions
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); |