aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2009-01-02 08:45:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-02 13:19:39 -0500
commita129909ca910d086b8536c790338504878489a95 (patch)
tree1d40d3af985012192c3279934142fba2b891161d /drivers
parent510a3049573868d3d77414bfa55d293f44d0dbbe (diff)
tty: rocketport uses different port flags to everyone else
Normalise them so we can use the common helpers later on Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/rocket.c40
-rw-r--r--drivers/char/rocket.h2
-rw-r--r--drivers/char/rocket_int.h5
3 files changed, 21 insertions, 26 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index f4d9c3993488..9d819808e84b 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -499,7 +499,7 @@ static void rp_handle_port(struct r_port *info)
499 if (!info) 499 if (!info)
500 return; 500 return;
501 501
502 if ((info->flags & ROCKET_INITIALIZED) == 0) { 502 if ((info->flags & ASYNC_INITIALIZED) == 0) {
503 printk(KERN_WARNING "rp: WARNING: rp_handle_port called with " 503 printk(KERN_WARNING "rp: WARNING: rp_handle_port called with "
504 "info->flags & NOT_INIT\n"); 504 "info->flags & NOT_INIT\n");
505 return; 505 return;
@@ -892,11 +892,11 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
892 * until it's done, and then try again. 892 * until it's done, and then try again.
893 */ 893 */
894 if (tty_hung_up_p(filp)) 894 if (tty_hung_up_p(filp))
895 return ((info->flags & ROCKET_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); 895 return ((info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS);
896 if (info->flags & ROCKET_CLOSING) { 896 if (info->flags & ASYNC_CLOSING) {
897 if (wait_for_completion_interruptible(&info->close_wait)) 897 if (wait_for_completion_interruptible(&info->close_wait))
898 return -ERESTARTSYS; 898 return -ERESTARTSYS;
899 return ((info->flags & ROCKET_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); 899 return ((info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS);
900 } 900 }
901 901
902 /* 902 /*
@@ -904,7 +904,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
904 * then make the check up front and then exit. 904 * then make the check up front and then exit.
905 */ 905 */
906 if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) { 906 if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) {
907 info->flags |= ROCKET_NORMAL_ACTIVE; 907 info->flags |= ASYNC_NORMAL_ACTIVE;
908 return 0; 908 return 0;
909 } 909 }
910 if (tty->termios->c_cflag & CLOCAL) 910 if (tty->termios->c_cflag & CLOCAL)
@@ -923,7 +923,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
923 spin_lock_irqsave(&info->slock, flags); 923 spin_lock_irqsave(&info->slock, flags);
924 924
925#ifdef ROCKET_DISABLE_SIMUSAGE 925#ifdef ROCKET_DISABLE_SIMUSAGE
926 info->flags |= ROCKET_NORMAL_ACTIVE; 926 info->flags |= ASYNC_NORMAL_ACTIVE;
927#else 927#else
928 if (!tty_hung_up_p(filp)) { 928 if (!tty_hung_up_p(filp)) {
929 extra_count = 1; 929 extra_count = 1;
@@ -938,14 +938,14 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
938 if (tty->termios->c_cflag & CBAUD) 938 if (tty->termios->c_cflag & CBAUD)
939 tty_port_raise_dtr_rts(port); 939 tty_port_raise_dtr_rts(port);
940 set_current_state(TASK_INTERRUPTIBLE); 940 set_current_state(TASK_INTERRUPTIBLE);
941 if (tty_hung_up_p(filp) || !(info->flags & ROCKET_INITIALIZED)) { 941 if (tty_hung_up_p(filp) || !(info->flags & ASYNC_INITIALIZED)) {
942 if (info->flags & ROCKET_HUP_NOTIFY) 942 if (info->flags & ASYNC_HUP_NOTIFY)
943 retval = -EAGAIN; 943 retval = -EAGAIN;
944 else 944 else
945 retval = -ERESTARTSYS; 945 retval = -ERESTARTSYS;
946 break; 946 break;
947 } 947 }
948 if (!(info->flags & ROCKET_CLOSING) && 948 if (!(info->flags & ASYNC_CLOSING) &&
949 (do_clocal || tty_port_carrier_raised(port))) 949 (do_clocal || tty_port_carrier_raised(port)))
950 break; 950 break;
951 if (signal_pending(current)) { 951 if (signal_pending(current)) {
@@ -975,7 +975,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
975#endif 975#endif
976 if (retval) 976 if (retval)
977 return retval; 977 return retval;
978 info->flags |= ROCKET_NORMAL_ACTIVE; 978 info->flags |= ASYNC_NORMAL_ACTIVE;
979 return 0; 979 return 0;
980} 980}
981 981
@@ -998,12 +998,12 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
998 if (!page) 998 if (!page)
999 return -ENOMEM; 999 return -ENOMEM;
1000 1000
1001 if (info->flags & ROCKET_CLOSING) { 1001 if (info->flags & ASYNC_CLOSING) {
1002 retval = wait_for_completion_interruptible(&info->close_wait); 1002 retval = wait_for_completion_interruptible(&info->close_wait);
1003 free_page(page); 1003 free_page(page);
1004 if (retval) 1004 if (retval)
1005 return retval; 1005 return retval;
1006 return ((info->flags & ROCKET_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); 1006 return ((info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS);
1007 } 1007 }
1008 1008
1009 /* 1009 /*
@@ -1032,7 +1032,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
1032 /* 1032 /*
1033 * Info->count is now 1; so it's safe to sleep now. 1033 * Info->count is now 1; so it's safe to sleep now.
1034 */ 1034 */
1035 if ((info->flags & ROCKET_INITIALIZED) == 0) { 1035 if ((info->flags & ASYNC_INITIALIZED) == 0) {
1036 cp = &info->channel; 1036 cp = &info->channel;
1037 sSetRxTrigger(cp, TRIG_1); 1037 sSetRxTrigger(cp, TRIG_1);
1038 if (sGetChanStatus(cp) & CD_ACT) 1038 if (sGetChanStatus(cp) & CD_ACT)
@@ -1056,7 +1056,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
1056 sEnRxFIFO(cp); 1056 sEnRxFIFO(cp);
1057 sEnTransmit(cp); 1057 sEnTransmit(cp);
1058 1058
1059 info->flags |= ROCKET_INITIALIZED; 1059 info->flags |= ASYNC_INITIALIZED;
1060 1060
1061 /* 1061 /*
1062 * Set up the tty->alt_speed kludge 1062 * Set up the tty->alt_speed kludge
@@ -1131,7 +1131,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
1131 spin_unlock_irqrestore(&info->slock, flags); 1131 spin_unlock_irqrestore(&info->slock, flags);
1132 return; 1132 return;
1133 } 1133 }
1134 info->flags |= ROCKET_CLOSING; 1134 info->flags |= ASYNC_CLOSING;
1135 spin_unlock_irqrestore(&info->slock, flags); 1135 spin_unlock_irqrestore(&info->slock, flags);
1136 1136
1137 cp = &info->channel; 1137 cp = &info->channel;
@@ -1151,7 +1151,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
1151 /* 1151 /*
1152 * Wait for the transmit buffer to clear 1152 * Wait for the transmit buffer to clear
1153 */ 1153 */
1154 if (info->port.closing_wait != ROCKET_CLOSING_WAIT_NONE) 1154 if (info->port.closing_wait != ASYNC_CLOSING_WAIT_NONE)
1155 tty_wait_until_sent(tty, info->port.closing_wait); 1155 tty_wait_until_sent(tty, info->port.closing_wait);
1156 /* 1156 /*
1157 * Before we drop DTR, make sure the UART transmitter 1157 * Before we drop DTR, make sure the UART transmitter
@@ -1192,7 +1192,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
1192 info->xmit_buf = NULL; 1192 info->xmit_buf = NULL;
1193 } 1193 }
1194 } 1194 }
1195 info->flags &= ~(ROCKET_INITIALIZED | ROCKET_CLOSING | ROCKET_NORMAL_ACTIVE); 1195 info->flags &= ~(ASYNC_INITIALIZED | ASYNC_CLOSING | ASYNC_NORMAL_ACTIVE);
1196 tty->closing = 0; 1196 tty->closing = 0;
1197 complete_all(&info->close_wait); 1197 complete_all(&info->close_wait);
1198 atomic_dec(&rp_num_ports_open); 1198 atomic_dec(&rp_num_ports_open);
@@ -1649,14 +1649,14 @@ static void rp_hangup(struct tty_struct *tty)
1649 printk(KERN_INFO "rp_hangup of ttyR%d...\n", info->line); 1649 printk(KERN_INFO "rp_hangup of ttyR%d...\n", info->line);
1650#endif 1650#endif
1651 rp_flush_buffer(tty); 1651 rp_flush_buffer(tty);
1652 if (info->flags & ROCKET_CLOSING) 1652 if (info->flags & ASYNC_CLOSING)
1653 return; 1653 return;
1654 if (info->port.count) 1654 if (info->port.count)
1655 atomic_dec(&rp_num_ports_open); 1655 atomic_dec(&rp_num_ports_open);
1656 clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]); 1656 clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]);
1657 1657
1658 info->port.count = 0; 1658 info->port.count = 0;
1659 info->flags &= ~ROCKET_NORMAL_ACTIVE; 1659 info->flags &= ~ASYNC_NORMAL_ACTIVE;
1660 info->port.tty = NULL; 1660 info->port.tty = NULL;
1661 1661
1662 cp = &info->channel; 1662 cp = &info->channel;
@@ -1666,7 +1666,7 @@ static void rp_hangup(struct tty_struct *tty)
1666 sDisCTSFlowCtl(cp); 1666 sDisCTSFlowCtl(cp);
1667 sDisTxSoftFlowCtl(cp); 1667 sDisTxSoftFlowCtl(cp);
1668 sClrTxXOFF(cp); 1668 sClrTxXOFF(cp);
1669 info->flags &= ~ROCKET_INITIALIZED; 1669 info->flags &= ~ASYNC_INITIALIZED;
1670 1670
1671 wake_up_interruptible(&info->port.open_wait); 1671 wake_up_interruptible(&info->port.open_wait);
1672} 1672}
diff --git a/drivers/char/rocket.h b/drivers/char/rocket.h
index a8b09195ebba..ec863f35f1a9 100644
--- a/drivers/char/rocket.h
+++ b/drivers/char/rocket.h
@@ -39,7 +39,7 @@ struct rocket_version {
39/* 39/*
40 * Rocketport flags 40 * Rocketport flags
41 */ 41 */
42#define ROCKET_CALLOUT_NOHUP 0x00000001 42/*#define ROCKET_CALLOUT_NOHUP 0x00000001 */
43#define ROCKET_FORCE_CD 0x00000002 43#define ROCKET_FORCE_CD 0x00000002
44#define ROCKET_HUP_NOTIFY 0x00000004 44#define ROCKET_HUP_NOTIFY 0x00000004
45#define ROCKET_SPLIT_TERMIOS 0x00000008 45#define ROCKET_SPLIT_TERMIOS 0x00000008
diff --git a/drivers/char/rocket_int.h b/drivers/char/rocket_int.h
index 21f3ff53ba32..67e0f1e778a2 100644
--- a/drivers/char/rocket_int.h
+++ b/drivers/char/rocket_int.h
@@ -1162,11 +1162,6 @@ struct r_port {
1162/* number of characters left in xmit buffer before we ask for more */ 1162/* number of characters left in xmit buffer before we ask for more */
1163#define WAKEUP_CHARS 256 1163#define WAKEUP_CHARS 256
1164 1164
1165/* Internal flags used only by the rocketport driver */
1166#define ROCKET_INITIALIZED 0x80000000 /* Port is active */
1167#define ROCKET_CLOSING 0x40000000 /* Serial port is closing */
1168#define ROCKET_NORMAL_ACTIVE 0x20000000 /* Normal port is active */
1169
1170/* 1165/*
1171 * Assigned major numbers for the Comtrol Rocketport 1166 * Assigned major numbers for the Comtrol Rocketport
1172 */ 1167 */