Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jul 2003 18:16:44 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 35065 for review
Message-ID:  <200307270116.h6R1GiWv038848@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=35065

Change 35065 by marcel@marcel_nfs on 2003/07/26 18:16:27

	o  Keep uart_core.c clean. Move utility functions to uart_subr.c.
	   That way we don't clutter the bi picture.
	o  Add UART_SETSIG() to the hardware interface.

Affected files ...

.. //depot/projects/uart/conf/files#12 edit
.. //depot/projects/uart/dev/uart/uart_core.c#9 edit
.. //depot/projects/uart/dev/uart/uart_dev_ns8250.c#9 edit
.. //depot/projects/uart/dev/uart/uart_dev_sab82532.c#6 edit
.. //depot/projects/uart/dev/uart/uart_dev_z8530.c#2 edit
.. //depot/projects/uart/dev/uart/uart_if.m#5 edit
.. //depot/projects/uart/dev/uart/uart_subr.c#1 add

Differences ...

==== //depot/projects/uart/conf/files#12 (text+ko) ====

@@ -781,9 +781,6 @@
 dev/tx/if_tx.c		optional tx
 dev/txp/if_txp.c	optional txp
 dev/uart/uart_if.m		optional	uart
-dev/uart/uart_dev_ns8250.c	optional	uart
-dev/uart/uart_dev_sab82532.c	optional	uart
-dev/uart/uart_dev_z8530.c	optional	uart
 dev/uart/uart_bus_acpi.c	optional	uart acpi
 dev/uart/uart_bus_ebus.c	optional	uart ebus
 dev/uart/uart_bus_isa.c		optional	uart isa
@@ -792,6 +789,10 @@
 dev/uart/uart_bus_puc.c		optional	uart puc
 dev/uart/uart_cons.c		optional	uart
 dev/uart/uart_core.c		optional	uart
+dev/uart/uart_dev_ns8250.c	optional	uart
+dev/uart/uart_dev_sab82532.c	optional	uart
+dev/uart/uart_dev_z8530.c	optional	uart
+dev/uart/uart_subr.c		optional	uart
 dev/ubsec/ubsec.c	optional ubsec
 #
 # USB support

==== //depot/projects/uart/dev/uart/uart_core.c#9 (text+ko) ====

@@ -71,19 +71,6 @@
 	.d_kqfilter = ttykqfilter,
 };
 
-void
-uart_debug(struct uart_softc *sc, const char *fmt, ...)
-{
-#if defined(UART_DEBUG) || 1
-	va_list ap;
-	va_start(ap, fmt);
-	if (sc != NULL)
-		device_print_prettyname(sc->sc_dev);
-	vprintf(fmt, ap);
-	va_end(ap);
-#endif
-}
-
 static void
 uart_tty_oproc(struct tty *tp)
 {
@@ -522,6 +509,8 @@
 			tp->t_ispeed = tp->t_ospeed = uart_console.baudrate;
 		} else
 			tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
+
+		UART_SETSIG(sc, UART_SIG_DTR|UART_SIG_RTS);
 	}
 
 	error = (*linesw[tp->t_line].l_open)(dev, tp);

==== //depot/projects/uart/dev/uart/uart_dev_ns8250.c#9 (text+ko) ====

@@ -328,6 +328,7 @@
 static int ns8250_bus_ipend(struct uart_softc *);
 static int ns8250_bus_probe(struct uart_softc *);
 static int ns8250_bus_receive(struct uart_softc *);
+static int ns8250_bus_setsig(struct uart_softc *, int);
 static int ns8250_bus_transmit(struct uart_softc *);
 
 static kobj_method_t ns8250_methods[] = {
@@ -338,6 +339,7 @@
 	KOBJMETHOD(uart_ipend,		ns8250_bus_ipend),
 	KOBJMETHOD(uart_probe,		ns8250_bus_probe),
 	KOBJMETHOD(uart_receive,	ns8250_bus_receive),
+	KOBJMETHOD(uart_setsig,		ns8250_bus_setsig),
 	KOBJMETHOD(uart_transmit,	ns8250_bus_transmit),
 	{ 0, 0 }
 };
@@ -581,6 +583,13 @@
 }
 
 static int
+ns8250_bus_setsig(struct uart_softc *sc, int sig)
+{
+
+	return (0);
+}
+
+static int
 ns8250_bus_transmit(struct uart_softc *sc)
 {
 	struct uart_bas *bas;

==== //depot/projects/uart/dev/uart/uart_dev_sab82532.c#6 (text+ko) ====

@@ -122,17 +122,19 @@
 static int sab82532_bus_ipend(struct uart_softc *);
 static int sab82532_bus_probe(struct uart_softc *);
 static int sab82532_bus_receive(struct uart_softc *);
+static int sab82532_bus_setsig(struct uart_softc *, int);
 static int sab82532_bus_transmit(struct uart_softc *);
 
 static kobj_method_t sab82532_methods[] = {
 	KOBJMETHOD(uart_attach,		sab82532_bus_attach),
 	KOBJMETHOD(uart_detach,		sab82532_bus_detach),
 	KOBJMETHOD(uart_flush,		sab82532_bus_flush),
-	KOBJMETHOD(uart_getsig,         sab82532_bus_getsig),
-	KOBJMETHOD(uart_ipend,          sab82532_bus_ipend),
+	KOBJMETHOD(uart_getsig,		sab82532_bus_getsig),
+	KOBJMETHOD(uart_ipend,		sab82532_bus_ipend),
 	KOBJMETHOD(uart_probe,		sab82532_bus_probe),
-	KOBJMETHOD(uart_receive,        sab82532_bus_receive),
-	KOBJMETHOD(uart_transmit,       sab82532_bus_transmit),
+	KOBJMETHOD(uart_receive,	sab82532_bus_receive),
+	KOBJMETHOD(uart_setsig,		sab82532_bus_setsig),
+	KOBJMETHOD(uart_transmit,	sab82532_bus_transmit),
 	{ 0, 0 }
 };
 
@@ -229,6 +231,13 @@
 }
 
 static int
+sab82532_bus_setsig(struct uart_softc *sc, int sig)
+{
+
+	return (0);
+}
+
+static int
 sab82532_bus_transmit(struct uart_softc *sc)
 {
 

==== //depot/projects/uart/dev/uart/uart_dev_z8530.c#2 (text+ko) ====

@@ -110,6 +110,7 @@
 static int z8530_bus_ipend(struct uart_softc *);
 static int z8530_bus_probe(struct uart_softc *);
 static int z8530_bus_receive(struct uart_softc *);
+static int z8530_bus_setsig(struct uart_softc *, int);
 static int z8530_bus_transmit(struct uart_softc *);
 
 static kobj_method_t z8530_methods[] = {
@@ -120,6 +121,7 @@
 	KOBJMETHOD(uart_ipend,          z8530_bus_ipend),
 	KOBJMETHOD(uart_probe,		z8530_bus_probe),
 	KOBJMETHOD(uart_receive,        z8530_bus_receive),
+	KOBJMETHOD(uart_setsig,		z8530_bus_setsig),
 	KOBJMETHOD(uart_transmit,       z8530_bus_transmit),
 	{ 0, 0 }
 };
@@ -182,6 +184,13 @@
 }
 
 static int
+z8530_bus_setsig(struct uart_softc *sc, int sig)
+{
+
+	return (0);
+}
+
+static int
 z8530_bus_transmit(struct uart_softc *sc)
 {
 

==== //depot/projects/uart/dev/uart/uart_if.m#5 (text+ko) ====

@@ -85,6 +85,13 @@
 	struct uart_softc *this;
 };
 
+# setsig() - set line and modem signals.
+# XXX needs explanation.
+METHOD int setsig {
+	struct uart_softc *this;
+	int sig;
+};
+
 # transmit() - move data from the transmit buffer to the transmit FIFO.
 # XXX needs explanation.
 METHOD int transmit {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307270116.h6R1GiWv038848>