vserver 1.9.5.x5
[linux-2.6.git] / drivers / serial / sunsab.c
index 4c38513..8caaf2e 100644 (file)
@@ -51,7 +51,7 @@
 
 struct uart_sunsab_port {
        struct uart_port                port;           /* Generic UART port    */
-       union sab82532_async_regs       *regs;          /* Chip registers       */
+       union sab82532_async_regs       __iomem *regs;  /* Chip registers       */
        unsigned long                   irqflags;       /* IRQ state flags      */
        int                             dsr;            /* Current DSR state    */
        unsigned int                    cec_timeout;    /* Chip poll timeout... */
@@ -143,6 +143,11 @@ receive_chars(struct uart_sunsab_port *up,
                writeb(SAB82532_CMDR_RMC, &up->regs->w.cmdr);
        }
 
+       /* Count may be zero for BRK, so we check for it here */
+       if ((stat->sreg.isr1 & SAB82532_ISR1_BRK) &&
+           (up->port.line == up->port.cons->index))
+               saw_console_brk = 1;
+
        for (i = 0; i < count; i++) {
                unsigned char ch = buf[i];
 
@@ -172,8 +177,6 @@ receive_chars(struct uart_sunsab_port *up,
                                stat->sreg.isr0 &= ~(SAB82532_ISR0_PERR |
                                                     SAB82532_ISR0_FERR);
                                up->port.icount.brk++;
-                               if (up->port.line == up->port.cons->index)
-                                       saw_console_brk = 1;
                                /*
                                 * We do the SysRQ and SAK checking
                                 * here because otherwise the break
@@ -325,8 +328,9 @@ static irqreturn_t sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
        tty = NULL;
        if (status.stat) {
-               if (status.sreg.isr0 & (SAB82532_ISR0_TCD | SAB82532_ISR0_TIME |
-                                       SAB82532_ISR0_RFO | SAB82532_ISR0_RPF))
+               if ((status.sreg.isr0 & (SAB82532_ISR0_TCD | SAB82532_ISR0_TIME |
+                                        SAB82532_ISR0_RFO | SAB82532_ISR0_RPF)) ||
+                   (status.sreg.isr1 & SAB82532_ISR1_BRK))
                        tty = receive_chars(up, &status, regs);
                if ((status.sreg.isr0 & SAB82532_ISR0_CDSC) ||
                    (status.sreg.isr1 & SAB82532_ISR1_CSC))
@@ -352,8 +356,10 @@ static irqreturn_t sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
        tty = NULL;
        if (status.stat) {
-               if (status.sreg.isr0 & (SAB82532_ISR0_TCD | SAB82532_ISR0_TIME |
-                                       SAB82532_ISR0_RFO | SAB82532_ISR0_RPF))
+               if ((status.sreg.isr0 & (SAB82532_ISR0_TCD | SAB82532_ISR0_TIME |
+                                        SAB82532_ISR0_RFO | SAB82532_ISR0_RPF)) ||
+                   (status.sreg.isr1 & SAB82532_ISR1_BRK))
+
                        tty = receive_chars(up, &status, regs);
                if ((status.sreg.isr0 & SAB82532_ISR0_CDSC) ||
                    (status.sreg.isr1 & (SAB82532_ISR1_BRK | SAB82532_ISR1_CSC)))
@@ -1125,14 +1131,14 @@ static int __init sunsab_init(void)
 
        sunserial_current_minor += num_channels;
        
+       sunsab_console_init();
+
        for (i = 0; i < num_channels; i++) {
                struct uart_sunsab_port *up = &sunsab_ports[i];
 
                uart_add_one_port(&sunsab_reg, &up->port);
        }
 
-       sunsab_console_init();
-
        return 0;
 }