mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.6.12 1/2] Altix ioc4 serial - set hfc from ioctl
@ 2005-03-29 19:49 Patrick Gefre
  2005-03-29 19:50 ` [PATCH 2.6.12 2/2] Altix ioc4 serial - set a better timeout/threshold Patrick Gefre
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Gefre @ 2005-03-29 19:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Patrick Gefre

Allow hardware flow control to be set from an ioctl.

Signed-off-by: Patrick Gefre <pfg@sgi.com>



Index: linux-2.5-ioc4/drivers/serial/ioc4_serial.c
===================================================================
--- linux-2.5-ioc4.orig/drivers/serial/ioc4_serial.c	2005-03-24 13:54:30.657706924 -0600
+++ linux-2.5-ioc4/drivers/serial/ioc4_serial.c	2005-03-24 13:56:48.230417236 -0600
@@ -1765,8 +1765,11 @@
 		the_port->ignore_status_mask &= ~N_DATA_READY;
 	}
 
-	if (cflag & CRTSCTS)
+	if (cflag & CRTSCTS) {
 		info->flags |= ASYNC_CTS_FLOW;
+		port->ip_sscr |= IOC4_SSCR_HFC_EN;
+		writel(port->ip_sscr, &port->ip_serial_regs->sscr);
+	}
 	else
 		info->flags &= ~ASYNC_CTS_FLOW;
 
@@ -1825,12 +1828,6 @@
 	/* set the speed of the serial port */
 	ioc4_change_speed(the_port, info->tty->termios, (struct termios *)0);
 
-	/* enable hardware flow control - after ioc4_change_speed because
-	 * ASYNC_CTS_FLOW is set there */
-	if (info->flags & ASYNC_CTS_FLOW) {
-		port->ip_sscr |= IOC4_SSCR_HFC_EN;
-		writel(port->ip_sscr, &port->ip_serial_regs->sscr);
-	}
 	info->flags |= UIF_INITIALIZED;
 	return 0;
 }

-- 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2.6.12 2/2] Altix ioc4 serial - set a better timeout/threshold
  2005-03-29 19:49 [PATCH 2.6.12 1/2] Altix ioc4 serial - set hfc from ioctl Patrick Gefre
@ 2005-03-29 19:50 ` Patrick Gefre
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick Gefre @ 2005-03-29 19:50 UTC (permalink / raw)
  To: linux-kernel; +Cc: Patrick Gefre


Set the timeout and threshold to better values.


Signed-off-by: Patrick Gefre <pfg@sgi.com>




Index: linux-2.5-ioc4/drivers/serial/ioc4_serial.c
===================================================================
--- linux-2.5-ioc4.orig/drivers/serial/ioc4_serial.c	2005-03-24 13:56:48.230417236 -0600
+++ linux-2.5-ioc4/drivers/serial/ioc4_serial.c	2005-03-24 13:58:35.560294893 -0600
@@ -1272,8 +1272,9 @@
 	 * and set the rx threshold to that amount.  There are 4 chars
 	 * per ring entry, so we'll divide the number of chars that will
 	 * arrive in timeout by 4.
+	 * So .... timeout * baud / 10 / HZ / 4, with HZ = 100.
 	 */
-	threshold = timeout * port->ip_baud / 10 / HZ / 4;
+	threshold = timeout * port->ip_baud / 4000;
 	if (threshold == 0)
 		threshold = 1;	/* otherwise we'll intr all the time! */
 
@@ -1285,8 +1286,10 @@
 
 	writel(port->ip_sscr, &port->ip_serial_regs->sscr);
 
-	/* Now set the rx timeout to the given value */
-	timeout = timeout * IOC4_SRTR_HZ / HZ;
+	/* Now set the rx timeout to the given value
+	 * again timeout * IOC4_SRTR_HZ / HZ
+	 */
+	timeout = timeout * IOC4_SRTR_HZ / 100;
 	if (timeout > IOC4_SRTR_CNT)
 		timeout = IOC4_SRTR_CNT;
 
@@ -1380,7 +1383,7 @@
 	if (port->ip_tx_lowat == 0)
 		port->ip_tx_lowat = 1;
 
-	set_rx_timeout(port, port->ip_rx_timeout);
+	set_rx_timeout(port, 2);
 
 	return 0;
 }

-- 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-29 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-29 19:49 [PATCH 2.6.12 1/2] Altix ioc4 serial - set hfc from ioctl Patrick Gefre
2005-03-29 19:50 ` [PATCH 2.6.12 2/2] Altix ioc4 serial - set a better timeout/threshold Patrick Gefre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®