diff options
Diffstat (limited to 'drivers/char/specialix.c')
-rw-r--r-- | drivers/char/specialix.c | 153 |
1 files changed, 73 insertions, 80 deletions
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 2ee4d9893757..037dc47e4cb1 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c | |||
@@ -608,9 +608,9 @@ static inline struct specialix_port * sx_get_port(struct specialix_board * bp, | |||
608 | dprintk (SX_DEBUG_CHAN, "channel: %d\n", channel); | 608 | dprintk (SX_DEBUG_CHAN, "channel: %d\n", channel); |
609 | if (channel < CD186x_NCH) { | 609 | if (channel < CD186x_NCH) { |
610 | port = &sx_port[board_No(bp) * SX_NPORT + channel]; | 610 | port = &sx_port[board_No(bp) * SX_NPORT + channel]; |
611 | dprintk (SX_DEBUG_CHAN, "port: %d %p flags: 0x%x\n",board_No(bp) * SX_NPORT + channel, port, port->flags & ASYNC_INITIALIZED); | 611 | dprintk (SX_DEBUG_CHAN, "port: %d %p flags: 0x%lx\n",board_No(bp) * SX_NPORT + channel, port, port->port.flags & ASYNC_INITIALIZED); |
612 | 612 | ||
613 | if (port->flags & ASYNC_INITIALIZED) { | 613 | if (port->port.flags & ASYNC_INITIALIZED) { |
614 | dprintk (SX_DEBUG_CHAN, "port: %d %p\n", channel, port); | 614 | dprintk (SX_DEBUG_CHAN, "port: %d %p\n", channel, port); |
615 | func_exit(); | 615 | func_exit(); |
616 | return port; | 616 | return port; |
@@ -637,7 +637,7 @@ static inline void sx_receive_exc(struct specialix_board * bp) | |||
637 | func_exit(); | 637 | func_exit(); |
638 | return; | 638 | return; |
639 | } | 639 | } |
640 | tty = port->tty; | 640 | tty = port->port.tty; |
641 | 641 | ||
642 | status = sx_in(bp, CD186x_RCSR); | 642 | status = sx_in(bp, CD186x_RCSR); |
643 | 643 | ||
@@ -673,7 +673,7 @@ static inline void sx_receive_exc(struct specialix_board * bp) | |||
673 | dprintk(SX_DEBUG_RX, "sx%d: port %d: Handling break...\n", | 673 | dprintk(SX_DEBUG_RX, "sx%d: port %d: Handling break...\n", |
674 | board_No(bp), port_No(port)); | 674 | board_No(bp), port_No(port)); |
675 | flag = TTY_BREAK; | 675 | flag = TTY_BREAK; |
676 | if (port->flags & ASYNC_SAK) | 676 | if (port->port.flags & ASYNC_SAK) |
677 | do_SAK(tty); | 677 | do_SAK(tty); |
678 | 678 | ||
679 | } else if (status & RCSR_PE) | 679 | } else if (status & RCSR_PE) |
@@ -707,7 +707,7 @@ static inline void sx_receive(struct specialix_board * bp) | |||
707 | func_exit(); | 707 | func_exit(); |
708 | return; | 708 | return; |
709 | } | 709 | } |
710 | tty = port->tty; | 710 | tty = port->port.tty; |
711 | 711 | ||
712 | count = sx_in(bp, CD186x_RDCR); | 712 | count = sx_in(bp, CD186x_RDCR); |
713 | dprintk (SX_DEBUG_RX, "port: %p: count: %d\n", port, count); | 713 | dprintk (SX_DEBUG_RX, "port: %p: count: %d\n", port, count); |
@@ -734,7 +734,7 @@ static inline void sx_transmit(struct specialix_board * bp) | |||
734 | return; | 734 | return; |
735 | } | 735 | } |
736 | dprintk (SX_DEBUG_TX, "port: %p\n", port); | 736 | dprintk (SX_DEBUG_TX, "port: %p\n", port); |
737 | tty = port->tty; | 737 | tty = port->port.tty; |
738 | 738 | ||
739 | if (port->IER & IER_TXEMPTY) { | 739 | if (port->IER & IER_TXEMPTY) { |
740 | /* FIFO drained */ | 740 | /* FIFO drained */ |
@@ -811,7 +811,7 @@ static inline void sx_check_modem(struct specialix_board * bp) | |||
811 | if (!(port = sx_get_port(bp, "Modem"))) | 811 | if (!(port = sx_get_port(bp, "Modem"))) |
812 | return; | 812 | return; |
813 | 813 | ||
814 | tty = port->tty; | 814 | tty = port->port.tty; |
815 | 815 | ||
816 | mcr = sx_in(bp, CD186x_MCR); | 816 | mcr = sx_in(bp, CD186x_MCR); |
817 | printk ("mcr = %02x.\n", mcr); | 817 | printk ("mcr = %02x.\n", mcr); |
@@ -821,7 +821,7 @@ static inline void sx_check_modem(struct specialix_board * bp) | |||
821 | msvr_cd = sx_in(bp, CD186x_MSVR) & MSVR_CD; | 821 | msvr_cd = sx_in(bp, CD186x_MSVR) & MSVR_CD; |
822 | if (msvr_cd) { | 822 | if (msvr_cd) { |
823 | dprintk (SX_DEBUG_SIGNALS, "Waking up guys in open.\n"); | 823 | dprintk (SX_DEBUG_SIGNALS, "Waking up guys in open.\n"); |
824 | wake_up_interruptible(&port->open_wait); | 824 | wake_up_interruptible(&port->port.open_wait); |
825 | } else { | 825 | } else { |
826 | dprintk (SX_DEBUG_SIGNALS, "Sending HUP.\n"); | 826 | dprintk (SX_DEBUG_SIGNALS, "Sending HUP.\n"); |
827 | tty_hangup(tty); | 827 | tty_hangup(tty); |
@@ -1030,7 +1030,7 @@ static void sx_change_speed(struct specialix_board *bp, struct specialix_port *p | |||
1030 | 1030 | ||
1031 | func_enter(); | 1031 | func_enter(); |
1032 | 1032 | ||
1033 | if (!(tty = port->tty) || !tty->termios) { | 1033 | if (!(tty = port->port.tty) || !tty->termios) { |
1034 | func_exit(); | 1034 | func_exit(); |
1035 | return; | 1035 | return; |
1036 | } | 1036 | } |
@@ -1052,9 +1052,9 @@ static void sx_change_speed(struct specialix_board *bp, struct specialix_port *p | |||
1052 | baud = tty_get_baud_rate(tty); | 1052 | baud = tty_get_baud_rate(tty); |
1053 | 1053 | ||
1054 | if (baud == 38400) { | 1054 | if (baud == 38400) { |
1055 | if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) | 1055 | if ((port->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) |
1056 | baud = 57600; | 1056 | baud = 57600; |
1057 | if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) | 1057 | if ((port->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) |
1058 | baud = 115200; | 1058 | baud = 115200; |
1059 | } | 1059 | } |
1060 | 1060 | ||
@@ -1244,7 +1244,7 @@ static int sx_setup_port(struct specialix_board *bp, struct specialix_port *port | |||
1244 | 1244 | ||
1245 | func_enter(); | 1245 | func_enter(); |
1246 | 1246 | ||
1247 | if (port->flags & ASYNC_INITIALIZED) { | 1247 | if (port->port.flags & ASYNC_INITIALIZED) { |
1248 | func_exit(); | 1248 | func_exit(); |
1249 | return 0; | 1249 | return 0; |
1250 | } | 1250 | } |
@@ -1268,12 +1268,12 @@ static int sx_setup_port(struct specialix_board *bp, struct specialix_port *port | |||
1268 | 1268 | ||
1269 | spin_lock_irqsave(&port->lock, flags); | 1269 | spin_lock_irqsave(&port->lock, flags); |
1270 | 1270 | ||
1271 | if (port->tty) | 1271 | if (port->port.tty) |
1272 | clear_bit(TTY_IO_ERROR, &port->tty->flags); | 1272 | clear_bit(TTY_IO_ERROR, &port->port.tty->flags); |
1273 | 1273 | ||
1274 | port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; | 1274 | port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; |
1275 | sx_change_speed(bp, port); | 1275 | sx_change_speed(bp, port); |
1276 | port->flags |= ASYNC_INITIALIZED; | 1276 | port->port.flags |= ASYNC_INITIALIZED; |
1277 | 1277 | ||
1278 | spin_unlock_irqrestore(&port->lock, flags); | 1278 | spin_unlock_irqrestore(&port->lock, flags); |
1279 | 1279 | ||
@@ -1292,7 +1292,7 @@ static void sx_shutdown_port(struct specialix_board *bp, struct specialix_port * | |||
1292 | 1292 | ||
1293 | func_enter(); | 1293 | func_enter(); |
1294 | 1294 | ||
1295 | if (!(port->flags & ASYNC_INITIALIZED)) { | 1295 | if (!(port->port.flags & ASYNC_INITIALIZED)) { |
1296 | func_exit(); | 1296 | func_exit(); |
1297 | return; | 1297 | return; |
1298 | } | 1298 | } |
@@ -1315,7 +1315,7 @@ static void sx_shutdown_port(struct specialix_board *bp, struct specialix_port * | |||
1315 | spin_lock_irqsave(&bp->lock, flags); | 1315 | spin_lock_irqsave(&bp->lock, flags); |
1316 | sx_out(bp, CD186x_CAR, port_No(port)); | 1316 | sx_out(bp, CD186x_CAR, port_No(port)); |
1317 | 1317 | ||
1318 | if (!(tty = port->tty) || C_HUPCL(tty)) { | 1318 | if (!(tty = port->port.tty) || C_HUPCL(tty)) { |
1319 | /* Drop DTR */ | 1319 | /* Drop DTR */ |
1320 | sx_out(bp, CD186x_MSVDTR, 0); | 1320 | sx_out(bp, CD186x_MSVDTR, 0); |
1321 | } | 1321 | } |
@@ -1330,7 +1330,7 @@ static void sx_shutdown_port(struct specialix_board *bp, struct specialix_port * | |||
1330 | spin_unlock_irqrestore(&bp->lock, flags); | 1330 | spin_unlock_irqrestore(&bp->lock, flags); |
1331 | if (tty) | 1331 | if (tty) |
1332 | set_bit(TTY_IO_ERROR, &tty->flags); | 1332 | set_bit(TTY_IO_ERROR, &tty->flags); |
1333 | port->flags &= ~ASYNC_INITIALIZED; | 1333 | port->port.flags &= ~ASYNC_INITIALIZED; |
1334 | 1334 | ||
1335 | if (!bp->count) | 1335 | if (!bp->count) |
1336 | sx_shutdown_board(bp); | 1336 | sx_shutdown_board(bp); |
@@ -1354,9 +1354,9 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, | |||
1354 | * If the device is in the middle of being closed, then block | 1354 | * If the device is in the middle of being closed, then block |
1355 | * until it's done, and then try again. | 1355 | * until it's done, and then try again. |
1356 | */ | 1356 | */ |
1357 | if (tty_hung_up_p(filp) || port->flags & ASYNC_CLOSING) { | 1357 | if (tty_hung_up_p(filp) || port->port.flags & ASYNC_CLOSING) { |
1358 | interruptible_sleep_on(&port->close_wait); | 1358 | interruptible_sleep_on(&port->port.close_wait); |
1359 | if (port->flags & ASYNC_HUP_NOTIFY) { | 1359 | if (port->port.flags & ASYNC_HUP_NOTIFY) { |
1360 | func_exit(); | 1360 | func_exit(); |
1361 | return -EAGAIN; | 1361 | return -EAGAIN; |
1362 | } else { | 1362 | } else { |
@@ -1371,7 +1371,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, | |||
1371 | */ | 1371 | */ |
1372 | if ((filp->f_flags & O_NONBLOCK) || | 1372 | if ((filp->f_flags & O_NONBLOCK) || |
1373 | (tty->flags & (1 << TTY_IO_ERROR))) { | 1373 | (tty->flags & (1 << TTY_IO_ERROR))) { |
1374 | port->flags |= ASYNC_NORMAL_ACTIVE; | 1374 | port->port.flags |= ASYNC_NORMAL_ACTIVE; |
1375 | func_exit(); | 1375 | func_exit(); |
1376 | return 0; | 1376 | return 0; |
1377 | } | 1377 | } |
@@ -1387,13 +1387,13 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, | |||
1387 | * exit, either normal or abnormal. | 1387 | * exit, either normal or abnormal. |
1388 | */ | 1388 | */ |
1389 | retval = 0; | 1389 | retval = 0; |
1390 | add_wait_queue(&port->open_wait, &wait); | 1390 | add_wait_queue(&port->port.open_wait, &wait); |
1391 | spin_lock_irqsave(&port->lock, flags); | 1391 | spin_lock_irqsave(&port->lock, flags); |
1392 | if (!tty_hung_up_p(filp)) { | 1392 | if (!tty_hung_up_p(filp)) { |
1393 | port->count--; | 1393 | port->port.count--; |
1394 | } | 1394 | } |
1395 | spin_unlock_irqrestore(&port->lock, flags); | 1395 | spin_unlock_irqrestore(&port->lock, flags); |
1396 | port->blocked_open++; | 1396 | port->port.blocked_open++; |
1397 | while (1) { | 1397 | while (1) { |
1398 | spin_lock_irqsave(&bp->lock, flags); | 1398 | spin_lock_irqsave(&bp->lock, flags); |
1399 | sx_out(bp, CD186x_CAR, port_No(port)); | 1399 | sx_out(bp, CD186x_CAR, port_No(port)); |
@@ -1410,14 +1410,14 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, | |||
1410 | spin_unlock_irqrestore(&bp->lock, flags); | 1410 | spin_unlock_irqrestore(&bp->lock, flags); |
1411 | set_current_state(TASK_INTERRUPTIBLE); | 1411 | set_current_state(TASK_INTERRUPTIBLE); |
1412 | if (tty_hung_up_p(filp) || | 1412 | if (tty_hung_up_p(filp) || |
1413 | !(port->flags & ASYNC_INITIALIZED)) { | 1413 | !(port->port.flags & ASYNC_INITIALIZED)) { |
1414 | if (port->flags & ASYNC_HUP_NOTIFY) | 1414 | if (port->port.flags & ASYNC_HUP_NOTIFY) |
1415 | retval = -EAGAIN; | 1415 | retval = -EAGAIN; |
1416 | else | 1416 | else |
1417 | retval = -ERESTARTSYS; | 1417 | retval = -ERESTARTSYS; |
1418 | break; | 1418 | break; |
1419 | } | 1419 | } |
1420 | if (!(port->flags & ASYNC_CLOSING) && | 1420 | if (!(port->port.flags & ASYNC_CLOSING) && |
1421 | (do_clocal || CD)) | 1421 | (do_clocal || CD)) |
1422 | break; | 1422 | break; |
1423 | if (signal_pending(current)) { | 1423 | if (signal_pending(current)) { |
@@ -1428,19 +1428,19 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, | |||
1428 | } | 1428 | } |
1429 | 1429 | ||
1430 | set_current_state(TASK_RUNNING); | 1430 | set_current_state(TASK_RUNNING); |
1431 | remove_wait_queue(&port->open_wait, &wait); | 1431 | remove_wait_queue(&port->port.open_wait, &wait); |
1432 | spin_lock_irqsave(&port->lock, flags); | 1432 | spin_lock_irqsave(&port->lock, flags); |
1433 | if (!tty_hung_up_p(filp)) { | 1433 | if (!tty_hung_up_p(filp)) { |
1434 | port->count++; | 1434 | port->port.count++; |
1435 | } | 1435 | } |
1436 | port->blocked_open--; | 1436 | port->port.blocked_open--; |
1437 | spin_unlock_irqrestore(&port->lock, flags); | 1437 | spin_unlock_irqrestore(&port->lock, flags); |
1438 | if (retval) { | 1438 | if (retval) { |
1439 | func_exit(); | 1439 | func_exit(); |
1440 | return retval; | 1440 | return retval; |
1441 | } | 1441 | } |
1442 | 1442 | ||
1443 | port->flags |= ASYNC_NORMAL_ACTIVE; | 1443 | port->port.flags |= ASYNC_NORMAL_ACTIVE; |
1444 | func_exit(); | 1444 | func_exit(); |
1445 | return 0; | 1445 | return 0; |
1446 | } | 1446 | } |
@@ -1484,10 +1484,10 @@ static int sx_open(struct tty_struct * tty, struct file * filp) | |||
1484 | } | 1484 | } |
1485 | 1485 | ||
1486 | spin_lock_irqsave(&bp->lock, flags); | 1486 | spin_lock_irqsave(&bp->lock, flags); |
1487 | port->count++; | 1487 | port->port.count++; |
1488 | bp->count++; | 1488 | bp->count++; |
1489 | tty->driver_data = port; | 1489 | tty->driver_data = port; |
1490 | port->tty = tty; | 1490 | port->port.tty = tty; |
1491 | spin_unlock_irqrestore(&bp->lock, flags); | 1491 | spin_unlock_irqrestore(&bp->lock, flags); |
1492 | 1492 | ||
1493 | if ((error = sx_setup_port(bp, port))) { | 1493 | if ((error = sx_setup_port(bp, port))) { |
@@ -1547,15 +1547,15 @@ static void sx_close(struct tty_struct * tty, struct file * filp) | |||
1547 | } | 1547 | } |
1548 | 1548 | ||
1549 | bp = port_Board(port); | 1549 | bp = port_Board(port); |
1550 | if ((tty->count == 1) && (port->count != 1)) { | 1550 | if ((tty->count == 1) && (port->port.count != 1)) { |
1551 | printk(KERN_ERR "sx%d: sx_close: bad port count;" | 1551 | printk(KERN_ERR "sx%d: sx_close: bad port count;" |
1552 | " tty->count is 1, port count is %d\n", | 1552 | " tty->count is 1, port count is %d\n", |
1553 | board_No(bp), port->count); | 1553 | board_No(bp), port->port.count); |
1554 | port->count = 1; | 1554 | port->port.count = 1; |
1555 | } | 1555 | } |
1556 | 1556 | ||
1557 | if (port->count > 1) { | 1557 | if (port->port.count > 1) { |
1558 | port->count--; | 1558 | port->port.count--; |
1559 | bp->count--; | 1559 | bp->count--; |
1560 | 1560 | ||
1561 | spin_unlock_irqrestore(&port->lock, flags); | 1561 | spin_unlock_irqrestore(&port->lock, flags); |
@@ -1563,7 +1563,7 @@ static void sx_close(struct tty_struct * tty, struct file * filp) | |||
1563 | func_exit(); | 1563 | func_exit(); |
1564 | return; | 1564 | return; |
1565 | } | 1565 | } |
1566 | port->flags |= ASYNC_CLOSING; | 1566 | port->port.flags |= ASYNC_CLOSING; |
1567 | /* | 1567 | /* |
1568 | * Now we wait for the transmit buffer to clear; and we notify | 1568 | * Now we wait for the transmit buffer to clear; and we notify |
1569 | * the line discipline to only process XON/XOFF characters. | 1569 | * the line discipline to only process XON/XOFF characters. |
@@ -1571,8 +1571,8 @@ static void sx_close(struct tty_struct * tty, struct file * filp) | |||
1571 | tty->closing = 1; | 1571 | tty->closing = 1; |
1572 | spin_unlock_irqrestore(&port->lock, flags); | 1572 | spin_unlock_irqrestore(&port->lock, flags); |
1573 | dprintk (SX_DEBUG_OPEN, "Closing\n"); | 1573 | dprintk (SX_DEBUG_OPEN, "Closing\n"); |
1574 | if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE) { | 1574 | if (port->port.closing_wait != ASYNC_CLOSING_WAIT_NONE) { |
1575 | tty_wait_until_sent(tty, port->closing_wait); | 1575 | tty_wait_until_sent(tty, port->port.closing_wait); |
1576 | } | 1576 | } |
1577 | /* | 1577 | /* |
1578 | * At this point we stop accepting input. To do this, we | 1578 | * At this point we stop accepting input. To do this, we |
@@ -1582,7 +1582,7 @@ static void sx_close(struct tty_struct * tty, struct file * filp) | |||
1582 | */ | 1582 | */ |
1583 | dprintk (SX_DEBUG_OPEN, "Closed\n"); | 1583 | dprintk (SX_DEBUG_OPEN, "Closed\n"); |
1584 | port->IER &= ~IER_RXD; | 1584 | port->IER &= ~IER_RXD; |
1585 | if (port->flags & ASYNC_INITIALIZED) { | 1585 | if (port->port.flags & ASYNC_INITIALIZED) { |
1586 | port->IER &= ~IER_TXRDY; | 1586 | port->IER &= ~IER_TXRDY; |
1587 | port->IER |= IER_TXEMPTY; | 1587 | port->IER |= IER_TXEMPTY; |
1588 | spin_lock_irqsave(&bp->lock, flags); | 1588 | spin_lock_irqsave(&bp->lock, flags); |
@@ -1611,10 +1611,10 @@ static void sx_close(struct tty_struct * tty, struct file * filp) | |||
1611 | board_No(bp), bp->count, tty->index); | 1611 | board_No(bp), bp->count, tty->index); |
1612 | bp->count = 0; | 1612 | bp->count = 0; |
1613 | } | 1613 | } |
1614 | if (--port->count < 0) { | 1614 | if (--port->port.count < 0) { |
1615 | printk(KERN_ERR "sx%d: sx_close: bad port count for tty%d: %d\n", | 1615 | printk(KERN_ERR "sx%d: sx_close: bad port count for tty%d: %d\n", |
1616 | board_No(bp), port_No(port), port->count); | 1616 | board_No(bp), port_No(port), port->port.count); |
1617 | port->count = 0; | 1617 | port->port.count = 0; |
1618 | } | 1618 | } |
1619 | 1619 | ||
1620 | sx_shutdown_port(bp, port); | 1620 | sx_shutdown_port(bp, port); |
@@ -1622,16 +1622,16 @@ static void sx_close(struct tty_struct * tty, struct file * filp) | |||
1622 | tty_ldisc_flush(tty); | 1622 | tty_ldisc_flush(tty); |
1623 | spin_lock_irqsave(&port->lock, flags); | 1623 | spin_lock_irqsave(&port->lock, flags); |
1624 | tty->closing = 0; | 1624 | tty->closing = 0; |
1625 | port->tty = NULL; | 1625 | port->port.tty = NULL; |
1626 | spin_unlock_irqrestore(&port->lock, flags); | 1626 | spin_unlock_irqrestore(&port->lock, flags); |
1627 | if (port->blocked_open) { | 1627 | if (port->port.blocked_open) { |
1628 | if (port->close_delay) { | 1628 | if (port->port.close_delay) { |
1629 | msleep_interruptible(jiffies_to_msecs(port->close_delay)); | 1629 | msleep_interruptible(jiffies_to_msecs(port->port.close_delay)); |
1630 | } | 1630 | } |
1631 | wake_up_interruptible(&port->open_wait); | 1631 | wake_up_interruptible(&port->port.open_wait); |
1632 | } | 1632 | } |
1633 | port->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); | 1633 | port->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); |
1634 | wake_up_interruptible(&port->close_wait); | 1634 | wake_up_interruptible(&port->port.close_wait); |
1635 | 1635 | ||
1636 | func_exit(); | 1636 | func_exit(); |
1637 | } | 1637 | } |
@@ -1815,7 +1815,7 @@ static int sx_tiocmget(struct tty_struct *tty, struct file *file) | |||
1815 | dprintk (SX_DEBUG_INIT, "Got msvr[%d] = %02x, car = %d.\n", | 1815 | dprintk (SX_DEBUG_INIT, "Got msvr[%d] = %02x, car = %d.\n", |
1816 | port_No(port), status, sx_in (bp, CD186x_CAR)); | 1816 | port_No(port), status, sx_in (bp, CD186x_CAR)); |
1817 | dprintk (SX_DEBUG_INIT, "sx_port = %p, port = %p\n", sx_port, port); | 1817 | dprintk (SX_DEBUG_INIT, "sx_port = %p, port = %p\n", sx_port, port); |
1818 | if (SX_CRTSCTS(port->tty)) { | 1818 | if (SX_CRTSCTS(port->port.tty)) { |
1819 | result = /* (status & MSVR_RTS) ? */ TIOCM_DTR /* : 0) */ | 1819 | result = /* (status & MSVR_RTS) ? */ TIOCM_DTR /* : 0) */ |
1820 | | ((status & MSVR_DTR) ? TIOCM_RTS : 0) | 1820 | | ((status & MSVR_DTR) ? TIOCM_RTS : 0) |
1821 | | ((status & MSVR_CD) ? TIOCM_CAR : 0) | 1821 | | ((status & MSVR_CD) ? TIOCM_CAR : 0) |
@@ -1857,7 +1857,7 @@ static int sx_tiocmset(struct tty_struct *tty, struct file *file, | |||
1857 | /* if (set & TIOCM_DTR) | 1857 | /* if (set & TIOCM_DTR) |
1858 | port->MSVR |= MSVR_DTR; */ | 1858 | port->MSVR |= MSVR_DTR; */ |
1859 | 1859 | ||
1860 | if (SX_CRTSCTS(port->tty)) { | 1860 | if (SX_CRTSCTS(port->port.tty)) { |
1861 | if (set & TIOCM_RTS) | 1861 | if (set & TIOCM_RTS) |
1862 | port->MSVR |= MSVR_DTR; | 1862 | port->MSVR |= MSVR_DTR; |
1863 | } else { | 1863 | } else { |
@@ -1869,7 +1869,7 @@ static int sx_tiocmset(struct tty_struct *tty, struct file *file, | |||
1869 | port->MSVR &= ~MSVR_RTS; */ | 1869 | port->MSVR &= ~MSVR_RTS; */ |
1870 | /* if (clear & TIOCM_DTR) | 1870 | /* if (clear & TIOCM_DTR) |
1871 | port->MSVR &= ~MSVR_DTR; */ | 1871 | port->MSVR &= ~MSVR_DTR; */ |
1872 | if (SX_CRTSCTS(port->tty)) { | 1872 | if (SX_CRTSCTS(port->port.tty)) { |
1873 | if (clear & TIOCM_RTS) | 1873 | if (clear & TIOCM_RTS) |
1874 | port->MSVR &= ~MSVR_DTR; | 1874 | port->MSVR &= ~MSVR_DTR; |
1875 | } else { | 1875 | } else { |
@@ -1929,27 +1929,27 @@ static inline int sx_set_serial_info(struct specialix_port * port, | |||
1929 | 1929 | ||
1930 | lock_kernel(); | 1930 | lock_kernel(); |
1931 | 1931 | ||
1932 | change_speed = ((port->flags & ASYNC_SPD_MASK) != | 1932 | change_speed = ((port->port.flags & ASYNC_SPD_MASK) != |
1933 | (tmp.flags & ASYNC_SPD_MASK)); | 1933 | (tmp.flags & ASYNC_SPD_MASK)); |
1934 | change_speed |= (tmp.custom_divisor != port->custom_divisor); | 1934 | change_speed |= (tmp.custom_divisor != port->custom_divisor); |
1935 | 1935 | ||
1936 | if (!capable(CAP_SYS_ADMIN)) { | 1936 | if (!capable(CAP_SYS_ADMIN)) { |
1937 | if ((tmp.close_delay != port->close_delay) || | 1937 | if ((tmp.close_delay != port->port.close_delay) || |
1938 | (tmp.closing_wait != port->closing_wait) || | 1938 | (tmp.closing_wait != port->port.closing_wait) || |
1939 | ((tmp.flags & ~ASYNC_USR_MASK) != | 1939 | ((tmp.flags & ~ASYNC_USR_MASK) != |
1940 | (port->flags & ~ASYNC_USR_MASK))) { | 1940 | (port->port.flags & ~ASYNC_USR_MASK))) { |
1941 | func_exit(); | 1941 | func_exit(); |
1942 | unlock_kernel(); | 1942 | unlock_kernel(); |
1943 | return -EPERM; | 1943 | return -EPERM; |
1944 | } | 1944 | } |
1945 | port->flags = ((port->flags & ~ASYNC_USR_MASK) | | 1945 | port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) | |
1946 | (tmp.flags & ASYNC_USR_MASK)); | 1946 | (tmp.flags & ASYNC_USR_MASK)); |
1947 | port->custom_divisor = tmp.custom_divisor; | 1947 | port->custom_divisor = tmp.custom_divisor; |
1948 | } else { | 1948 | } else { |
1949 | port->flags = ((port->flags & ~ASYNC_FLAGS) | | 1949 | port->port.flags = ((port->port.flags & ~ASYNC_FLAGS) | |
1950 | (tmp.flags & ASYNC_FLAGS)); | 1950 | (tmp.flags & ASYNC_FLAGS)); |
1951 | port->close_delay = tmp.close_delay; | 1951 | port->port.close_delay = tmp.close_delay; |
1952 | port->closing_wait = tmp.closing_wait; | 1952 | port->port.closing_wait = tmp.closing_wait; |
1953 | port->custom_divisor = tmp.custom_divisor; | 1953 | port->custom_divisor = tmp.custom_divisor; |
1954 | } | 1954 | } |
1955 | if (change_speed) { | 1955 | if (change_speed) { |
@@ -1975,10 +1975,10 @@ static inline int sx_get_serial_info(struct specialix_port * port, | |||
1975 | tmp.line = port - sx_port; | 1975 | tmp.line = port - sx_port; |
1976 | tmp.port = bp->base; | 1976 | tmp.port = bp->base; |
1977 | tmp.irq = bp->irq; | 1977 | tmp.irq = bp->irq; |
1978 | tmp.flags = port->flags; | 1978 | tmp.flags = port->port.flags; |
1979 | tmp.baud_base = (SX_OSCFREQ + CD186x_TPC/2) / CD186x_TPC; | 1979 | tmp.baud_base = (SX_OSCFREQ + CD186x_TPC/2) / CD186x_TPC; |
1980 | tmp.close_delay = port->close_delay * HZ/100; | 1980 | tmp.close_delay = port->port.close_delay * HZ/100; |
1981 | tmp.closing_wait = port->closing_wait * HZ/100; | 1981 | tmp.closing_wait = port->port.closing_wait * HZ/100; |
1982 | tmp.custom_divisor = port->custom_divisor; | 1982 | tmp.custom_divisor = port->custom_divisor; |
1983 | tmp.xmit_fifo_size = CD186x_NFIFO; | 1983 | tmp.xmit_fifo_size = CD186x_NFIFO; |
1984 | unlock_kernel(); | 1984 | unlock_kernel(); |
@@ -2199,17 +2199,17 @@ static void sx_hangup(struct tty_struct * tty) | |||
2199 | 2199 | ||
2200 | sx_shutdown_port(bp, port); | 2200 | sx_shutdown_port(bp, port); |
2201 | spin_lock_irqsave(&port->lock, flags); | 2201 | spin_lock_irqsave(&port->lock, flags); |
2202 | bp->count -= port->count; | 2202 | bp->count -= port->port.count; |
2203 | if (bp->count < 0) { | 2203 | if (bp->count < 0) { |
2204 | printk(KERN_ERR "sx%d: sx_hangup: bad board count: %d port: %d\n", | 2204 | printk(KERN_ERR "sx%d: sx_hangup: bad board count: %d port: %d\n", |
2205 | board_No(bp), bp->count, tty->index); | 2205 | board_No(bp), bp->count, tty->index); |
2206 | bp->count = 0; | 2206 | bp->count = 0; |
2207 | } | 2207 | } |
2208 | port->count = 0; | 2208 | port->port.count = 0; |
2209 | port->flags &= ~ASYNC_NORMAL_ACTIVE; | 2209 | port->port.flags &= ~ASYNC_NORMAL_ACTIVE; |
2210 | port->tty = NULL; | 2210 | port->port.tty = NULL; |
2211 | spin_unlock_irqrestore(&port->lock, flags); | 2211 | spin_unlock_irqrestore(&port->lock, flags); |
2212 | wake_up_interruptible(&port->open_wait); | 2212 | wake_up_interruptible(&port->port.open_wait); |
2213 | 2213 | ||
2214 | func_exit(); | 2214 | func_exit(); |
2215 | } | 2215 | } |
@@ -2224,10 +2224,6 @@ static void sx_set_termios(struct tty_struct * tty, struct ktermios * old_termio | |||
2224 | if (sx_paranoia_check(port, tty->name, "sx_set_termios")) | 2224 | if (sx_paranoia_check(port, tty->name, "sx_set_termios")) |
2225 | return; | 2225 | return; |
2226 | 2226 | ||
2227 | if (tty->termios->c_cflag == old_termios->c_cflag && | ||
2228 | tty->termios->c_iflag == old_termios->c_iflag) | ||
2229 | return; | ||
2230 | |||
2231 | bp = port_Board(port); | 2227 | bp = port_Board(port); |
2232 | spin_lock_irqsave(&port->lock, flags); | 2228 | spin_lock_irqsave(&port->lock, flags); |
2233 | sx_change_speed(port_Board(port), port); | 2229 | sx_change_speed(port_Board(port), port); |
@@ -2297,10 +2293,7 @@ static int sx_init_drivers(void) | |||
2297 | memset(sx_port, 0, sizeof(sx_port)); | 2293 | memset(sx_port, 0, sizeof(sx_port)); |
2298 | for (i = 0; i < SX_NPORT * SX_NBOARD; i++) { | 2294 | for (i = 0; i < SX_NPORT * SX_NBOARD; i++) { |
2299 | sx_port[i].magic = SPECIALIX_MAGIC; | 2295 | sx_port[i].magic = SPECIALIX_MAGIC; |
2300 | sx_port[i].close_delay = 50 * HZ/100; | 2296 | tty_port_init(&sx_port[i].port); |
2301 | sx_port[i].closing_wait = 3000 * HZ/100; | ||
2302 | init_waitqueue_head(&sx_port[i].open_wait); | ||
2303 | init_waitqueue_head(&sx_port[i].close_wait); | ||
2304 | spin_lock_init(&sx_port[i].lock); | 2297 | spin_lock_init(&sx_port[i].lock); |
2305 | } | 2298 | } |
2306 | 2299 | ||