]> git.neil.brown.name Git - history.git/commitdiff
Import 2.2.15pre19 2.2.15pre19
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:21:10 +0000 (15:21 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:21:10 +0000 (15:21 -0500)
40 files changed:
Makefile
drivers/char/cyclades.c
drivers/char/dz.c
drivers/char/epca.c
drivers/char/esp.c
drivers/char/generic_serial.c
drivers/char/ip2/i2lib.c
drivers/char/ip2main.c
drivers/char/isicom.c
drivers/char/istallion.c
drivers/char/moxa.c
drivers/char/mxser.c
drivers/char/n_hdlc.c
drivers/char/n_tty.c
drivers/char/pcxx.c
drivers/char/pty.c
drivers/char/random.c
drivers/char/rio/riointr.c
drivers/char/riscom8.c
drivers/char/rocket.c
drivers/char/serial.c
drivers/char/serial167.c
drivers/char/specialix.c
drivers/char/stallion.c
drivers/char/sx.c
drivers/char/synclink.c
drivers/char/tty_io.c
drivers/char/tty_ioctl.c
drivers/macintosh/macserial.c
drivers/sbus/char/aurora.c
drivers/sbus/char/sab82532.c
drivers/sbus/char/su.c
drivers/sbus/char/zs.c
drivers/sound/cmpci.c
drivers/sound/es1370.c
drivers/sound/es1371.c
drivers/sound/maestro.c
drivers/sound/sonicvibes.c
include/linux/tty.h
masq.patch [deleted file]

index d9a9a9c635f6d75b542076f18539455549fd1e98..8e63a7c2d0c88ea20faca64b59e4454e8e8ea020 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 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/)
 
index eba36b4c4fabdcb628a83a9f037c683ea87346ce..3d4cec56ca808f6f63f12f382a667fff5bfe8b1c 100644 (file)
@@ -1011,6 +1011,7 @@ do_softint(void *private_)
             (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)) {
@@ -4591,6 +4592,7 @@ cy_flush_buffer(struct tty_struct *tty)
        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);
index 30f28280b7ada0bb2665c4e525d42676c1528615..fecae4d9f3ee603b280c22d607e04c470b89061e 100644 (file)
@@ -407,6 +407,7 @@ static void do_softint (void *private_data)
     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);
   }
 }
 
@@ -763,6 +764,7 @@ static void dz_flush_buffer (struct tty_struct *tty)
   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);
index e1d2cd2f700f5f884d28403bd80ce501b44f93d8..a5f458e30c45610dbd288928bcb4eafe650b94e3 100644 (file)
@@ -1225,6 +1225,7 @@ static void pc_flush_buffer(struct tty_struct *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);
 
@@ -2445,7 +2446,7 @@ static void doevent(int crd)
                                                  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 */
@@ -2465,6 +2466,7 @@ static void doevent(int crd)
                                                (tty->ldisc.write_wakeup)(tty);
 
                                        wake_up_interruptible(&tty->write_wait);
+                                       wake_up_interruptible(&tty->poll_wait);
 
                                } /* End if EMPTYWAIT */
 
index bf852fb20308361d7a86c3491fb229add56aaeff..3c7460cdd7990f90cbdc68cccc0fddd7e179b6e3 100644 (file)
@@ -799,6 +799,7 @@ static void do_softint(void *private_)
                    tty->ldisc.write_wakeup)
                        (tty->ldisc.write_wakeup)(tty);
                wake_up_interruptible(&tty->write_wait);
+               wake_up_interruptible(&tty->poll_wait);
        }
 }
 
@@ -1410,6 +1411,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
        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);
index a4c3251aaed886a94d7e591290726a0cca3635e8..a10a0fce5e8be8e4d3f2efefb79d0aaee98568a0 100644 (file)
@@ -434,6 +434,7 @@ void gs_flush_buffer(struct tty_struct *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);
@@ -548,6 +549,7 @@ void gs_do_softint(void *private_)
                    tty->ldisc.write_wakeup)
                        (tty->ldisc.write_wakeup)(tty);
                wake_up_interruptible(&tty->write_wait);
+               wake_up_interruptible(&tty->poll_wait);
        }
        func_exit ();
 }
index f8d6f3b169b20e2b4404304bad8e7028beb9345d..efe152484b05ff09bb7fd9749f27ef3c51294d21 100644 (file)
@@ -1390,6 +1390,7 @@ ip2_owake( PTTY tp)
        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 )
        {
index 77e0f95af8027557595aa8aaee04c1973ebb88b8..e6574597be7d8f66e5bbcaba462b773f871d9ba5 100644 (file)
@@ -1204,6 +1204,7 @@ do_status( i2ChanStrPtr pCh )
                                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
index d31b73606518a14d0a9aa8597e4a681a616fa575..3d65abe8e936127f6cba3911c0af98d13e257ac4 100644 (file)
@@ -532,6 +532,7 @@ static void isicom_bottomhalf(void * data)
            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 */           
@@ -1696,6 +1697,7 @@ static void isicom_flush_buffer(struct tty_struct * 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);
index afeb8e09e5d98c37c3ebbd7a754e0035409b0c7c..ae2d2c9cc34694a02490a9413e11fb63e38d1a36 100644 (file)
@@ -2498,6 +2498,7 @@ static void stli_flushbuffer(struct tty_struct *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);
@@ -3034,6 +3035,7 @@ static inline int stli_hostcmd(stlibrd_t *brdp, stliport_t *portp)
                                        EBRDENABLE(brdp);
                                }
                                wake_up_interruptible(&tty->write_wait);
+                               wake_up_interruptible(&tty->poll_wait);
                        }
                }
 
index b99e2b0cec84334865fa76a1101403fe98b19abb..0e7376ee7aea6d75aade1cf01462e70fc93be377 100644 (file)
@@ -743,6 +743,7 @@ static void moxa_flush_buffer(struct tty_struct *tty)
            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)
@@ -1000,6 +1001,7 @@ static void moxa_poll(unsigned long ignored)
                                                  tp->ldisc.write_wakeup)
                                                        (tp->ldisc.write_wakeup) (tp);
                                                wake_up_interruptible(&tp->write_wait);
+                                               wake_up_interruptible(&tp->poll_wait);
                                        }
                                }
                        }
@@ -1190,6 +1192,7 @@ static void check_xmit_empty(unsigned long data)
                            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;
index 74a3da523c5e1c2e671d94e740f1a9ed480414d3..322e7036889c9caf1e97fccfb546dbcc21220079 100644 (file)
@@ -716,6 +716,7 @@ static void mxser_do_softint(void *private_)
                    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);
@@ -1011,6 +1012,7 @@ static void mxser_flush_buffer(struct tty_struct *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);
index 0c5d2bcdc2e81620fd31bdefd9d198cfb3fa95aa..361a4b60ba7c9440202c6bb2a93a314174f8738b 100644 (file)
@@ -239,6 +239,7 @@ struct n_hdlc {
        /* 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;
@@ -317,6 +318,7 @@ static void n_hdlc_release (struct n_hdlc *n_hdlc)
                
        /* 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)
@@ -659,6 +661,7 @@ static void n_hdlc_tty_receive(struct tty_struct *tty,
        
        /* 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);
 
@@ -988,13 +991,7 @@ static unsigned int n_hdlc_tty_poll (struct tty_struct *tty,
        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 */
@@ -1057,6 +1054,7 @@ static struct n_hdlc *n_hdlc_alloc (void)
 
        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;
index 9d60a762464f41f0c98e5f53854c34a59fe7d781..80763b17f7e068dc9d7a22dc2d7e72c8d7158cb9 100644 (file)
@@ -122,6 +122,7 @@ void n_tty_flush_buffer(struct tty_struct * tty)
        if (tty->link->packet) {
                tty->ctrl_status |= TIOCPKT_FLUSHREAD;
                wake_up_interruptible(&tty->link->read_wait);
+               wake_up_interruptible(&tty->link->poll_wait);
        }
 }
 
@@ -441,6 +442,7 @@ static inline void n_tty_receive_break(struct tty_struct *tty)
        }
        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)
@@ -471,6 +473,7 @@ static inline void n_tty_receive_parity_error(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)
@@ -633,8 +636,11 @@ send_signal:
                        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;
                }
        }
@@ -738,8 +744,11 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
        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);
+               }
        }
 
        /*
@@ -947,7 +956,7 @@ do_it_again:
                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 {
@@ -1079,7 +1088,7 @@ do_it_again:
        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;
@@ -1171,8 +1180,7 @@ static unsigned int normal_poll(struct tty_struct * tty, struct file * file, pol
 {
        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)
index 9b0418faf00f2a00cd1f099dc3cca7e050e8844a..27e1b0eff49b5a474f321d43b7054d292074874e 100644 (file)
@@ -869,6 +869,7 @@ static void pcxe_flush_buffer(struct tty_struct *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);
 }
@@ -1748,6 +1749,7 @@ static void doevent(int crd)
                                                tty->ldisc.write_wakeup)
                                                (tty->ldisc.write_wakeup)(tty);
                                        wake_up_interruptible(&tty->write_wait);
+                                       wake_up_interruptible(&tty->poll_wait);
                                }
                        }
 
@@ -1759,6 +1761,7 @@ static void doevent(int crd)
                                                tty->ldisc.write_wakeup)
                                                (tty->ldisc.write_wakeup)(tty);
                                        wake_up_interruptible(&tty->write_wait);
+                                       wake_up_interruptible(&tty->poll_wait);
                                }
                        }
                }
index 5ee1ee5b1e8f03ca860d2e54db91e1de6d821619..80b073986e95874d4c8ce52bd4b854f5d9c99190 100644 (file)
@@ -75,6 +75,7 @@ static void pty_close(struct tty_struct * tty, struct file * filp)
                        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)
@@ -82,6 +83,7 @@ static void pty_close(struct tty_struct * tty, struct file * filp)
        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);
@@ -296,6 +298,7 @@ static void pty_flush_buffer(struct tty_struct *tty)
        if (to->packet) {
                tty->ctrl_status |= TIOCPKT_FLUSHWRITE;
                wake_up_interruptible(&to->read_wait);
+               wake_up_interruptible(&to->poll_wait);
        }
 }
 
index 944a690aaa3207122571190bceaaeaa813753a2a..0a8922720862642f87649195dd60cca4088cda5e 100644 (file)
@@ -425,6 +425,7 @@ static struct timer_rand_state extract_timer_state;
 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,
@@ -556,6 +557,7 @@ __initfunc(void rand_initialize(void))
 #endif
        extract_timer_state.dont_count_entropy = 1;
        random_read_wait = NULL;
+       random_poll_wait = NULL;
        random_write_wait = NULL;
 }
 
@@ -763,7 +765,10 @@ static void add_timer_randomness(struct random_bucket *r,
 
                /* 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
@@ -1219,7 +1224,10 @@ static ssize_t extract_entropy(struct random_bucket *r, char * buf,
                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 */
@@ -1365,8 +1373,7 @@ random_poll(struct file *file, poll_table * wait)
 {
        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;
@@ -1449,7 +1456,10 @@ random_ioctl(struct inode * inode, struct file * file,
                 * 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))
@@ -1502,7 +1512,10 @@ random_ioctl(struct inode * inode, struct file * file,
                 * 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))
index 427bbf7233e9ef76467c5bbbf1f56a57e63868b0..c389c4fb7563d1729838a037ee5bd5e8ae43cded 100644 (file)
@@ -254,6 +254,7 @@ char *              en;
     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);
   }
 
 }
index 7764997b580fecfc30642f35fae1e1a635948453..a5a9ae67139312bb5c2e6473be98794d5de13a5b 100644 (file)
@@ -1331,6 +1331,7 @@ static void rc_flush_buffer(struct tty_struct *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);
@@ -1713,6 +1714,7 @@ static void do_softint(void *private_)
                    tty->ldisc.write_wakeup)
                        (tty->ldisc.write_wakeup)(tty);
                wake_up_interruptible(&tty->write_wait);
+               wake_up_interruptible(&tty->poll_wait);
        }
 }
 
index 13aa8edec27a267d101f156f4ed43cf80f732ba9..a53a56c139f03300540a6e730281463773c10027 100644 (file)
@@ -443,6 +443,7 @@ static _INLINE_ void rp_do_transmit(struct r_port *info)
                    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,
@@ -1697,6 +1698,7 @@ static void rp_hangup(struct tty_struct *tty)
                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) {
index 0b03cb87c2f73773981176da7f1810dc9c9669ea..cc18c7070d7c9ae12eb9d0d7648302d3ce3df213 100644 (file)
@@ -816,6 +816,7 @@ static void do_softint(void *private_)
                    tty->ldisc.write_wakeup)
                        (tty->ldisc.write_wakeup)(tty);
                wake_up_interruptible(&tty->write_wait);
+               wake_up_interruptible(&tty->poll_wait);
        }
 }
 
@@ -1537,6 +1538,7 @@ static void rs_flush_buffer(struct tty_struct *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);
index b3ff152579f69713213141a9f15b65b1a9582a8c..a719786fcd91cad1324c8af0ecf23f322565e35f 100644 (file)
@@ -775,6 +775,7 @@ do_softint(void *private_)
            (tty->ldisc.write_wakeup)(tty);
        }
        wake_up_interruptible(&tty->write_wait);
+       wake_up_interruptible(&tty->poll_wait);
     }
 } /* do_softint */
 
@@ -1332,6 +1333,7 @@ cy_flush_buffer(struct tty_struct *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);
index 5aaa0cbc0ae3c970f88991306c47de79256e64e8..8820b8f237996c9d152d1ec778514a8214c8cb46 100644 (file)
@@ -1733,6 +1733,7 @@ static void sx_flush_buffer(struct tty_struct *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);
@@ -2191,6 +2192,7 @@ static void do_softint(void *private_)
                    tty->ldisc.write_wakeup)
                        (tty->ldisc.write_wakeup)(tty);
                wake_up_interruptible(&tty->write_wait);
+               wake_up_interruptible(&tty->poll_wait);
        }
 }
 
index a98afcdd11ac68742ae4d9c0c772970e8d70049a..0f2f1cbe0ba0a9db2853a2da541c4b4b78c24de2 100644 (file)
@@ -1883,6 +1883,7 @@ static void stl_flushbuffer(struct tty_struct *tty)
 
        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);
@@ -2267,6 +2268,7 @@ static void stl_offintr(void *private)
                    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);
index 515bf0a41c66f5a344bae3364b5ea64a53c5a428..0770913106788b4b729e12517ffde250c9812b35 100644 (file)
@@ -1064,6 +1064,7 @@ void sx_transmit_chars (struct sx_port *port)
                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);
index 5feeeef8028db5e7ed930c3dbeee48c07f7043ef..524794f98958fa9c49cb4511b5e84056acd4de99 100644 (file)
@@ -1280,6 +1280,7 @@ void mgsl_bh_transmit_data( struct mgsl_struct *info, unsigned short Datacount )
                        (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
@@ -2478,6 +2479,7 @@ static void mgsl_flush_buffer(struct tty_struct *tty)
        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);
index 08a482bac4fa0b9b3252cd07a3b1541a6e105a2f..0b415b366bf079f71cd9d34f7c2376be1b88aa00 100644 (file)
@@ -434,6 +434,7 @@ void do_tty_hangup(void *data)
 
        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
@@ -574,6 +575,7 @@ void stop_tty(struct tty_struct *tty)
                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);
@@ -588,6 +590,7 @@ void start_tty(struct tty_struct *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);
@@ -595,6 +598,7 @@ void start_tty(struct tty_struct *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, 
@@ -1106,6 +1110,10 @@ static void release_dev(struct file * filp)
                                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++;
@@ -1120,6 +1128,10 @@ static void release_dev(struct file * filp)
                                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;
@@ -1448,7 +1460,7 @@ static int tty_fasync(int fd, struct file * filp, int on)
                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;
@@ -1456,7 +1468,7 @@ static int tty_fasync(int fd, struct file * filp, int on)
                        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;
index 2cad9dba6e2506a8511a9fd481cb0f2a31abc440..8ea08fb13ab8c142588e70bddcaa05be2894630a 100644 (file)
@@ -113,8 +113,11 @@ static void change_termios(struct tty_struct * tty, struct termios * new_termios
        }
        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 */
 
@@ -132,6 +135,7 @@ static void change_termios(struct tty_struct * tty, struct termios * new_termios
                        else
                                tty->ctrl_status |= TIOCPKT_NOSTOP;
                        wake_up_interruptible(&tty->link->read_wait);
+                       wake_up_interruptible(&tty->link->poll_wait);
                }
        }
 
index 4553616d2520269da7f0b082371f253af438e00d..ea8a6f74df0a9a8759e8a38113bc4ea744d922c8 100644 (file)
@@ -711,6 +711,7 @@ static void do_softint(void *private_)
                    tty->ldisc.write_wakeup)
                        (tty->ldisc.write_wakeup)(tty);
                wake_up_interruptible(&tty->write_wait);
+               wake_up_interruptible(&tty->poll_wait);
        }
 }
 
@@ -1487,6 +1488,7 @@ static void rs_flush_buffer(struct tty_struct *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);
index fe064c0348623f75dc032d5f8905b8ed7a3ff647..1998d43badeb154ead20796c1226f64ca5b3f144 100644 (file)
@@ -1702,6 +1702,7 @@ printk("aurora_flush_buffer: start\n");
        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);
@@ -2197,6 +2198,7 @@ printk("do_softint: start\n");
                    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");
index 08c81583b76e9b23670cf16c48f9f38a1020605a..606f7560d82bfb5e7f615ee350347f2d4cb77919 100644 (file)
@@ -671,6 +671,7 @@ static void do_softint(void *private_)
                    tty->ldisc.write_wakeup)
                        (tty->ldisc.write_wakeup)(tty);
                wake_up_interruptible(&tty->write_wait);
+               wake_up_interruptible(&tty->poll_wait);
        }
 }
 
@@ -1156,6 +1157,7 @@ static void sab82532_flush_buffer(struct tty_struct *tty)
        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);
index 02859bc0f35a1efe2f5f96b97f09cbc8cf94cef8..7d8b066960bfb99e9b0a673ed9769ed7b13a77ee 100644 (file)
@@ -694,6 +694,7 @@ static void do_softint(void *private_)
                    tty->ldisc.write_wakeup)
                        (tty->ldisc.write_wakeup)(tty);
                wake_up_interruptible(&tty->write_wait);
+               wake_up_interruptible(&tty->poll_wait);
        }
 }
 
@@ -1312,6 +1313,7 @@ su_flush_buffer(struct tty_struct *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);
index fa6cbbf5c47c051caf021c3448e69c4b4b963038..0e76085debddf5058fac0febba633e9b3401060a 100644 (file)
@@ -737,6 +737,7 @@ static void do_softint(void *private_)
                    tty->ldisc.write_wakeup)
                        (tty->ldisc.write_wakeup)(tty);
                wake_up_interruptible(&tty->write_wait);
+               wake_up_interruptible(&tty->poll_wait);
        }
 }
 
@@ -1184,6 +1185,7 @@ static void zs_flush_buffer(struct tty_struct *tty)
        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);
index 00ba679578ba5692777c94b4d97e8ea86dd07c2e..4462b74e89e806c8ab230326ad7fdb008b8841fa 100644 (file)
@@ -272,6 +272,7 @@ struct cm_state {
        struct semaphore open_sem;
        mode_t open_mode;
        struct wait_queue *open_wait;
+       struct wait_queue *poll_wait;
 
        struct dmabuf {
                void *rawbuf;
@@ -303,6 +304,7 @@ struct cm_state {
                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];
@@ -751,7 +753,10 @@ static void cm_update_ptr(struct cm_state *s)
                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) {
@@ -763,7 +768,10 @@ static void cm_update_ptr(struct cm_state *s)
                                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);
+                       }
                }
        }
 }
@@ -785,7 +793,10 @@ static void cm_handle_midi(struct cm_state *s)
                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);
@@ -795,7 +806,10 @@ static void cm_handle_midi(struct cm_state *s)
                        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)
@@ -1380,10 +1394,8 @@ static unsigned int cm_poll(struct file *file, struct poll_table_struct *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);
        cm_update_ptr(s);
        if (file->f_mode & FMODE_READ) {
@@ -1955,10 +1967,8 @@ static unsigned int cm_midi_poll(struct file *file, struct poll_table_struct *wa
        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)
@@ -2368,10 +2378,12 @@ int __init init_cmpci(void)
                }
                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;
index ed9d9efd766f0b33f74649f62e943baa562d3af0..6362876717c4af90ab0baa8d89520d234157a8bf 100644 (file)
@@ -355,6 +355,7 @@ struct es1370_state {
        struct semaphore open_sem;
        mode_t open_mode;
        wait_queue_head_t open_wait;
+       wait_queue_head_t poll_wait;
 
        struct dmabuf {
                void *rawbuf;
@@ -385,6 +386,7 @@ struct es1370_state {
                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;
@@ -671,7 +673,10 @@ static void es1370_update_ptr(struct es1370_state *s)
                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;
@@ -711,6 +716,7 @@ static void es1370_update_ptr(struct es1370_state *s)
                        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) {
@@ -723,7 +729,10 @@ static void es1370_update_ptr(struct es1370_state *s)
                                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);
+                       }
                }
        }
 }
@@ -747,7 +756,10 @@ static void es1370_handle_midi(struct es1370_state *s)
                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);
@@ -757,7 +769,10 @@ static void es1370_handle_midi(struct es1370_state *s)
                        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);
 }
 
@@ -1295,10 +1310,8 @@ static unsigned int es1370_poll(struct file *file, struct poll_table_struct *wai
        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) {
@@ -2286,10 +2299,8 @@ static unsigned int es1370_midi_poll(struct file *file, struct poll_table_struct
        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)
@@ -2478,9 +2489,11 @@ __initfunc(int init_es1370(void))
                }
                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);
index e98751bbe7d34b19bc49eb0fdcaea49852f51964..1676b41294e18c03171b24751fe3941605301184 100644 (file)
@@ -471,6 +471,7 @@ struct es1371_state {
        struct semaphore open_sem;
        mode_t open_mode;
        wait_queue_head_t open_wait;
+       wait_queue_head_t poll_wait;
 
        struct dmabuf {
                void *rawbuf;
@@ -501,6 +502,7 @@ struct es1371_state {
                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;
@@ -1046,7 +1048,10 @@ static void es1371_update_ptr(struct es1371_state *s)
                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;
@@ -1085,7 +1090,10 @@ static void es1371_update_ptr(struct es1371_state *s)
                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) {
@@ -1098,7 +1106,10 @@ static void es1371_update_ptr(struct es1371_state *s)
                                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);
+                       }
                }
        }
 }
@@ -1122,7 +1133,10 @@ static void es1371_handle_midi(struct es1371_state *s)
                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);
@@ -1132,7 +1146,10 @@ static void es1371_handle_midi(struct es1371_state *s)
                        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);
 }
 
@@ -1875,10 +1892,8 @@ static unsigned int es1371_poll(struct file *file, struct poll_table_struct *wai
        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) {
@@ -2853,10 +2868,9 @@ static unsigned int es1371_midi_poll(struct file *file, struct poll_table_struct
        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)
@@ -3080,10 +3094,12 @@ __initfunc(static int probe_chip(struct pci_dev *pcidev, int index))
                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);
index cf0246ebc9d621893bfec998ef89528cde9e5e26..48360865fd8664f2173894e009f00da3ae9e26c1 100644 (file)
@@ -396,6 +396,7 @@ struct ess_state {
        /* 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 */
@@ -1815,7 +1816,10 @@ ess_update_ptr(struct ess_state *s)
                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 
@@ -1846,6 +1850,7 @@ ess_update_ptr(struct ess_state *s)
                        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;
@@ -1867,6 +1872,7 @@ ess_update_ptr(struct ess_state *s)
                        }
                        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);*/
                        }
@@ -2403,10 +2409,8 @@ static unsigned int ess_poll(struct file *file, struct poll_table_struct *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);
        ess_update_ptr(s);
        if (file->f_mode & FMODE_READ) {
@@ -3359,6 +3363,7 @@ maestro_install(struct pci_dev *pcidev, int card_type)
                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;
index 011c622c37b376239d2e34133ffeebafbf3be365..926f3c6af992912f07c583a496b4e3df052be5bc 100644 (file)
@@ -321,6 +321,7 @@ struct sv_state {
        struct semaphore open_sem;
        mode_t open_mode;
        wait_queue_head_t open_wait;
+       wait_queue_head_t poll_wait;
 
        struct dmabuf {
                void *rawbuf;
@@ -821,7 +822,10 @@ static void sv_update_ptr(struct sv_state *s)
                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;
@@ -839,7 +843,10 @@ static void sv_update_ptr(struct sv_state *s)
                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) {
@@ -851,7 +858,10 @@ static void sv_update_ptr(struct sv_state *s)
                                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);
+                       }
                }
        }
 }
@@ -1489,10 +1499,8 @@ static unsigned int sv_poll(struct file *file, struct poll_table_struct *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) {
@@ -2462,6 +2470,7 @@ __initfunc(int init_sonicvibes(void))
                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);
index e5abf885f1aaa78596fa0276ae670cd2c38c840c..161bac4c2682251850254b7b692d29bdd021d362 100644 (file)
@@ -277,6 +277,7 @@ struct tty_struct {
        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;
diff --git a/masq.patch b/masq.patch
deleted file mode 100644 (file)
index 7881f1e..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-# 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 ####