[Midnightbsd-cvs] src [10059] trunk/sys/dev: sync with freebsd
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun May 27 18:56:59 EDT 2018
Revision: 10059
http://svnweb.midnightbsd.org/src/?rev=10059
Author: laffer1
Date: 2018-05-27 18:56:58 -0400 (Sun, 27 May 2018)
Log Message:
-----------
sync with freebsd
Modified Paths:
--------------
trunk/sys/dev/spibus/spi.h
trunk/sys/dev/spibus/spibus.c
trunk/sys/dev/spibus/spibus_if.m
trunk/sys/dev/spibus/spibusvar.h
trunk/sys/dev/ste/if_ste.c
trunk/sys/dev/ste/if_stereg.h
trunk/sys/dev/stge/if_stge.c
trunk/sys/dev/stge/if_stgereg.h
trunk/sys/dev/streams/streams.c
trunk/sys/dev/sym/README.sym
trunk/sys/dev/sym/sym_conf.h
trunk/sys/dev/sym/sym_defs.h
trunk/sys/dev/sym/sym_fw.h
trunk/sys/dev/sym/sym_fw1.h
trunk/sys/dev/sym/sym_fw2.h
trunk/sys/dev/sym/sym_hipd.c
trunk/sys/dev/tl/if_tl.c
trunk/sys/dev/tl/if_tlreg.h
trunk/sys/dev/twe/twe.c
trunk/sys/dev/twe/twe_compat.h
trunk/sys/dev/twe/twe_freebsd.c
trunk/sys/dev/twe/twe_tables.h
trunk/sys/dev/twe/tweio.h
trunk/sys/dev/twe/twereg.h
trunk/sys/dev/twe/twevar.h
Added Paths:
-----------
trunk/sys/dev/spibus/ofw_spibus.c
Property Changed:
----------------
trunk/sys/dev/spibus/spibus_if.m
trunk/sys/dev/sym/README.sym
Added: trunk/sys/dev/spibus/ofw_spibus.c
===================================================================
--- trunk/sys/dev/spibus/ofw_spibus.c (rev 0)
+++ trunk/sys/dev/spibus/ofw_spibus.c 2018-05-27 22:56:58 UTC (rev 10059)
@@ -0,0 +1,193 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright (c) 2009, Nathan Whitehorn <nwhitehorn at FreeBSD.org>
+ * Copyright (c) 2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Oleksandr Rybalko
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/sys/dev/spibus/ofw_spibus.c 260489 2014-01-09 18:28:58Z loos $");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/libkern.h>
+#include <sys/lock.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+
+#include <dev/fdt/fdt_common.h>
+#include <dev/spibus/spi.h>
+#include <dev/spibus/spibusvar.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+#include <dev/ofw/openfirm.h>
+
+#include "spibus_if.h"
+
+struct ofw_spibus_devinfo {
+ struct spibus_ivar opd_dinfo;
+ struct ofw_bus_devinfo opd_obdinfo;
+};
+
+/* Methods */
+static device_probe_t ofw_spibus_probe;
+static device_attach_t ofw_spibus_attach;
+static device_t ofw_spibus_add_child(device_t dev, u_int order,
+ const char *name, int unit);
+static const struct ofw_bus_devinfo *ofw_spibus_get_devinfo(device_t bus,
+ device_t dev);
+
+static int
+ofw_spibus_probe(device_t dev)
+{
+
+ if (ofw_bus_get_node(dev) == -1)
+ return (ENXIO);
+ device_set_desc(dev, "OFW SPI bus");
+
+ return (0);
+}
+
+static int
+ofw_spibus_attach(device_t dev)
+{
+ struct spibus_softc *sc = device_get_softc(dev);
+ struct ofw_spibus_devinfo *dinfo;
+ phandle_t child;
+ pcell_t paddr;
+ device_t childdev;
+
+ sc->dev = dev;
+
+ bus_generic_probe(dev);
+ bus_enumerate_hinted_children(dev);
+
+ /*
+ * Attach those children represented in the device tree.
+ */
+ for (child = OF_child(ofw_bus_get_node(dev)); child != 0;
+ child = OF_peer(child)) {
+ /*
+ * Try to get the CS number first from the spi-chipselect
+ * property, then try the reg property.
+ */
+ if (OF_getencprop(child, "spi-chipselect", &paddr,
+ sizeof(paddr)) == -1) {
+ if (OF_getencprop(child, "reg", &paddr,
+ sizeof(paddr)) == -1)
+ continue;
+ }
+
+ /*
+ * Now set up the SPI and OFW bus layer devinfo and add it
+ * to the bus.
+ */
+ dinfo = malloc(sizeof(struct ofw_spibus_devinfo), M_DEVBUF,
+ M_NOWAIT | M_ZERO);
+ if (dinfo == NULL)
+ continue;
+ dinfo->opd_dinfo.cs = paddr;
+ if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) !=
+ 0) {
+ free(dinfo, M_DEVBUF);
+ continue;
+ }
+ childdev = device_add_child(dev, NULL, -1);
+ device_set_ivars(childdev, dinfo);
+ }
+
+ return (bus_generic_attach(dev));
+}
+
+static device_t
+ofw_spibus_add_child(device_t dev, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct ofw_spibus_devinfo *devi;
+
+ child = device_add_child_ordered(dev, order, name, unit);
+ if (child == NULL)
+ return (child);
+ devi = malloc(sizeof(struct ofw_spibus_devinfo), M_DEVBUF,
+ M_NOWAIT | M_ZERO);
+ if (devi == NULL) {
+ device_delete_child(dev, child);
+ return (0);
+ }
+
+ /*
+ * NULL all the OFW-related parts of the ivars for non-OFW
+ * children.
+ */
+ devi->opd_obdinfo.obd_node = -1;
+ devi->opd_obdinfo.obd_name = NULL;
+ devi->opd_obdinfo.obd_compat = NULL;
+ devi->opd_obdinfo.obd_type = NULL;
+ devi->opd_obdinfo.obd_model = NULL;
+
+ device_set_ivars(child, devi);
+
+ return (child);
+}
+
+static const struct ofw_bus_devinfo *
+ofw_spibus_get_devinfo(device_t bus, device_t dev)
+{
+ struct ofw_spibus_devinfo *dinfo;
+
+ dinfo = device_get_ivars(dev);
+ return (&dinfo->opd_obdinfo);
+}
+
+static device_method_t ofw_spibus_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, ofw_spibus_probe),
+ DEVMETHOD(device_attach, ofw_spibus_attach),
+
+ /* Bus interface */
+ DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str),
+ DEVMETHOD(bus_add_child, ofw_spibus_add_child),
+
+ /* ofw_bus interface */
+ DEVMETHOD(ofw_bus_get_devinfo, ofw_spibus_get_devinfo),
+ DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat),
+ DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model),
+ DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name),
+ DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node),
+ DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type),
+
+ DEVMETHOD_END
+};
+
+static devclass_t ofwspibus_devclass;
+
+DEFINE_CLASS_1(spibus, ofw_spibus_driver, ofw_spibus_methods,
+ sizeof(struct spibus_softc), spibus_driver);
+DRIVER_MODULE(ofw_spibus, spi, ofw_spibus_driver, ofwspibus_devclass, 0, 0);
+MODULE_VERSION(ofw_spibus, 1);
+MODULE_DEPEND(ofw_spibus, spibus, 1, 1, 1);
Property changes on: trunk/sys/dev/spibus/ofw_spibus.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/sys/dev/spibus/spi.h
===================================================================
--- trunk/sys/dev/spibus/spi.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/spibus/spi.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,4 +1,5 @@
/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/dev/spibus/spi.h 239626 2012-08-23 22:38:37Z imp $ */
struct spi_command {
void *tx_cmd;
@@ -10,3 +11,5 @@
void *rx_data;
uint32_t rx_data_sz;
};
+
+#define SPI_CHIP_SELECT_HIGH 0x1 /* Chip select high (else low) */
Modified: trunk/sys/dev/spibus/spibus.c
===================================================================
--- trunk/sys/dev/spibus/spibus.c 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/spibus/spibus.c 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,5 +1,6 @@
+/* $MidnightBSD$ */
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/spibus/spibus.c 260489 2014-01-09 18:28:58Z loos $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -23,7 +24,7 @@
spibus_probe(device_t dev)
{
device_set_desc(dev, "spibus bus");
- return (0);
+ return (BUS_PROBE_GENERIC);
}
static int
@@ -185,7 +186,7 @@
DEVMETHOD_END
};
-static driver_t spibus_driver = {
+driver_t spibus_driver = {
"spibus",
spibus_methods,
sizeof(struct spibus_softc)
Modified: trunk/sys/dev/spibus/spibus_if.m
===================================================================
--- trunk/sys/dev/spibus/spibus_if.m 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/spibus/spibus_if.m 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
#-
# Copyright (c) 2006 M. Warner Losh
# All rights reserved.
@@ -23,7 +24,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $MidnightBSD$
+# $FreeBSD: stable/10/sys/dev/spibus/spibus_if.m 160370 2006-07-14 22:47:07Z imp $
#
#include <sys/bus.h>
Property changes on: trunk/sys/dev/spibus/spibus_if.m
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/dev/spibus/spibusvar.h
===================================================================
--- trunk/sys/dev/spibus/spibusvar.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/spibus/spibusvar.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,4 +1,5 @@
/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/dev/spibus/spibusvar.h 260489 2014-01-09 18:28:58Z loos $ */
#define SPIBUS_IVAR(d) (struct spibus_ivar *) device_get_ivars(d)
#define SPIBUS_SOFTC(d) (struct spibus_softc *) device_get_softc(d)
@@ -18,7 +19,7 @@
};
#define SPIBUS_ACCESSOR(A, B, T) \
-__inline static int \
+static inline int \
spibus_get_ ## A(device_t dev, T *t) \
{ \
return BUS_READ_IVAR(device_get_parent(dev), dev, \
@@ -26,3 +27,6 @@
}
SPIBUS_ACCESSOR(cs, CS, uint32_t)
+
+extern driver_t spibus_driver;
+extern devclass_t spibus_devclass;
Modified: trunk/sys/dev/ste/if_ste.c
===================================================================
--- trunk/sys/dev/ste/if_ste.c 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/ste/if_ste.c 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul at ctr.columbia.edu>. All rights reserved.
@@ -31,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/ste/if_ste.c 243857 2012-12-04 09:32:43Z glebius $");
#ifdef HAVE_KERNEL_OPTION_HEADERS
#include "opt_device_polling.h"
Modified: trunk/sys/dev/ste/if_stereg.h
===================================================================
--- trunk/sys/dev/ste/if_stereg.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/ste/if_stereg.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul at ctr.columbia.edu>. All rights reserved.
@@ -29,7 +30,7 @@
* 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/ste/if_stereg.h 226995 2011-11-01 16:13:59Z marius $
*/
/*
Modified: trunk/sys/dev/stge/if_stge.c
===================================================================
--- trunk/sys/dev/stge/if_stge.c 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/stge/if_stge.c 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/* $NetBSD: if_stge.c,v 1.32 2005/12/11 12:22:49 christos Exp $ */
/*-
@@ -35,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/stge/if_stge.c 312362 2017-01-18 02:16:17Z yongari $");
#ifdef HAVE_KERNEL_OPTION_HEADERS
#include "opt_device_polling.h"
@@ -507,7 +508,7 @@
}
}
- if ((error = stge_dma_alloc(sc) != 0))
+ if ((error = stge_dma_alloc(sc)) != 0)
goto fail;
/*
@@ -573,7 +574,6 @@
ifp->if_ioctl = stge_ioctl;
ifp->if_start = stge_start;
ifp->if_init = stge_init;
- ifp->if_mtu = ETHERMTU;
ifp->if_snd.ifq_drv_maxlen = STGE_TX_RING_CNT - 1;
IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
IFQ_SET_READY(&ifp->if_snd);
Modified: trunk/sys/dev/stge/if_stgereg.h
===================================================================
--- trunk/sys/dev/stge/if_stgereg.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/stge/if_stgereg.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/* $NetBSD: if_stgereg.h,v 1.3 2003/02/10 21:10:07 christos Exp $ */
/*-
@@ -29,7 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/dev/stge/if_stgereg.h 226995 2011-11-01 16:13:59Z marius $ */
/*
* Sundance Technology PCI vendor ID
Modified: trunk/sys/dev/streams/streams.c
===================================================================
--- trunk/sys/dev/streams/streams.c 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/streams/streams.c 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
@@ -33,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/streams/streams.c 321020 2017-07-15 17:25:40Z dchagin $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -98,6 +99,7 @@
.fo_close = svr4_soo_close,
.fo_chmod = invfo_chmod,
.fo_chown = invfo_chown,
+ .fo_sendfile = invfo_sendfile,
};
static struct cdevsw streams_cdevsw = {
@@ -175,6 +177,7 @@
};
DECLARE_MODULE(streams, streams_mod, SI_SUB_DRIVERS, SI_ORDER_ANY);
MODULE_VERSION(streams, 1);
+MODULE_DEPEND(streams, svr4elf, 1, 1, 1);
/*
* We only need open() and close() routines. open() calls socreate()
@@ -186,7 +189,6 @@
static int
streamsopen(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
- struct filedesc *fdp;
struct svr4_strm *st;
struct socket *so;
struct file *fp;
@@ -242,7 +244,6 @@
return EOPNOTSUPP;
}
- fdp = td->td_proc->p_fd;
if ((error = falloc(td, &fp, &fd, 0)) != 0)
return error;
/* An extra reference on `fp' has been held for us by falloc(). */
@@ -249,7 +250,7 @@
error = socreate(family, &so, type, protocol, td->td_ucred, td);
if (error) {
- fdclose(fdp, fp, fd, td);
+ fdclose(td, fp, fd);
fdrop(fp, td);
return error;
}
@@ -328,19 +329,6 @@
}
-struct svr4_strm *
-svr4_stream_get(fp)
- struct file *fp;
-{
- struct socket *so;
-
- if (fp == NULL || fp->f_type != DTYPE_SOCKET)
- return NULL;
-
- so = fp->f_data;
- return so->so_emuldata;
-}
-
static int
svr4_soo_close(struct file *fp, struct thread *td)
{
Modified: trunk/sys/dev/sym/README.sym
===================================================================
--- trunk/sys/dev/sym/README.sym 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/sym/README.sym 2018-05-27 22:56:58 UTC (rev 10059)
@@ -54,7 +54,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/dev/sym/README.sym 220944 2011-04-22 09:52:28Z marius $
*/
README.sym
Property changes on: trunk/sys/dev/sym/README.sym
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/dev/sym/sym_conf.h
===================================================================
--- trunk/sys/dev/sym/sym_conf.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/sym/sym_conf.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/dev/sym/sym_conf.h,v 1.2 2008/12/02 22:43:11 laffer1 Exp $ */
+/* $MidnightBSD$ */
/*-
* Device driver optimized for the Symbios/LSI 53C896/53C895A/53C1010
* PCI-SCSI controllers.
@@ -56,7 +56,7 @@
* SUCH DAMAGE.
*/
-/* $FreeBSD$ */
+/* $FreeBSD: stable/10/sys/dev/sym/sym_conf.h 237101 2012-06-14 20:49:22Z marius $ */
#ifndef SYM_CONF_H
#define SYM_CONF_H
Modified: trunk/sys/dev/sym/sym_defs.h
===================================================================
--- trunk/sys/dev/sym/sym_defs.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/sym/sym_defs.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/dev/sym/sym_defs.h,v 1.2 2008/12/02 22:43:11 laffer1 Exp $ */
+/* $MidnightBSD$ */
/*-
* Device driver optimized for the Symbios/LSI 53C896/53C895A/53C1010
* PCI-SCSI controllers.
@@ -56,7 +56,7 @@
* SUCH DAMAGE.
*/
-/* $FreeBSD$ */
+/* $FreeBSD: stable/10/sys/dev/sym/sym_defs.h 179029 2008-05-15 20:27:18Z marius $ */
#ifndef SYM_DEFS_H
#define SYM_DEFS_H
Modified: trunk/sys/dev/sym/sym_fw.h
===================================================================
--- trunk/sys/dev/sym/sym_fw.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/sym/sym_fw.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/dev/sym/sym_fw.h,v 1.2 2008/12/02 22:43:11 laffer1 Exp $ */
+/* $MidnightBSD$ */
/*-
* Device driver optimized for the Symbios/LSI 53C896/53C895A/53C1010
* PCI-SCSI controllers.
@@ -56,7 +56,7 @@
* SUCH DAMAGE.
*/
-/* $FreeBSD$ */
+/* $FreeBSD: stable/10/sys/dev/sym/sym_fw.h 179029 2008-05-15 20:27:18Z marius $ */
#ifndef SYM_FW_H
#define SYM_FW_H
Modified: trunk/sys/dev/sym/sym_fw1.h
===================================================================
--- trunk/sys/dev/sym/sym_fw1.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/sym/sym_fw1.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/dev/sym/sym_fw1.h,v 1.2 2008/12/02 22:43:11 laffer1 Exp $ */
+/* $MidnightBSD$ */
/*-
* Device driver optimized for the Symbios/LSI 53C896/53C895A/53C1010
* PCI-SCSI controllers.
@@ -56,7 +56,7 @@
* SUCH DAMAGE.
*/
-/* $FreeBSD$ */
+/* $FreeBSD: stable/10/sys/dev/sym/sym_fw1.h 220950 2011-04-22 12:46:39Z marius $ */
/*
* Scripts for SYMBIOS-Processor
Modified: trunk/sys/dev/sym/sym_fw2.h
===================================================================
--- trunk/sys/dev/sym/sym_fw2.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/sym/sym_fw2.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/dev/sym/sym_fw2.h,v 1.2 2008/12/02 22:43:11 laffer1 Exp $ */
+/* $MidnightBSD$ */
/*-
* Device driver optimized for the Symbios/LSI 53C896/53C895A/53C1010
* PCI-SCSI controllers.
@@ -56,7 +56,7 @@
* SUCH DAMAGE.
*/
-/* $FreeBSD$ */
+/* $FreeBSD: stable/10/sys/dev/sym/sym_fw2.h 220950 2011-04-22 12:46:39Z marius $ */
/*
* Scripts for SYMBIOS-Processor
Modified: trunk/sys/dev/sym/sym_hipd.c
===================================================================
--- trunk/sys/dev/sym/sym_hipd.c 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/sym/sym_hipd.c 2018-05-27 22:56:58 UTC (rev 10059)
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/sym/sym_hipd.c 315813 2017-03-23 06:41:13Z mav $");
#define SYM_DRIVER_NAME "sym-1.6.5-20000902"
@@ -87,6 +87,7 @@
#include <machine/bus.h>
#include <machine/resource.h>
+#include <machine/atomic.h>
#ifdef __sparc64__
#include <dev/ofw/openfirm.h>
@@ -130,8 +131,14 @@
*/
#if defined __i386__ || defined __amd64__
#define MEMORY_BARRIER() do { ; } while(0)
+#elif defined __powerpc__
+#define MEMORY_BARRIER() __asm__ volatile("eieio; sync" : : : "memory")
+#elif defined __ia64__
+#define MEMORY_BARRIER() __asm__ volatile("mf.a; mf" : : : "memory")
#elif defined __sparc64__
#define MEMORY_BARRIER() __asm__ volatile("membar #Sync" : : : "memory")
+#elif defined __arm__
+#define MEMORY_BARRIER() dmb()
#else
#error "Not supported platform"
#endif
@@ -148,16 +155,6 @@
(ptr)->flink = (ptr); (ptr)->blink = (ptr); \
} while (0)
-static __inline struct sym_quehead *sym_que_first(struct sym_quehead *head)
-{
- return (head->flink == head) ? NULL : head->flink;
-}
-
-static __inline struct sym_quehead *sym_que_last(struct sym_quehead *head)
-{
- return (head->blink == head) ? NULL : head->blink;
-}
-
static __inline void __sym_que_add(struct sym_quehead * new,
struct sym_quehead * blink,
struct sym_quehead * flink)
@@ -219,17 +216,6 @@
#define sym_insque_tail(new, head) __sym_que_add(new, (head)->blink, head)
-static __inline struct sym_quehead *sym_remque_tail(struct sym_quehead *head)
-{
- struct sym_quehead *elem = head->blink;
-
- if (elem != head)
- __sym_que_del(elem->blink, head);
- else
- elem = NULL;
- return elem;
-}
-
/*
* This one may be useful.
*/
@@ -2350,8 +2336,8 @@
assert(!(ccb->ccb_h.status & CAM_SIM_QUEUED));
ccb->ccb_h.status = CAM_REQ_INPROG;
- callout_reset(&cp->ch, ccb->ccb_h.timeout * hz / 1000, sym_callout,
- (caddr_t) ccb);
+ callout_reset_sbt(&cp->ch, SBT_1MS * ccb->ccb_h.timeout, 0, sym_callout,
+ (caddr_t)ccb, 0);
ccb->ccb_h.status |= CAM_SIM_QUEUED;
ccb->ccb_h.sym_hcb_ptr = np;
@@ -3427,7 +3413,6 @@
/*
* Check against our hardware limits, or bugs :).
*/
- if (fak < 0) {fak = 0; ret = -1;}
if (fak > 2) {fak = 2; ret = -1;}
/*
@@ -7858,51 +7843,14 @@
return;
}
- if (!(ccb_h->flags & CAM_SCATTER_VALID)) {
- /* Single buffer */
- if (!(ccb_h->flags & CAM_DATA_PHYS)) {
- /* Buffer is virtual */
- cp->dmamapped = (dir == CAM_DIR_IN) ?
- SYM_DMA_READ : SYM_DMA_WRITE;
- retv = bus_dmamap_load(np->data_dmat, cp->dmamap,
- csio->data_ptr, csio->dxfer_len,
- sym_execute_ccb, cp, 0);
- if (retv == EINPROGRESS) {
- cp->host_status = HS_WAIT;
- xpt_freeze_simq(np->sim, 1);
- csio->ccb_h.status |= CAM_RELEASE_SIMQ;
- }
- } else {
- /* Buffer is physical */
- struct bus_dma_segment seg;
-
- seg.ds_addr = (bus_addr_t) csio->data_ptr;
- sym_execute_ccb(cp, &seg, 1, 0);
- }
- } else {
- /* Scatter/gather list */
- struct bus_dma_segment *segs;
-
- if ((ccb_h->flags & CAM_SG_LIST_PHYS) != 0) {
- /* The SG list pointer is physical */
- sym_set_cam_status(cp->cam_ccb, CAM_REQ_INVALID);
- goto out_abort;
- }
-
- if (!(ccb_h->flags & CAM_DATA_PHYS)) {
- /* SG buffer pointers are virtual */
- sym_set_cam_status(cp->cam_ccb, CAM_REQ_INVALID);
- goto out_abort;
- }
-
- /* SG buffer pointers are physical */
- segs = (struct bus_dma_segment *)csio->data_ptr;
- sym_execute_ccb(cp, segs, csio->sglist_cnt, 0);
+ cp->dmamapped = (dir == CAM_DIR_IN) ? SYM_DMA_READ : SYM_DMA_WRITE;
+ retv = bus_dmamap_load_ccb(np->data_dmat, cp->dmamap,
+ (union ccb *)csio, sym_execute_ccb, cp, 0);
+ if (retv == EINPROGRESS) {
+ cp->host_status = HS_WAIT;
+ xpt_freeze_simq(np->sim, 1);
+ csio->ccb_h.status |= CAM_RELEASE_SIMQ;
}
- return;
-out_abort:
- sym_xpt_done(np, (union ccb *) csio, cp);
- sym_free_ccb(np, cp);
}
/*
@@ -8088,7 +8036,7 @@
if ((np->features & FE_WIDE) != 0)
cpi->hba_inquiry |= PI_WIDE_16;
cpi->target_sprt = 0;
- cpi->hba_misc = 0;
+ cpi->hba_misc = PIM_UNMAPPED;
if (np->usrflags & SYM_SCAN_TARGETS_HILO)
cpi->hba_misc |= PIM_SCANHILO;
if (np->usrflags & SYM_AVOID_BUS_RESET)
@@ -8102,9 +8050,9 @@
cpi->bus_id = cam_sim_bus(sim);
cpi->initiator_id = np->myaddr;
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Symbios", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Symbios", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->protocol = PROTO_SCSI;
@@ -8560,11 +8508,9 @@
/*
* Alloc/get/map/retrieve everything that deals with MMIO.
*/
- if ((command & PCIM_CMD_MEMEN) != 0) {
- int regs_id = SYM_PCI_MMIO;
- np->mmio_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
- ®s_id, RF_ACTIVE);
- }
+ i = SYM_PCI_MMIO;
+ np->mmio_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &i,
+ RF_ACTIVE);
if (!np->mmio_res) {
device_printf(dev, "failed to allocate MMIO resources\n");
goto attach_failed;
@@ -8587,11 +8533,8 @@
* User want us to use normal IO with PCI.
* Alloc/get/map/retrieve everything that deals with IO.
*/
- if ((command & PCI_COMMAND_IO_ENABLE) != 0) {
- int regs_id = SYM_PCI_IO;
- np->io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- ®s_id, RF_ACTIVE);
- }
+ i = SYM_PCI_IO;
+ np->io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &i, RF_ACTIVE);
if (!np->io_res) {
device_printf(dev, "failed to allocate IO resources\n");
goto attach_failed;
@@ -8603,8 +8546,7 @@
* If the chip has RAM.
* Alloc/get/map/retrieve the corresponding resources.
*/
- if ((np->features & (FE_RAM|FE_RAM8K)) &&
- (command & PCIM_CMD_MEMEN) != 0) {
+ if (np->features & (FE_RAM|FE_RAM8K)) {
int regs_id = SYM_PCI_RAM;
if (np->features & FE_64BIT)
regs_id = SYM_PCI_RAM64;
@@ -8953,6 +8895,7 @@
if (xpt_bus_register(sim, np->device, 0) != CAM_SUCCESS)
goto fail;
np->sim = sim;
+ sim = NULL;
if (xpt_create_path(&path, NULL,
cam_sim_path(np->sim), CAM_TARGET_WILDCARD,
@@ -8964,7 +8907,7 @@
/*
* Establish our async notification handler.
*/
- if (xpt_register_async(AC_LOST_DEVICE, sym_async, sim, path) !=
+ if (xpt_register_async(AC_LOST_DEVICE, sym_async, np->sim, path) !=
CAM_REQ_CMP)
goto fail;
Modified: trunk/sys/dev/tl/if_tl.c
===================================================================
--- trunk/sys/dev/tl/if_tl.c 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/tl/if_tl.c 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1997, 1998
* Bill Paul <wpaul at ctr.columbia.edu>. All rights reserved.
@@ -31,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/tl/if_tl.c 243857 2012-12-04 09:32:43Z glebius $");
/*
* Texas Instruments ThunderLAN driver for FreeBSD 2.2.6 and 3.x.
@@ -1175,7 +1176,6 @@
ifp->if_ioctl = tl_ioctl;
ifp->if_start = tl_start;
ifp->if_init = tl_init;
- ifp->if_mtu = ETHERMTU;
ifp->if_snd.ifq_maxlen = TL_TX_LIST_CNT - 1;
ifp->if_capabilities |= IFCAP_VLAN_MTU;
ifp->if_capenable |= IFCAP_VLAN_MTU;
Modified: trunk/sys/dev/tl/if_tlreg.h
===================================================================
--- trunk/sys/dev/tl/if_tlreg.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/tl/if_tlreg.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1997, 1998
* Bill Paul <wpaul at ctr.columbia.edu>. All rights reserved.
@@ -29,7 +30,7 @@
* 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/tl/if_tlreg.h 226995 2011-11-01 16:13:59Z marius $
*/
struct tl_type {
Modified: trunk/sys/dev/twe/twe.c
===================================================================
--- trunk/sys/dev/twe/twe.c 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/twe/twe.c 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2000 Michael Smith
* Copyright (c) 2003 Paul Saab
@@ -26,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/dev/twe/twe.c 281826 2015-04-21 11:27:50Z mav $
*/
/*
@@ -985,7 +986,7 @@
if (usetmp && (tr->tr_data != NULL)) {
tr->tr_flags |= TWE_CMD_IMMEDIATE;
- if (tr->tr_length > MAXBSIZE)
+ if (tr->tr_length > DFLTPHYS)
return (EINVAL);
bcopy(tr->tr_data, sc->twe_immediate, tr->tr_length);
}
Modified: trunk/sys/dev/twe/twe_compat.h
===================================================================
--- trunk/sys/dev/twe/twe_compat.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/twe/twe_compat.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2000 Michael Smith
* Copyright (c) 2003 Paul Saab
@@ -26,13 +27,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/dev/twe/twe_compat.h 240209 2012-09-07 18:41:19Z jhb $
*/
/*
* Portability and compatibility interfaces.
*/
-#if defined(__MidnightBSD__) || defined(__FreeBSD__)
+#ifdef __FreeBSD__
/******************************************************************************
* FreeBSD
*/
Modified: trunk/sys/dev/twe/twe_freebsd.c
===================================================================
--- trunk/sys/dev/twe/twe_freebsd.c 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/twe/twe_freebsd.c 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2000 Michael Smith
* Copyright (c) 2003 Paul Saab
@@ -28,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/twe/twe_freebsd.c 281826 2015-04-21 11:27:50Z mav $");
/*
* FreeBSD-specific code.
@@ -233,7 +234,8 @@
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
- MAXBSIZE, TWE_MAX_SGL_LENGTH, /* maxsize, nsegments */
+ BUS_SPACE_MAXSIZE_32BIT, /* maxsize */
+ BUS_SPACE_UNRESTRICTED, /* nsegments */
BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
0, /* flags */
NULL, /* lockfunc */
@@ -301,7 +303,8 @@
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
- MAXBSIZE, TWE_MAX_SGL_LENGTH,/* maxsize, nsegments */
+ (TWE_MAX_SGL_LENGTH - 1) * PAGE_SIZE,/* maxsize */
+ TWE_MAX_SGL_LENGTH, /* nsegments */
BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
BUS_DMA_ALLOCNOW, /* flags */
busdma_lock_mutex, /* lockfunc */
@@ -320,7 +323,7 @@
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
- MAXBSIZE, 1, /* maxsize, nsegments */
+ DFLTPHYS, 1, /* maxsize, nsegments */
BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
0, /* flags */
NULL, /* lockfunc */
Modified: trunk/sys/dev/twe/twe_tables.h
===================================================================
--- trunk/sys/dev/twe/twe_tables.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/twe/twe_tables.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2000 Michael Smith
* Copyright (c) 2003 Paul Saab
@@ -26,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/dev/twe/twe_tables.h 123103 2003-12-02 07:57:20Z ps $
*/
/*
Modified: trunk/sys/dev/twe/tweio.h
===================================================================
--- trunk/sys/dev/twe/tweio.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/twe/tweio.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2000 Michael Smith
* Copyright (c) 2003 Paul Saab
@@ -26,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/dev/twe/tweio.h 142025 2005-02-17 19:05:42Z vkashyap $
*/
Modified: trunk/sys/dev/twe/twereg.h
===================================================================
--- trunk/sys/dev/twe/twereg.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/twe/twereg.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2000 Michael Smith
* Copyright (c) 2003 Paul Saab
@@ -26,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/dev/twe/twereg.h 129144 2004-05-12 04:10:37Z vkashyap $
*/
/*
Modified: trunk/sys/dev/twe/twevar.h
===================================================================
--- trunk/sys/dev/twe/twevar.h 2018-05-27 22:54:44 UTC (rev 10058)
+++ trunk/sys/dev/twe/twevar.h 2018-05-27 22:56:58 UTC (rev 10059)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2000 Michael Smith
* Copyright (c) 2000 BSDi
@@ -24,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/dev/twe/twevar.h 240209 2012-09-07 18:41:19Z jhb $
*/
#define TWE_DRIVER_VERSION_STRING "1.50.01.002"
More information about the Midnightbsd-cvs
mailing list