aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/epca.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/epca.c')
-rw-r--r--drivers/char/epca.c168
1 files changed, 77 insertions, 91 deletions
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index 60a4df7dac12..456e4ede049f 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -184,9 +184,8 @@ static void pc_stop(struct tty_struct *);
184static void pc_start(struct tty_struct *); 184static void pc_start(struct tty_struct *);
185static void pc_throttle(struct tty_struct *tty); 185static void pc_throttle(struct tty_struct *tty);
186static void pc_unthrottle(struct tty_struct *tty); 186static void pc_unthrottle(struct tty_struct *tty);
187static void digi_send_break(struct channel *ch, int msec); 187static int pc_send_break(struct tty_struct *tty, int msec);
188static void setup_empty_event(struct tty_struct *tty, struct channel *ch); 188static void setup_empty_event(struct tty_struct *tty, struct channel *ch);
189static void epca_setup(char *, int *);
190 189
191static int pc_write(struct tty_struct *, const unsigned char *, int); 190static int pc_write(struct tty_struct *, const unsigned char *, int);
192static int pc_init(void); 191static int pc_init(void);
@@ -432,7 +431,7 @@ static void pc_close(struct tty_struct *tty, struct file *filp)
432 spin_unlock_irqrestore(&epca_lock, flags); 431 spin_unlock_irqrestore(&epca_lock, flags);
433 return; 432 return;
434 } 433 }
435 if (ch->count-- > 1) { 434 if (ch->port.count-- > 1) {
436 /* Begin channel is open more than once */ 435 /* Begin channel is open more than once */
437 /* 436 /*
438 * Return without doing anything. Someone might still 437 * Return without doing anything. Someone might still
@@ -442,19 +441,19 @@ static void pc_close(struct tty_struct *tty, struct file *filp)
442 return; 441 return;
443 } 442 }
444 /* Port open only once go ahead with shutdown & reset */ 443 /* Port open only once go ahead with shutdown & reset */
445 BUG_ON(ch->count < 0); 444 BUG_ON(ch->port.count < 0);
446 445
447 /* 446 /*
448 * Let the rest of the driver know the channel is being closed. 447 * Let the rest of the driver know the channel is being closed.
449 * This becomes important if an open is attempted before close 448 * This becomes important if an open is attempted before close
450 * is finished. 449 * is finished.
451 */ 450 */
452 ch->asyncflags |= ASYNC_CLOSING; 451 ch->port.flags |= ASYNC_CLOSING;
453 tty->closing = 1; 452 tty->closing = 1;
454 453
455 spin_unlock_irqrestore(&epca_lock, flags); 454 spin_unlock_irqrestore(&epca_lock, flags);
456 455
457 if (ch->asyncflags & ASYNC_INITIALIZED) { 456 if (ch->port.flags & ASYNC_INITIALIZED) {
458 /* Setup an event to indicate when the 457 /* Setup an event to indicate when the
459 transmit buffer empties */ 458 transmit buffer empties */
460 setup_empty_event(tty, ch); 459 setup_empty_event(tty, ch);
@@ -469,17 +468,17 @@ static void pc_close(struct tty_struct *tty, struct file *filp)
469 spin_lock_irqsave(&epca_lock, flags); 468 spin_lock_irqsave(&epca_lock, flags);
470 tty->closing = 0; 469 tty->closing = 0;
471 ch->event = 0; 470 ch->event = 0;
472 ch->tty = NULL; 471 ch->port.tty = NULL;
473 spin_unlock_irqrestore(&epca_lock, flags); 472 spin_unlock_irqrestore(&epca_lock, flags);
474 473
475 if (ch->blocked_open) { 474 if (ch->port.blocked_open) {
476 if (ch->close_delay) 475 if (ch->close_delay)
477 msleep_interruptible(jiffies_to_msecs(ch->close_delay)); 476 msleep_interruptible(jiffies_to_msecs(ch->close_delay));
478 wake_up_interruptible(&ch->open_wait); 477 wake_up_interruptible(&ch->port.open_wait);
479 } 478 }
480 ch->asyncflags &= ~(ASYNC_NORMAL_ACTIVE | ASYNC_INITIALIZED | 479 ch->port.flags &= ~(ASYNC_NORMAL_ACTIVE | ASYNC_INITIALIZED |
481 ASYNC_CLOSING); 480 ASYNC_CLOSING);
482 wake_up_interruptible(&ch->close_wait); 481 wake_up_interruptible(&ch->port.close_wait);
483 } 482 }
484} 483}
485 484
@@ -489,7 +488,7 @@ static void shutdown(struct channel *ch)
489 struct tty_struct *tty; 488 struct tty_struct *tty;
490 struct board_chan __iomem *bc; 489 struct board_chan __iomem *bc;
491 490
492 if (!(ch->asyncflags & ASYNC_INITIALIZED)) 491 if (!(ch->port.flags & ASYNC_INITIALIZED))
493 return; 492 return;
494 493
495 spin_lock_irqsave(&epca_lock, flags); 494 spin_lock_irqsave(&epca_lock, flags);
@@ -504,7 +503,7 @@ static void shutdown(struct channel *ch)
504 */ 503 */
505 if (bc) 504 if (bc)
506 writeb(0, &bc->idata); 505 writeb(0, &bc->idata);
507 tty = ch->tty; 506 tty = ch->port.tty;
508 507
509 /* If we're a modem control device and HUPCL is on, drop RTS & DTR. */ 508 /* If we're a modem control device and HUPCL is on, drop RTS & DTR. */
510 if (tty->termios->c_cflag & HUPCL) { 509 if (tty->termios->c_cflag & HUPCL) {
@@ -518,7 +517,7 @@ static void shutdown(struct channel *ch)
518 * will have to reinitialized. Set a flag to indicate this. 517 * will have to reinitialized. Set a flag to indicate this.
519 */ 518 */
520 /* Prevent future Digi programmed interrupts from coming active */ 519 /* Prevent future Digi programmed interrupts from coming active */
521 ch->asyncflags &= ~ASYNC_INITIALIZED; 520 ch->port.flags &= ~ASYNC_INITIALIZED;
522 spin_unlock_irqrestore(&epca_lock, flags); 521 spin_unlock_irqrestore(&epca_lock, flags);
523} 522}
524 523
@@ -538,12 +537,12 @@ static void pc_hangup(struct tty_struct *tty)
538 shutdown(ch); 537 shutdown(ch);
539 538
540 spin_lock_irqsave(&epca_lock, flags); 539 spin_lock_irqsave(&epca_lock, flags);
541 ch->tty = NULL; 540 ch->port.tty = NULL;
542 ch->event = 0; 541 ch->event = 0;
543 ch->count = 0; 542 ch->port.count = 0;
544 ch->asyncflags &= ~(ASYNC_NORMAL_ACTIVE | ASYNC_INITIALIZED); 543 ch->port.flags &= ~(ASYNC_NORMAL_ACTIVE | ASYNC_INITIALIZED);
545 spin_unlock_irqrestore(&epca_lock, flags); 544 spin_unlock_irqrestore(&epca_lock, flags);
546 wake_up_interruptible(&ch->open_wait); 545 wake_up_interruptible(&ch->port.open_wait);
547 } 546 }
548} 547}
549 548
@@ -795,7 +794,7 @@ static int block_til_ready(struct tty_struct *tty,
795 unsigned long flags; 794 unsigned long flags;
796 795
797 if (tty_hung_up_p(filp)) { 796 if (tty_hung_up_p(filp)) {
798 if (ch->asyncflags & ASYNC_HUP_NOTIFY) 797 if (ch->port.flags & ASYNC_HUP_NOTIFY)
799 retval = -EAGAIN; 798 retval = -EAGAIN;
800 else 799 else
801 retval = -ERESTARTSYS; 800 retval = -ERESTARTSYS;
@@ -806,10 +805,10 @@ static int block_til_ready(struct tty_struct *tty,
806 * If the device is in the middle of being closed, then block until 805 * If the device is in the middle of being closed, then block until
807 * it's done, and then try again. 806 * it's done, and then try again.
808 */ 807 */
809 if (ch->asyncflags & ASYNC_CLOSING) { 808 if (ch->port.flags & ASYNC_CLOSING) {
810 interruptible_sleep_on(&ch->close_wait); 809 interruptible_sleep_on(&ch->port.close_wait);
811 810
812 if (ch->asyncflags & ASYNC_HUP_NOTIFY) 811 if (ch->port.flags & ASYNC_HUP_NOTIFY)
813 return -EAGAIN; 812 return -EAGAIN;
814 else 813 else
815 return -ERESTARTSYS; 814 return -ERESTARTSYS;
@@ -820,7 +819,7 @@ static int block_til_ready(struct tty_struct *tty,
820 * If non-blocking mode is set, then make the check up front 819 * If non-blocking mode is set, then make the check up front
821 * and then exit. 820 * and then exit.
822 */ 821 */
823 ch->asyncflags |= ASYNC_NORMAL_ACTIVE; 822 ch->port.flags |= ASYNC_NORMAL_ACTIVE;
824 return 0; 823 return 0;
825 } 824 }
826 if (tty->termios->c_cflag & CLOCAL) 825 if (tty->termios->c_cflag & CLOCAL)
@@ -828,24 +827,24 @@ static int block_til_ready(struct tty_struct *tty,
828 /* Block waiting for the carrier detect and the line to become free */ 827 /* Block waiting for the carrier detect and the line to become free */
829 828
830 retval = 0; 829 retval = 0;
831 add_wait_queue(&ch->open_wait, &wait); 830 add_wait_queue(&ch->port.open_wait, &wait);
832 831
833 spin_lock_irqsave(&epca_lock, flags); 832 spin_lock_irqsave(&epca_lock, flags);
834 /* We dec count so that pc_close will know when to free things */ 833 /* We dec count so that pc_close will know when to free things */
835 if (!tty_hung_up_p(filp)) 834 if (!tty_hung_up_p(filp))
836 ch->count--; 835 ch->port.count--;
837 ch->blocked_open++; 836 ch->port.blocked_open++;
838 while (1) { 837 while (1) {
839 set_current_state(TASK_INTERRUPTIBLE); 838 set_current_state(TASK_INTERRUPTIBLE);
840 if (tty_hung_up_p(filp) || 839 if (tty_hung_up_p(filp) ||
841 !(ch->asyncflags & ASYNC_INITIALIZED)) { 840 !(ch->port.flags & ASYNC_INITIALIZED)) {
842 if (ch->asyncflags & ASYNC_HUP_NOTIFY) 841 if (ch->port.flags & ASYNC_HUP_NOTIFY)
843 retval = -EAGAIN; 842 retval = -EAGAIN;
844 else 843 else
845 retval = -ERESTARTSYS; 844 retval = -ERESTARTSYS;
846 break; 845 break;
847 } 846 }
848 if (!(ch->asyncflags & ASYNC_CLOSING) && 847 if (!(ch->port.flags & ASYNC_CLOSING) &&
849 (do_clocal || (ch->imodem & ch->dcd))) 848 (do_clocal || (ch->imodem & ch->dcd)))
850 break; 849 break;
851 if (signal_pending(current)) { 850 if (signal_pending(current)) {
@@ -864,17 +863,17 @@ static int block_til_ready(struct tty_struct *tty,
864 } 863 }
865 864
866 __set_current_state(TASK_RUNNING); 865 __set_current_state(TASK_RUNNING);
867 remove_wait_queue(&ch->open_wait, &wait); 866 remove_wait_queue(&ch->port.open_wait, &wait);
868 if (!tty_hung_up_p(filp)) 867 if (!tty_hung_up_p(filp))
869 ch->count++; 868 ch->port.count++;
870 ch->blocked_open--; 869 ch->port.blocked_open--;
871 870
872 spin_unlock_irqrestore(&epca_lock, flags); 871 spin_unlock_irqrestore(&epca_lock, flags);
873 872
874 if (retval) 873 if (retval)
875 return retval; 874 return retval;
876 875
877 ch->asyncflags |= ASYNC_NORMAL_ACTIVE; 876 ch->port.flags |= ASYNC_NORMAL_ACTIVE;
878 return 0; 877 return 0;
879} 878}
880 879
@@ -933,7 +932,7 @@ static int pc_open(struct tty_struct *tty, struct file *filp)
933 * necessary because we do not wish to flush and shutdown the channel 932 * necessary because we do not wish to flush and shutdown the channel
934 * until the last app holding the channel open, closes it. 933 * until the last app holding the channel open, closes it.
935 */ 934 */
936 ch->count++; 935 ch->port.count++;
937 /* 936 /*
938 * Set a kernel structures pointer to our local channel structure. This 937 * Set a kernel structures pointer to our local channel structure. This
939 * way we can get to it when passed only a tty struct. 938 * way we can get to it when passed only a tty struct.
@@ -957,14 +956,14 @@ static int pc_open(struct tty_struct *tty, struct file *filp)
957 writew(head, &bc->rout); 956 writew(head, &bc->rout);
958 957
959 /* Set the channels associated tty structure */ 958 /* Set the channels associated tty structure */
960 ch->tty = tty; 959 ch->port.tty = tty;
961 960
962 /* 961 /*
963 * The below routine generally sets up parity, baud, flow control 962 * The below routine generally sets up parity, baud, flow control
964 * issues, etc.... It effect both control flags and input flags. 963 * issues, etc.... It effect both control flags and input flags.
965 */ 964 */
966 epcaparam(tty, ch); 965 epcaparam(tty, ch);
967 ch->asyncflags |= ASYNC_INITIALIZED; 966 ch->port.flags |= ASYNC_INITIALIZED;
968 memoff(ch); 967 memoff(ch);
969 spin_unlock_irqrestore(&epca_lock, flags); 968 spin_unlock_irqrestore(&epca_lock, flags);
970 969
@@ -976,7 +975,7 @@ static int pc_open(struct tty_struct *tty, struct file *filp)
976 * waiting for the line... 975 * waiting for the line...
977 */ 976 */
978 spin_lock_irqsave(&epca_lock, flags); 977 spin_lock_irqsave(&epca_lock, flags);
979 ch->tty = tty; 978 ch->port.tty = tty;
980 globalwinon(ch); 979 globalwinon(ch);
981 /* Enable Digi Data events */ 980 /* Enable Digi Data events */
982 writeb(1, &bc->idata); 981 writeb(1, &bc->idata);
@@ -1017,8 +1016,8 @@ static void __exit epca_module_exit(void)
1017 } 1016 }
1018 ch = card_ptr[crd]; 1017 ch = card_ptr[crd];
1019 for (count = 0; count < bd->numports; count++, ch++) { 1018 for (count = 0; count < bd->numports; count++, ch++) {
1020 if (ch && ch->tty) 1019 if (ch && ch->port.tty)
1021 tty_hangup(ch->tty); 1020 tty_hangup(ch->port.tty);
1022 } 1021 }
1023 } 1022 }
1024 pci_unregister_driver(&epca_driver); 1023 pci_unregister_driver(&epca_driver);
@@ -1040,6 +1039,7 @@ static const struct tty_operations pc_ops = {
1040 .throttle = pc_throttle, 1039 .throttle = pc_throttle,
1041 .unthrottle = pc_unthrottle, 1040 .unthrottle = pc_unthrottle,
1042 .hangup = pc_hangup, 1041 .hangup = pc_hangup,
1042 .break_ctl = pc_send_break
1043}; 1043};
1044 1044
1045static int info_open(struct tty_struct *tty, struct file *filp) 1045static int info_open(struct tty_struct *tty, struct file *filp)
@@ -1132,7 +1132,7 @@ static int __init pc_init(void)
1132 pc_driver->init_termios.c_lflag = 0; 1132 pc_driver->init_termios.c_lflag = 0;
1133 pc_driver->init_termios.c_ispeed = 9600; 1133 pc_driver->init_termios.c_ispeed = 9600;
1134 pc_driver->init_termios.c_ospeed = 9600; 1134 pc_driver->init_termios.c_ospeed = 9600;
1135 pc_driver->flags = TTY_DRIVER_REAL_RAW; 1135 pc_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_HARDWARE_BREAK;
1136 tty_set_operations(pc_driver, &pc_ops); 1136 tty_set_operations(pc_driver, &pc_ops);
1137 1137
1138 pc_info->owner = THIS_MODULE; 1138 pc_info->owner = THIS_MODULE;
@@ -1427,7 +1427,7 @@ static void post_fep_init(unsigned int crd)
1427 ch->boardnum = crd; 1427 ch->boardnum = crd;
1428 ch->channelnum = i; 1428 ch->channelnum = i;
1429 ch->magic = EPCA_MAGIC; 1429 ch->magic = EPCA_MAGIC;
1430 ch->tty = NULL; 1430 ch->port.tty = NULL;
1431 1431
1432 if (shrinkmem) { 1432 if (shrinkmem) {
1433 fepcmd(ch, SETBUFFER, 32, 0, 0, 0); 1433 fepcmd(ch, SETBUFFER, 32, 0, 0, 0);
@@ -1510,10 +1510,10 @@ static void post_fep_init(unsigned int crd)
1510 ch->fepstopca = 0; 1510 ch->fepstopca = 0;
1511 1511
1512 ch->close_delay = 50; 1512 ch->close_delay = 50;
1513 ch->count = 0; 1513 ch->port.count = 0;
1514 ch->blocked_open = 0; 1514 ch->port.blocked_open = 0;
1515 init_waitqueue_head(&ch->open_wait); 1515 init_waitqueue_head(&ch->port.open_wait);
1516 init_waitqueue_head(&ch->close_wait); 1516 init_waitqueue_head(&ch->port.close_wait);
1517 1517
1518 spin_unlock_irqrestore(&epca_lock, flags); 1518 spin_unlock_irqrestore(&epca_lock, flags);
1519 } 1519 }
@@ -1633,15 +1633,15 @@ static void doevent(int crd)
1633 if (event & MODEMCHG_IND) { 1633 if (event & MODEMCHG_IND) {
1634 /* A modem signal change has been indicated */ 1634 /* A modem signal change has been indicated */
1635 ch->imodem = mstat; 1635 ch->imodem = mstat;
1636 if (ch->asyncflags & ASYNC_CHECK_CD) { 1636 if (ch->port.flags & ASYNC_CHECK_CD) {
1637 /* We are now receiving dcd */ 1637 /* We are now receiving dcd */
1638 if (mstat & ch->dcd) 1638 if (mstat & ch->dcd)
1639 wake_up_interruptible(&ch->open_wait); 1639 wake_up_interruptible(&ch->port.open_wait);
1640 else /* No dcd; hangup */ 1640 else /* No dcd; hangup */
1641 pc_sched_event(ch, EPCA_EVENT_HANGUP); 1641 pc_sched_event(ch, EPCA_EVENT_HANGUP);
1642 } 1642 }
1643 } 1643 }
1644 tty = ch->tty; 1644 tty = ch->port.tty;
1645 if (tty) { 1645 if (tty) {
1646 if (event & BREAK_IND) { 1646 if (event & BREAK_IND) {
1647 /* A break has been indicated */ 1647 /* A break has been indicated */
@@ -1880,9 +1880,9 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch)
1880 * that the driver will wait on carrier detect. 1880 * that the driver will wait on carrier detect.
1881 */ 1881 */
1882 if (ts->c_cflag & CLOCAL) 1882 if (ts->c_cflag & CLOCAL)
1883 ch->asyncflags &= ~ASYNC_CHECK_CD; 1883 ch->port.flags &= ~ASYNC_CHECK_CD;
1884 else 1884 else
1885 ch->asyncflags |= ASYNC_CHECK_CD; 1885 ch->port.flags |= ASYNC_CHECK_CD;
1886 mval = ch->m_dtr | ch->m_rts; 1886 mval = ch->m_dtr | ch->m_rts;
1887 } /* End CBAUD not detected */ 1887 } /* End CBAUD not detected */
1888 iflag = termios2digi_i(ch, ts->c_iflag); 1888 iflag = termios2digi_i(ch, ts->c_iflag);
@@ -1972,7 +1972,7 @@ static void receive_data(struct channel *ch)
1972 globalwinon(ch); 1972 globalwinon(ch);
1973 if (ch->statusflags & RXSTOPPED) 1973 if (ch->statusflags & RXSTOPPED)
1974 return; 1974 return;
1975 tty = ch->tty; 1975 tty = ch->port.tty;
1976 if (tty) 1976 if (tty)
1977 ts = tty->termios; 1977 ts = tty->termios;
1978 bc = ch->brdchan; 1978 bc = ch->brdchan;
@@ -2032,7 +2032,7 @@ static void receive_data(struct channel *ch)
2032 globalwinon(ch); 2032 globalwinon(ch);
2033 writew(tail, &bc->rout); 2033 writew(tail, &bc->rout);
2034 /* Must be called with global data */ 2034 /* Must be called with global data */
2035 tty_schedule_flip(ch->tty); 2035 tty_schedule_flip(ch->port.tty);
2036} 2036}
2037 2037
2038static int info_ioctl(struct tty_struct *tty, struct file *file, 2038static int info_ioctl(struct tty_struct *tty, struct file *file,
@@ -2177,7 +2177,6 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file,
2177 unsigned int cmd, unsigned long arg) 2177 unsigned int cmd, unsigned long arg)
2178{ 2178{
2179 digiflow_t dflow; 2179 digiflow_t dflow;
2180 int retval;
2181 unsigned long flags; 2180 unsigned long flags;
2182 unsigned int mflag, mstat; 2181 unsigned int mflag, mstat;
2183 unsigned char startc, stopc; 2182 unsigned char startc, stopc;
@@ -2189,37 +2188,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file,
2189 bc = ch->brdchan; 2188 bc = ch->brdchan;
2190 else 2189 else
2191 return -EINVAL; 2190 return -EINVAL;
2192 /*
2193 * For POSIX compliance we need to add more ioctls. See tty_ioctl.c in
2194 * /usr/src/linux/drivers/char for a good example. In particular think
2195 * about adding TCSETAF, TCSETAW, TCSETA, TCSETSF, TCSETSW, TCSETS.
2196 */
2197 switch (cmd) { 2191 switch (cmd) {
2198 case TCSBRK: /* SVID version: non-zero arg --> no break */
2199 retval = tty_check_change(tty);
2200 if (retval)
2201 return retval;
2202 /* Setup an event to indicate when the transmit
2203 buffer empties */
2204 spin_lock_irqsave(&epca_lock, flags);
2205 setup_empty_event(tty, ch);
2206 spin_unlock_irqrestore(&epca_lock, flags);
2207 tty_wait_until_sent(tty, 0);
2208 if (!arg)
2209 digi_send_break(ch, HZ / 4); /* 1/4 second */
2210 return 0;
2211 case TCSBRKP: /* support for POSIX tcsendbreak() */
2212 retval = tty_check_change(tty);
2213 if (retval)
2214 return retval;
2215 /* Setup an event to indicate when the transmit buffer
2216 empties */
2217 spin_lock_irqsave(&epca_lock, flags);
2218 setup_empty_event(tty, ch);
2219 spin_unlock_irqrestore(&epca_lock, flags);
2220 tty_wait_until_sent(tty, 0);
2221 digi_send_break(ch, arg ? arg*(HZ/10) : HZ/4);
2222 return 0;
2223 case TIOCMODG: 2192 case TIOCMODG:
2224 mflag = pc_tiocmget(tty, file); 2193 mflag = pc_tiocmget(tty, file);
2225 if (put_user(mflag, (unsigned long __user *)argp)) 2194 if (put_user(mflag, (unsigned long __user *)argp))
@@ -2262,8 +2231,8 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file,
2262 tty_wait_until_sent(tty, 0); 2231 tty_wait_until_sent(tty, 0);
2263 } else { 2232 } else {
2264 /* ldisc lock already held in ioctl */ 2233 /* ldisc lock already held in ioctl */
2265 if (tty->ldisc.flush_buffer) 2234 if (tty->ldisc.ops->flush_buffer)
2266 tty->ldisc.flush_buffer(tty); 2235 tty->ldisc.ops->flush_buffer(tty);
2267 } 2236 }
2268 unlock_kernel(); 2237 unlock_kernel();
2269 /* Fall Thru */ 2238 /* Fall Thru */
@@ -2376,7 +2345,7 @@ static void pc_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
2376 2345
2377 if (!(old_termios->c_cflag & CLOCAL) && 2346 if (!(old_termios->c_cflag & CLOCAL) &&
2378 (tty->termios->c_cflag & CLOCAL)) 2347 (tty->termios->c_cflag & CLOCAL))
2379 wake_up_interruptible(&ch->open_wait); 2348 wake_up_interruptible(&ch->port.open_wait);
2380 2349
2381 } /* End if channel valid */ 2350 } /* End if channel valid */
2382} 2351}
@@ -2386,13 +2355,13 @@ static void do_softint(struct work_struct *work)
2386 struct channel *ch = container_of(work, struct channel, tqueue); 2355 struct channel *ch = container_of(work, struct channel, tqueue);
2387 /* Called in response to a modem change event */ 2356 /* Called in response to a modem change event */
2388 if (ch && ch->magic == EPCA_MAGIC) { 2357 if (ch && ch->magic == EPCA_MAGIC) {
2389 struct tty_struct *tty = ch->tty; 2358 struct tty_struct *tty = ch->port.tty;
2390 2359
2391 if (tty && tty->driver_data) { 2360 if (tty && tty->driver_data) {
2392 if (test_and_clear_bit(EPCA_EVENT_HANGUP, &ch->event)) { 2361 if (test_and_clear_bit(EPCA_EVENT_HANGUP, &ch->event)) {
2393 tty_hangup(tty); 2362 tty_hangup(tty);
2394 wake_up_interruptible(&ch->open_wait); 2363 wake_up_interruptible(&ch->port.open_wait);
2395 ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE; 2364 ch->port.flags &= ~ASYNC_NORMAL_ACTIVE;
2396 } 2365 }
2397 } 2366 }
2398 } 2367 }
@@ -2505,10 +2474,14 @@ static void pc_unthrottle(struct tty_struct *tty)
2505 } 2474 }
2506} 2475}
2507 2476
2508static void digi_send_break(struct channel *ch, int msec) 2477static int pc_send_break(struct tty_struct *tty, int msec)
2509{ 2478{
2479 struct channel *ch = (struct channel *) tty->driver_data;
2510 unsigned long flags; 2480 unsigned long flags;
2511 2481
2482 if (msec == -1)
2483 return -EOPNOTSUPP;
2484
2512 spin_lock_irqsave(&epca_lock, flags); 2485 spin_lock_irqsave(&epca_lock, flags);
2513 globalwinon(ch); 2486 globalwinon(ch);
2514 /* 2487 /*
@@ -2521,6 +2494,7 @@ static void digi_send_break(struct channel *ch, int msec)
2521 fepcmd(ch, SENDBREAK, msec, 0, 10, 0); 2494 fepcmd(ch, SENDBREAK, msec, 0, 10, 0);
2522 memoff(ch); 2495 memoff(ch);
2523 spin_unlock_irqrestore(&epca_lock, flags); 2496 spin_unlock_irqrestore(&epca_lock, flags);
2497 return 0;
2524} 2498}
2525 2499
2526/* Caller MUST hold the lock */ 2500/* Caller MUST hold the lock */
@@ -2538,7 +2512,8 @@ static void setup_empty_event(struct tty_struct *tty, struct channel *ch)
2538 memoff(ch); 2512 memoff(ch);
2539} 2513}
2540 2514
2541static void epca_setup(char *str, int *ints) 2515#ifndef MODULE
2516static void __init epca_setup(char *str, int *ints)
2542{ 2517{
2543 struct board_info board; 2518 struct board_info board;
2544 int index, loop, last; 2519 int index, loop, last;
@@ -2792,6 +2767,17 @@ static void epca_setup(char *str, int *ints)
2792 num_cards++; 2767 num_cards++;
2793} 2768}
2794 2769
2770static int __init epca_real_setup(char *str)
2771{
2772 int ints[11];
2773
2774 epca_setup(get_options(str, 11, ints), ints);
2775 return 1;
2776}
2777
2778__setup("digiepca", epca_real_setup);
2779#endif
2780
2795enum epic_board_types { 2781enum epic_board_types {
2796 brd_xr = 0, 2782 brd_xr = 0,
2797 brd_xem, 2783 brd_xem,