diff options
Diffstat (limited to 'drivers/char/ip2/ip2main.c')
-rw-r--r-- | drivers/char/ip2/ip2main.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c index 319f804fc4d6..c4f4ca31f7c0 100644 --- a/drivers/char/ip2/ip2main.c +++ b/drivers/char/ip2/ip2main.c | |||
@@ -1052,9 +1052,9 @@ set_irq( int boardnum, int boardIrq ) | |||
1052 | * Write to FIFO; don't bother to adjust fifo capacity for this, since | 1052 | * Write to FIFO; don't bother to adjust fifo capacity for this, since |
1053 | * board will respond almost immediately after SendMail hit. | 1053 | * board will respond almost immediately after SendMail hit. |
1054 | */ | 1054 | */ |
1055 | WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags); | 1055 | write_lock_irqsave(&pB->write_fifo_spinlock, flags); |
1056 | iiWriteBuf(pB, tempCommand, 4); | 1056 | iiWriteBuf(pB, tempCommand, 4); |
1057 | WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags); | 1057 | write_unlock_irqrestore(&pB->write_fifo_spinlock, flags); |
1058 | pB->i2eUsingIrq = boardIrq; | 1058 | pB->i2eUsingIrq = boardIrq; |
1059 | pB->i2eOutMailWaiting |= MB_OUT_STUFFED; | 1059 | pB->i2eOutMailWaiting |= MB_OUT_STUFFED; |
1060 | 1060 | ||
@@ -1072,9 +1072,9 @@ set_irq( int boardnum, int boardIrq ) | |||
1072 | (CMD_OF(tempCommand))[4] = 64; // chars | 1072 | (CMD_OF(tempCommand))[4] = 64; // chars |
1073 | 1073 | ||
1074 | (CMD_OF(tempCommand))[5] = 87; // HW_TEST | 1074 | (CMD_OF(tempCommand))[5] = 87; // HW_TEST |
1075 | WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags); | 1075 | write_lock_irqsave(&pB->write_fifo_spinlock, flags); |
1076 | iiWriteBuf(pB, tempCommand, 8); | 1076 | iiWriteBuf(pB, tempCommand, 8); |
1077 | WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags); | 1077 | write_unlock_irqrestore(&pB->write_fifo_spinlock, flags); |
1078 | 1078 | ||
1079 | CHANNEL_OF(tempCommand) = 0; | 1079 | CHANNEL_OF(tempCommand) = 0; |
1080 | PTYPE_OF(tempCommand) = PTYPE_BYPASS; | 1080 | PTYPE_OF(tempCommand) = PTYPE_BYPASS; |
@@ -1089,9 +1089,9 @@ set_irq( int boardnum, int boardIrq ) | |||
1089 | CMD_COUNT_OF(tempCommand) = 2; | 1089 | CMD_COUNT_OF(tempCommand) = 2; |
1090 | (CMD_OF(tempCommand))[0] = 44; /* get ping */ | 1090 | (CMD_OF(tempCommand))[0] = 44; /* get ping */ |
1091 | (CMD_OF(tempCommand))[1] = 200; /* 200 ms */ | 1091 | (CMD_OF(tempCommand))[1] = 200; /* 200 ms */ |
1092 | WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags); | 1092 | write_lock_irqsave(&pB->write_fifo_spinlock, flags); |
1093 | iiWriteBuf(pB, tempCommand, 4); | 1093 | iiWriteBuf(pB, tempCommand, 4); |
1094 | WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags); | 1094 | write_unlock_irqrestore(&pB->write_fifo_spinlock, flags); |
1095 | #endif | 1095 | #endif |
1096 | 1096 | ||
1097 | iiEnableMailIrq(pB); | 1097 | iiEnableMailIrq(pB); |
@@ -1270,12 +1270,12 @@ static void do_input(struct work_struct *work) | |||
1270 | 1270 | ||
1271 | // Data input | 1271 | // Data input |
1272 | if ( pCh->pTTY != NULL ) { | 1272 | if ( pCh->pTTY != NULL ) { |
1273 | READ_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags) | 1273 | read_lock_irqsave(&pCh->Ibuf_spinlock, flags); |
1274 | if (!pCh->throttled && (pCh->Ibuf_stuff != pCh->Ibuf_strip)) { | 1274 | if (!pCh->throttled && (pCh->Ibuf_stuff != pCh->Ibuf_strip)) { |
1275 | READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) | 1275 | read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); |
1276 | i2Input( pCh ); | 1276 | i2Input( pCh ); |
1277 | } else | 1277 | } else |
1278 | READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) | 1278 | read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); |
1279 | } else { | 1279 | } else { |
1280 | ip2trace(CHANN, ITRC_INPUT, 22, 0 ); | 1280 | ip2trace(CHANN, ITRC_INPUT, 22, 0 ); |
1281 | 1281 | ||
@@ -1719,9 +1719,9 @@ ip2_write( PTTY tty, const unsigned char *pData, int count) | |||
1719 | ip2_flush_chars( tty ); | 1719 | ip2_flush_chars( tty ); |
1720 | 1720 | ||
1721 | /* This is the actual move bit. Make sure it does what we need!!!!! */ | 1721 | /* This is the actual move bit. Make sure it does what we need!!!!! */ |
1722 | WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); | 1722 | write_lock_irqsave(&pCh->Pbuf_spinlock, flags); |
1723 | bytesSent = i2Output( pCh, pData, count); | 1723 | bytesSent = i2Output( pCh, pData, count); |
1724 | WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); | 1724 | write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); |
1725 | 1725 | ||
1726 | ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent ); | 1726 | ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent ); |
1727 | 1727 | ||
@@ -1746,13 +1746,13 @@ ip2_putchar( PTTY tty, unsigned char ch ) | |||
1746 | 1746 | ||
1747 | // ip2trace (CHANN, ITRC_PUTC, ITRC_ENTER, 1, ch ); | 1747 | // ip2trace (CHANN, ITRC_PUTC, ITRC_ENTER, 1, ch ); |
1748 | 1748 | ||
1749 | WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); | 1749 | write_lock_irqsave(&pCh->Pbuf_spinlock, flags); |
1750 | pCh->Pbuf[pCh->Pbuf_stuff++] = ch; | 1750 | pCh->Pbuf[pCh->Pbuf_stuff++] = ch; |
1751 | if ( pCh->Pbuf_stuff == sizeof pCh->Pbuf ) { | 1751 | if ( pCh->Pbuf_stuff == sizeof pCh->Pbuf ) { |
1752 | WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); | 1752 | write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); |
1753 | ip2_flush_chars( tty ); | 1753 | ip2_flush_chars( tty ); |
1754 | } else | 1754 | } else |
1755 | WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); | 1755 | write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); |
1756 | 1756 | ||
1757 | // ip2trace (CHANN, ITRC_PUTC, ITRC_RETURN, 1, ch ); | 1757 | // ip2trace (CHANN, ITRC_PUTC, ITRC_RETURN, 1, ch ); |
1758 | } | 1758 | } |
@@ -1772,7 +1772,7 @@ ip2_flush_chars( PTTY tty ) | |||
1772 | i2ChanStrPtr pCh = tty->driver_data; | 1772 | i2ChanStrPtr pCh = tty->driver_data; |
1773 | unsigned long flags; | 1773 | unsigned long flags; |
1774 | 1774 | ||
1775 | WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); | 1775 | write_lock_irqsave(&pCh->Pbuf_spinlock, flags); |
1776 | if ( pCh->Pbuf_stuff ) { | 1776 | if ( pCh->Pbuf_stuff ) { |
1777 | 1777 | ||
1778 | // ip2trace (CHANN, ITRC_PUTC, 10, 1, strip ); | 1778 | // ip2trace (CHANN, ITRC_PUTC, 10, 1, strip ); |
@@ -1786,7 +1786,7 @@ ip2_flush_chars( PTTY tty ) | |||
1786 | } | 1786 | } |
1787 | pCh->Pbuf_stuff -= strip; | 1787 | pCh->Pbuf_stuff -= strip; |
1788 | } | 1788 | } |
1789 | WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); | 1789 | write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); |
1790 | } | 1790 | } |
1791 | 1791 | ||
1792 | /******************************************************************************/ | 1792 | /******************************************************************************/ |
@@ -1804,9 +1804,9 @@ ip2_write_room ( PTTY tty ) | |||
1804 | i2ChanStrPtr pCh = tty->driver_data; | 1804 | i2ChanStrPtr pCh = tty->driver_data; |
1805 | unsigned long flags; | 1805 | unsigned long flags; |
1806 | 1806 | ||
1807 | READ_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); | 1807 | read_lock_irqsave(&pCh->Pbuf_spinlock, flags); |
1808 | bytesFree = i2OutputFree( pCh ) - pCh->Pbuf_stuff; | 1808 | bytesFree = i2OutputFree( pCh ) - pCh->Pbuf_stuff; |
1809 | READ_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); | 1809 | read_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); |
1810 | 1810 | ||
1811 | ip2trace (CHANN, ITRC_WRITE, 11, 1, bytesFree ); | 1811 | ip2trace (CHANN, ITRC_WRITE, 11, 1, bytesFree ); |
1812 | 1812 | ||
@@ -1836,12 +1836,12 @@ ip2_chars_in_buf ( PTTY tty ) | |||
1836 | pCh->Obuf_char_count + pCh->Pbuf_stuff, | 1836 | pCh->Obuf_char_count + pCh->Pbuf_stuff, |
1837 | pCh->Obuf_char_count, pCh->Pbuf_stuff ); | 1837 | pCh->Obuf_char_count, pCh->Pbuf_stuff ); |
1838 | #endif | 1838 | #endif |
1839 | READ_LOCK_IRQSAVE(&pCh->Obuf_spinlock,flags); | 1839 | read_lock_irqsave(&pCh->Obuf_spinlock, flags); |
1840 | rc = pCh->Obuf_char_count; | 1840 | rc = pCh->Obuf_char_count; |
1841 | READ_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags); | 1841 | read_unlock_irqrestore(&pCh->Obuf_spinlock, flags); |
1842 | READ_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); | 1842 | read_lock_irqsave(&pCh->Pbuf_spinlock, flags); |
1843 | rc += pCh->Pbuf_stuff; | 1843 | rc += pCh->Pbuf_stuff; |
1844 | READ_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); | 1844 | read_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); |
1845 | return rc; | 1845 | return rc; |
1846 | } | 1846 | } |
1847 | 1847 | ||
@@ -1865,9 +1865,9 @@ ip2_flush_buffer( PTTY tty ) | |||
1865 | #ifdef IP2DEBUG_WRITE | 1865 | #ifdef IP2DEBUG_WRITE |
1866 | printk (KERN_DEBUG "IP2: flush buffer\n" ); | 1866 | printk (KERN_DEBUG "IP2: flush buffer\n" ); |
1867 | #endif | 1867 | #endif |
1868 | WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); | 1868 | write_lock_irqsave(&pCh->Pbuf_spinlock, flags); |
1869 | pCh->Pbuf_stuff = 0; | 1869 | pCh->Pbuf_stuff = 0; |
1870 | WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); | 1870 | write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); |
1871 | i2FlushOutput( pCh ); | 1871 | i2FlushOutput( pCh ); |
1872 | ip2_owake(tty); | 1872 | ip2_owake(tty); |
1873 | 1873 | ||
@@ -1953,15 +1953,15 @@ ip2_unthrottle ( PTTY tty ) | |||
1953 | pCh->throttled = 0; | 1953 | pCh->throttled = 0; |
1954 | i2QueueCommands(PTYPE_BYPASS, pCh, 0, 1, CMD_RESUME); | 1954 | i2QueueCommands(PTYPE_BYPASS, pCh, 0, 1, CMD_RESUME); |
1955 | serviceOutgoingFifo( pCh->pMyBord ); | 1955 | serviceOutgoingFifo( pCh->pMyBord ); |
1956 | READ_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags) | 1956 | read_lock_irqsave(&pCh->Ibuf_spinlock, flags); |
1957 | if ( pCh->Ibuf_stuff != pCh->Ibuf_strip ) { | 1957 | if ( pCh->Ibuf_stuff != pCh->Ibuf_strip ) { |
1958 | READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) | 1958 | read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); |
1959 | #ifdef IP2DEBUG_READ | 1959 | #ifdef IP2DEBUG_READ |
1960 | printk (KERN_DEBUG "i2Input called from unthrottle\n" ); | 1960 | printk (KERN_DEBUG "i2Input called from unthrottle\n" ); |
1961 | #endif | 1961 | #endif |
1962 | i2Input( pCh ); | 1962 | i2Input( pCh ); |
1963 | } else | 1963 | } else |
1964 | READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) | 1964 | read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); |
1965 | } | 1965 | } |
1966 | 1966 | ||
1967 | static void | 1967 | static void |
@@ -2204,9 +2204,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg ) | |||
2204 | * for masking). Caller should use TIOCGICOUNT to see which one it was | 2204 | * for masking). Caller should use TIOCGICOUNT to see which one it was |
2205 | */ | 2205 | */ |
2206 | case TIOCMIWAIT: | 2206 | case TIOCMIWAIT: |
2207 | WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags); | 2207 | write_lock_irqsave(&pB->read_fifo_spinlock, flags); |
2208 | cprev = pCh->icount; /* note the counters on entry */ | 2208 | cprev = pCh->icount; /* note the counters on entry */ |
2209 | WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags); | 2209 | write_unlock_irqrestore(&pB->read_fifo_spinlock, flags); |
2210 | i2QueueCommands(PTYPE_BYPASS, pCh, 100, 4, | 2210 | i2QueueCommands(PTYPE_BYPASS, pCh, 100, 4, |
2211 | CMD_DCD_REP, CMD_CTS_REP, CMD_DSR_REP, CMD_RI_REP); | 2211 | CMD_DCD_REP, CMD_CTS_REP, CMD_DSR_REP, CMD_RI_REP); |
2212 | init_waitqueue_entry(&wait, current); | 2212 | init_waitqueue_entry(&wait, current); |
@@ -2226,9 +2226,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg ) | |||
2226 | rc = -ERESTARTSYS; | 2226 | rc = -ERESTARTSYS; |
2227 | break; | 2227 | break; |
2228 | } | 2228 | } |
2229 | WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags); | 2229 | write_lock_irqsave(&pB->read_fifo_spinlock, flags); |
2230 | cnow = pCh->icount; /* atomic copy */ | 2230 | cnow = pCh->icount; /* atomic copy */ |
2231 | WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags); | 2231 | write_unlock_irqrestore(&pB->read_fifo_spinlock, flags); |
2232 | if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && | 2232 | if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && |
2233 | cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) { | 2233 | cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) { |
2234 | rc = -EIO; /* no change => rc */ | 2234 | rc = -EIO; /* no change => rc */ |
@@ -2266,9 +2266,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg ) | |||
2266 | case TIOCGICOUNT: | 2266 | case TIOCGICOUNT: |
2267 | ip2trace (CHANN, ITRC_IOCTL, 11, 1, rc ); | 2267 | ip2trace (CHANN, ITRC_IOCTL, 11, 1, rc ); |
2268 | 2268 | ||
2269 | WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags); | 2269 | write_lock_irqsave(&pB->read_fifo_spinlock, flags); |
2270 | cnow = pCh->icount; | 2270 | cnow = pCh->icount; |
2271 | WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags); | 2271 | write_unlock_irqrestore(&pB->read_fifo_spinlock, flags); |
2272 | p_cuser = argp; | 2272 | p_cuser = argp; |
2273 | rc = put_user(cnow.cts, &p_cuser->cts); | 2273 | rc = put_user(cnow.cts, &p_cuser->cts); |
2274 | rc = put_user(cnow.dsr, &p_cuser->dsr); | 2274 | rc = put_user(cnow.dsr, &p_cuser->dsr); |
@@ -2874,7 +2874,7 @@ ip2_ipl_ioctl ( struct inode *pInode, struct file *pFile, UINT cmd, ULONG arg ) | |||
2874 | case 65: /* Board - ip2stat */ | 2874 | case 65: /* Board - ip2stat */ |
2875 | if ( pB ) { | 2875 | if ( pB ) { |
2876 | rc = copy_to_user(argp, pB, sizeof(i2eBordStr)); | 2876 | rc = copy_to_user(argp, pB, sizeof(i2eBordStr)); |
2877 | rc = put_user(INB(pB->i2eStatus), | 2877 | rc = put_user(inb(pB->i2eStatus), |
2878 | (ULONG __user *)(arg + (ULONG)(&pB->i2eStatus) - (ULONG)pB ) ); | 2878 | (ULONG __user *)(arg + (ULONG)(&pB->i2eStatus) - (ULONG)pB ) ); |
2879 | } else { | 2879 | } else { |
2880 | rc = -ENODEV; | 2880 | rc = -ENODEV; |