int pcxx_ncook=sizeof(pcxx_cook);
int pcxx_nbios=sizeof(pcxx_bios);
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define pcxxassert(x, msg) if(!(x)) pcxx_error(__LINE__, msg)
#define FEPTIMEOUT 200000
{
unsigned long flags;
- int e1, e2;
+ int e1;
printk(KERN_NOTICE "Unloading PC/Xx version %s\n", VERSION);
restore_flags(flags);
}
-/*
- * pcxe_init() is our init_module():
- */
-module_init(pcxe_init);
-module_cleanup(pcxe_cleanup);
-
static inline struct channel *chan(register struct tty_struct *tty)
{
if (tty) {
if(tty->driver->flush_buffer)
tty->driver->flush_buffer(tty);
- if(tty->ldisc.flush_buffer)
- tty->ldisc.flush_buffer(tty);
+ tty_ldisc_flush(tty);
shutdown(info);
tty->closing = 0;
info->event = 0;
info->tty = NULL;
-#ifndef MODULE
-/* ldiscs[] is not available in a MODULE
-** worth noting that while I'm not sure what this hunk of code is supposed
-** to do, it is not present in the serial.c driver. Hmmm. If you know,
-** please send me a note. brian@ilinx.com
-** Don't know either what this is supposed to do christoph@lameter.com.
-*/
- if(tty->ldisc.num != ldiscs[N_TTY].num) {
- if(tty->ldisc.close)
- (tty->ldisc.close)(tty);
- tty->ldisc = ldiscs[N_TTY];
- tty->termios->c_line = N_TTY;
- if(tty->ldisc.open)
- (tty->ldisc.open)(tty);
- }
-#endif
if(info->blocked_open) {
if(info->close_delay) {
current->state = TASK_INTERRUPTIBLE;
tail &= (size - 1);
stlen = (head >= tail) ? (size - (head - tail) - 1) : (tail - head - 1);
- count = MIN(stlen, count);
+ count = min(stlen, count);
memoff(ch);
restore_flags(flags);
remain = tail - head - 1;
stlen = remain;
}
- count = MIN(remain, count);
+ count = min(remain, count);
txwinon(ch);
while (count > 0) {
- stlen = MIN(count, stlen);
+ stlen = min(count, stlen);
memcpy(ch->txptr + head, buf, stlen);
buf += stlen;
count -= stlen;
memoff(ch);
restore_flags(flags);
- wake_up_interruptible(&tty->write_wait);
- if((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
- (tty->ldisc.write_wakeup)(tty);
+ tty_wakeup(tty);
}
static void pcxe_flush_chars(struct tty_struct *tty)
}
#endif
-module_init(pcxe_init)
-module_exit(pcxe_exit)
-
static struct tty_operations pcxe_ops = {
.open = pcxe_open,
.close = pcxe_close,
return ret;
}
+module_init(pcxe_init)
+module_exit(pcxe_cleanup)
static void pcxxpoll(unsigned long dummy)
{
if (event & LOWTX_IND) {
if (ch->statusflags & LOWWAIT) {
ch->statusflags &= ~LOWWAIT;
- if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
- tty->ldisc.write_wakeup)
- (tty->ldisc.write_wakeup)(tty);
- wake_up_interruptible(&tty->write_wait);
+ tty_wakeup(tty);
}
}
ch->statusflags &= ~TXBUSY;
if (ch->statusflags & EMPTYWAIT) {
ch->statusflags &= ~EMPTYWAIT;
- if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
- tty->ldisc.write_wakeup)
- (tty->ldisc.write_wakeup)(tty);
- wake_up_interruptible(&tty->write_wait);
+ tty_wakeup(tty);
}
}
}
volatile struct board_chan *bc;
unsigned long flags;
int mflag = 0;
+ int mstat;
if(ch)
bc = ch->brdchan;
pcxxparam(tty,ch);
memoff(ch);
restore_flags(flags);
+ return 0;
}
tty_wait_until_sent(tty, 0);
}
else {
- if(tty->ldisc.flush_buffer)
- tty->ldisc.flush_buffer(tty);
+ tty_ldisc_flush(tty);
}
/* Fall Thru */