From owner-p4-projects@FreeBSD.ORG Wed Mar 29 22:29:25 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 30E1A16A425; Wed, 29 Mar 2006 22:29:25 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB66C16A41F for ; Wed, 29 Mar 2006 22:29:24 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F0DA43D45 for ; Wed, 29 Mar 2006 22:29:24 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2TMTOwr078537 for ; Wed, 29 Mar 2006 22:29:24 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2TMTOlu078534 for perforce@freebsd.org; Wed, 29 Mar 2006 22:29:24 GMT (envelope-from marcel@freebsd.org) Date: Wed, 29 Mar 2006 22:29:24 GMT Message-Id: <200603292229.k2TMTOlu078534@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Cc: Subject: PERFORCE change 94269 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2006 22:29:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=94269 Change 94269 by marcel@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;