aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-01-09 23:54:20 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:02:00 -0500
commitd9e39538ce7c52e45e653e777d73ed373189c20d (patch)
tree66471ccdce44916973b0ab3efc3f5d9fd9ebc223 /drivers
parentc58cbb6cbb635f53c8b340ae8da9e84b263cc41a (diff)
[PATCH] clean up computone remaining cli use
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/ip2/i2lib.c2
-rw-r--r--drivers/char/ip2main.c26
2 files changed, 16 insertions, 12 deletions
diff --git a/drivers/char/ip2/i2lib.c b/drivers/char/ip2/i2lib.c
index ba85eb1b6ec7..fc944d375be7 100644
--- a/drivers/char/ip2/i2lib.c
+++ b/drivers/char/ip2/i2lib.c
@@ -854,7 +854,7 @@ i2Input(i2ChanStrPtr pCh)
854 count += IBUF_SIZE; 854 count += IBUF_SIZE;
855 } 855 }
856 // Don't give more than can be taken by the line discipline 856 // Don't give more than can be taken by the line discipline
857 amountToMove = pCh->pTTY->ldisc.receive_room( pCh->pTTY ); 857 amountToMove = pCh->pTTY->receive_room;
858 if (count > amountToMove) { 858 if (count > amountToMove) {
859 count = amountToMove; 859 count = amountToMove;
860 } 860 }
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
index d815d197dc3e..56e93a5a1e24 100644
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2main.c
@@ -172,7 +172,7 @@ static int Fip_firmware_size;
172/* Private (static) functions */ 172/* Private (static) functions */
173static int ip2_open(PTTY, struct file *); 173static int ip2_open(PTTY, struct file *);
174static void ip2_close(PTTY, struct file *); 174static void ip2_close(PTTY, struct file *);
175static int ip2_write(PTTY, int, const unsigned char *, int); 175static int ip2_write(PTTY, const unsigned char *, int);
176static void ip2_putchar(PTTY, unsigned char); 176static void ip2_putchar(PTTY, unsigned char);
177static void ip2_flush_chars(PTTY); 177static void ip2_flush_chars(PTTY);
178static int ip2_write_room(PTTY); 178static int ip2_write_room(PTTY);
@@ -1713,7 +1713,7 @@ ip2_hangup ( PTTY tty )
1713/* */ 1713/* */
1714/******************************************************************************/ 1714/******************************************************************************/
1715static int 1715static int
1716ip2_write( PTTY tty, int user, const unsigned char *pData, int count) 1716ip2_write( PTTY tty, const unsigned char *pData, int count)
1717{ 1717{
1718 i2ChanStrPtr pCh = tty->driver_data; 1718 i2ChanStrPtr pCh = tty->driver_data;
1719 int bytesSent = 0; 1719 int bytesSent = 0;
@@ -1726,7 +1726,7 @@ ip2_write( PTTY tty, int user, const unsigned char *pData, int count)
1726 1726
1727 /* This is the actual move bit. Make sure it does what we need!!!!! */ 1727 /* This is the actual move bit. Make sure it does what we need!!!!! */
1728 WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); 1728 WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags);
1729 bytesSent = i2Output( pCh, pData, count, user ); 1729 bytesSent = i2Output( pCh, pData, count, 0 );
1730 WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); 1730 WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags);
1731 1731
1732 ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent ); 1732 ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent );
@@ -2001,7 +2001,9 @@ ip2_stop ( PTTY tty )
2001static int ip2_tiocmget(struct tty_struct *tty, struct file *file) 2001static int ip2_tiocmget(struct tty_struct *tty, struct file *file)
2002{ 2002{
2003 i2ChanStrPtr pCh = DevTable[tty->index]; 2003 i2ChanStrPtr pCh = DevTable[tty->index];
2004#ifdef ENABLE_DSSNOW
2004 wait_queue_t wait; 2005 wait_queue_t wait;
2006#endif
2005 2007
2006 if (pCh == NULL) 2008 if (pCh == NULL)
2007 return -ENODEV; 2009 return -ENODEV;
@@ -2089,15 +2091,17 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
2089{ 2091{
2090 wait_queue_t wait; 2092 wait_queue_t wait;
2091 i2ChanStrPtr pCh = DevTable[tty->index]; 2093 i2ChanStrPtr pCh = DevTable[tty->index];
2094 i2eBordStrPtr pB;
2092 struct async_icount cprev, cnow; /* kernel counter temps */ 2095 struct async_icount cprev, cnow; /* kernel counter temps */
2093 struct serial_icounter_struct __user *p_cuser; 2096 struct serial_icounter_struct __user *p_cuser;
2094 int rc = 0; 2097 int rc = 0;
2095 unsigned long flags; 2098 unsigned long flags;
2096 void __user *argp = (void __user *)arg; 2099 void __user *argp = (void __user *)arg;
2097 2100
2098 if ( pCh == NULL ) { 2101 if ( pCh == NULL )
2099 return -ENODEV; 2102 return -ENODEV;
2100 } 2103
2104 pB = pCh->pMyBord;
2101 2105
2102 ip2trace (CHANN, ITRC_IOCTL, ITRC_ENTER, 2, cmd, arg ); 2106 ip2trace (CHANN, ITRC_IOCTL, ITRC_ENTER, 2, cmd, arg );
2103 2107
@@ -2206,9 +2210,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
2206 * for masking). Caller should use TIOCGICOUNT to see which one it was 2210 * for masking). Caller should use TIOCGICOUNT to see which one it was
2207 */ 2211 */
2208 case TIOCMIWAIT: 2212 case TIOCMIWAIT:
2209 save_flags(flags);cli(); 2213 WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags);
2210 cprev = pCh->icount; /* note the counters on entry */ 2214 cprev = pCh->icount; /* note the counters on entry */
2211 restore_flags(flags); 2215 WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags);
2212 i2QueueCommands(PTYPE_BYPASS, pCh, 100, 4, 2216 i2QueueCommands(PTYPE_BYPASS, pCh, 100, 4,
2213 CMD_DCD_REP, CMD_CTS_REP, CMD_DSR_REP, CMD_RI_REP); 2217 CMD_DCD_REP, CMD_CTS_REP, CMD_DSR_REP, CMD_RI_REP);
2214 init_waitqueue_entry(&wait, current); 2218 init_waitqueue_entry(&wait, current);
@@ -2228,9 +2232,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
2228 rc = -ERESTARTSYS; 2232 rc = -ERESTARTSYS;
2229 break; 2233 break;
2230 } 2234 }
2231 save_flags(flags);cli(); 2235 WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags);
2232 cnow = pCh->icount; /* atomic copy */ 2236 cnow = pCh->icount; /* atomic copy */
2233 restore_flags(flags); 2237 WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags);
2234 if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && 2238 if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
2235 cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) { 2239 cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) {
2236 rc = -EIO; /* no change => rc */ 2240 rc = -EIO; /* no change => rc */
@@ -2268,9 +2272,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
2268 case TIOCGICOUNT: 2272 case TIOCGICOUNT:
2269 ip2trace (CHANN, ITRC_IOCTL, 11, 1, rc ); 2273 ip2trace (CHANN, ITRC_IOCTL, 11, 1, rc );
2270 2274
2271 save_flags(flags);cli(); 2275 WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags);
2272 cnow = pCh->icount; 2276 cnow = pCh->icount;
2273 restore_flags(flags); 2277 WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags);
2274 p_cuser = argp; 2278 p_cuser = argp;
2275 rc = put_user(cnow.cts, &p_cuser->cts); 2279 rc = put_user(cnow.cts, &p_cuser->cts);
2276 rc = put_user(cnow.dsr, &p_cuser->dsr); 2280 rc = put_user(cnow.dsr, &p_cuser->dsr);