Re: 2.6.13-mm1

serue
2005-09-12T17:04:29Z

Hmm, this patch itself seems to have a few typos, but so does
the 2.6.13-mm{1,2,3}.

Quoting Alan Cox (alan@redhat.com):
> --- drivers/serial/icom.c~ 2005-09-01 22:37:16.986829264 +0100
> +++ drivers/serial/icom.c 2005-09-01 22:37:16.986829264 +0100
> @@ -737,6 +737,7 @@
>
> status = cpu_to_le16(icom_port->statStg->rcv[rcv_buff].flags);
> while (status & SA_FL_RCV_DONE) {
> + int first = -1;
>
> trace(icom_port, "FID_STATUS", status);
> count = cpu_to_le16(icom_port->statStg->rcv[rcv_buff].leLength);
> @@ -751,15 +752,17 @@
> icom_port->recv_buf_pci;
>
> /* Block copy all but the last byte as this may have status */
> - if(count > 0)
> + if(count > 0) {
> + first = icon->recv_buf[offset];
s/icon/icom_port/ ?

> tty_insert_flip_string(tty, icon_port->recv_buf + offset, count - 1);

s/icon_port/icom_port/ ?

> + }
>
> icount = &icom_port->uart_port.icount;
> icount->rx += count;
>
> /* Break detect logic */
> if ((status & SA_FLAGS_FRAME_ERROR)
> - && (tty->flip.char_buf_ptr[0] == 0x00)) {
> + && first == 0) {
> status &= ~SA_FLAGS_FRAME_ERROR;
> status |= SA_FLAGS_BREAK_DET;
> trace(icom_port, "BREAK_DET", 0);

And in 2.6.13-mm3, we have:

@@ -798,33 +792,26 @@ static void recv_interrupt(u16 port_int_
status &= icom_port->read_status_mask;

if (status & SA_FLAGS_BREAK_DET) {
- *tty->flip.flag_buf_ptr = TTY_BREAK;
+ flag = TTY_BREAK;
} else if (status & SA_FLAGS_PARITY_ERROR) {
trace(icom_port, "PARITY_ERROR", 0);
- *tty->flip.flag_buf_ptr = TTY_PARITY;
+ flag = TTY_PARITY;
} else if (status & SA_FLAGS_FRAME_ERROR)
- *tty->flip.flag_buf_ptr = TTY_FRAME;
+ flag = TTY_FRAME;

- if (status & SA_FLAGS_OVERRUN) {
- /*
- * Overrun is special, since it's
- * reported immediately, and doesn't
- * affect the current character
- */
- if (tty->flip.count < TTY_FLIPBUF_SIZE) {
- tty->flip.count++;
- tty->flip.flag_buf_ptr++;
- tty->flip.char_buf_ptr++;
- *tty->flip.flag_buf_ptr = TTY_OVERRUN;
- }
- }
}

- tty->flip.flag_buf_ptr++;
- tty->flip.char_buf_ptr++;
- tty->flip.count++;
- ignore_char:
- icom_port->statStg->rcv[rcv_buff].flags = 0;
+ tty_insert_flip_char(tty, icon_port->recv_buf + offset + count - 1, flag);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Is this meant to be
tty_insert_flip_char(tty, *(icon_port->recv_buf + offset + count - 1), flag);
?

+
+ if (status & SA_FLAGS_OVERRUN)
+ /*
+ * Overrun is special, since it's
+ * reported immediately, and doesn't
+ * affect the current character
+ */
+ tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+ignore_char:
+ icom_port->statStg->rcv[rcv_buff].flags = 0;
icom_port->statStg->rcv[rcv_buff].leLength = 0;
icom_port->statStg->rcv[rcv_buff].WorkingLength =
(unsigned short int) cpu_to_le16(RCV_BUFF_SZ);

Again, sorry I didn't catch this back in -mm1 or -mm2...

thanks,
-serge