VERSION = 2
PATCHLEVEL = 2
SUBLEVEL = 15
-EXTRAVERSION = pre18
+EXTRAVERSION = pre19
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
(tty->ldisc.write_wakeup)(tty);
}
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
#ifdef Z_WAKE
if (test_and_clear_bit(Cy_EVENT_SHUTDOWN_WAKEUP, &info->event)) {
CY_UNLOCK(info, flags);
}
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP))
&& tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup) (tty);
wake_up_interruptible (&tty->write_wait);
+ wake_up_interruptible (&tty->poll_wait);
}
}
sti ();
wake_up_interruptible (&tty->write_wait);
+ wake_up_interruptible (&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
-
+ wake_up_interruptible(&tty->poll_wait);
} /* End if LOWWAIT */
} /* End LOWTX_IND */
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
} /* End if EMPTYWAIT */
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
}
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
sti();
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
func_exit ();
}
ip2trace (CHANN, ITRC_SICMD, 10, 2, tp->flags, (1 << TTY_DO_WRITE_WAKEUP) );
#endif
wake_up_interruptible ( &tp->write_wait );
+ wake_up_interruptible ( &tp->poll_wait );
if ( ( tp->flags & (1 << TTY_DO_WRITE_WAKEUP) )
&& tp->ldisc.write_wakeup )
{
goto skip_this;
}
wake_up_interruptible(&pCh->pTTY->read_wait);
+ wake_up_interruptible(&pCh->pTTY->poll_wait);
}
#ifdef NEVER_HAPPENS_AS_SETUP_XXX
// and can't work because we don't know the_char
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
/* main interrupt handler routine */
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
EBRDENABLE(brdp);
}
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
}
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup) (tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
static int moxa_chars_in_buffer(struct tty_struct *tty)
tp->ldisc.write_wakeup)
(tp->ldisc.write_wakeup) (tp);
wake_up_interruptible(&tp->write_wait);
+ wake_up_interruptible(&tp->poll_wait);
}
}
}
ch->tty->ldisc.write_wakeup)
(ch->tty->ldisc.write_wakeup) (ch->tty);
wake_up_interruptible(&ch->tty->write_wait);
+ wake_up_interruptible(&ch->tty->poll_wait);
return;
}
moxaEmptyTimer[ch->port].expires = jiffies + HZ;
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup) (tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
if (test_and_clear_bit(MXSER_EVENT_HANGUP, &info->event)) {
tty_hangup(tty);
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup) (tty);
/* Queues for select() functionality */
wait_queue_head_t read_wait;
wait_queue_head_t write_wait;
+ wait_queue_head_t poll_wait;
int tbusy; /* reentrancy flag for tx wakeup code */
int woke_up;
/* Ensure that the n_hdlcd process is not hanging on select()/poll() */
wake_up_interruptible (&n_hdlc->read_wait);
+ wake_up_interruptible (&n_hdlc->poll_wait);
wake_up_interruptible (&n_hdlc->write_wait);
if (tty != NULL && tty->disc_data == n_hdlc)
/* wake up any blocked reads and perform async signalling */
wake_up_interruptible (&n_hdlc->read_wait);
+ wake_up_interruptible (&n_hdlc->poll_wait);
if (n_hdlc->tty->fasync != NULL)
kill_fasync (n_hdlc->tty->fasync, SIGIO);
if (n_hdlc && n_hdlc->magic == HDLC_MAGIC && tty == n_hdlc->tty) {
/* queue current process into any wait queue that */
/* may awaken in the future (read and write) */
-#if LINUX_VERSION_CODE < VERSION(2,1,89)
- poll_wait(&n_hdlc->read_wait, wait);
- poll_wait(&n_hdlc->write_wait, wait);
-#else
- poll_wait(filp, &n_hdlc->read_wait, wait);
- poll_wait(filp, &n_hdlc->write_wait, wait);
-#endif
+ poll_wait(filp, &n_hdlc->poll_wait, wait);
/* set bits for operations that wont block */
if(n_hdlc->rx_buf_list.head)
mask |= POLLIN | POLLRDNORM; /* readable */
n_hdlc->flags = 0;
init_waitqueue_head(&n_hdlc->read_wait);
+ init_waitqueue_head(&n_hdlc->poll_wait);
init_waitqueue_head(&n_hdlc->write_wait);
return n_hdlc;
if (tty->link->packet) {
tty->ctrl_status |= TIOCPKT_FLUSHREAD;
wake_up_interruptible(&tty->link->read_wait);
+ wake_up_interruptible(&tty->link->poll_wait);
}
}
}
put_tty_queue('\0', tty);
wake_up_interruptible(&tty->read_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
static inline void n_tty_receive_overrun(struct tty_struct *tty)
else
put_tty_queue(c, tty);
wake_up_interruptible(&tty->read_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
tty->canon_data++;
if (tty->fasync)
kill_fasync(tty->fasync, SIGIO);
- if (tty->read_wait)
+ if (tty->read_wait || tty->poll_wait)
+ {
wake_up_interruptible(&tty->read_wait);
+ wake_up_interruptible(&tty->poll_wait);
+ }
return;
}
}
if (!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) {
if (tty->fasync)
kill_fasync(tty->fasync, SIGIO);
- if (tty->read_wait)
+ if (tty->read_wait||tty->poll_wait)
+ {
wake_up_interruptible(&tty->read_wait);
+ wake_up_interruptible(&tty->poll_wait);
+ }
}
/*
if (minimum) {
if (time)
tty->minimum_to_wake = 1;
- else if (!waitqueue_active(&tty->read_wait) ||
+ else if ((!waitqueue_active(&tty->read_wait) && !waitqueue_active(&tty->poll_wait)) ||
(tty->minimum_to_wake > minimum))
tty->minimum_to_wake = minimum;
} else {
up(&tty->atomic_read);
remove_wait_queue(&tty->read_wait, &wait);
- if (!waitqueue_active(&tty->read_wait))
+ if (!waitqueue_active(&tty->read_wait) && !waitqueue_active(&tty->poll_wait))
tty->minimum_to_wake = minimum;
current->state = TASK_RUNNING;
{
unsigned int mask = 0;
- poll_wait(file, &tty->read_wait, wait);
- poll_wait(file, &tty->write_wait, wait);
+ poll_wait(file, &tty->poll_wait, wait);
if (input_available_p(tty, TIME_CHAR(tty) ? 0 : MIN_CHAR(tty)))
mask |= POLLIN | POLLRDNORM;
if (tty->packet && tty->link->ctrl_status)
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
}
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
}
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
}
}
return;
}
wake_up_interruptible(&tty->read_wait);
+ wake_up_interruptible(&tty->poll_wait);
wake_up_interruptible(&tty->write_wait);
tty->packet = 0;
if (!tty->link)
tty->link->packet = 0;
wake_up_interruptible(&tty->link->read_wait);
wake_up_interruptible(&tty->link->write_wait);
+ wake_up_interruptible(&tty->link->poll_wait);
set_bit(TTY_OTHER_CLOSED, &tty->link->flags);
if (tty->driver.subtype == PTY_TYPE_MASTER) {
set_bit(TTY_OTHER_CLOSED, &tty->flags);
if (to->packet) {
tty->ctrl_status |= TIOCPKT_FLUSHWRITE;
wake_up_interruptible(&to->read_wait);
+ wake_up_interruptible(&to->poll_wait);
}
}
static struct timer_rand_state *irq_timer_state[NR_IRQS];
static struct timer_rand_state *blkdev_timer_state[MAX_BLKDEV];
static struct wait_queue *random_read_wait;
+static struct wait_queue *random_poll_wait;
static struct wait_queue *random_write_wait;
static ssize_t random_read(struct file * file, char * buf,
#endif
extract_timer_state.dont_count_entropy = 1;
random_read_wait = NULL;
+ random_poll_wait = NULL;
random_write_wait = NULL;
}
/* Wake up waiting processes, if we have enough entropy. */
if (r->entropy_count >= WAIT_INPUT_BITS)
+ {
wake_up_interruptible(&random_read_wait);
+ wake_up_interruptible(&random_poll_wait);
+ }
}
#ifdef RANDOM_BENCHMARK
r->entropy_count = 0;
if (r->entropy_count < WAIT_OUTPUT_BITS)
+ {
wake_up_interruptible(&random_write_wait);
+ wake_up_interruptible(&random_poll_wait);
+ }
while (nbytes) {
/* Hash the pool to get the output */
{
unsigned int mask;
- poll_wait(file, &random_read_wait, wait);
- poll_wait(file, &random_write_wait, wait);
+ poll_wait(file, &random_poll_wait, wait);
mask = 0;
if (random_state.entropy_count >= WAIT_INPUT_BITS)
mask |= POLLIN | POLLRDNORM;
* entropy.
*/
if (random_state.entropy_count >= WAIT_INPUT_BITS)
+ {
wake_up_interruptible(&random_read_wait);
+ wake_up_interruptible(&random_poll_wait);
+ }
return 0;
case RNDGETPOOL:
if (!capable(CAP_SYS_ADMIN))
* entropy.
*/
if (random_state.entropy_count >= WAIT_INPUT_BITS)
+ {
wake_up_interruptible(&random_read_wait);
+ wake_up_interruptible(&random_poll_wait);
+ }
return 0;
case RNDZAPENTCNT:
if (!capable(CAP_SYS_ADMIN))
rio_dprint (RIO_DEBUG_INTR, ("(%d/%d)\n",
PortP->gs.wakeup_chars, PortP->gs.xmit_cnt));
wake_up_interruptible(&PortP->gs.tty->write_wait);
+ wake_up_interruptible(&PortP->gs.tty->poll_wait);
}
}
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
}
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
#ifdef ROCKET_DEBUG_INTR
printk("(%d,%d,%d,%d)...", info->xmit_cnt, info->xmit_head,
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
sti();
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
return;
}
if (info->count) {
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
}
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
(tty->ldisc.write_wakeup)(tty);
}
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
} /* do_softint */
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP))
&& tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
}
stl_flush(portp);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
if (test_bit(ASYI_DCDCHANGE, &portp->istate)) {
clear_bit(ASYI_DCDCHANGE, &portp->istate);
sx_dprintk (SX_DEBUG_TRANSMIT, "Waking up.... ldisc (%d)....\n",
port->gs.wakeup_chars);
wake_up_interruptible(&port->gs.tty->write_wait);
+ wake_up_interruptible(&port->gs.tty->poll_wait);
}
clear_bit (SX_PORT_TRANSMIT_LOCK, &port->locks);
(tty->ldisc.write_wakeup)(tty);
}
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
/* if transmitter idle and loopmode_send_done_requested
spin_unlock_irqrestore(&info->irq_spinlock,flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
wake_up_interruptible(&tty->read_wait);
+ wake_up_interruptible(&tty->poll_wait);
/*
* Shutdown the current line discipline, and reset it to
tty->ctrl_status &= ~TIOCPKT_START;
tty->ctrl_status |= TIOCPKT_STOP;
wake_up_interruptible(&tty->link->read_wait);
+ wake_up_interruptible(&tty->link->poll_wait);
}
if (tty->driver.stop)
(tty->driver.stop)(tty);
tty->ctrl_status &= ~TIOCPKT_STOP;
tty->ctrl_status |= TIOCPKT_START;
wake_up_interruptible(&tty->link->read_wait);
+ wake_up_interruptible(&tty->link->poll_wait);
}
if (tty->driver.start)
(tty->driver.start)(tty);
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
static ssize_t tty_read(struct file * file, char * buf, size_t count,
wake_up(&tty->read_wait);
do_sleep++;
}
+ if (waitqueue_active(&tty->poll_wait)) {
+ wake_up(&tty->poll_wait);
+ do_sleep++;
+ }
if (waitqueue_active(&tty->write_wait)) {
wake_up(&tty->write_wait);
do_sleep++;
wake_up(&o_tty->write_wait);
do_sleep++;
}
+ if (waitqueue_active(&o_tty->poll_wait)) {
+ wake_up(&o_tty->poll_wait);
+ do_sleep++;
+ }
}
if (!do_sleep)
break;
return retval;
if (on) {
- if (!waitqueue_active(&tty->read_wait))
+ if (!waitqueue_active(&tty->read_wait) && !waitqueue_active(&tty->poll_wait))
tty->minimum_to_wake = 1;
if (filp->f_owner.pid == 0) {
filp->f_owner.pid = (-tty->pgrp) ? : current->pid;
filp->f_owner.euid = current->euid;
}
} else {
- if (!tty->fasync && !waitqueue_active(&tty->read_wait))
+ if (!tty->fasync && !waitqueue_active(&tty->read_wait) && !waitqueue_active(&tty->poll_wait))
tty->minimum_to_wake = N_TTY_BUF_SIZE;
}
return 0;
}
sti();
if (canon_change && !L_ICANON(tty) && tty->read_cnt)
+ {
/* Get characters left over from canonical mode. */
wake_up_interruptible(&tty->read_wait);
+ wake_up_interruptible(&tty->poll_wait);
+ }
/* see if packet mode change of state */
else
tty->ctrl_status |= TIOCPKT_NOSTOP;
wake_up_interruptible(&tty->link->read_wait);
+ wake_up_interruptible(&tty->link->poll_wait);
}
}
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
}
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
#ifdef AURORA_DEBUG
printk("do_softint: end\n");
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
}
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
sti();
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
}
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
restore_flags(flags);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
}
}
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
sti();
wake_up_interruptible(&tty->write_wait);
+ wake_up_interruptible(&tty->poll_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
struct semaphore open_sem;
mode_t open_mode;
struct wait_queue *open_wait;
+ struct wait_queue *poll_wait;
struct dmabuf {
void *rawbuf;
unsigned ord, owr, ocnt;
struct wait_queue *iwait;
struct wait_queue *owait;
+ struct wait_queue *pollwait;
struct timer_list timer;
unsigned char ibuf[MIDIINBUF];
unsigned char obuf[MIDIOUTBUF];
if (s->dma_dac.mapped) {
s->dma_dac.count += diff;
if (s->dma_dac.count >= (signed)s->dma_dac.fragsize)
+ {
wake_up(&s->dma_dac.wait);
+ wake_up(&s->poll_wait);
+ }
} else {
s->dma_dac.count -= diff;
if (s->dma_dac.count <= 0) {
s->dma_dac.endcleared = 1;
}
if (s->dma_dac.count + (signed)s->dma_dac.fragsize <= (signed)s->dma_dac.dmasize)
+ {
wake_up(&s->dma_dac.wait);
+ wake_up(&s->poll_wait);
+ }
}
}
}
wake = 1;
}
if (wake)
+ {
wake_up(&s->midi.iwait);
+ wake_up(&s->midi.pollwait);
+ }
wake = 0;
while (!(inb(s->iomidi+1) & 0x40) && s->midi.ocnt > 0) {
outb(s->midi.obuf[s->midi.ord], s->iomidi);
wake = 1;
}
if (wake)
+ {
wake_up(&s->midi.owait);
+ wake_up(&s->midi.pollwait);
+ }
}
static void cm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
unsigned int mask = 0;
VALIDATE_STATE(s);
- if (file->f_mode & FMODE_WRITE)
- poll_wait(file, &s->dma_dac.wait, wait);
- if (file->f_mode & FMODE_READ)
- poll_wait(file, &s->dma_adc.wait, wait);
+ if (file->f_mode & (FMODE_WRITE|FMODE_READ))
+ poll_wait(file, &s->poll_wait, wait);
spin_lock_irqsave(&s->lock, flags);
cm_update_ptr(s);
if (file->f_mode & FMODE_READ) {
unsigned int mask = 0;
VALIDATE_STATE(s);
- if (file->f_mode & FMODE_WRITE)
- poll_wait(file, &s->midi.owait, wait);
- if (file->f_mode & FMODE_READ)
- poll_wait(file, &s->midi.iwait, wait);
+ if (file->f_mode & (FMODE_WRITE|FMODE_READ))
+ poll_wait(file, &s->midi.pollwait, wait);
spin_lock_irqsave(&s->lock, flags);
if (file->f_mode & FMODE_READ) {
if (s->midi.icnt > 0)
}
memset(s, 0, sizeof(struct cm_state));
init_waitqueue(&s->dma_adc.wait);
+ init_waitqueue(&s->poll_wait);
init_waitqueue(&s->dma_dac.wait);
init_waitqueue(&s->open_wait);
init_waitqueue(&s->midi.iwait);
init_waitqueue(&s->midi.owait);
+ init_waitqueue(&s->midi.pollwait);
s->open_sem = MUTEX;
s->magic = CM_MAGIC;
s->iobase = pcidev->base_address[0] & PCI_BASE_ADDRESS_IO_MASK;
struct semaphore open_sem;
mode_t open_mode;
wait_queue_head_t open_wait;
+ wait_queue_head_t poll_wait;
struct dmabuf {
void *rawbuf;
unsigned ord, owr, ocnt;
wait_queue_head_t iwait;
wait_queue_head_t owait;
+ wait_queue_head_t pollwait;
unsigned char ibuf[MIDIINBUF];
unsigned char obuf[MIDIOUTBUF];
} midi;
s->dma_adc.total_bytes += diff;
s->dma_adc.count += diff;
if (s->dma_adc.count >= (signed)s->dma_adc.fragsize)
+ {
wake_up(&s->dma_adc.wait);
+ wake_up(&s->poll_wait);
+ }
if (!s->dma_adc.mapped) {
if (s->dma_adc.count > (signed)(s->dma_adc.dmasize - ((3 * s->dma_adc.fragsize) >> 1))) {
s->ctrl &= ~CTRL_ADC_EN;
s->dma_dac2.count += diff;
if (s->dma_dac2.count >= (signed)s->dma_dac2.fragsize)
wake_up(&s->dma_dac2.wait);
+ wake_up(&s->poll_wait);
} else {
s->dma_dac2.count -= diff;
if (s->dma_dac2.count <= 0) {
s->dma_dac2.endcleared = 1;
}
if (s->dma_dac2.count + (signed)s->dma_dac2.fragsize <= (signed)s->dma_dac2.dmasize)
+ {
wake_up(&s->dma_dac2.wait);
+ wake_up(&s->poll_wait);
+ }
}
}
}
wake = 1;
}
if (wake)
+ {
wake_up(&s->midi.iwait);
+ wake_up(&s->midi.pollwait);
+ }
wake = 0;
while ((inb(s->io+ES1370_REG_UART_STATUS) & USTAT_TXRDY) && s->midi.ocnt > 0) {
outb(s->midi.obuf[s->midi.ord], s->io+ES1370_REG_UART_DATA);
wake = 1;
}
if (wake)
+ {
wake_up(&s->midi.owait);
+ wake_up(&s->midi.pollwait);
+ }
outb((s->midi.ocnt > 0) ? UCTRL_RXINTEN | UCTRL_ENA_TXINT : UCTRL_RXINTEN, s->io+ES1370_REG_UART_CONTROL);
}
unsigned int mask = 0;
VALIDATE_STATE(s);
- if (file->f_mode & FMODE_WRITE)
- poll_wait(file, &s->dma_dac2.wait, wait);
- if (file->f_mode & FMODE_READ)
- poll_wait(file, &s->dma_adc.wait, wait);
+ if (file->f_mode & (FMODE_READ|FMODE_WRITE))
+ poll_wait(file, &s->poll_wait, wait);
spin_lock_irqsave(&s->lock, flags);
es1370_update_ptr(s);
if (file->f_mode & FMODE_READ) {
unsigned int mask = 0;
VALIDATE_STATE(s);
- if (file->f_mode & FMODE_WRITE)
- poll_wait(file, &s->midi.owait, wait);
- if (file->f_mode & FMODE_READ)
- poll_wait(file, &s->midi.iwait, wait);
+ if (file->f_mode & (FMODE_WRITE|FMODE_READ))
+ poll_wait(file, &s->midi.pollwait, wait);
spin_lock_irqsave(&s->lock, flags);
if (file->f_mode & FMODE_READ) {
if (s->midi.icnt > 0)
}
memset(s, 0, sizeof(struct es1370_state));
init_waitqueue_head(&s->dma_adc.wait);
+ init_waitqueue_head(&s->poll_wait);
init_waitqueue_head(&s->dma_dac1.wait);
init_waitqueue_head(&s->dma_dac2.wait);
init_waitqueue_head(&s->open_wait);
+ init_waitqueue_head(&s->midi.pollwait);
init_waitqueue_head(&s->midi.iwait);
init_waitqueue_head(&s->midi.owait);
init_MUTEX(&s->open_sem);
struct semaphore open_sem;
mode_t open_mode;
wait_queue_head_t open_wait;
+ wait_queue_head_t poll_wait;
struct dmabuf {
void *rawbuf;
unsigned ord, owr, ocnt;
wait_queue_head_t iwait;
wait_queue_head_t owait;
+ wait_queue_head_t pollwait;
unsigned char ibuf[MIDIINBUF];
unsigned char obuf[MIDIOUTBUF];
} midi;
s->dma_adc.total_bytes += diff;
s->dma_adc.count += diff;
if (s->dma_adc.count >= (signed)s->dma_adc.fragsize)
+ {
wake_up(&s->dma_adc.wait);
+ wake_up(&s->poll_wait);
+ }
if (!s->dma_adc.mapped) {
if (s->dma_adc.count > (signed)(s->dma_adc.dmasize - ((3 * s->dma_adc.fragsize) >> 1))) {
s->ctrl &= ~CTRL_ADC_EN;
if (s->dma_dac2.mapped) {
s->dma_dac2.count += diff;
if (s->dma_dac2.count >= (signed)s->dma_dac2.fragsize)
+ {
wake_up(&s->dma_dac2.wait);
+ wake_up(&s->poll_wait);
+ }
} else {
s->dma_dac2.count -= diff;
if (s->dma_dac2.count <= 0) {
s->dma_dac2.endcleared = 1;
}
if (s->dma_dac2.count + (signed)s->dma_dac2.fragsize <= (signed)s->dma_dac2.dmasize)
+ {
wake_up(&s->dma_dac2.wait);
+ wake_up(&s->poll_wait);
+ }
}
}
}
wake = 1;
}
if (wake)
+ {
wake_up(&s->midi.iwait);
+ wake_up(&s->midi.pollwait);
+ }
wake = 0;
while ((inb(s->io+ES1371_REG_UART_STATUS) & USTAT_TXRDY) && s->midi.ocnt > 0) {
outb(s->midi.obuf[s->midi.ord], s->io+ES1371_REG_UART_DATA);
wake = 1;
}
if (wake)
+ {
+ wake_up(&s->midi.pollwait);
wake_up(&s->midi.owait);
+ }
outb((s->midi.ocnt > 0) ? UCTRL_RXINTEN | UCTRL_ENA_TXINT : UCTRL_RXINTEN, s->io+ES1371_REG_UART_CONTROL);
}
unsigned int mask = 0;
VALIDATE_STATE(s);
- if (file->f_mode & FMODE_WRITE)
- poll_wait(file, &s->dma_dac2.wait, wait);
- if (file->f_mode & FMODE_READ)
- poll_wait(file, &s->dma_adc.wait, wait);
+ if (file->f_mode & (FMODE_WRITE|FMODE_READ))
+ poll_wait(file, &s->poll_wait, wait);
spin_lock_irqsave(&s->lock, flags);
es1371_update_ptr(s);
if (file->f_mode & FMODE_READ) {
unsigned int mask = 0;
VALIDATE_STATE(s);
- if (file->f_mode & FMODE_WRITE)
- poll_wait(file, &s->midi.owait, wait);
- if (file->f_mode & FMODE_READ)
- poll_wait(file, &s->midi.iwait, wait);
+ if (file->f_mode & (FMODE_WRITE|FMODE_READ))
+ poll_wait(file, &s->midi.pollwait, wait);
+
spin_lock_irqsave(&s->lock, flags);
if (file->f_mode & FMODE_READ) {
if (s->midi.icnt > 0)
return -1;
}
memset(s, 0, sizeof(struct es1371_state));
+ init_waitqueue_head(&s->poll_wait);
init_waitqueue_head(&s->dma_adc.wait);
init_waitqueue_head(&s->dma_dac1.wait);
init_waitqueue_head(&s->dma_dac2.wait);
init_waitqueue_head(&s->open_wait);
+ init_waitqueue_head(&s->midi.pollwait);
init_waitqueue_head(&s->midi.iwait);
init_waitqueue_head(&s->midi.owait);
init_MUTEX(&s->open_sem);
/* only let 1 be opening at a time */
struct semaphore open_sem;
wait_queue_head_t open_wait;
+ wait_queue_head_t poll_wait;
mode_t open_mode;
/* soundcore stuff */
s->dma_adc.total_bytes += diff;
s->dma_adc.count += diff;
if (s->dma_adc.count >= (signed)s->dma_adc.fragsize)
+ {
wake_up(&s->dma_adc.wait);
+ wake_up(&s->poll_wait);
+ }
if (!s->dma_adc.mapped) {
if (s->dma_adc.count > (signed)(s->dma_adc.dmasize - ((3 * s->dma_adc.fragsize) >> 1))) {
/* FILL ME
s->dma_dac.count += diff;
if (s->dma_dac.count >= (signed)s->dma_dac.fragsize) {
wake_up(&s->dma_dac.wait);
+ wake_up(&s->poll_wait);
}
} else {
s->dma_dac.count -= diff;
}
if (s->dma_dac.count + (signed)s->dma_dac.fragsize <= (signed)s->dma_dac.dmasize) {
wake_up(&s->dma_dac.wait);
+ wake_up(&s->poll_wait);
/* printk("waking up DAC count: %d sw: %d hw: %d\n",s->dma_dac.count, s->dma_dac.swptr,
hwptr);*/
}
unsigned int mask = 0;
VALIDATE_STATE(s);
- if (file->f_mode & FMODE_WRITE)
- poll_wait(file, &s->dma_dac.wait, wait);
- if (file->f_mode & FMODE_READ)
- poll_wait(file, &s->dma_adc.wait, wait);
+ if (file->f_mode & (FMODE_WRITE|FMODE_READ))
+ poll_wait(file, &s->poll_wait, wait);
spin_lock_irqsave(&s->lock, flags);
ess_update_ptr(s);
if (file->f_mode & FMODE_READ) {
init_waitqueue_head(&s->dma_adc.wait);
init_waitqueue_head(&s->dma_dac.wait);
init_waitqueue_head(&s->open_wait);
+ init_waitqueue_head(&s->poll_wait);
spin_lock_init(&s->lock);
SILLY_INIT_SEM(s->open_sem);
s->magic = ESS_STATE_MAGIC;
struct semaphore open_sem;
mode_t open_mode;
wait_queue_head_t open_wait;
+ wait_queue_head_t poll_wait;
struct dmabuf {
void *rawbuf;
s->dma_adc.total_bytes += diff;
s->dma_adc.count += diff;
if (s->dma_adc.count >= (signed)s->dma_adc.fragsize)
+ {
wake_up(&s->dma_adc.wait);
+ wake_up(&s->poll_wait);
+ }
if (!s->dma_adc.mapped) {
if (s->dma_adc.count > (signed)(s->dma_adc.dmasize - ((3 * s->dma_adc.fragsize) >> 1))) {
s->enable &= ~SV_CENABLE_RE;
if (s->dma_dac.mapped) {
s->dma_dac.count += diff;
if (s->dma_dac.count >= (signed)s->dma_dac.fragsize)
+ {
wake_up(&s->dma_dac.wait);
+ wake_up(&s->poll_wait);
+ }
} else {
s->dma_dac.count -= diff;
if (s->dma_dac.count <= 0) {
s->dma_dac.endcleared = 1;
}
if (s->dma_dac.count + (signed)s->dma_dac.fragsize <= (signed)s->dma_dac.dmasize)
+ {
wake_up(&s->dma_dac.wait);
+ wake_up(&s->poll_wait);
+ }
}
}
}
unsigned int mask = 0;
VALIDATE_STATE(s);
- if (file->f_mode & FMODE_WRITE)
- poll_wait(file, &s->dma_dac.wait, wait);
- if (file->f_mode & FMODE_READ)
- poll_wait(file, &s->dma_adc.wait, wait);
+ if (file->f_mode & (FMODE_WRITE|FMODE_READ))
+ poll_wait(file, &s->poll_wait, wait);
spin_lock_irqsave(&s->lock, flags);
sv_update_ptr(s);
if (file->f_mode & FMODE_READ) {
init_waitqueue_head(&s->dma_adc.wait);
init_waitqueue_head(&s->dma_dac.wait);
init_waitqueue_head(&s->open_wait);
+ init_waitqueue_head(&s->poll_wait);
init_waitqueue_head(&s->midi.iwait);
init_waitqueue_head(&s->midi.owait);
init_MUTEX(&s->open_sem);
int alt_speed; /* For magic substitution of 38400 bps */
struct wait_queue *write_wait;
struct wait_queue *read_wait;
+ struct wait_queue *poll_wait;
struct tq_struct tq_hangup;
void *disc_data;
void *driver_data;
+++ /dev/null
-# This is a patch for linux-2.2.15pre16 to update it to linux-2.2.15pre16.masq
-#
-# To apply this patch:
-# STEP 1: Chdir to the source directory.
-# STEP 2: Run the 'applypatch' program with this patch file as input.
-#
-# If you do not have 'applypatch', it is part of the 'makepatch' package
-# that you can fetch from the Comprehensive Perl Archive Network:
-# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
-# In the above URL, 'x' should be 2 or higher.
-#
-# To apply this patch without the use of 'applypatch':
-# STEP 1: Chdir to the source directory.
-# STEP 2: Run the 'patch' program with this file as input.
-#
-#### End of Preamble ####
-
-#### Patch data follows ####
-diff -u 'linux-2.2.15pre16/Documentation/Configure.help' 'linux-2.2.15pre16.masq/Documentation/Configure.help'
-Index: ./Documentation/Configure.help
---- ./Documentation/Configure.help Fri Mar 31 09:34:45 2000
-+++ ./Documentation/Configure.help Fri Mar 31 09:50:34 2000
-@@ -2550,6 +2550,20 @@
- kernel whenever you want; read Documentation/modules.txt for
- details.
-
-+IP: UDP masquerading loose checking
-+CONFIG_IP_MASQUERADE_UDP_LOOSE
-+ Whether UDP masquerading does address checking in a loose fashion.
-+
-+ If you say Y here, then UDP masqueraded connections will allow
-+ any external system to be connect back through the firewall to the
-+ port on the internal machine. However it will allow the more
-+ efficient use of masqueraded ports, and may be required for some
-+ gaming uses.
-+
-+ You should only say Y here if you understand the consequences since
-+ it will open your internal network to external probing and potential
-+ attacks. In all other cases choose N
-+
- IP: ICMP masquerading
- CONFIG_IP_MASQUERADE_ICMP
- The basic masquerade code described for "IP: masquerading" above
-diff -u 'linux-2.2.15pre16/net/ipv4/Config.in' 'linux-2.2.15pre16.masq/net/ipv4/Config.in'
-Index: ./net/ipv4/Config.in
---- ./net/ipv4/Config.in Fri Mar 31 09:34:03 2000
-+++ ./net/ipv4/Config.in Fri Mar 31 09:52:26 2000
-@@ -41,6 +41,7 @@
- bool 'IP: masquerading' CONFIG_IP_MASQUERADE
- if [ "$CONFIG_IP_MASQUERADE" != "n" ]; then
- comment 'Protocol-specific masquerading support will be built as modules.'
-+ bool 'IP: UDP masquerading loose checking' CONFIG_IP_MASQUERADE_UDP_LOOSE
- bool 'IP: ICMP masquerading' CONFIG_IP_MASQUERADE_ICMP
- comment 'Protocol-specific masquerading support will be built as modules.'
- if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-diff -u 'linux-2.2.15pre16/net/ipv4/ip_masq.c' 'linux-2.2.15pre16.masq/net/ipv4/ip_masq.c'
-Index: ./net/ipv4/ip_masq.c
-Prereq: 1.34.2.2
---- ./net/ipv4/ip_masq.c Fri Mar 31 09:34:19 2000
-+++ ./net/ipv4/ip_masq.c Fri Mar 31 14:38:17 2000
-@@ -412,12 +412,6 @@
- #define MASQ_DPORT_PASS (IP_MASQ_F_NO_DPORT|IP_MASQ_F_DLOOSE)
-
- /*
-- * By default enable dest loose semantics
-- */
--#define CONFIG_IP_MASQ_LOOSE_DEFAULT 1
--
--
--/*
- * Set masq expiration (deletion) and adds timer,
- * if timeout==0 cancel expiration.
- * Warning: it does not check/delete previous timer!
-@@ -937,7 +931,7 @@
- atomic_set(&ms->refcnt,0);
-
- if (proto == IPPROTO_UDP && !mport)
--#ifdef CONFIG_IP_MASQ_LOOSE_DEFAULT
-+#ifdef CONFIG_IP_MASQUERADE_UDP_LOOSE
- /*
- * Flag this tunnel as "dest loose"
- *
-#### End of Patch data ####
-
-#### ApplyPatch data follows ####
-# Data version : 1.0
-# Date generated : Fri Mar 31 14:38:26 2000
-# Generated by : makepatch 2.00
-# Recurse directories : Yes
-# p 'Documentation/Configure.help' 565235 954492634 0100644
-# p 'net/ipv4/Config.in' 3618 954492746 0100644
-# p 'net/ipv4/ip_masq.c' 65999 954509897 0100644
-#### End of ApplyPatch data ####
-
-#### End of Patch kit [created: Fri Mar 31 14:38:26 2000] ####
-#### Checksum: 95 3735 33457 ####