Hi,
This patch makes setserial work again for the drivers that uses
generic_serial (sx, rio, ...).
Patrick
diff -u -r --new-file linux-2.4.0-test7.clean/drivers/char/generic_serial.c
linux-2.4.0-test7.generic_serial/drivers/char/generic_serial.c
--- linux-2.4.0-test7.clean/drivers/char/generic_serial.c Fri Aug 11 23:54:17
2000
+++ linux-2.4.0-test7.generic_serial/drivers/char/generic_serial.c Tue Aug 29
+14:05:08 2000
@@ -368,7 +368,7 @@
struct gs_port *port = ptr;
long end_jiffies;
int jiffies_to_transmit, charsleft = 0, rv = 0;
- int to, rcib;
+ int rcib;
func_enter();
@@ -392,6 +392,7 @@
return rv;
}
/* stop trying: now + twice the time it would normally take + seconds */
+ if (timeout == 0) timeout = MAX_SCHEDULE_TIMEOUT;
end_jiffies = jiffies;
if (timeout != MAX_SCHEDULE_TIMEOUT)
end_jiffies += port->baud?(2 * rcib * 10 * HZ / port->baud):0;
@@ -400,11 +401,9 @@
gs_dprintk (GS_DEBUG_FLUSH, "now=%lx, end=%lx (%ld).\n",
jiffies, end_jiffies, end_jiffies-jiffies);
- to = 100;
/* the expression is actually jiffies < end_jiffies, but that won't
work around the wraparound. Tricky eh? */
- while (to-- &&
- (charsleft = gs_real_chars_in_buffer (port->tty)) &&
+ while ((charsleft = gs_real_chars_in_buffer (port->tty)) &&
time_after (end_jiffies, jiffies)) {
/* Units check:
chars * (bits/char) * (jiffies /sec) / (bits/sec) = jiffies!