PERFORCE change 37462 for review
Sam Leffler
sam at FreeBSD.org
Wed Sep 3 16:22:31 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=37462
Change 37462 by sam at sam_ebb on 2003/09/03 16:21:56
IFC
Affected files ...
.. //depot/projects/netperf/sys/amd64/conf/GENERIC#2 integrate
.. //depot/projects/netperf/sys/boot/i386/pxeldr/Makefile#2 integrate
.. //depot/projects/netperf/sys/boot/i386/pxeldr/pxeldr.s#2 integrate
.. //depot/projects/netperf/sys/cam/scsi/scsi_cd.c#3 integrate
.. //depot/projects/netperf/sys/cam/scsi/scsi_da.c#9 integrate
.. //depot/projects/netperf/sys/dev/pci/pci.c#5 integrate
.. //depot/projects/netperf/sys/dev/sound/pci/ich.c#5 integrate
.. //depot/projects/netperf/sys/dev/usb/ohci_pci.c#4 integrate
.. //depot/projects/netperf/sys/i386/i386/elan-mmcr.c#3 integrate
.. //depot/projects/netperf/sys/kern/kern_tc.c#4 integrate
.. //depot/projects/netperf/sys/kern/subr_taskqueue.c#3 integrate
.. //depot/projects/netperf/sys/pci/if_sis.c#9 integrate
.. //depot/projects/netperf/sys/pci/if_sisreg.h#3 integrate
.. //depot/projects/netperf/sys/sys/taskqueue.h#3 integrate
.. //depot/projects/netperf/sys/ufs/ffs/ffs_softdep.c#3 integrate
Differences ...
==== //depot/projects/netperf/sys/amd64/conf/GENERIC#2 (text+ko) ====
@@ -16,7 +16,7 @@
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.390 2003/06/27 23:11:22 peter Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.391 2003/09/03 01:24:47 obrien Exp $
machine amd64
cpu HAMMER
@@ -76,6 +76,7 @@
# ATA and ATAPI devices
device ata
device atadisk # ATA disk drives
+device ataraid # ATA RAID drives
device atapicd # ATAPI CDROM drives
device atapifd # ATAPI floppy drives
device atapist # ATAPI tape drives
==== //depot/projects/netperf/sys/boot/i386/pxeldr/Makefile#2 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/i386/pxeldr/Makefile,v 1.8 2002/09/17 01:48:56 peter Exp $
+# $FreeBSD: src/sys/boot/i386/pxeldr/Makefile,v 1.9 2003/09/03 08:12:20 phk Exp $
MAINTAINER=jhb at FreeBSD.org
@@ -17,6 +17,11 @@
M4FLAGS+= -DPROBE_KEYBOARD
.endif
+.if defined(BOOT_PXELDR_ALWAYS_SERIAL)
+M4FLAGS+= -DALWAYS_SERIAL
+.endif
+
+
.if exists(${.OBJDIR}/../loader)
LOADERBIN= ${.OBJDIR}/../loader/loader.bin
.else
==== //depot/projects/netperf/sys/boot/i386/pxeldr/pxeldr.s#2 (text+ko) ====
@@ -13,7 +13,7 @@
# purpose.
#
-# $FreeBSD: src/sys/boot/i386/pxeldr/pxeldr.s,v 1.8 2001/08/09 20:47:58 mp Exp $
+# $FreeBSD: src/sys/boot/i386/pxeldr/pxeldr.s,v 1.9 2003/09/03 08:12:20 phk Exp $
#
# This simple program is a preloader for the normal boot3 loader. It is simply
@@ -110,6 +110,11 @@
orb $KARGS_FLAGS_PXE, 0x8(%bx) # kargs->bootflags |=
# KARGS_FLAGS_PXE
popl 0xc(%bx) # kargs->pxeinfo = *PXENV+
+ifdef(`ALWAYS_SERIAL',`
+#
+# set the RBX_SERIAL bit in the howto byte.
+ orl $RB_SERIAL, (%bx) # enable serial console
+')
ifdef(`PROBE_KEYBOARD',`
#
# Look at the BIOS data area to see if we have an enhanced keyboard. If not,
==== //depot/projects/netperf/sys/cam/scsi/scsi_cd.c#3 (text+ko) ====
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.80 2003/07/28 06:15:58 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.81 2003/09/03 04:46:28 ken Exp $");
#include "opt_cd.h"
@@ -62,6 +62,7 @@
#include <sys/dvdio.h>
#include <sys/devicestat.h>
#include <sys/sysctl.h>
+#include <sys/taskqueue.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
@@ -154,6 +155,7 @@
eventhandler_tag clonetag;
int minimum_command_size;
int outstanding_cmds;
+ struct task sysctl_task;
struct sysctl_ctx_list sysctl_ctx;
struct sysctl_oid *sysctl_tree;
STAILQ_HEAD(, cd_mode_params) mode_queue;
@@ -598,6 +600,43 @@
}
}
+static void
+cdsysctlinit(void *context, int pending)
+{
+ struct cam_periph *periph;
+ struct cd_softc *softc;
+ char tmpstr[80], tmpstr2[80];
+
+ periph = (struct cam_periph *)context;
+ softc = (struct cd_softc *)periph->softc;
+
+ snprintf(tmpstr, sizeof(tmpstr), "CAM CD unit %d", periph->unit_number);
+ snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number);
+
+ mtx_lock(&Giant);
+
+ sysctl_ctx_init(&softc->sysctl_ctx);
+ softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
+ SYSCTL_STATIC_CHILDREN(_kern_cam_cd), OID_AUTO,
+ tmpstr2, CTLFLAG_RD, 0, tmpstr);
+
+ if (softc->sysctl_tree == NULL) {
+ printf("cdsysctlinit: unable to allocate sysctl tree\n");
+ return;
+ }
+
+ /*
+ * Now register the sysctl handler, so the user can the value on
+ * the fly.
+ */
+ SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree),
+ OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW,
+ &softc->minimum_command_size, 0, cdcmdsizesysctl, "I",
+ "Minimum CDB size");
+
+ mtx_unlock(&Giant);
+}
+
/*
* We have a handler function for this so we can check the values when the
* user sets them, instead of every time we look at them.
@@ -642,7 +681,7 @@
struct ccb_setasync csa;
struct ccb_pathinq cpi;
struct ccb_getdev *cgd;
- char tmpstr[80], tmpstr2[80];
+ char tmpstr[80];
caddr_t match;
cgd = (struct ccb_getdev *)arg;
@@ -696,17 +735,7 @@
if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_misc & PIM_NO_6_BYTE))
softc->quirks |= CD_Q_10_BYTE_ONLY;
- snprintf(tmpstr, sizeof(tmpstr), "CAM CD unit %d", periph->unit_number);
- snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number);
- sysctl_ctx_init(&softc->sysctl_ctx);
- softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
- SYSCTL_STATIC_CHILDREN(_kern_cam_cd), OID_AUTO,
- tmpstr2, CTLFLAG_RD, 0, tmpstr);
- if (softc->sysctl_tree == NULL) {
- printf("cdregister: unable to allocate sysctl tree\n");
- free(softc, M_DEVBUF);
- return (CAM_REQ_CMP_ERR);
- }
+ TASK_INIT(&softc->sysctl_task, 0, cdsysctlinit, periph);
/* The default is 6 byte commands, unless quirked otherwise */
if (softc->quirks & CD_Q_10_BYTE_ONLY)
@@ -728,15 +757,6 @@
softc->minimum_command_size = 10;
/*
- * Now register the sysctl handler, so the user can the value on
- * the fly.
- */
- SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree),
- OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW,
- &softc->minimum_command_size, 0, cdcmdsizesysctl, "I",
- "Minimum CDB size");
-
- /*
* We need to register the statistics structure for this device,
* but we don't have the blocksize yet for it. So, we register
* the structure and indicate that we don't have the blocksize
@@ -1847,6 +1867,11 @@
xpt_announce_periph(periph, announce_buf);
if (softc->flags & CD_FLAG_CHANGER)
cdchangerschedule(softc);
+ /*
+ * Create our sysctl variables, now that we know
+ * we have successfully attached.
+ */
+ taskqueue_enqueue(taskqueue_thread,&softc->sysctl_task);
}
softc->state = CD_STATE_NORMAL;
/*
==== //depot/projects/netperf/sys/cam/scsi/scsi_da.c#9 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.156 2003/08/25 18:48:45 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.158 2003/09/03 12:31:03 ken Exp $");
#ifdef _KERNEL
#include "opt_da.h"
@@ -41,6 +41,7 @@
#include <sys/kernel.h>
#include <sys/bio.h>
#include <sys/sysctl.h>
+#include <sys/taskqueue.h>
#endif /* _KERNEL */
#include <sys/devicestat.h>
@@ -133,6 +134,7 @@
struct disk_params params;
struct disk disk;
union ccb saved_ccb;
+ struct task sysctl_task;
struct sysctl_ctx_list sysctl_ctx;
struct sysctl_oid *sysctl_tree;
};
@@ -388,6 +390,7 @@
static periph_init_t dainit;
static void daasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg);
+static void dasysctlinit(void *context, int pending);
static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS);
static periph_ctor_t daregister;
static periph_dtor_t dacleanup;
@@ -915,6 +918,41 @@
}
}
+static void
+dasysctlinit(void *context, int pending)
+{
+ struct cam_periph *periph;
+ struct da_softc *softc;
+ char tmpstr[80], tmpstr2[80];
+
+ periph = (struct cam_periph *)context;
+ softc = (struct da_softc *)periph->softc;
+
+ snprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number);
+ snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number);
+
+ mtx_lock(&Giant);
+ sysctl_ctx_init(&softc->sysctl_ctx);
+ softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
+ SYSCTL_STATIC_CHILDREN(_kern_cam_da), OID_AUTO, tmpstr2,
+ CTLFLAG_RD, 0, tmpstr);
+ if (softc->sysctl_tree == NULL) {
+ printf("dasysctlinit: unable to allocate sysctl tree\n");
+ return;
+ }
+
+ /*
+ * Now register the sysctl handler, so the user can the value on
+ * the fly.
+ */
+ SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree),
+ OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW,
+ &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I",
+ "Minimum CDB size");
+
+ mtx_unlock(&Giant);
+}
+
static int
dacmdsizesysctl(SYSCTL_HANDLER_ARGS)
{
@@ -955,7 +993,7 @@
struct ccb_setasync csa;
struct ccb_pathinq cpi;
struct ccb_getdev *cgd;
- char tmpstr[80], tmpstr2[80];
+ char tmpstr[80];
caddr_t match;
cgd = (struct ccb_getdev *)arg;
@@ -1008,17 +1046,7 @@
if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_misc & PIM_NO_6_BYTE))
softc->quirks |= DA_Q_NO_6_BYTE;
- snprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number);
- snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number);
- sysctl_ctx_init(&softc->sysctl_ctx);
- softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
- SYSCTL_STATIC_CHILDREN(_kern_cam_da), OID_AUTO, tmpstr2,
- CTLFLAG_RD, 0, tmpstr);
- if (softc->sysctl_tree == NULL) {
- printf("daregister: unable to allocate sysctl tree\n");
- free(softc, M_DEVBUF);
- return (CAM_REQ_CMP_ERR);
- }
+ TASK_INIT(&softc->sysctl_task, 0, dasysctlinit, periph);
/*
* RBC devices don't have to support READ(6), only READ(10).
@@ -1050,15 +1078,6 @@
softc->minimum_cmd_size = 16;
/*
- * Now register the sysctl handler, so the user can the value on
- * the fly.
- */
- SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree),
- OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW,
- &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I",
- "Minimum CDB size");
-
- /*
* Block our timeout handler while we
* add this softc to the dev list.
*/
@@ -1539,8 +1558,14 @@
}
}
free(csio->data_ptr, M_TEMP);
- if (announce_buf[0] != '\0')
+ if (announce_buf[0] != '\0') {
xpt_announce_periph(periph, announce_buf);
+ /*
+ * Create our sysctl variables, now that we know
+ * we have successfully attached.
+ */
+ taskqueue_enqueue(taskqueue_thread,&softc->sysctl_task);
+ }
softc->state = DA_STATE_NORMAL;
/*
* Since our peripheral may be invalidated by an error
==== //depot/projects/netperf/sys/dev/pci/pci.c#5 (text+ko) ====
@@ -25,7 +25,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.
*
- * $FreeBSD: src/sys/dev/pci/pci.c,v 1.229 2003/09/02 17:30:37 jhb Exp $
+ * $FreeBSD: src/sys/dev/pci/pci.c,v 1.230 2003/09/03 15:24:31 jhb Exp $
*
*/
@@ -1344,7 +1344,7 @@
break;
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
- if (*rid < PCIR_MAPS + 4*cfg->nummaps) {
+ if (*rid < PCIR_BAR(cfg->nummaps)) {
/*
* Enable the I/O mode. We should
* also be allocating resources
==== //depot/projects/netperf/sys/dev/sound/pci/ich.c#5 (text+ko) ====
@@ -32,7 +32,7 @@
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/ich.c,v 1.35 2003/08/28 19:24:49 obrien Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/ich.c,v 1.36 2003/09/03 07:38:21 obrien Exp $");
/* -------------------------------------------------------------------- */
@@ -648,6 +648,10 @@
device_set_desc(dev, "Nvidia nForce2");
return 0;
+ case 0x00da10de:
+ device_set_desc(dev, "Nvidia nForce3");
+ return 0;
+
case 0x74451022:
device_set_desc(dev, "AMD-768");
return 0;
==== //depot/projects/netperf/sys/dev/usb/ohci_pci.c#4 (text+ko) ====
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/ohci_pci.c,v 1.33 2003/08/24 17:55:55 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/ohci_pci.c,v 1.34 2003/09/03 07:40:17 obrien Exp $");
/*
* USB Open Host Controller driver.
@@ -77,6 +77,7 @@
#define PCI_OHCI_VENDORID_APPLE 0x106b
#define PCI_OHCI_VENDORID_CMDTECH 0x1095
#define PCI_OHCI_VENDORID_NEC 0x1033
+#define PCI_OHCI_VENDORID_NVIDIA 0x12D2
#define PCI_OHCI_VENDORID_OPTI 0x1045
#define PCI_OHCI_VENDORID_SIS 0x1039
@@ -95,6 +96,9 @@
#define PCI_OHCI_DEVICEID_NEC 0x00351033
static const char *ohci_device_nec = "NEC uPD 9210 USB controller";
+#define PCI_OHCI_DEVICEID_NFORCE3 0x00d710de
+static const char *ohci_device_nforce3 = "nVidia nForce3 USB Controller";
+
#define PCI_OHCI_DEVICEID_USB0670 0x06701095
static const char *ohci_device_usb0670 = "CMD Tech 670 (USB0670) USB controller";
@@ -135,6 +139,8 @@
return (ohci_device_firelink);
case PCI_OHCI_DEVICEID_NEC:
return (ohci_device_nec);
+ case PCI_OHCI_DEVICEID_NFORCE3:
+ return (ohci_device_nforce3);
case PCI_OHCI_DEVICEID_SIS5571:
return (ohci_device_sis5571);
case PCI_OHCI_DEVICEID_KEYLARGO:
@@ -219,6 +225,9 @@
case PCI_OHCI_VENDORID_NEC:
sprintf(sc->sc_vendor, "NEC");
break;
+ case PCI_OHCI_VENDORID_NVIDIA:
+ sprintf(sc->sc_vendor, "nVidia");
+ break;
case PCI_OHCI_VENDORID_OPTI:
sprintf(sc->sc_vendor, "OPTi");
break;
==== //depot/projects/netperf/sys/i386/i386/elan-mmcr.c#3 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/elan-mmcr.c,v 1.16 2003/08/25 09:48:46 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/elan-mmcr.c,v 1.17 2003/09/03 08:13:12 phk Exp $");
#include "opt_cpu.h"
#include <sys/param.h>
@@ -101,7 +101,8 @@
NULL,
0xffff,
ELAN_XTAL / 4,
- "ELAN"
+ "ELAN",
+ 1000
};
static int
==== //depot/projects/netperf/sys/kern/kern_tc.c#4 (text+ko) ====
@@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_tc.c,v 1.156 2003/08/20 19:12:46 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_tc.c,v 1.157 2003/09/03 08:14:16 phk Exp $");
#include "opt_ntp.h"
@@ -288,16 +288,20 @@
{
unsigned u;
- if (tc->tc_quality >= 0 || bootverbose)
+ u = tc->tc_frequency / tc->tc_counter_mask;
+ if (u > hz && tc->tc_quality >= 0) {
+ tc->tc_quality = -2000;
+ if (bootverbose) {
+ printf("Timecounter \"%s\" frequency %ju Hz",
+ tc->tc_name, (intmax_t)tc->tc_frequency);
+ printf(" -- Insufficient hz, needs at least %u\n", u);
+ }
+ } else if (tc->tc_quality >= 0 || bootverbose) {
printf("Timecounter \"%s\" frequency %ju Hz quality %d",
tc->tc_name, (intmax_t)tc->tc_frequency,
tc->tc_quality);
+ }
- u = tc->tc_frequency / tc->tc_counter_mask;
- if (u > hz) {
- printf(" -- Insufficient hz, needs at least %u\n", u);
- return;
- }
printf("\n");
tc->tc_next = timecounters;
timecounters = tc;
==== //depot/projects/netperf/sys/kern/subr_taskqueue.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/subr_taskqueue.c,v 1.16 2003/06/11 00:56:57 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/subr_taskqueue.c,v 1.17 2003/09/03 04:46:28 ken Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -36,6 +36,8 @@
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/taskqueue.h>
+#include <sys/kthread.h>
+#include <sys/unistd.h>
static MALLOC_DEFINE(M_TASKQUEUE, "taskqueue", "Task Queues");
@@ -44,6 +46,7 @@
static void *taskqueue_ih;
static void *taskqueue_giant_ih;
static struct mtx taskqueue_queues_mutex;
+static struct proc *taskqueue_thread_proc;
struct taskqueue {
STAILQ_ENTRY(taskqueue) tq_link;
@@ -233,6 +236,31 @@
taskqueue_run(taskqueue_swi_giant);
}
+static void
+taskqueue_kthread(void *arg)
+{
+ struct mtx kthread_mutex;
+
+ bzero(&kthread_mutex, sizeof(kthread_mutex));
+
+ mtx_init(&kthread_mutex, "taskqueue kthread", NULL, MTX_DEF);
+
+ mtx_lock(&kthread_mutex);
+
+ for (;;) {
+ mtx_unlock(&kthread_mutex);
+ taskqueue_run(taskqueue_thread);
+ mtx_lock(&kthread_mutex);
+ msleep(&taskqueue_thread, &kthread_mutex, PWAIT, "tqthr", 0);
+ }
+}
+
+static void
+taskqueue_thread_enqueue(void *context)
+{
+ wakeup(&taskqueue_thread);
+}
+
TASKQUEUE_DEFINE(swi, taskqueue_swi_enqueue, 0,
swi_add(NULL, "task queue", taskqueue_swi_run, NULL, SWI_TQ,
INTR_MPSAFE, &taskqueue_ih));
@@ -241,6 +269,10 @@
swi_add(NULL, "Giant task queue", taskqueue_swi_giant_run,
NULL, SWI_TQ_GIANT, 0, &taskqueue_giant_ih));
+TASKQUEUE_DEFINE(thread, taskqueue_thread_enqueue, 0,
+ kthread_create(taskqueue_kthread, NULL,
+ &taskqueue_thread_proc, RFNOWAIT, 0, "taskqueue"));
+
int
taskqueue_enqueue_fast(struct taskqueue *queue, struct task *task)
{
==== //depot/projects/netperf/sys/pci/if_sis.c#9 (text+ko) ====
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_sis.c,v 1.82 2003/08/22 07:13:21 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_sis.c,v 1.83 2003/09/03 07:40:04 phk Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -107,7 +107,7 @@
static struct sis_type sis_devs[] = {
{ SIS_VENDORID, SIS_DEVICEID_900, "SiS 900 10/100BaseTX" },
{ SIS_VENDORID, SIS_DEVICEID_7016, "SiS 7016 10/100BaseTX" },
- { NS_VENDORID, NS_DEVICEID_DP83815, "NatSemi DP83815 10/100BaseTX" },
+ { NS_VENDORID, NS_DEVICEID_DP83815, "NatSemi DP8381[56] 10/100BaseTX" },
{ 0, 0, NULL }
};
@@ -1052,6 +1052,8 @@
sc = device_get_softc(dev);
unit = device_get_unit(dev);
+ sc->sis_self = dev;
+
mtx_init(&sc->sis_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
MTX_DEF | MTX_RECURSE);
@@ -1131,6 +1133,18 @@
*/
switch (pci_get_vendor(dev)) {
case NS_VENDORID:
+ sc->sis_srr = CSR_READ_4(sc, NS_SRR);
+
+ /* We can't update the device description, so spew */
+ if (sc->sis_srr == NS_SRR_15C)
+ device_printf(dev, "Silicon Revision: DP83815C\n");
+ else if (sc->sis_srr == NS_SRR_15D)
+ device_printf(dev, "Silicon Revision: DP83815D\n");
+ else if (sc->sis_srr == NS_SRR_16A)
+ device_printf(dev, "Silicon Revision: DP83816A\n");
+ else
+ device_printf(dev, "Silicon Revision %x\n", sc->sis_srr);
+
/*
* Reading the MAC address out of the EEPROM on
* the NatSemi chip takes a bit more work than
@@ -2033,6 +2047,16 @@
*/
sis_stop(sc);
+#ifdef notyet
+ if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr >= NS_SRR_16A) {
+ /*
+ * Configure 400usec of interrupt holdoff. This is based
+ * on emperical tests on a Soekris 4801.
+ */
+ CSR_WRITE_4(sc, NS_IHR, 0x100 | 4);
+ }
+#endif
+
mii = device_get_softc(sc->sis_miibus);
/* Set MAC address */
@@ -2148,7 +2172,7 @@
SIS_CLRBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_TXPKTS);
}
- if (sc->sis_type == SIS_TYPE_83815 &&
+ if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr < NS_SRR_16A &&
IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) {
uint32_t reg;
@@ -2165,6 +2189,7 @@
DELAY(100);
reg = CSR_READ_4(sc, NS_PHY_TDATA);
if ((reg & 0x0080) == 0 || (reg & 0xff) >= 0xd8) {
+ device_printf(sc->sis_self, "Applying short cable fix (reg=%x)\n", reg);
CSR_WRITE_4(sc, NS_PHY_TDATA, 0x00e8);
SIS_SETBIT(sc, NS_PHY_DSPCFG, 0x20);
}
==== //depot/projects/netperf/sys/pci/if_sisreg.h#3 (text+ko) ====
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/pci/if_sisreg.h,v 1.22 2003/07/22 01:35:09 cognet Exp $
+ * $FreeBSD: src/sys/pci/if_sisreg.h,v 1.23 2003/09/03 07:40:04 phk Exp $
*/
/*
@@ -74,8 +74,10 @@
#define SIS_TIMEUNIT 0xA4
#define SIS_GPIO 0xB8
-/* NS DP83815 registers */
+/* NS DP83815/6 registers */
+#define NS_IHR 0x1C
#define NS_CLKRUN 0x3C
+#define NS_SRR 0x58
#define NS_BMCR 0x80
#define NS_BMSR 0x84
#define NS_PHYIDR1 0x88
@@ -97,6 +99,11 @@
#define NS_CLKRUN_PMEENB 0x00000100
#define NS_CLNRUN_CLKRUN_ENB 0x00000001
+/* NS silicon revisions */
+#define NS_SRR_15C 0x302
+#define NS_SRR_15D 0x403
+#define NS_SRR_16A 0x505
+
#define SIS_CSR_TX_ENABLE 0x00000001
#define SIS_CSR_TX_DISABLE 0x00000002
#define SIS_CSR_RX_ENABLE 0x00000004
@@ -442,6 +449,7 @@
#define SIS_TYPE_900 1
#define SIS_TYPE_7016 2
#define SIS_TYPE_83815 3
+#define SIS_TYPE_83816 4
struct sis_softc {
struct arpcom arpcom; /* interface info */
@@ -450,11 +458,13 @@
struct resource *sis_res;
struct resource *sis_irq;
void *sis_intrhand;
+ device_t sis_self;
device_t sis_miibus;
u_int8_t sis_unit;
u_int8_t sis_type;
u_int8_t sis_rev;
u_int8_t sis_link;
+ u_int sis_srr;
struct sis_list_data sis_ldata;
bus_dma_tag_t sis_parent_tag;
bus_dma_tag_t sis_tag;
==== //depot/projects/netperf/sys/sys/taskqueue.h#3 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/sys/taskqueue.h,v 1.7 2003/02/26 03:15:42 scottl Exp $
+ * $FreeBSD: src/sys/sys/taskqueue.h,v 1.8 2003/09/03 04:46:28 ken Exp $
*/
#ifndef _SYS_TASKQUEUE_H_
@@ -107,13 +107,20 @@
struct __hack
/*
- * This queue is serviced by a software interrupt handler. To enqueue
- * a task, call taskqueue_enqueue(taskqueue_swi, &task).
+ * These queues are serviced by software interrupt handlers. To enqueue
+ * a task, call taskqueue_enqueue(taskqueue_swi, &task) or
+ * taskqueue_enqueue(taskqueue_swi_giant, &task).
*/
TASKQUEUE_DECLARE(swi_giant);
TASKQUEUE_DECLARE(swi);
/*
+ * This queue is serviced by a kernel thread. To enqueue a task, call
+ * taskqueue_enqueue(taskqueue_thread, &task).
+ */
+TASKQUEUE_DECLARE(thread);
+
+/*
* Queue for swi handlers dispatched from fast interrupt handlers.
* These are necessarily different from the above because the queue
* must be locked with spinlocks since sleep mutex's cannot be used
==== //depot/projects/netperf/sys/ufs/ffs/ffs_softdep.c#3 (text+ko) ====
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ufs/ffs/ffs_softdep.c,v 1.143 2003/08/31 11:26:52 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/ufs/ffs/ffs_softdep.c,v 1.144 2003/09/03 04:08:15 jeff Exp $");
/*
* For now we want the safety net that the DIAGNOSTIC and DEBUG flags provide.
@@ -4694,7 +4694,8 @@
FREE_LOCK(&lk);
return;
}
- ibp = getdirtybuf(&inodedep->id_buf, NULL, MNT_WAIT);
+ ibp = inodedep->id_buf;
+ ibp = getdirtybuf(&ibp, NULL, MNT_WAIT);
FREE_LOCK(&lk);
if (ibp && (error = BUF_WRITE(ibp)) != 0)
softdep_error("softdep_update_inodeblock: bwrite", error);
@@ -5015,7 +5016,8 @@
adp = WK_ALLOCDIRECT(wk);
if (adp->ad_state & DEPCOMPLETE)
continue;
- nbp = getdirtybuf(&adp->ad_buf, NULL, waitfor);
+ nbp = adp->ad_buf;
+ nbp = getdirtybuf(&nbp, NULL, waitfor);
if (nbp == NULL)
continue;
FREE_LOCK(&lk);
@@ -5031,7 +5033,8 @@
aip = WK_ALLOCINDIR(wk);
if (aip->ai_state & DEPCOMPLETE)
continue;
- nbp = getdirtybuf(&aip->ai_buf, NULL, waitfor);
+ nbp = aip->ai_buf;
+ nbp = getdirtybuf(&nbp, NULL, waitfor);
if (nbp == NULL)
continue;
FREE_LOCK(&lk);
@@ -5049,7 +5052,8 @@
LIST_FOREACH(aip, &WK_INDIRDEP(wk)->ir_deplisthd, ai_next) {
if (aip->ai_state & DEPCOMPLETE)
continue;
- nbp = getdirtybuf(&aip->ai_buf, NULL, MNT_WAIT);
+ nbp = aip->ai_buf;
+ nbp = getdirtybuf(&nbp, NULL, MNT_WAIT);
if (nbp == NULL)
goto restart;
FREE_LOCK(&lk);
@@ -5098,7 +5102,8 @@
* been sync'ed, this dependency can show up. So,
* rather than panic, just flush it.
*/
- nbp = getdirtybuf(&WK_MKDIR(wk)->md_buf, NULL, waitfor);
+ nbp = WK_MKDIR(wk)->md_buf;
+ nbp = getdirtybuf(&nbp, NULL, waitfor);
if (nbp == NULL)
continue;
FREE_LOCK(&lk);
@@ -5118,8 +5123,8 @@
* been sync'ed, this dependency can show up. So,
* rather than panic, just flush it.
*/
- nbp = getdirtybuf(&WK_BMSAFEMAP(wk)->sm_buf,
- NULL, waitfor);
+ nbp = WK_BMSAFEMAP(wk)->sm_buf;
+ nbp = getdirtybuf(&nbp, NULL, waitfor);
if (nbp == NULL)
continue;
FREE_LOCK(&lk);
@@ -5268,7 +5273,8 @@
TAILQ_FOREACH(adp, listhead, ad_next) {
if (adp->ad_state & DEPCOMPLETE)
continue;
- bp = getdirtybuf(&adp->ad_buf, NULL, waitfor);
+ bp = adp->ad_buf;
+ bp = getdirtybuf(&bp, NULL, waitfor);
if (bp == NULL) {
if (waitfor == MNT_NOWAIT)
continue;
@@ -5383,7 +5389,8 @@
* push them to disk.
*/
if ((inodedep->id_state & DEPCOMPLETE) == 0) {
- bp = getdirtybuf(&inodedep->id_buf, NULL, MNT_WAIT);
+ bp = inodedep->id_buf;
+ bp = getdirtybuf(&bp, NULL, MNT_WAIT);
FREE_LOCK(&lk);
if (bp && (error = BUF_WRITE(bp)) != 0)
break;
More information about the p4-projects
mailing list