[Midnightbsd-cvs] src [10074] trunk/sys/dev/scd: sync rt scc scd

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun May 27 19:16:35 EDT 2018


Revision: 10074
          http://svnweb.midnightbsd.org/src/?rev=10074
Author:   laffer1
Date:     2018-05-27 19:16:34 -0400 (Sun, 27 May 2018)
Log Message:
-----------
sync rt scc scd

Modified Paths:
--------------
    trunk/sys/dev/rt/if_rt.c
    trunk/sys/dev/rt/if_rtreg.h
    trunk/sys/dev/rt/if_rtvar.h
    trunk/sys/dev/scc/scc_bfe.h
    trunk/sys/dev/scc/scc_bfe_ebus.c
    trunk/sys/dev/scc/scc_bfe_macio.c
    trunk/sys/dev/scc/scc_bfe_quicc.c
    trunk/sys/dev/scc/scc_bfe_sbus.c
    trunk/sys/dev/scc/scc_bus.h
    trunk/sys/dev/scc/scc_core.c
    trunk/sys/dev/scc/scc_dev_quicc.c
    trunk/sys/dev/scc/scc_dev_sab82532.c
    trunk/sys/dev/scc/scc_dev_z8530.c
    trunk/sys/dev/scc/scc_if.m
    trunk/sys/dev/scd/scd.c
    trunk/sys/dev/scd/scd_isa.c
    trunk/sys/dev/scd/scdreg.h
    trunk/sys/dev/scd/scdvar.h

Property Changed:
----------------
    trunk/sys/dev/scc/scc_if.m

Modified: trunk/sys/dev/rt/if_rt.c
===================================================================
--- trunk/sys/dev/rt/if_rt.c	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/rt/if_rt.c	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2011, Aleksandr Rybalko
  * based on hard work
@@ -29,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/rt/if_rt.c 294689 2016-01-24 22:14:37Z ian $");
 
 #include "if_rtvar.h"
 #include "if_rtreg.h"
@@ -148,7 +149,7 @@
 rt_probe(device_t dev)
 {
 	device_set_desc(dev, "Ralink RT305XF onChip Ethernet MAC");
-	return (0);
+	return (BUS_PROBE_NOWILDCARD);
 }
 
 /*
@@ -176,20 +177,6 @@
 }
 
 #ifdef USE_GENERATED_MAC_ADDRESS
-static char *
-kernenv_next(char *cp)
-{
-
-	if (cp != NULL) {
-		while (*cp != 0)
-			cp++;
-		cp++;
-		if (*cp == 0)
-			cp = NULL;
-	}
-	return (cp);
-}
-
 /*
  * generate_mac(uin8_t *mac)
  * This is MAC address generator for cases when real device MAC address
@@ -208,14 +195,8 @@
 	uint32_t crc = 0xffffffff;
 
 	/* Generate CRC32 on kenv */
-	if (dynamic_kenv) {
-		for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) {
-			crc = calculate_crc32c(crc, cp, strlen(cp) + 1);
-		}
-	} else {
-		for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) {
-			crc = calculate_crc32c(crc, cp, strlen(cp) + 1);
-		}
+	for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) {
+		crc = calculate_crc32c(crc, cp, strlen(cp) + 1);
 	}
 	crc = ~crc;
 
@@ -383,7 +364,6 @@
 	ifp->if_init = rt_init;
 	ifp->if_ioctl = rt_ioctl;
 	ifp->if_start = rt_start;
-	ifp->if_mtu = ETHERMTU;
 #define	RT_TX_QLEN	256
 
 	IFQ_SET_MAXLEN(&ifp->if_snd, RT_TX_QLEN);
@@ -476,6 +456,7 @@
 	struct rt_softc *sc;
 #ifdef IF_RT_PHY_SUPPORT
 	struct mii_data *mii;
+	struct mii_softc *miisc;
 	int error = 0;
 
 	sc = ifp->if_softc;
@@ -482,14 +463,9 @@
 	RT_SOFTC_LOCK(sc);
 
 	mii = device_get_softc(sc->rt_miibus);
-	if (mii->mii_instance) {
-		struct mii_softc *miisc;
-		for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL;
-				miisc = LIST_NEXT(miisc, mii_list))
-			mii_phy_reset(miisc);
-	}
-	if (mii)
-		error = mii_mediachg(mii);
+	LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
+		PHY_RESET(miisc);
+	error = mii_mediachg(mii);
 	RT_SOFTC_UNLOCK(sc);
 
 	return (error);
@@ -2344,45 +2320,45 @@
 	stats = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
 	    "stats", CTLFLAG_RD, 0, "statistic");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "interrupts", CTLFLAG_RD, &sc->interrupts, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "interrupts", CTLFLAG_RD, &sc->interrupts,
 	    "all interrupts");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "tx_coherent_interrupts", CTLFLAG_RD, &sc->tx_coherent_interrupts,
-	    0, "Tx coherent interrupts");
+	    "Tx coherent interrupts");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "rx_coherent_interrupts", CTLFLAG_RD, &sc->rx_coherent_interrupts,
-	    0, "Rx coherent interrupts");
+	    "Rx coherent interrupts");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "rx_interrupts", CTLFLAG_RD, &sc->rx_interrupts, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "rx_interrupts", CTLFLAG_RD, &sc->rx_interrupts,
 	    "Rx interrupts");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "rx_delay_interrupts", CTLFLAG_RD, &sc->rx_delay_interrupts, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "rx_delay_interrupts", CTLFLAG_RD, &sc->rx_delay_interrupts,
 	    "Rx delay interrupts");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "TXQ3_interrupts", CTLFLAG_RD, &sc->tx_interrupts[3], 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "TXQ3_interrupts", CTLFLAG_RD, &sc->tx_interrupts[3],
 	    "Tx AC3 interrupts");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "TXQ2_interrupts", CTLFLAG_RD, &sc->tx_interrupts[2], 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "TXQ2_interrupts", CTLFLAG_RD, &sc->tx_interrupts[2],
 	    "Tx AC2 interrupts");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "TXQ1_interrupts", CTLFLAG_RD, &sc->tx_interrupts[1], 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "TXQ1_interrupts", CTLFLAG_RD, &sc->tx_interrupts[1],
 	    "Tx AC1 interrupts");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "TXQ0_interrupts", CTLFLAG_RD, &sc->tx_interrupts[0], 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "TXQ0_interrupts", CTLFLAG_RD, &sc->tx_interrupts[0],
 	    "Tx AC0 interrupts");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "tx_delay_interrupts", CTLFLAG_RD, &sc->tx_delay_interrupts,
-	    0, "Tx delay interrupts");
+	    "Tx delay interrupts");
 
 	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "TXQ3_desc_queued", CTLFLAG_RD, &sc->tx_ring[3].desc_queued,
@@ -2416,93 +2392,96 @@
 	    "TXQ0_data_queued", CTLFLAG_RD, &sc->tx_ring[0].data_queued,
 	    0, "Tx AC0 data queued");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "TXQ3_data_queue_full", CTLFLAG_RD, &sc->tx_data_queue_full[3],
-	    0, "Tx AC3 data queue full");
+	    "Tx AC3 data queue full");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "TXQ2_data_queue_full", CTLFLAG_RD, &sc->tx_data_queue_full[2],
-	    0, "Tx AC2 data queue full");
+	    "Tx AC2 data queue full");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "TXQ1_data_queue_full", CTLFLAG_RD, &sc->tx_data_queue_full[1],
-	    0, "Tx AC1 data queue full");
+	    "Tx AC1 data queue full");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "TXQ0_data_queue_full", CTLFLAG_RD, &sc->tx_data_queue_full[0],
-	    0, "Tx AC0 data queue full");
+	    "Tx AC0 data queue full");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "tx_watchdog_timeouts", CTLFLAG_RD, &sc->tx_watchdog_timeouts,
-	    0, "Tx watchdog timeouts");
+	    "Tx watchdog timeouts");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "tx_defrag_packets", CTLFLAG_RD, &sc->tx_defrag_packets, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "tx_defrag_packets", CTLFLAG_RD, &sc->tx_defrag_packets,
 	    "Tx defragmented packets");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "no_tx_desc_avail", CTLFLAG_RD, &sc->no_tx_desc_avail, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "no_tx_desc_avail", CTLFLAG_RD, &sc->no_tx_desc_avail,
 	    "no Tx descriptors available");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "rx_mbuf_alloc_errors", CTLFLAG_RD, &sc->rx_mbuf_alloc_errors,
-	    0, "Rx mbuf allocation errors");
+	    "Rx mbuf allocation errors");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "rx_mbuf_dmamap_errors", CTLFLAG_RD, &sc->rx_mbuf_dmamap_errors,
-	    0, "Rx mbuf DMA mapping errors");
+	    "Rx mbuf DMA mapping errors");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "tx_queue_0_not_empty", CTLFLAG_RD, &sc->tx_queue_not_empty[0],
-	    0, "Tx queue 0 not empty");
+	    "Tx queue 0 not empty");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
 	    "tx_queue_1_not_empty", CTLFLAG_RD, &sc->tx_queue_not_empty[1],
-	    0, "Tx queue 1 not empty");
+	    "Tx queue 1 not empty");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "rx_packets", CTLFLAG_RD, &sc->rx_packets, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "rx_packets", CTLFLAG_RD, &sc->rx_packets,
 	    "Rx packets");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "rx_crc_errors", CTLFLAG_RD, &sc->rx_crc_err, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "rx_crc_errors", CTLFLAG_RD, &sc->rx_crc_err,
 	    "Rx CRC errors");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "rx_phy_errors", CTLFLAG_RD, &sc->rx_phy_err, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "rx_phy_errors", CTLFLAG_RD, &sc->rx_phy_err,
 	    "Rx PHY errors");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "rx_dup_packets", CTLFLAG_RD, &sc->rx_dup_packets, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "rx_dup_packets", CTLFLAG_RD, &sc->rx_dup_packets,
 	    "Rx duplicate packets");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "rx_fifo_overflows", CTLFLAG_RD, &sc->rx_fifo_overflows, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "rx_fifo_overflows", CTLFLAG_RD, &sc->rx_fifo_overflows,
 	    "Rx FIFO overflows");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "rx_bytes", CTLFLAG_RD, &sc->rx_bytes, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "rx_bytes", CTLFLAG_RD, &sc->rx_bytes,
 	    "Rx bytes");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "rx_long_err", CTLFLAG_RD, &sc->rx_long_err, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "rx_long_err", CTLFLAG_RD, &sc->rx_long_err,
 	    "Rx too long frame errors");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "rx_short_err", CTLFLAG_RD, &sc->rx_short_err, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "rx_short_err", CTLFLAG_RD, &sc->rx_short_err,
 	    "Rx too short frame errors");
 
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "tx_bytes", CTLFLAG_RD, &sc->tx_bytes, 0,
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "tx_bytes", CTLFLAG_RD, &sc->tx_bytes,
 	    "Tx bytes");
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "tx_packets", CTLFLAG_RD, &sc->tx_packets, 0,
+
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "tx_packets", CTLFLAG_RD, &sc->tx_packets,
 	    "Tx packets");
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "tx_skip", CTLFLAG_RD, &sc->tx_skip, 0,
+
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "tx_skip", CTLFLAG_RD, &sc->tx_skip,
 	    "Tx skip count for GDMA ports");
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
-	    "tx_collision", CTLFLAG_RD, &sc->tx_collision, 0,
+
+	SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO,
+	    "tx_collision", CTLFLAG_RD, &sc->tx_collision,
 	    "Tx collision count for GDMA ports");
 }
 

Modified: trunk/sys/dev/rt/if_rtreg.h
===================================================================
--- trunk/sys/dev/rt/if_rtreg.h	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/rt/if_rtreg.h	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2009, Aleksandr Rybalko
  * All rights reserved.
@@ -24,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/dev/rt/if_rtreg.h 223927 2011-07-11 08:23:59Z ray $
  */
 
 #ifndef _IF_RTREG_H_

Modified: trunk/sys/dev/rt/if_rtvar.h
===================================================================
--- trunk/sys/dev/rt/if_rtvar.h	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/rt/if_rtvar.h	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2010-2011 Aleksandr Rybalko <ray at ddteam.net>
  * Copyright (c) 2009-2010 Alexander Egorenkov <egorenar at gmail.com>
@@ -25,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/dev/rt/if_rtvar.h 223927 2011-07-11 08:23:59Z ray $
  */
 
 #ifndef _IF_RTVAR_H_

Modified: trunk/sys/dev/scc/scc_bfe.h
===================================================================
--- trunk/sys/dev/scc/scc_bfe.h	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scc/scc_bfe.h	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2004-2006 Marcel Moolenaar
  * All rights reserved.
@@ -23,7 +24,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/dev/scc/scc_bfe.h 253902 2013-08-02 23:31:51Z marius $
  */
 
 #ifndef _DEV_SCC_BFE_H_
@@ -136,7 +137,7 @@
 };
 
 extern devclass_t scc_devclass;
-extern char scc_driver_name[];
+extern const char scc_driver_name[];
 
 int scc_bfe_attach(device_t dev, u_int ipc);
 int scc_bfe_detach(device_t dev);

Modified: trunk/sys/dev/scc/scc_bfe_ebus.c
===================================================================
--- trunk/sys/dev/scc/scc_bfe_ebus.c	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scc/scc_bfe_ebus.c	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2004-2006 Marcel Moolenaar
  * All rights reserved.
@@ -25,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/scc/scc_bfe_ebus.c 253900 2013-08-02 23:30:32Z marius $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -94,4 +95,4 @@
 	sizeof(struct scc_softc),
 };
 
-DRIVER_MODULE(scc, ebus, scc_ebus_driver, scc_devclass, 0, 0);
+DRIVER_MODULE(scc, ebus, scc_ebus_driver, scc_devclass, NULL, NULL);

Modified: trunk/sys/dev/scc/scc_bfe_macio.c
===================================================================
--- trunk/sys/dev/scc/scc_bfe_macio.c	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scc/scc_bfe_macio.c	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2006 Marcel Moolenaar
  * All rights reserved.
@@ -25,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/scc/scc_bfe_macio.c 253900 2013-08-02 23:30:32Z marius $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -90,4 +91,4 @@
 	sizeof(struct scc_softc),
 };
 
-DRIVER_MODULE(scc, macio, scc_macio_driver, scc_devclass, 0, 0);
+DRIVER_MODULE(scc, macio, scc_macio_driver, scc_devclass, NULL, NULL);

Modified: trunk/sys/dev/scc/scc_bfe_quicc.c
===================================================================
--- trunk/sys/dev/scc/scc_bfe_quicc.c	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scc/scc_bfe_quicc.c	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2006 Marcel Moolenaar
  * All rights reserved.
@@ -25,10 +26,8 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/scc/scc_bfe_quicc.c 253900 2013-08-02 23:30:32Z marius $");
 
-#define	__RMAN_RESOURCE_VISIBLE
-
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
@@ -98,4 +97,4 @@
 	sizeof(struct scc_softc),
 };
 
-DRIVER_MODULE(scc, quicc, scc_quicc_driver, scc_devclass, 0, 0);
+DRIVER_MODULE(scc, quicc, scc_quicc_driver, scc_devclass, NULL, NULL);

Modified: trunk/sys/dev/scc/scc_bfe_sbus.c
===================================================================
--- trunk/sys/dev/scc/scc_bfe_sbus.c	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scc/scc_bfe_sbus.c	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2004-2006 Marcel Moolenaar
  * All rights reserved.
@@ -25,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/scc/scc_bfe_sbus.c 253900 2013-08-02 23:30:32Z marius $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -90,5 +91,5 @@
 	sizeof(struct scc_softc),
 };
 
-DRIVER_MODULE(scc, fhc, scc_sbus_driver, scc_devclass, 0, 0);
-DRIVER_MODULE(scc, sbus, scc_sbus_driver, scc_devclass, 0, 0);
+DRIVER_MODULE(scc, fhc, scc_sbus_driver, scc_devclass, NULL, NULL);
+DRIVER_MODULE(scc, sbus, scc_sbus_driver, scc_devclass, NULL, NULL);

Modified: trunk/sys/dev/scc/scc_bus.h
===================================================================
--- trunk/sys/dev/scc/scc_bus.h	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scc/scc_bus.h	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2004-2006 Marcel Moolenaar
  * All rights reserved.
@@ -23,7 +24,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/dev/scc/scc_bus.h 176772 2008-03-03 18:20:17Z raj $
  */
 
 #ifndef _DEV_SCC_BUS_H_

Modified: trunk/sys/dev/scc/scc_core.c
===================================================================
--- trunk/sys/dev/scc/scc_core.c	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scc/scc_core.c	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2004-2006 Marcel Moolenaar
  * All rights reserved.
@@ -25,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/scc/scc_core.c 253902 2013-08-02 23:31:51Z marius $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -46,7 +47,7 @@
 #include "scc_if.h"
 
 devclass_t scc_devclass;
-char scc_driver_name[] = "scc";
+const char scc_driver_name[] = "scc";
 
 static MALLOC_DEFINE(M_SCC, "SCC", "SCC driver");
 

Modified: trunk/sys/dev/scc/scc_dev_quicc.c
===================================================================
--- trunk/sys/dev/scc/scc_dev_quicc.c	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scc/scc_dev_quicc.c	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2004-2006 Marcel Moolenaar
  * All rights reserved.
@@ -25,15 +26,12 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/scc/scc_dev_quicc.c 253920 2013-08-03 21:24:52Z marius $");
 
-#define __RMAN_RESOURCE_VISIBLE
-
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
 #include <sys/conf.h>
-#include <sys/endian.h>
 #include <machine/bus.h>
 #include <sys/rman.h>
 #include <sys/serial.h>
@@ -47,9 +45,13 @@
 
 #define	quicc_read2(bas, reg)		\
 	bus_space_read_2((bas)->bst, (bas)->bsh, reg)
+#define	quicc_read4(bas, reg)		\
+	bus_space_read_4((bas)->bst, (bas)->bsh, reg)
 
 #define	quicc_write2(bas, reg, val)	\
 	bus_space_write_2((bas)->bst, (bas)->bsh, reg, val)
+#define	quicc_write4(bas, reg, val)	\
+	bus_space_write_4((bas)->bst, (bas)->bsh, reg, val)
 
 static int quicc_bfe_attach(struct scc_softc *, int);
 static int quicc_bfe_enabled(struct scc_softc *, struct scc_chan *);
@@ -63,7 +65,7 @@
 	KOBJMETHOD(scc_iclear,	quicc_bfe_iclear),
 	KOBJMETHOD(scc_ipend,	quicc_bfe_ipend),
 	KOBJMETHOD(scc_probe,	quicc_bfe_probe),
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 struct scc_class scc_quicc_class = {
@@ -77,11 +79,9 @@
 };
 
 static int
-quicc_bfe_attach(struct scc_softc *sc, int reset)
+quicc_bfe_attach(struct scc_softc *sc __unused, int reset __unused)
 {
-	struct scc_bas *bas;
 
-	bas = &sc->sc_bas;
 	return (0);
 }
 
@@ -104,7 +104,18 @@
 static int
 quicc_bfe_iclear(struct scc_softc *sc, struct scc_chan *ch)
 {
+	struct scc_bas *bas;
+	uint16_t rb, st;
 
+	bas = &sc->sc_bas;
+	mtx_lock_spin(&sc->sc_hwmtx);
+	if (ch->ch_ipend & SER_INT_RXREADY) {
+		rb = quicc_read2(bas, QUICC_PRAM_SCC_RBASE(ch->ch_nr - 1));
+		st = quicc_read2(bas, rb);
+		(void)quicc_read4(bas, rb + 4);
+		quicc_write2(bas, rb, st | 0x9000);
+	}
+	mtx_unlock_spin(&sc->sc_hwmtx);
 	return (0);
 }
 
@@ -142,10 +153,8 @@
 }
 
 static int
-quicc_bfe_probe(struct scc_softc *sc)
+quicc_bfe_probe(struct scc_softc *sc __unused)
 {
-	struct scc_bas *bas;
 
-	bas = &sc->sc_bas;
 	return (0);
 }

Modified: trunk/sys/dev/scc/scc_dev_sab82532.c
===================================================================
--- trunk/sys/dev/scc/scc_dev_sab82532.c	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scc/scc_dev_sab82532.c	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2004-2006 Marcel Moolenaar
  * All rights reserved.
@@ -25,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/scc/scc_dev_sab82532.c 253899 2013-08-02 23:28:49Z marius $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -52,7 +53,7 @@
 	KOBJMETHOD(scc_iclear,	sab82532_bfe_iclear),
 	KOBJMETHOD(scc_ipend,	sab82532_bfe_ipend),
 	KOBJMETHOD(scc_probe,	sab82532_bfe_probe),
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 struct scc_class scc_sab82532_class = {
@@ -66,11 +67,9 @@
 };
 
 static int
-sab82532_bfe_attach(struct scc_softc *sc, int reset)
+sab82532_bfe_attach(struct scc_softc *sc __unused, int reset __unused)
 {
-	struct scc_bas *bas;
 
-	bas = &sc->sc_bas;
 	return (0);
 }
 
@@ -77,7 +76,28 @@
 static int
 sab82532_bfe_iclear(struct scc_softc *sc, struct scc_chan *ch)
 {
+	struct scc_bas *bas;
+	int i, ofs, rbcl;
 
+	bas = &sc->sc_bas;
+	ofs = (ch->ch_nr - 1) * SAB_CHANLEN;
+	mtx_lock_spin(&sc->sc_hwmtx);
+	if (ch->ch_ipend & SER_INT_RXREADY) {
+		if (scc_getreg(bas, ofs + SAB_STAR) & SAB_STAR_RFNE) {
+			rbcl = scc_getreg(bas, ofs + SAB_RBCL) & 31;
+			if (rbcl == 0)
+				rbcl = 32;
+			for (i = 0; i < rbcl; i += 2) {
+				(void)scc_getreg(bas, ofs + SAB_RFIFO);
+				(void)scc_getreg(bas, ofs + SAB_RFIFO + 1);
+			}
+		}
+		while (scc_getreg(bas, ofs + SAB_STAR) & SAB_STAR_CEC)
+			;
+		scc_setreg(bas, ofs + SAB_CMDR, SAB_CMDR_RMC);
+		scc_barrier(bas);
+	}
+	mtx_unlock_spin(&sc->sc_hwmtx);
 	return (0);
 }
 
@@ -124,10 +144,8 @@
 }
 
 static int
-sab82532_bfe_probe(struct scc_softc *sc)
+sab82532_bfe_probe(struct scc_softc *sc __unused)
 {
-	struct scc_bas *bas;
 
-	bas = &sc->sc_bas;
 	return (0);
 }

Modified: trunk/sys/dev/scc/scc_dev_z8530.c
===================================================================
--- trunk/sys/dev/scc/scc_dev_z8530.c	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scc/scc_dev_z8530.c	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2004-2006 Marcel Moolenaar
  * All rights reserved.
@@ -25,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/scc/scc_dev_z8530.c 260287 2014-01-04 21:32:53Z dim $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -52,7 +53,7 @@
 	KOBJMETHOD(scc_iclear,	z8530_bfe_iclear),
 	KOBJMETHOD(scc_ipend,	z8530_bfe_ipend),
 	KOBJMETHOD(scc_probe,	z8530_bfe_probe),
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 struct scc_class scc_z8530_class = {
@@ -66,15 +67,6 @@
 };
 
 /* Multiplexed I/O. */
-static __inline void
-scc_setmreg(struct scc_bas *bas, int ch, int reg, int val)
-{
-
-	scc_setreg(bas, ch + REG_CTRL, reg);
-	scc_barrier(bas);
-	scc_setreg(bas, ch + REG_CTRL, val);
-}
-
 static __inline uint8_t
 scc_getmreg(struct scc_bas *bas, int ch, int reg)
 {
@@ -85,11 +77,9 @@
 }
 
 static int
-z8530_bfe_attach(struct scc_softc *sc, int reset)
+z8530_bfe_attach(struct scc_softc *sc __unused, int reset __unused)
 {
-	struct scc_bas *bas;
 
-	bas = &sc->sc_bas;
 	return (0);
 }
 
@@ -148,9 +138,7 @@
 	if (ip & IP_TIB)
 		ch[1]->ch_ipend |= SER_INT_TXIDLE;
 	if (ip & IP_SIA) {
-		scc_setreg(bas, CHAN_A + REG_CTRL, CR_RSTXSI);
-		scc_barrier(bas);
-		bes = scc_getreg(bas, CHAN_A + REG_CTRL);
+		bes = scc_getmreg(bas, CHAN_A, CR_RSTXSI);
 		if (bes & BES_BRK)
 			ch[0]->ch_ipend |= SER_INT_BREAK;
 		sig = ch[0]->ch_hwsig;
@@ -166,9 +154,7 @@
 			ch[0]->ch_ipend |= SER_INT_OVERRUN;
 	}
 	if (ip & IP_SIB) {
-		scc_setreg(bas, CHAN_B + REG_CTRL, CR_RSTXSI);
-		scc_barrier(bas);
-		bes = scc_getreg(bas, CHAN_B + REG_CTRL);
+		bes = scc_getmreg(bas, CHAN_B, CR_RSTXSI);
 		if (bes & BES_BRK)
 			ch[1]->ch_ipend |= SER_INT_BREAK;
 		sig = ch[1]->ch_hwsig;
@@ -189,10 +175,8 @@
 }
 
 static int
-z8530_bfe_probe(struct scc_softc *sc)
+z8530_bfe_probe(struct scc_softc *sc __unused)
 {
-	struct scc_bas *bas;
 
-	bas = &sc->sc_bas;
 	return (0);
 }

Modified: trunk/sys/dev/scc/scc_if.m
===================================================================
--- trunk/sys/dev/scc/scc_if.m	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scc/scc_if.m	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 #-
 # Copyright (c) 2004-2006 Marcel Moolenaar
 # All rights reserved.
@@ -23,7 +24,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
-# $MidnightBSD$
+# $FreeBSD: stable/10/sys/dev/scc/scc_if.m 188174 2009-02-05 19:32:34Z imp $
 
 #include <sys/param.h>
 #include <sys/bus.h>


Property changes on: trunk/sys/dev/scc/scc_if.m
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/dev/scd/scd.c
===================================================================
--- trunk/sys/dev/scd/scd.c	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scd/scd.c	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1995 Mikael Hybsch
  * All rights reserved.
@@ -41,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/scd/scd.c 320923 2017-07-12 22:16:54Z jhb $");
 
 
 #undef	SCD_DEBUG
@@ -172,6 +173,8 @@
 	sc->scd_dev_t = make_dev(&scd_cdevsw, 8 * unit,
 		UID_ROOT, GID_OPERATOR, 0640, "scd%d", unit);
 	sc->scd_dev_t->si_drv1 = (void *)sc;
+	device_printf(sc->dev,
+	    "WARNING: This driver is deprecated and will be removed.\n");
 
 	return (0);
 }

Modified: trunk/sys/dev/scd/scd_isa.c
===================================================================
--- trunk/sys/dev/scd/scd_isa.c	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scd/scd_isa.c	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,8 +1,9 @@
+/* $MidnightBSD$ */
 /*
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/scd/scd_isa.c 146734 2005-05-29 04:42:30Z nyan $");
 
 #include <sys/param.h>
 #include <sys/systm.h>

Modified: trunk/sys/dev/scd/scdreg.h
===================================================================
--- trunk/sys/dev/scd/scdreg.h	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scd/scdreg.h	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1995 Mikael Hybsch
  * All rights reserved.
@@ -25,7 +26,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/dev/scd/scdreg.h 143063 2005-03-02 21:33:29Z joerg $
  *
  */
 

Modified: trunk/sys/dev/scd/scdvar.h
===================================================================
--- trunk/sys/dev/scd/scdvar.h	2018-05-27 23:15:22 UTC (rev 10073)
+++ trunk/sys/dev/scd/scdvar.h	2018-05-27 23:16:34 UTC (rev 10074)
@@ -1,5 +1,6 @@
+/* $MidnightBSD$ */
 /*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/dev/scd/scdvar.h 130585 2004-06-16 09:47:26Z phk $
  */
 
 struct scd_mbx {



More information about the Midnightbsd-cvs mailing list