]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/rio/riointr.c
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6-omap-h63xx.git] / drivers / char / rio / riointr.c
index c05e84c6b0d38a2705787e56975201e6ca7bd97c..ebc76342712c1485da63b58eb01d83be38e34a4d 100644 (file)
@@ -162,13 +162,8 @@ void RIOTxEnable(char *en)
 
        rio_spin_unlock_irqrestore(&PortP->portSem, flags);
 
-       if (PortP->gs.xmit_cnt <= (PortP->gs.wakeup_chars + 2 * PKT_MAX_DATA_LEN)) {
-               rio_dprintk(RIO_DEBUG_INTR, "Waking up.... ldisc:%d (%d/%d)....", (int) (PortP->gs.tty->flags & (1 << TTY_DO_WRITE_WAKEUP)), PortP->gs.wakeup_chars, PortP->gs.xmit_cnt);
-               if ((PortP->gs.tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && PortP->gs.tty->ldisc.write_wakeup)
-                       (PortP->gs.tty->ldisc.write_wakeup) (PortP->gs.tty);
-               rio_dprintk(RIO_DEBUG_INTR, "(%d/%d)\n", PortP->gs.wakeup_chars, PortP->gs.xmit_cnt);
-               wake_up_interruptible(&PortP->gs.tty->write_wait);
-       }
+       if (PortP->gs.xmit_cnt <= (PortP->gs.wakeup_chars + 2 * PKT_MAX_DATA_LEN))
+               tty_wakeup(PortP->gs.tty);
 
 }
 
@@ -181,7 +176,7 @@ static int RupIntr;
 static int RxIntr;
 static int TxIntr;
 
-void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From)
+void RIOServiceHost(struct rio_info *p, struct Host *HostP)
 {
        rio_spin_lock(&HostP->HostLock);
        if ((HostP->Flags & RUN_STATE) != RC_RUNNING) {
@@ -546,7 +541,7 @@ static void RIOReceive(struct rio_info *p, struct Port *PortP)
         ** run out of space it will be set to the offset of the
         ** next byte to copy from the packet data area. The packet
         ** length field is decremented by the number of bytes that
-        ** we succesfully removed from the packet. When this reaches
+        ** we successfully removed from the packet. When this reaches
         ** zero, we reset the offset pointer to be zero, and free
         ** the packet from the front of the queue.
         */
@@ -585,19 +580,19 @@ static void RIOReceive(struct rio_info *p, struct Port *PortP)
                        /*
                         ** check that it is not a command!
                         */
-                       if (PacketP->len & PKT_CMD_BIT) {
+                       if (readb(&PacketP->len) & PKT_CMD_BIT) {
                                rio_dprintk(RIO_DEBUG_INTR, "RIO: unexpected command packet received on PHB\n");
                                /*      rio_dprint(RIO_DEBUG_INTR, (" sysport   = %d\n", p->RIOPortp->PortNum)); */
-                               rio_dprintk(RIO_DEBUG_INTR, " dest_unit = %d\n", PacketP->dest_unit);
-                               rio_dprintk(RIO_DEBUG_INTR, " dest_port = %d\n", PacketP->dest_port);
-                               rio_dprintk(RIO_DEBUG_INTR, " src_unit  = %d\n", PacketP->src_unit);
-                               rio_dprintk(RIO_DEBUG_INTR, " src_port  = %d\n", PacketP->src_port);
-                               rio_dprintk(RIO_DEBUG_INTR, " len          = %d\n", PacketP->len);
-                               rio_dprintk(RIO_DEBUG_INTR, " control   = %d\n", PacketP->control);
-                               rio_dprintk(RIO_DEBUG_INTR, " csum         = %d\n", PacketP->csum);
+                               rio_dprintk(RIO_DEBUG_INTR, " dest_unit = %d\n", readb(&PacketP->dest_unit));
+                               rio_dprintk(RIO_DEBUG_INTR, " dest_port = %d\n", readb(&PacketP->dest_port));
+                               rio_dprintk(RIO_DEBUG_INTR, " src_unit  = %d\n", readb(&PacketP->src_unit));
+                               rio_dprintk(RIO_DEBUG_INTR, " src_port  = %d\n", readb(&PacketP->src_port));
+                               rio_dprintk(RIO_DEBUG_INTR, " len          = %d\n", readb(&PacketP->len));
+                               rio_dprintk(RIO_DEBUG_INTR, " control   = %d\n", readb(&PacketP->control));
+                               rio_dprintk(RIO_DEBUG_INTR, " csum         = %d\n", readw(&PacketP->csum));
                                rio_dprintk(RIO_DEBUG_INTR, "    data bytes: ");
                                for (DataCnt = 0; DataCnt < PKT_MAX_DATA_LEN; DataCnt++)
-                                       rio_dprintk(RIO_DEBUG_INTR, "%d\n", PacketP->data[DataCnt]);
+                                       rio_dprintk(RIO_DEBUG_INTR, "%d\n", readb(&PacketP->data[DataCnt]));
                                remove_receive(PortP);
                                put_free_end(PortP->HostP, PacketP);
                                continue;       /* with next packet */
@@ -618,7 +613,7 @@ static void RIOReceive(struct rio_info *p, struct Port *PortP)
                         ** and available space.
                         */
 
-                       transCount = tty_buffer_request_room(TtyP, PacketP->len & PKT_LEN_MASK);
+                       transCount = tty_buffer_request_room(TtyP, readb(&PacketP->len) & PKT_LEN_MASK);
                        rio_dprintk(RIO_DEBUG_REC, "port %d: Copy %d bytes\n", PortP->PortNum, transCount);
                        /*
                         ** To use the following 'kkprintfs' for debugging - change the '#undef'
@@ -630,12 +625,12 @@ static void RIOReceive(struct rio_info *p, struct Port *PortP)
                        tty_prepare_flip_string(TtyP, &buf, transCount);
                        rio_memcpy_fromio(buf, ptr, transCount);
                        PortP->RxDataStart += transCount;
-                       PacketP->len -= transCount;
+                       writeb(readb(&PacketP->len)-transCount, &PacketP->len);
                        copied += transCount;
 
 
 
-                       if (PacketP->len == 0) {
+                       if (readb(&PacketP->len) == 0) {
                                /*
                                 ** If we have emptied the packet, then we can
                                 ** free it, and reset the start pointer for