PERFORCE change 94269 for review
Marcel Moolenaar
marcel at FreeBSD.org
Wed Mar 29 22:29:25 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=94269
Change 94269 by marcel at marcel_nfs on 2006/03/29 22:29:21
Rename the reset() method of the serdev interface to sysdev().
Intead of scc(4) asking for each channel and mode if the
hardware can be reset, it's asking now if the channel in that
mode is used as a system device (think console, keyboard, etc).
Consequently, the hardware is not reset, but additionally the
channel is fixed in that mode. This means that no bsc(4) or
hdlc(4) will be probed and/or attached for that channel, which
means that there won't be devices that cannot be used.
Affected files ...
.. //depot/projects/uart/dev/scc/scc_bfe.h#12 edit
.. //depot/projects/uart/dev/scc/scc_core.c#15 edit
.. //depot/projects/uart/dev/uart/uart_bus.h#43 edit
.. //depot/projects/uart/dev/uart/uart_bus_scc.c#6 edit
.. //depot/projects/uart/dev/uart/uart_core.c#51 edit
.. //depot/projects/uart/kern/serdev_if.m#3 edit
Differences ...
==== //depot/projects/uart/dev/scc/scc_bfe.h#12 (text+ko) ====
@@ -74,6 +74,7 @@
int m_fastintr:1;
int m_hasintr:1;
int m_probed:1;
+ int m_sysdev:1;
driver_intr_t *ih;
serdev_intr_t *ih_src[SCC_ISRCCNT];
@@ -87,6 +88,7 @@
struct scc_mode ch_mode[SCC_NMODES];
u_int ch_nr;
+ int ch_sysdev:1;
uint32_t ch_ipend;
uint32_t ch_hwsig;
==== //depot/projects/uart/dev/scc/scc_core.c#15 (text+ko) ====
==== //depot/projects/uart/dev/uart/uart_bus.h#43 (text+ko) ====
@@ -142,7 +142,7 @@
int uart_bus_detach(device_t dev);
serdev_intr_t *uart_bus_ihand(device_t dev, int ipend);
int uart_bus_probe(device_t dev, int regshft, int rclk, int rid, int chan);
-int uart_bus_reset(device_t dev);
+int uart_bus_sysdev(device_t dev);
int uart_tty_attach(struct uart_softc *);
int uart_tty_detach(struct uart_softc *);
==== //depot/projects/uart/dev/uart/uart_bus_scc.c#6 (text+ko) ====
@@ -53,7 +53,7 @@
DEVMETHOD(device_detach, uart_bus_detach),
/* Serdev interface */
DEVMETHOD(serdev_ihand, uart_bus_ihand),
- DEVMETHOD(serdev_reset, uart_bus_reset),
+ DEVMETHOD(serdev_sysdev, uart_bus_sysdev),
{ 0, 0 }
};
==== //depot/projects/uart/dev/uart/uart_core.c#51 (text+ko) ====
@@ -267,14 +267,12 @@
}
int
-uart_bus_reset(device_t dev)
+uart_bus_sysdev(device_t dev)
{
struct uart_softc *sc;
- int reset;
sc = device_get_softc(dev);
- reset = (sc->sc_sysdev == NULL) ? 1 : 0;
- return (reset);
+ return ((sc->sc_sysdev != NULL) ? 1 : 0);
}
int
==== //depot/projects/uart/kern/serdev_if.m#3 (text+ko) ====
@@ -50,9 +50,9 @@
}
static int
- default_reset(device_t dev)
+ default_sysdev(device_t dev)
{
- return (1);
+ return (0);
}
};
@@ -66,17 +66,14 @@
int ipend;
} DEFAULT default_ihand;
-# reset() - Serial device hardware reset veto function.
+# sysdev() - Query system device status
# This method may be called by the umbrella driver for each child driver
-# to establish if a hardware reset can be performed or not. When, for
-# example, a serial channel is used as the system console, a hardware
-# reset should not happen as it interrupts console operation.
-# Each child driver is expected to perform a channel reset in any case
-# and a hardware reset is assumed to have happened when at least one of
-# the channels is in use.
-# The return value is 0 when no hardware reset should happen and !0
-# otherwise.
-METHOD int reset {
+# to establish if a particular channel and mode is currently being used
+# for system specific usage. If this is the case, the hardware is not
+# reset and the channel will not change its operation mode.
+# The return value is !0 if the channel and mode are used for a system
+# device and 0 otherwise.
+METHOD int sysdev {
device_t dev;
-} DEFAULT default_reset;
+} DEFAULT default_sysdev;
More information about the p4-projects
mailing list