These notes are for the drivers which have already been integrated into the
kernel and have been tested on Linux kernels 2.0, 2.2, 2.3, and 2.4.
-Version: 1.2.11
-Date: 10/21/2001
+Version: 1.2.14
+Date: 11/01/2001
Historical Author: Andrew Manison <amanison@america.net>
-Primary Author: Doug McNash <dougm@computone.com>
-Testing: larryg@computone.com
+Primary Author: Doug McNash
Support: support@computone.com
Fixes and Updates: Mike Warfield <mhw@wittsend.com>
products previous to the Intelliport II.
This driver was developed on the v2.0.x Linux tree and has been tested up
-to v2.2.14; it will probably not work with earlier v1.X kernels,.
+to v2.4.14; it will probably not work with earlier v1.X kernels,.
2. QUICK INSTALLATION
cuf0 - cuf255 for callout devices.
If you are using devfs, existing devices are automatically created within
-the devfs name space. Normal devices will be ttf/0 - ttf/255 and callout
-devices will be cuf/0 - cuf/255. With devfs installed, ip2mkdev will
+the devfs name space. Normal devices will be tts/F0 - tts/F255 and callout
+devices will be cua/F0 - cua/F255. With devfs installed, ip2mkdev will
create symbolic links in /dev from the old conventional names to the newer
devfs names as follows:
/dev/ip2ipl[n] -> /dev/ip2/ipl[n] n = 0 - 3
/dev/ip2stat[n] -> /dev/ip2/stat[n] n = 0 - 3
- /dev/ttyF[n] -> /dev/ttf/[n] n = 0 - 255
- /dev/cuf[n] -> /dev/cuf/[n] n = 0 - 255
+ /dev/ttyF[n] -> /dev/tts/F[n] n = 0 - 255
+ /dev/cuf[n] -> /dev/cua/F[n] n = 0 - 255
Only devices for existing ports and boards will be created.
+IMPORTANT NOTE: The naming convention used for devfs by this driver
+was changed from 1.2.12 to 1.2.13. The old naming convention was to
+use ttf/%d for the tty device and cuf/%d for the cua device. That
+has been changed to conform to an agreed-upon standard of placing
+all the tty devices under tts. The device names are now tts/F%d for
+the tty device and cua/F%d for the cua devices. If you were using
+the older devfs names, you must update for the newer convention.
+
You do not need to run ip2mkdev if you are using devfs and only want to
use the devfs native device names.
documentation files, .../linux/Documentation/filesystems/devfs/REAME.
If you are using devfs, existing devices are automatically created within
-the devfs name space. Normal devices will be ttf/0 - ttf/255 and callout
-devices will be cuf/0 - cuf/255. With devfs installed, ip2mkdev will
+the devfs name space. Normal devices will be tts/F0 - tts/F255 and callout
+devices will be cua/F0 - cua/F255. With devfs installed, ip2mkdev will
create symbolic links in /dev from the old conventional names to the newer
devfs names as follows:
/dev/ip2ipl[n] -> /dev/ip2/ipl[n] n = 0 - 3
/dev/ip2stat[n] -> /dev/ip2/stat[n] n = 0 - 3
- /dev/ttyF[n] -> /dev/ttf/[n] n = 0 - 255
- /dev/cuf[n] -> /dev/cuf/[n] n = 0 - 255
+ /dev/ttyF[n] -> /dev/tts/F[n] n = 0 - 255
+ /dev/cuf[n] -> /dev/cua/F[n] n = 0 - 255
Only devices for existing ports and boards will be created.
+IMPORTANT NOTE: The naming convention used for devfs by this driver
+was changed from 1.2.12 to 1.2.13. The old naming convention was to
+use ttf/%d for the tty device and cuf/%d for the cua device. That
+has been changed to conform to an agreed-upon standard of placing
+all the tty devices under tts. The device names are now tts/F%d for
+the tty device and cua/F%d for the cua devices. If you were using
+the older devfs names, you must update for the newer convention.
+
You do not need to run ip2mkdev if you are using devfs and only want to
use the devfs native device names.
#!/bin/sh
-# This is a shell archive (produced by GNU sharutils 4.2).
+# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
-# Made on 2000-03-10 11:55 EST by <root@wittsend.wittsend.com>.
-# Source directory was `/mnt1/src/linux-2.3.50c/Documentation'.
+# Made on 2001-10-29 10:32 EST by <mhw@alcove.wittsend.com>.
+# Source directory was `/home2/src/tmp'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
-# 4061 -rwxr-xr-x ip2mkdev
+# 4251 -rwxr-xr-x ip2mkdev
#
save_IFS="${IFS}"
IFS="${IFS}:"
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
-touch -am 1231235999 $$.touch >/dev/null 2>&1
-if test ! -f 1231235999 && test -f $$.touch; then
- shar_touch=touch
+if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
+ shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
+elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
+ shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
+elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
+ shar_touch='touch -am $3$4$5$6$2 "$8"'
else
shar_touch=:
echo
$echo "installing GNU \`touch', distributed in GNU File Utilities..."
echo
fi
-rm -f 1231235999 $$.touch
+rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
-if mkdir _sh17088; then
+if mkdir _sh17581; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
# before running this script. Running this script will then recreate
# all the valid devices.
#
-# =mhw=
# Michael H. Warfield
+# /\/\|=mhw=|\/\/
# mhw@wittsend.com
#
-# Updated 03/09/2000 for devfs support in ip2 drivers. =mhw=
+# Updated 10/29/2000 for version 1.2.13 naming convention
+# under devfs. /\/\|=mhw=|\/\/
+#
+# Updated 03/09/2000 for devfs support in ip2 drivers. /\/\|=mhw=|\/\/
#
X
if test -d /dev/ip2 ; then
X ln -s ip2/$i ip2$i
X fi
X done
-X for i in `ls ttf` ; do
-X if test ! -L ttyF$i ; then
+X for i in `( cd tts ; ls F* )` ; do
+X if test ! -L tty$i ; then
X # Remove it incase it wasn't a symlink (old device)
-X rm -f ttyF$i
-X ln -s ttyf/$i ttyF$i
+X rm -f tty$i
+X ln -s tts/$i tty$i
X fi
X done
-X for i in `ls cuf` ; do
-X if test ! -L cuf$i ; then
+X for i in `( cd cua ; ls F* )` ; do
+X DEVNUMBER=`expr $i : 'F\(.*\)'`
+X if test ! -L cuf$DEVNUMBER ; then
X # Remove it incase it wasn't a symlink (old device)
-X rm -f cuf$i
-X ln -s cuf/$i cuf$i
+X rm -f cuf$DEVNUMBER
+X ln -s cua/$i cuf$DEVNUMBER
X fi
X done
X exit 0
X
Xexit 0
SHAR_EOF
- $shar_touch -am 03101153100 'ip2mkdev' &&
+ (set 20 01 10 29 10 32 01 'ip2mkdev'; eval "$shar_touch") &&
chmod 0755 'ip2mkdev' ||
$echo 'restore of' 'ip2mkdev' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'ip2mkdev:' 'MD5 check failed'
-b0671abeba07b0a9266b70aaf24509b3 ip2mkdev
+cb5717134509f38bad9fde6b1f79b4a4 ip2mkdev
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'ip2mkdev'`"
- test 4061 -eq "$shar_count" ||
- $echo 'ip2mkdev:' 'original size' '4061,' 'current size' "$shar_count!"
+ test 4251 -eq "$shar_count" ||
+ $echo 'ip2mkdev:' 'original size' '4251,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh17088
+rm -fr _sh17581
exit 0
VERSION = 2
PATCHLEVEL = 2
SUBLEVEL = 20
-EXTRAVERSION = pre12
+EXTRAVERSION =
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+++ /dev/null
-/*
- * This file is automatically generated by ./gentbl, DO NOT EDIT!
-*/
-
-#define SINTABBITS 9
-#define SINTABSIZE (1<<SINTABBITS)
-
-static short isintab[SINTABSIZE+SINTABSIZE/4] = {
- 0, 402, 804, 1206, 1607, 2009, 2410, 2811,
- 3211, 3611, 4011, 4409, 4807, 5205, 5601, 5997,
- 6392, 6786, 7179, 7571, 7961, 8351, 8739, 9126,
- 9511, 9895, 10278, 10659, 11038, 11416, 11792, 12166,
- 12539, 12909, 13278, 13645, 14009, 14372, 14732, 15090,
- 15446, 15799, 16150, 16499, 16845, 17189, 17530, 17868,
- 18204, 18537, 18867, 19194, 19519, 19840, 20159, 20474,
- 20787, 21096, 21402, 21705, 22004, 22301, 22594, 22883,
- 23169, 23452, 23731, 24006, 24278, 24546, 24811, 25072,
- 25329, 25582, 25831, 26077, 26318, 26556, 26789, 27019,
- 27244, 27466, 27683, 27896, 28105, 28309, 28510, 28706,
- 28897, 29085, 29268, 29446, 29621, 29790, 29955, 30116,
- 30272, 30424, 30571, 30713, 30851, 30984, 31113, 31236,
- 31356, 31470, 31580, 31684, 31785, 31880, 31970, 32056,
- 32137, 32213, 32284, 32350, 32412, 32468, 32520, 32567,
- 32609, 32646, 32678, 32705, 32727, 32744, 32757, 32764,
- 32767, 32764, 32757, 32744, 32727, 32705, 32678, 32646,
- 32609, 32567, 32520, 32468, 32412, 32350, 32284, 32213,
- 32137, 32056, 31970, 31880, 31785, 31684, 31580, 31470,
- 31356, 31236, 31113, 30984, 30851, 30713, 30571, 30424,
- 30272, 30116, 29955, 29790, 29621, 29446, 29268, 29085,
- 28897, 28706, 28510, 28309, 28105, 27896, 27683, 27466,
- 27244, 27019, 26789, 26556, 26318, 26077, 25831, 25582,
- 25329, 25072, 24811, 24546, 24278, 24006, 23731, 23452,
- 23169, 22883, 22594, 22301, 22004, 21705, 21402, 21096,
- 20787, 20474, 20159, 19840, 19519, 19194, 18867, 18537,
- 18204, 17868, 17530, 17189, 16845, 16499, 16150, 15799,
- 15446, 15090, 14732, 14372, 14009, 13645, 13278, 12909,
- 12539, 12166, 11792, 11416, 11038, 10659, 10278, 9895,
- 9511, 9126, 8739, 8351, 7961, 7571, 7179, 6786,
- 6392, 5997, 5601, 5205, 4807, 4409, 4011, 3611,
- 3211, 2811, 2410, 2009, 1607, 1206, 804, 402,
- 0, -402, -804, -1206, -1607, -2009, -2410, -2811,
- -3211, -3611, -4011, -4409, -4807, -5205, -5601, -5997,
- -6392, -6786, -7179, -7571, -7961, -8351, -8739, -9126,
- -9511, -9895,-10278,-10659,-11038,-11416,-11792,-12166,
- -12539,-12909,-13278,-13645,-14009,-14372,-14732,-15090,
- -15446,-15799,-16150,-16499,-16845,-17189,-17530,-17868,
- -18204,-18537,-18867,-19194,-19519,-19840,-20159,-20474,
- -20787,-21096,-21402,-21705,-22004,-22301,-22594,-22883,
- -23169,-23452,-23731,-24006,-24278,-24546,-24811,-25072,
- -25329,-25582,-25831,-26077,-26318,-26556,-26789,-27019,
- -27244,-27466,-27683,-27896,-28105,-28309,-28510,-28706,
- -28897,-29085,-29268,-29446,-29621,-29790,-29955,-30116,
- -30272,-30424,-30571,-30713,-30851,-30984,-31113,-31236,
- -31356,-31470,-31580,-31684,-31785,-31880,-31970,-32056,
- -32137,-32213,-32284,-32350,-32412,-32468,-32520,-32567,
- -32609,-32646,-32678,-32705,-32727,-32744,-32757,-32764,
- -32767,-32764,-32757,-32744,-32727,-32705,-32678,-32646,
- -32609,-32567,-32520,-32468,-32412,-32350,-32284,-32213,
- -32137,-32056,-31970,-31880,-31785,-31684,-31580,-31470,
- -31356,-31236,-31113,-30984,-30851,-30713,-30571,-30424,
- -30272,-30116,-29955,-29790,-29621,-29446,-29268,-29085,
- -28897,-28706,-28510,-28309,-28105,-27896,-27683,-27466,
- -27244,-27019,-26789,-26556,-26318,-26077,-25831,-25582,
- -25329,-25072,-24811,-24546,-24278,-24006,-23731,-23452,
- -23169,-22883,-22594,-22301,-22004,-21705,-21402,-21096,
- -20787,-20474,-20159,-19840,-19519,-19194,-18867,-18537,
- -18204,-17868,-17530,-17189,-16845,-16499,-16150,-15799,
- -15446,-15090,-14732,-14372,-14009,-13645,-13278,-12909,
- -12539,-12166,-11792,-11416,-11038,-10659,-10278, -9895,
- -9511, -9126, -8739, -8351, -7961, -7571, -7179, -6786,
- -6392, -5997, -5601, -5205, -4807, -4409, -4011, -3611,
- -3211, -2811, -2410, -2009, -1607, -1206, -804, -402,
- 0, 402, 804, 1206, 1607, 2009, 2410, 2811,
- 3211, 3611, 4011, 4409, 4807, 5205, 5601, 5997,
- 6392, 6786, 7179, 7571, 7961, 8351, 8739, 9126,
- 9511, 9895, 10278, 10659, 11038, 11416, 11792, 12166,
- 12539, 12909, 13278, 13645, 14009, 14372, 14732, 15090,
- 15446, 15799, 16150, 16499, 16845, 17189, 17530, 17868,
- 18204, 18537, 18867, 19194, 19519, 19840, 20159, 20474,
- 20787, 21096, 21402, 21705, 22004, 22301, 22594, 22883,
- 23169, 23452, 23731, 24006, 24278, 24546, 24811, 25072,
- 25329, 25582, 25831, 26077, 26318, 26556, 26789, 27019,
- 27244, 27466, 27683, 27896, 28105, 28309, 28510, 28706,
- 28897, 29085, 29268, 29446, 29621, 29790, 29955, 30116,
- 30272, 30424, 30571, 30713, 30851, 30984, 31113, 31236,
- 31356, 31470, 31580, 31684, 31785, 31880, 31970, 32056,
- 32137, 32213, 32284, 32350, 32412, 32468, 32520, 32567,
- 32609, 32646, 32678, 32705, 32727, 32744, 32757, 32764
-};
-
pCh->tqueue_status.routine = (void(*)(void*)) do_status;
pCh->tqueue_status.data = pCh;
+#ifdef IP2DEBUG_TRACE
pCh->trace = ip2trace;
+#endif
++pCh;
--nChannels;
if ( !i2Validate ( pCh ) ) {
return -1;
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_QUEUE, ITRC_ENTER, 0 );
-#endif
+
pB = pCh->pMyBord;
// Board must also exist, and THE INTERRUPT COMMAND ALREADY SENT
if (--bufroom < 0) {
bufroom += maxBuff;
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_QUEUE, 2, 1, bufroom );
-#endif
+
// Check for overflow
if (totalsize <= bufroom) {
// Normal Expected path - We still hold LOCK
}
}
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_QUEUE, 3, 1, totalsize );
-#endif
+
// Prepare to wait for buffers to empty
WRITE_UNLOCK_IRQRESTORE(lock_var_p,flags);
serviceOutgoingFifo(pB); // Dump what we got
return 0; // Wake up! Time to die!!!
}
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_QUEUE, 4, 0 );
-#endif
+ ip2trace (CHANN, ITRC_QUEUE, 4, 0 );
+
} // end of for(;;)
// At this point we have room and the lock - stick them in.
// pCs->cmd[0].
if (pCs == CMD_BMARK_REQ) {
pCh->bookMarks++;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_DRAIN, 30, 1, pCh->bookMarks );
-#endif
+
}
cnt = pCs->length;
// if the last command had to be at the end of a block, we end
// the existing block here and start a new one.
if ((blocksize + cnt > maxBlock) || lastended) {
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_QUEUE, 5, 0 );
-#endif
+
PTYPE_OF(pInsert) = type;
CHANNEL_OF(pInsert) = channel;
// count here does not include the header
i2QueueNeeds(pB, pCh, NEED_BYPASS);
break;
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_QUEUE, ITRC_RETURN, 1, nCommands );
-#endif
+
return nCommands; // Good status: number of commands sent
}
unsigned short status;
i2eBordStrPtr pB;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_STATUS, ITRC_ENTER, 2, pCh->dataSetIn, resetBits );
-#endif
// Make sure the channel exists, otherwise do nothing */
if ( !i2Validate ( pCh ) )
pCh->dataSetIn &= ~(I2_DDCD | I2_DCTS | I2_DDSR | I2_DRI);
}
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_STATUS, ITRC_RETURN, 1, pCh->dataSetIn );
-#endif
return status;
}
int count;
unsigned long flags = 0;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_INPUT, ITRC_ENTER, 0);
-#endif
// Ensure channel structure seems real
if ( !i2Validate( pCh ) ) {
i2Input_exit:
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_INPUT, ITRC_RETURN, 1, count);
-#endif
+
return count;
}
if ( !i2Validate ( pCh ) )
return -1;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_INPUT, 10, 0);
-#endif
WRITE_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags);
count = pCh->Ibuf_stuff - pCh->Ibuf_strip;
} else {
WRITE_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags);
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_INPUT, 19, 1, count);
-#endif
+
return count;
}
int bailout = 10;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_OUTPUT, ITRC_ENTER, 2, count, user );
-#endif
// Ensure channel structure seems real
if ( !i2Validate ( pCh ) )
// Small WINDOW here with no LOCK but I can't call Flush with LOCK
// We would be flushing (or ending flush) anyway
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 10, 1, amountToMove );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 10, 1, amountToMove );
+
if ( !(pCh->flush_flags && i2RetryFlushOutput(pCh) )
&& amountToMove > 0 )
{
WRITE_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags);
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_OUTPUT, 13, 1, stuffIndex );
-#endif
} else {
// becuz we need to stuff a flush
// or amount to move is <= 0
-#ifdef IP2DEBUG_TRACE
ip2trace(CHANN, ITRC_OUTPUT, 14, 3,
- amountToMove, pB->i2eFifoRemains, pB->i2eWaitingForEmptyFifo );
-#endif
+ amountToMove, pB->i2eFifoRemains,
+ pB->i2eWaitingForEmptyFifo );
+
// Put this channel back on queue
// this ultimatly gets more data or wakes write output
i2QueueNeeds(pB, pCh, NEED_INLINE);
if ( pB->i2eWaitingForEmptyFifo ) {
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_OUTPUT, 16, 0 );
-#endif
+
// or schedule
if (!in_interrupt()) {
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 61, 0 );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 61, 0 );
+
current->state = TASK_INTERRUPTIBLE;
current->counter = 0;
schedule_timeout(2);
}
continue;
} else {
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 62, 0 );
-#endif
+
+ ip2trace (CHANN, ITRC_OUTPUT, 62, 0 );
+
// let interrupt in = WAS restore_flags()
// We hold no lock nor is irq off anymore???
}
else if ( pB->i2eFifoRemains < 32 && !pB->i2eTxMailEmpty ( pB ) )
{
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 19, 2, pB->i2eFifoRemains,
- pB->i2eTxMailEmpty );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 19, 2,
+ pB->i2eFifoRemains,
+ pB->i2eTxMailEmpty );
+
break; // from while(count)
} else if ( pCh->channelNeeds & NEED_CREDIT ) {
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_OUTPUT, 22, 0 );
-#endif
+
break; // from while(count)
} else if ( --bailout) {
// Try to throw more things (maybe not us) in the fifo if we're
// not already waiting for it.
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_OUTPUT, 20, 0 );
-#endif
+
serviceOutgoingFifo(pB);
//break; CONTINUE;
} else {
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 21, 3, pB->i2eFifoRemains,
- pB->i2eOutMailWaiting, pB->i2eWaitingForEmptyFifo );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 21, 3,
+ pB->i2eFifoRemains,
+ pB->i2eOutMailWaiting,
+ pB->i2eWaitingForEmptyFifo );
+
break; // from while(count)
}
}
// We drop through either when the count expires, or when there is some
// count left, but there was a non-blocking write.
if (countOriginal > count) {
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_OUTPUT, 17, 2, countOriginal, count );
-#endif
+
serviceOutgoingFifo( pB );
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_OUTPUT, ITRC_RETURN, 2, countOriginal, count );
-#endif
return countOriginal - count;
}
i2FlushOutput(i2ChanStrPtr pCh)
{
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_FLUSH, 1, 1, pCh->flush_flags );
-#endif
if (pCh->flush_flags)
return;
if ( 1 != i2QueueCommands(PTYPE_BYPASS, pCh, 0, 1, CMD_STARTFL) ) {
pCh->flush_flags = STARTFL_FLAG; // Failed - flag for later
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_FLUSH, 2, 0 );
-#endif
+
} else if ( 1 != i2QueueCommands(PTYPE_INLINE, pCh, 0, 1, CMD_STOPFL) ) {
pCh->flush_flags = STOPFL_FLAG; // Failed - flag for later
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_FLUSH, 3, 0 );
-#endif
}
}
{
int old_flags = pCh->flush_flags;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_FLUSH, 14, 1, old_flags );
-#endif
pCh->flush_flags = 0; // Clear flag so we can avoid recursion
// and queue the commands
} else {
old_flags = STARTFL_FLAG; //Failure - Flag for retry later
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_FLUSH, 15, 1, old_flags );
-#endif
+
}
if ( old_flags & STOPFL_FLAG ) {
if ( 1 == i2QueueCommands(PTYPE_INLINE, pCh, 0, 1, CMD_STOPFL) > 0 ) {
old_flags = 0; // Success - clear flags
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_FLUSH, 16, 1, old_flags );
-#endif
}
- pCh->flush_flags = old_flags;
+ pCh->flush_flags = old_flags;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_FLUSH, 17, 1, old_flags );
-#endif
+
return old_flags;
}
static void
i2DrainWakeup(i2ChanStrPtr pCh)
{
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_DRAIN, 10, 1, pCh->BookmarkTimer.expires );
-#endif
+
pCh->BookmarkTimer.expires = 0;
wake_up_interruptible( &pCh->pBookmarkWait );
}
wait_queue_t wait;
i2eBordStrPtr pB;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_DRAIN, ITRC_ENTER, 1, pCh->BookmarkTimer.expires);
-#endif
+
pB = pCh->pMyBord;
// If the board has gone fatal, return bad,
// and also hit the trap routine if it exists.
pCh->BookmarkTimer.function = (void*)(unsigned long)i2DrainWakeup;
pCh->BookmarkTimer.data = (unsigned long)pCh;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_DRAIN, 1, 1, pCh->BookmarkTimer.expires );
-#endif
add_timer( &(pCh->BookmarkTimer) );
}
(pCh->BookmarkTimer.expires > jiffies)) {
del_timer( &(pCh->BookmarkTimer) );
pCh->BookmarkTimer.expires = 0;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_DRAIN, 3, 1, pCh->BookmarkTimer.expires );
-#endif
}
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_DRAIN, ITRC_RETURN, 1, pCh->BookmarkTimer.expires );
-#endif
return;
}
pCh = tp->driver_data;
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_SICMD, 10, 2, tp->flags, (1 << TTY_DO_WRITE_WAKEUP) );
-#endif
+ ip2trace (CHANN, ITRC_SICMD, 10, 2, tp->flags,
+ (1 << TTY_DO_WRITE_WAKEUP) );
+
wake_up_interruptible ( &tp->write_wait );
wake_up_interruptible ( &tp->poll_wait );
if ( ( tp->flags & (1 << TTY_DO_WRITE_WAKEUP) )
&& tp->ldisc.write_wakeup )
{
(tp->ldisc.write_wakeup) ( tp );
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_SICMD, 11, 0 );
-#endif
}
}
unsigned char dss_change;
unsigned long bflags,cflags;
-#ifdef IP2DEBUG_TRACE
- //ip2trace (ITRC_NO_PORT, ITRC_SFIFO, ITRC_ENTER, 0 );
-#endif
+// ip2trace (ITRC_NO_PORT, ITRC_SFIFO, ITRC_ENTER, 0 );
while (HAS_INPUT(pB)) {
-#ifdef IP2DEBUG_TRACE
- //ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 2, 0 );
-#endif
+// ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 2, 0 );
+
// Process packet from fifo a one atomic unit
WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock,bflags);
case PTYPE_DATA:
pB->got_input = 1;
-#ifdef IP2DEBUG_TRACE
- //ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 3, 0 );
-#endif
+// ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 3, 0 );
+
channel = CHANNEL_OF(pB->i2eLeadoffWord); /* Store channel */
count = iiReadWord(pB); /* Count is in the next word */
break; // From switch: ready for next packet
case PTYPE_STATUS:
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 4, 0 );
-#endif
count = CMD_COUNT_OF(pB->i2eLeadoffWord);
while (pc < pcLimit) {
channel = *pc++;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_SFIFO, 7, 2, channel, *pc );
-#endif
+
/* check for valid channel */
if (channel < pB->i2eChannelCnt
&&
break;
case STAT_DCD_UP:
-#ifdef IP2DEBUG_TRACE
ip2trace (channel, ITRC_MODEM, 1, 1, pCh->dataSetIn );
-#endif
+
if ( !(pCh->dataSetIn & I2_DCD) )
{
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_MODEM, 2, 0 );
-#endif
pCh->dataSetIn |= I2_DDCD;
pCh->icount.dcd++;
dss_change = 1;
}
pCh->dataSetIn |= I2_DCD;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_MODEM, 3, 1, pCh->dataSetIn );
-#endif
break;
case STAT_DCD_DN:
-#ifdef IP2DEBUG_TRACE
ip2trace (channel, ITRC_MODEM, 4, 1, pCh->dataSetIn );
-#endif
if ( pCh->dataSetIn & I2_DCD )
{
-#ifdef IP2DEBUG_TRACE
ip2trace (channel, ITRC_MODEM, 5, 0 );
-#endif
pCh->dataSetIn |= I2_DDCD;
pCh->icount.dcd++;
dss_change = 1;
}
pCh->dataSetIn &= ~I2_DCD;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_MODEM, 6, 1, pCh->dataSetIn );
-#endif
break;
case STAT_DSR_UP:
if (pCh->bookMarks <= 0 ) {
pCh->bookMarks = 0;
wake_up_interruptible( &pCh->pBookmarkWait );
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_DRAIN, 20, 1, pCh->BookmarkTimer.expires );
-#endif
}
break;
pCh->outfl.room =
((flowStatPtr)pc)->room -
(pCh->outfl.asof - ((flowStatPtr)pc)->asof);
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_STFLW, 1, 1, pCh->outfl.room );
-#endif
+
if (pCh->channelNeeds & NEED_CREDIT)
{
-#ifdef IP2DEBUG_TRACE
- ip2trace (channel, ITRC_STFLW, 2, 1, pCh->channelNeeds);
-#endif
+ ip2trace (channel, ITRC_STFLW, 2, 1, pCh->channelNeeds);
+
pCh->channelNeeds &= ~NEED_CREDIT;
i2QueueNeeds(pB, pCh, NEED_INLINE);
if ( pCh->pTTY )
ip2_owake(pCh->pTTY);
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_STFLW, 3, 1, pCh->channelNeeds);
-#endif
+
pc += sizeof(flowStat);
break;
break;
default: // Neither packet? should be impossible
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 5, 1,
PTYPE_OF(pB->i2eLeadoffWord) );
-#endif
+
break;
} // End of switch on type of packets
} //while(board HAS_INPUT)
-#ifdef IP2DEBUG_TRACE
+
ip2trace (ITRC_NO_PORT, ITRC_SFIFO, ITRC_RETURN, 0 );
-#endif
+
// Send acknowledgement to the board even if there was no data!
pB->i2eOutMailWaiting |= MB_IN_STRIPPED;
return;
i2ChanStrPtr pCh;
unsigned short paddedSize = ROUNDUP(sizeof(flowIn));
-#ifdef IP2DEBUG_TRACE
-ip2trace (ITRC_NO_PORT, ITRC_SFLOW, ITRC_ENTER, 2, pB->i2eFifoRemains, paddedSize );
-#endif
+ ip2trace (ITRC_NO_PORT, ITRC_SFLOW, ITRC_ENTER, 2,
+ pB->i2eFifoRemains, paddedSize );
// Continue processing so long as there are entries, or there is room in the
// fifo. Each entry represents a channel with something to do.
break;
}
#ifdef DEBUG_FIFO
-WriteDBGBuf("FLOW",(unsigned char *) &(pCh->infl), paddedSize);
+ WriteDBGBuf("FLOW",(unsigned char *) &(pCh->infl), paddedSize);
#endif /* DEBUG_FIFO */
} // Either clogged or finished all the work
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_SFLOW, ITRC_RETURN, 0 );
-#endif
}
//******************************************************************************
int bailout = 1000;
int bailout2;
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_SICMD, ITRC_ENTER, 3, pB->i2eFifoRemains,
pB->i2Dbuf_strip, pB->i2Dbuf_stuff );
-#endif
// Continue processing so long as there are entries, or there is room in the
// fifo. Each entry represents a channel with something to do.
WRITE_LOCK_IRQSAVE(&pCh->Obuf_spinlock,flags);
stripIndex = pCh->Obuf_strip;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_SICMD, 3, 2, stripIndex, pCh->Obuf_stuff );
-#endif
+
// as long as there are packets for this channel...
bailout2 = 1000;
while ( --bailout2 && stripIndex != pCh->Obuf_stuff) {
flowsize = CREDIT_USAGE(flowsize);
paddedSize = ROUNDUP(packetSize);
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_SICMD, 4, 2, pB->i2eFifoRemains, paddedSize );
-#endif
+
// If we don't have enough credits from the board to send the data,
// flag the channel that we are waiting for flow control credit, and
// break out. This will clean up this channel and remove us from the
// queue of hot things to do.
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_SICMD, 5, 2, pCh->outfl.room, flowsize );
-#endif
+
if (pCh->outfl.room <= flowsize) {
// Do Not have the credits to send this packet.
i2QueueNeeds(pB, pCh, NEED_CREDIT);
}
pRemove += packetSize;
stripIndex += packetSize;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_SICMD, 6, 2, stripIndex, pCh->Obuf_strip);
-#endif
+
if (stripIndex >= OBUF_SIZE) {
stripIndex = 0;
pRemove = pCh->Obuf;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_SICMD, 7, 1, stripIndex );
-#endif
+
}
} /* while */
if ( !bailout2 ) {
WRITE_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags);
if ( notClogged )
{
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_SICMD, 8, 0 );
-#endif
+
if ( pCh->pTTY ) {
ip2_owake(pCh->pTTY);
}
}
} // Either clogged or finished all the work
-#ifdef IP2DEBUG_TRACE
+
if ( !bailout ) {
ip2trace (ITRC_NO_PORT, ITRC_ERROR, 4, 0 );
}
-#endif
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_SICMD, ITRC_RETURN, 1,pB->i2Dbuf_strip);
-#endif
}
//******************************************************************************
}
pB->i2eStartMail = NO_MAIL_HERE;
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INTR, 2, 1, inmail );
-#endif
if (inmail != NO_MAIL_HERE) {
// If the board has gone fatal, nothing to do but hit a bit that will
pB->i2eFifoRemains = pB->i2eFifoSize;
pB->i2eWaitingForEmptyFifo = 0;
WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags);
-#ifdef IP2DEBUG_TRACE
- ip2trace (ITRC_NO_PORT, ITRC_INTR, 30, 1, pB->i2eFifoRemains );
-#endif
+
+ ip2trace (ITRC_NO_PORT, ITRC_INTR, 30, 1, pB->i2eFifoRemains );
+
}
serviceOutgoingFifo(pB);
}
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INTR, 8, 0 );
-#endif
exit_i2ServiceBoard:
static int i2ServiceBoard(i2eBordStrPtr);
static void i2DrainOutput(i2ChanStrPtr, int);
+#ifdef IP2DEBUG_TRACE
+void ip2trace(unsigned short,unsigned char,unsigned char,unsigned long,...);
+#else
+#define ip2trace(a,b,c,d...) do {} while (0)
+#endif
+
// Argument to i2QueueCommands
//
#define C_IN_LINE 1
//
// Done:
//
+// 1.2.14 /\/\|=mhw=|\/\/
+// Added bounds checking to ip2_ipl_ioctl to avoid potential terroristic acts.
+// Changed the definition of ip2trace to be more consistant with kernel style
+// Thanks to Andreas Dilger <adilger@turbolabs.com> for these updates
+//
+// 1.2.13 /\/\|=mhw=|\/\/
+// DEVFS: Renamed ttf/{n} to tts/F{n} and cuf/{n} to cua/F{n} to conform
+// to agreed devfs serial device naming convention.
+//
+// 1.2.12 /\/\|=mhw=|\/\/
+// Cleaned up some remove queue cut and paste errors
+//
// 1.2.11 /\/\|=mhw=|\/\/
// Clean up potential NULL pointer dereferences
// Clean up devfs registration
/* String constants to identify ourselves */
static char *pcName = "Computone IntelliPort Plus multiport driver";
-static char *pcVersion = "1.2.11";
+static char *pcVersion = "1.2.14";
/* String constants for port names */
static char *pcDriver_name = "ip2";
#ifdef CONFIG_DEVFS_FS
-static char *pcTty = "ttf/%d";
-static char *pcCallout = "cuf/%d";
+static char *pcTty = "tts/F%d";
+static char *pcCallout = "cua/F%d";
#else
static char *pcTty = "ttyF";
static char *pcCallout = "cuf";
static int ip2_ipl_ioctl(struct inode *, struct file *, UINT, ULONG);
static int ip2_ipl_open(struct inode *, struct file *);
-void ip2trace(unsigned short,unsigned char,unsigned char,unsigned long,...);
static int DumpTraceBuffer(char *, int);
static int DumpFifoBuffer( char *, int);
i2eBordStrPtr pB = NULL;
int rc = -1;
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INIT, ITRC_ENTER, 0 );
-#endif
/* process command line arguments to modprobe or
insmod i.e. iop & irqp */
}
}
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INIT, 2, 0 );
-#endif
/* Zero out the normal tty device structure. */
memset ( &ip2_tty_driver, 0, sizeof ip2_tty_driver );
ip2_callout_driver.major = IP2_CALLOUT_MAJOR;
ip2_callout_driver.subtype = SERIAL_TYPE_CALLOUT;
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INIT, 3, 0 );
-#endif
/* Register the tty devices. */
if ( ( err = tty_register_driver ( &ip2_tty_driver ) ) ) {
printk(KERN_ERR "IP2: failed to register read_procmem (%d)\n", err );
} else {
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INIT, 4, 0 );
-#endif
/* Register the interrupt handler or poll handler, depending upon the
* specified interrupt.
*/
}
}
}
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INIT, ITRC_RETURN, 0 );
-#endif
return 0;
}
int i;
i2eBordStrPtr pB;
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, irq );
-#endif
/* Service just the boards on the list using this irq */
for( i = 0; i < i2nBoards; ++i ) {
++irq_counter;
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
-#endif
}
/******************************************************************************/
static void
ip2_poll(unsigned long arg)
{
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INTR, 100, 0 );
-#endif
+
TimerOn = 0; // it's the truth but not checked in service
// Just polled boards, IRQ = 0 will hit all non-interrupt boards.
add_timer( &PollTimer );
TimerOn = 1;
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
-#endif
}
static inline void
{
unsigned long flags;
-#ifdef IP2DEBUG_TRACE
ip2trace(CHANN, ITRC_INPUT, 21, 0 );
-#endif
+
// Data input
if ( pCh->pTTY != NULL ) {
READ_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags)
} else
READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags)
} else {
-#ifdef IP2DEBUG_TRACE
ip2trace(CHANN, ITRC_INPUT, 22, 0 );
-#endif
+
i2InputFlush( pCh );
}
}
status = i2GetStatus( pCh, (I2_BRK|I2_PAR|I2_FRA|I2_OVR) );
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_STATUS, 21, 1, status );
-#endif
if (pCh->pTTY && (status & (I2_BRK|I2_PAR|I2_FRA|I2_OVR)) ) {
if ( (status & I2_BRK) ) {
}
}
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_STATUS, 26, 0 );
-#endif
}
/******************************************************************************/
int do_clocal = 0;
i2ChanStrPtr pCh = DevTable[MINOR(tty->device)];
-#ifdef IP2DEBUG_TRACE
ip2trace (MINOR(tty->device), ITRC_OPEN, ITRC_ENTER, 0 );
-#endif
if ( pCh == NULL ) {
return -ENODEV;
}
if ( tty_hung_up_p(pFile) ) {
set_current_state( TASK_RUNNING );
- remove_wait_queue(&pCh->dss_now_wait, &wait);
+ remove_wait_queue(&pCh->open_wait, &wait);
return ( pCh->flags & ASYNC_HUP_NOTIFY ) ? -EBUSY : -ERESTARTSYS;
}
if ( !(pCh->flags & ASYNC_CALLOUT_ACTIVE) &&
(pCh->flags & ASYNC_CLOSING)?"True":"False");
printk(KERN_DEBUG "OpenBlock: waiting for CD or signal\n");
#endif
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_OPEN, 3, 2, (pCh->flags & ASYNC_CALLOUT_ACTIVE),
- (pCh->flags & ASYNC_CLOSING) );
-#endif
+ (pCh->flags & ASYNC_CLOSING) );
/* check for signal */
if (signal_pending(current)) {
rc = (( pCh->flags & ASYNC_HUP_NOTIFY ) ? -EAGAIN : -ERESTARTSYS);
schedule();
}
set_current_state( TASK_RUNNING );
- remove_wait_queue(&pCh->dss_now_wait, &wait);
+ remove_wait_queue(&pCh->open_wait, &wait);
--pCh->wopen; //why count?
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_OPEN, 4, 0 );
-#endif
+
if (rc != 0 ) {
return rc;
}
#endif
serviceOutgoingFifo( pCh->pMyBord );
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_OPEN, ITRC_RETURN, 0 );
-#endif
+
return 0;
}
return;
}
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_CLOSE, ITRC_ENTER, 0 );
-#endif
#ifdef IP2DEBUG_OPEN
printk(KERN_DEBUG "IP2:close ttyF%02X:\n",MINOR(tty->device));
if ( tty_hung_up_p ( pFile ) ) {
MOD_DEC_USE_COUNT;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_CLOSE, 2, 1, 2 );
-#endif
+
return;
}
if ( tty->count > 1 ) { /* not the last close */
MOD_DEC_USE_COUNT;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_CLOSE, 2, 1, 3 );
-#endif
+
return;
}
pCh->flags |= ASYNC_CLOSING; // last close actually
MOD_DEC_USE_COUNT;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_CLOSE, ITRC_RETURN, 1, 1 );
-#endif
+
return;
}
return;
}
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_HANGUP, ITRC_ENTER, 0 );
-#endif
ip2_flush_buffer(tty);
pCh->pTTY = NULL;
wake_up_interruptible ( &pCh->open_wait );
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_HANGUP, ITRC_RETURN, 0 );
-#endif
}
/******************************************************************************/
int bytesSent = 0;
unsigned long flags;
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_WRITE, ITRC_ENTER, 2, count, -1 );
-#endif
+ ip2trace (CHANN, ITRC_WRITE, ITRC_ENTER, 2, count, -1 );
/* Flush out any buffered data left over from ip2_putchar() calls. */
ip2_flush_chars( tty );
bytesSent = i2Output( pCh, pData, count, user );
WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags);
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent );
-#endif
+ ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent );
+
return bytesSent > 0 ? bytesSent : 0;
}
i2ChanStrPtr pCh = tty->driver_data;
unsigned long flags;
-#ifdef IP2DEBUG_TRACE
// ip2trace (CHANN, ITRC_PUTC, ITRC_ENTER, 1, ch );
-#endif
WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags);
pCh->Pbuf[pCh->Pbuf_stuff++] = ch;
} else
WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags);
-#ifdef IP2DEBUG_TRACE
// ip2trace (CHANN, ITRC_PUTC, ITRC_RETURN, 1, ch );
-#endif
}
/******************************************************************************/
WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags);
if ( pCh->Pbuf_stuff ) {
-#ifdef IP2DEBUG_TRACE
-// ip2trace (CHANN, ITRC_PUTC, 10, 1, strip );
-#endif
+
+// ip2trace (CHANN, ITRC_PUTC, 10, 1, strip );
+
//
// We may need to restart i2Output if it does not fullfill this request
//
bytesFree = i2OutputFree( pCh ) - pCh->Pbuf_stuff;
READ_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags);
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_WRITE, 11, 1, bytesFree );
-#endif
return ((bytesFree > 0) ? bytesFree : 0);
}
i2ChanStrPtr pCh = tty->driver_data;
int rc;
unsigned long flags;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_WRITE, 12, 1, pCh->Obuf_char_count + pCh->Pbuf_stuff );
-#endif
+
#ifdef IP2DEBUG_WRITE
printk (KERN_DEBUG "IP2: chars in buffer = %d (%d,%d)\n",
pCh->Obuf_char_count + pCh->Pbuf_stuff,
i2ChanStrPtr pCh = tty->driver_data;
unsigned long flags;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_FLUSH, ITRC_ENTER, 0 );
-#endif
+
#ifdef IP2DEBUG_WRITE
printk (KERN_DEBUG "IP2: flush buffer\n" );
#endif
WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags);
i2FlushOutput( pCh );
ip2_owake(tty);
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_FLUSH, ITRC_RETURN, 0 );
-#endif
+
}
/******************************************************************************/
return -ENODEV;
}
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_IOCTL, ITRC_ENTER, 2, cmd, arg );
-#endif
#ifdef IP2DEBUG_IOCTL
printk(KERN_DEBUG "IP2: ioctl cmd (%x), arg (%lx)\n", cmd, arg );
switch(cmd) {
case TIOCGSERIAL:
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_IOCTL, 2, 1, rc );
-#endif
+
rc = get_serial_info(pCh, (struct serial_struct *) arg);
if (rc)
return rc;
break;
case TIOCSSERIAL:
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_IOCTL, 3, 1, rc );
-#endif
+
rc = set_serial_info(pCh, (struct serial_struct *) arg);
if (rc)
return rc;
case TCSBRK: /* SVID version: non-zero arg --> no break */
rc = tty_check_change(tty);
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_IOCTL, 4, 1, rc );
-#endif
+
if (!rc) {
ip2_wait_until_sent(tty,0);
if (!arg) {
case TCSBRKP: /* support for POSIX tcsendbreak() */
rc = tty_check_change(tty);
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_IOCTL, 5, 1, rc );
-#endif
+
if (!rc) {
ip2_wait_until_sent(tty,0);
i2QueueCommands(PTYPE_INLINE, pCh, 100, 1,
break;
case TIOCGSOFTCAR:
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_IOCTL, 6, 1, rc );
-#endif
+
PUT_USER(rc,C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
if (rc)
return rc;
break;
case TIOCSSOFTCAR:
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_IOCTL, 7, 1, rc );
-#endif
+
GET_USER(rc,arg,(unsigned long *) arg);
if (rc)
return rc;
break;
case TIOCMGET:
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_IOCTL, 8, 1, rc );
-#endif
+
i2QueueCommands(PTYPE_BYPASS, pCh, 100, 1, CMD_DSS_NOW);
init_waitqueue_entry(&wait, current);
case TIOCMBIS:
case TIOCMBIC:
case TIOCMSET:
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_IOCTL, 9, 0 );
-#endif
+
rc = set_modem_info(pCh, cmd, (unsigned int *) arg);
break;
serviceOutgoingFifo( pCh->pMyBord );
for(;;) {
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_IOCTL, 10, 0 );
-#endif
+
schedule();
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_IOCTL, 11, 0 );
-#endif
+
/* see if a signal did it */
if (signal_pending(current)) {
rc = -ERESTARTSYS;
* serial driver.
*/
case TIOCGICOUNT:
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_IOCTL, 11, 1, rc );
-#endif
+
save_flags(flags);cli();
cnow = pCh->icount;
restore_flags(flags);
case TIOCSERSETMULTI:
default:
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_IOCTL, 12, 0 );
-#endif
+
rc = -ENOIOCTLCMD;
break;
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_IOCTL, ITRC_RETURN, 0 );
-#endif
+
return rc;
}
#ifdef IP2DEBUG_IOCTL
printk (KERN_DEBUG "IP2: set line discipline\n" );
#endif
-#ifdef IP2DEBUG_TRACE
+
ip2trace (((i2ChanStrPtr)tty->driver_data)->port_index, ITRC_IOCTL, 16, 0 );
-#endif
+
}
/******************************************************************************/
break;
default:
- pCh = DevTable[cmd];
- if ( pCh )
- {
- COPY_TO_USER(rc, (char*)arg, (char*)pCh, sizeof(i2ChanStr) );
+ if (cmd < IP2_MAX_PORTS) {
+ pCh = DevTable[cmd];
+ if ( pCh )
+ {
+ COPY_TO_USER(rc, (char*)arg, (char*)pCh, sizeof(i2ChanStr) );
+ } else {
+ rc = -ENODEV;
+ }
} else {
- rc = cmd < 64 ? -ENODEV : -EINVAL;
+ rc = -EINVAL;
}
}
break;
/* */
/* */
/******************************************************************************/
+#ifdef IP2DEBUG_TRACE
void
ip2trace (unsigned short pn, unsigned char cat, unsigned char label, unsigned long codes, ...)
{
-#ifdef IP2DEBUG_TRACE
long flags;
unsigned long *pCode = &codes;
union ip2breadcrumb bc;
tracebuf[tracestuff++] = *++pCode;
}
-#endif
}
+#endif