Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 May 2004 18:26:06 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 53440 for review
Message-ID:  <200405250126.i4P1Q6sF002293@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=53440

Change 53440 by rwatson@rwatson_paprika on 2004/05/24 18:25:23

	Integrate netperf_socket forward to FreeBSD CVS HEAD.  Changes
	include:
	
	- bde fixes more of amd64 profiling
	- PCI changes to avoid writing to read-only registers.
	- ISP driver grows target mode.

Affected files ...

.. //depot/projects/netperf_socket/sys/amd64/amd64/apic_vector.S#4 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/exception.S#4 integrate
.. //depot/projects/netperf_socket/sys/amd64/ia32/ia32_exception.S#3 integrate
.. //depot/projects/netperf_socket/sys/amd64/isa/atpic_vector.S#4 integrate
.. //depot/projects/netperf_socket/sys/conf/files.amd64#8 integrate
.. //depot/projects/netperf_socket/sys/dev/bge/if_bge.c#6 integrate
.. //depot/projects/netperf_socket/sys/dev/bge/if_bgereg.h#2 integrate
.. //depot/projects/netperf_socket/sys/dev/cp/if_cp.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/fxp/if_fxp.c#8 integrate
.. //depot/projects/netperf_socket/sys/dev/isp/isp.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/isp/isp_freebsd.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/isp/isp_inline.h#2 integrate
.. //depot/projects/netperf_socket/sys/dev/isp/isp_pci.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/isp/isp_target.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/isp/ispvar.h#4 integrate
.. //depot/projects/netperf_socket/sys/dev/musycc/musycc.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/pcf/pcf.c#1 branch
.. //depot/projects/netperf_socket/sys/dev/pci/pci.c#7 integrate
.. //depot/projects/netperf_socket/sys/dev/re/if_re.c#7 integrate
.. //depot/projects/netperf_socket/sys/i386/i386/mptable.c#3 integrate
.. //depot/projects/netperf_socket/sys/net/if_ef.c#2 integrate
.. //depot/projects/netperf_socket/sys/netgraph/ng_hole.c#3 integrate
.. //depot/projects/netperf_socket/sys/pci/if_rl.c#9 integrate
.. //depot/projects/netperf_socket/sys/pci/if_rlreg.h#2 integrate
.. //depot/projects/netperf_socket/sys/sys/mbuf.h#9 integrate

Differences ...

==== //depot/projects/netperf_socket/sys/amd64/amd64/apic_vector.S#4 (text+ko) ====

@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  *
  *	from: vector.s, 386BSD 0.1 unknown origin
- * $FreeBSD: src/sys/amd64/amd64/apic_vector.S,v 1.99 2004/05/23 16:23:29 bde Exp $
+ * $FreeBSD: src/sys/amd64/amd64/apic_vector.S,v 1.100 2004/05/24 12:08:56 bde Exp $
  */
 
 /*
@@ -129,7 +129,6 @@
 
 	iretq
 
-MCOUNT_LABEL(bintr2)
 	ISR_VEC(1, apic_isr1)
 	ISR_VEC(2, apic_isr2)
 	ISR_VEC(3, apic_isr3)
@@ -137,7 +136,6 @@
 	ISR_VEC(5, apic_isr5)
 	ISR_VEC(6, apic_isr6)
 	ISR_VEC(7, apic_isr7)
-MCOUNT_LABEL(eintr2)
 
 #ifdef SMP
 /*

==== //depot/projects/netperf_socket/sys/amd64/amd64/exception.S#4 (text+ko) ====

@@ -27,9 +27,12 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.117 2004/05/23 17:18:48 bde Exp $
+ * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.119 2004/05/24 12:42:16 bde Exp $
  */
 
+#include "opt_atpic.h"
+#include "opt_ia32.h"
+
 #include <machine/asmacros.h>
 #include <machine/psl.h>
 #include <machine/trap.h>
@@ -294,8 +297,44 @@
 	MEXITCOUNT
 	jmp	doreti			/* Handle any ASTs */
 
+/*
+ * To efficiently implement classification of trap and interrupt handlers
+ * for profiling, there must be only trap handlers between the labels btrap
+ * and bintr, and only interrupt handlers between the labels bintr and
+ * eintr.  This is implemented (partly) by including files that contain
+ * some of the handlers.  Before including the files, set up a normal asm
+ * environment so that the included files doen't need to know that they are
+ * included.
+ */
+
+#ifdef IA32
+	.data
+	.p2align 4
+	.text
+	SUPERALIGN_TEXT
+
+#include <amd64/ia32/ia32_exception.S>
+#endif
+
+	.data
+	.p2align 4
+	.text
+	SUPERALIGN_TEXT
+MCOUNT_LABEL(bintr)
+
+#include <amd64/amd64/apic_vector.S>
+
+#ifdef DEV_ATPIC
 	.data
-	ALIGN_DATA
+	.p2align 4
+	.text
+	SUPERALIGN_TEXT
+
+#include <amd64/isa/atpic_vector.S>
+#endif
+
+	.text
+MCOUNT_LABEL(eintr)
 
 /*
  * void doreti(struct trapframe)
@@ -304,7 +343,6 @@
  */
 	.text
 	SUPERALIGN_TEXT
-	.globl	doreti
 	.type	doreti,@function
 doreti:
 	FAKE_MCOUNT($bintr)		/* init "from" bintr -> doreti */

==== //depot/projects/netperf_socket/sys/amd64/ia32/ia32_exception.S#3 (text+ko) ====

@@ -23,16 +23,13 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/ia32/ia32_exception.S,v 1.3 2004/05/23 19:06:15 bde Exp $
+ * $FreeBSD: src/sys/amd64/ia32/ia32_exception.S,v 1.4 2004/05/24 11:28:11 bde Exp $
  */
 
 #include <machine/asmacros.h>
 
 #include "assym.s"
 
-#define	IDTVEC(name)	ALIGN_TEXT; .globl __CONCAT(X,name); \
-			.type __CONCAT(X,name),@function; __CONCAT(X,name):
-
 	.text
 /*
  * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80)

==== //depot/projects/netperf_socket/sys/amd64/isa/atpic_vector.S#4 (text+ko) ====

@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  *
  *	from: vector.s, 386BSD 0.1 unknown origin
- * $FreeBSD: src/sys/amd64/isa/atpic_vector.S,v 1.44 2004/05/23 16:23:29 bde Exp $
+ * $FreeBSD: src/sys/amd64/isa/atpic_vector.S,v 1.45 2004/05/24 12:08:56 bde Exp $
  */
 
 /*
@@ -72,7 +72,6 @@
 	MEXITCOUNT ;							\
 	jmp	doreti
 
-MCOUNT_LABEL(bintr)
 	INTR(0, atpic_intr0)
 	INTR(1, atpic_intr1)
 	INTR(2, atpic_intr2)
@@ -89,4 +88,3 @@
 	INTR(13, atpic_intr13)
 	INTR(14, atpic_intr14)
 	INTR(15, atpic_intr15)
-MCOUNT_LABEL(eintr)

==== //depot/projects/netperf_socket/sys/conf/files.amd64#8 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.amd64,v 1.35 2004/05/23 18:38:27 bde Exp $
+# $FreeBSD: src/sys/conf/files.amd64,v 1.37 2004/05/24 12:08:56 bde Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -41,7 +41,7 @@
 amd64/acpica/madt.c		optional	acpi
 amd64/amd64/amd64-gdbstub.c	optional	ddb
 amd64/amd64/amd64_mem.c		standard
-amd64/amd64/apic_vector.S	standard
+#amd64/amd64/apic_vector.S	standard
 amd64/amd64/atomic.c		standard
 amd64/amd64/autoconf.c		standard
 amd64/amd64/busdma_machdep.c	standard
@@ -69,8 +69,8 @@
 amd64/amd64/mptable.c		optional	mptable
 amd64/amd64/mptable_pci.c	optional	mptable pci
 amd64/amd64/nexus.c		standard
+amd64/amd64/pmap.c		standard
 amd64/amd64/prof_machdep.c	optional	profiling-routine
-amd64/amd64/pmap.c		standard
 amd64/amd64/sigtramp.S		standard
 amd64/amd64/support.S		standard
 amd64/amd64/sys_machdep.c	standard
@@ -80,7 +80,7 @@
 amd64/amd64/uma_machdep.c	standard
 amd64/amd64/vm_machdep.c	standard
 amd64/isa/atpic.c		optional	atpic isa
-amd64/isa/atpic_vector.S	optional	atpic isa
+#amd64/isa/atpic_vector.S	optional	atpic isa
 amd64/isa/clock.c		standard
 amd64/isa/elcr.c		standard
 amd64/isa/isa.c			standard
@@ -88,11 +88,11 @@
 amd64/isa/nmi.c			standard
 amd64/pci/pci_bus.c		optional	pci
 amd64/pci/pci_cfgreg.c		optional	pci
+crypto/blowfish/bf_enc.c	optional	crypto
 crypto/blowfish/bf_enc.c	optional	ipsec ipsec_esp
+crypto/des/des_ecb.c		optional	netsmbcrypto
+crypto/des/des_enc.c		optional	crypto
 crypto/des/des_enc.c		optional	ipsec ipsec_esp
-crypto/blowfish/bf_enc.c	optional	crypto
-crypto/des/des_enc.c		optional	crypto
-crypto/des/des_ecb.c		optional	netsmbcrypto
 crypto/des/des_enc.c		optional	netsmbcrypto
 crypto/des/des_setkey.c		optional	netsmbcrypto
 dev/fb/fb.c			optional	fb
@@ -140,7 +140,7 @@
 #
 # IA32 binary support
 #
-amd64/ia32/ia32_exception.S	optional	ia32
+#amd64/ia32/ia32_exception.S	optional	ia32
 amd64/ia32/ia32_signal.c	optional	ia32
 amd64/ia32/ia32_sigtramp.S	optional	ia32
 amd64/ia32/ia32_syscall.c	optional	ia32

==== //depot/projects/netperf_socket/sys/dev/bge/if_bge.c#6 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.67 2004/05/23 16:11:45 mux Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.68 2004/05/24 04:46:54 ps Exp $");
 
 /*
  * Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
@@ -148,6 +148,8 @@
 		"Broadcom BCM5704S Dual Gigabit Ethernet" },
 	{ BCOM_VENDORID, BCOM_DEVICEID_BCM5705,
 		"Broadcom BCM5705 Gigabit Ethernet" },
+	{ BCOM_VENDORID, BCOM_DEVICEID_BCM5705K,
+		"Broadcom BCM5705K Gigabit Ethernet" },
 	{ BCOM_VENDORID, BCOM_DEVICEID_BCM5705M,
 		"Broadcom BCM5705M Gigabit Ethernet" },
 	{ BCOM_VENDORID, BCOM_DEVICEID_BCM5705M_ALT,

==== //depot/projects/netperf_socket/sys/dev/bge/if_bgereg.h#2 (text+ko) ====

@@ -30,7 +30,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.26 2004/01/08 17:19:11 wpaul Exp $
+ * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.27 2004/05/24 04:46:54 ps Exp $
  */
 
 /*
@@ -1819,6 +1819,7 @@
 #define BCOM_DEVICEID_BCM5704C		0x1648
 #define BCOM_DEVICEID_BCM5704S		0x16A8
 #define BCOM_DEVICEID_BCM5705		0x1653
+#define BCOM_DEVICEID_BCM5705K		0x1654
 #define BCOM_DEVICEID_BCM5705M		0x165D
 #define BCOM_DEVICEID_BCM5705M_ALT	0x165E
 #define BCOM_DEVICEID_BCM5782		0x1696

==== //depot/projects/netperf_socket/sys/dev/cp/if_cp.c#2 (text+ko) ====

@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cp/if_cp.c,v 1.1 2004/05/05 16:11:45 rik Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cp/if_cp.c,v 1.2 2004/05/24 19:39:56 jhb Exp $");
 
 #include <sys/param.h>
 
@@ -368,7 +368,7 @@
 #else
 	bd->board = b;
 	b->sys = bd;
-	rid = PCIR_MAPS;
+	rid = PCIR_BAR(0);
 	bd->cp_res = bus_alloc_resource (dev, SYS_RES_MEMORY, &rid,
 			0, ~0, 1, RF_ACTIVE);
 	if (! bd->cp_res) {
@@ -384,7 +384,7 @@
 	if (res) {
 		printf ("cp%d: can't init, error code:%x\n", unit, res);
 #if __FreeBSD_version >= 400000
-		bus_release_resource (dev, SYS_RES_MEMORY, PCIR_MAPS, bd->cp_res);
+		bus_release_resource (dev, SYS_RES_MEMORY, PCIR_BAR(0), bd->cp_res);
 #endif
 		free (b, M_DEVBUF);
 		splx (s);
@@ -418,7 +418,7 @@
        	if (! bd->cp_irq) {
 		printf ("cp%d: cannot map interrupt\n", unit);
 		bus_release_resource (dev, SYS_RES_MEMORY,
-				PCIR_MAPS, bd->cp_res);
+				PCIR_BAR(0), bd->cp_res);
 		free (b, M_DEVBUF);
 		splx (s);
 		return (ENXIO);
@@ -428,7 +428,7 @@
 	if (error) {
 		printf ("cp%d: cannot set up irq\n", unit);
 		bus_release_resource (dev, SYS_RES_MEMORY,
-				PCIR_MAPS, bd->cp_res);
+				PCIR_BAR(0), bd->cp_res);
 		bus_release_resource (dev, SYS_RES_IRQ, 0, bd->cp_irq);
 		free (b, M_DEVBUF);
 		splx (s);
@@ -601,7 +601,7 @@
 	bus_teardown_intr (dev, bd->cp_irq, bd->cp_intrhand);
 	bus_deactivate_resource (dev, SYS_RES_IRQ, 0, bd->cp_irq);
 	bus_release_resource (dev, SYS_RES_IRQ, 0, bd->cp_irq);
-	bus_release_resource (dev, SYS_RES_MEMORY, PCIR_MAPS, bd->cp_res);
+	bus_release_resource (dev, SYS_RES_MEMORY, PCIR_BAR(0), bd->cp_res);
 	cp_led_off (b);
 	if (led_timo[b->num].callout)
 		untimeout (cp_led_off, b, led_timo[b->num]);

==== //depot/projects/netperf_socket/sys/dev/fxp/if_fxp.c#8 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.207 2004/05/23 21:05:07 yar Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.208 2004/05/24 18:31:56 mux Exp $");
 
 /*
  * Intel EtherExpress Pro/100B PCI Fast Ethernet driver
@@ -864,8 +864,8 @@
 	int i;
 
 	mtx_assert(&sc->sc_mtx, MA_NOTOWNED);
-	if (sc->ih)
-		panic("fxp_release() called with intr handle still active");
+	KASSERT(sc->ih == NULL,
+	    ("fxp_release() called with intr handle still active"));
 	if (sc->miibus)
 		device_delete_child(sc->dev, sc->miibus);
 	bus_generic_detach(sc->dev);

==== //depot/projects/netperf_socket/sys/dev/isp/isp.c#3 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/isp/isp.c,v 1.110 2004/02/07 03:42:17 mjacob Exp $ */
+/* $FreeBSD: src/sys/dev/isp/isp.c,v 1.111 2004/05/24 07:02:24 njl Exp $ */
 /*
  * Machine and OS Independent (well, as best as possible)
  * code for the Qlogic ISP SCSI adapters.
@@ -5843,7 +5843,7 @@
 isp_reinit(struct ispsoftc *isp)
 {
 	XS_T *xs;
-	u_int16_t handle;
+	int i;
 
 	if (IS_FC(isp)) {
 		isp_mark_getpdb_all(isp);
@@ -5863,11 +5863,13 @@
 	}
 	isp->isp_nactive = 0;
 
-	for (handle = 1; (int) handle <= isp->isp_maxcmds; handle++) {
-		xs = isp_find_xs(isp, handle);
+	for (i = 0; i < isp->isp_maxcmds; i++) {
+		u_int16_t handle;
+		xs = isp->isp_xflist[i];
 		if (xs == NULL) {
 			continue;
 		}
+		handle = isp_index_handle(i);
 		isp_destroy_handle(isp, handle);
 		if (XS_XFRLEN(xs)) {
 			ISP_DMAFREE(isp, xs, handle);

==== //depot/projects/netperf_socket/sys/dev/isp/isp_freebsd.c#3 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.100 2004/02/21 21:10:43 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.101 2004/05/24 07:02:25 njl Exp $");
 
 #include <dev/isp/isp_freebsd.h>
 #include <sys/unistd.h>
@@ -545,6 +545,7 @@
 static int isp_handle_platform_atio(struct ispsoftc *, at_entry_t *);
 static int isp_handle_platform_atio2(struct ispsoftc *, at2_entry_t *);
 static int isp_handle_platform_ctio(struct ispsoftc *, void *);
+static void isp_handle_platform_ctio_fastpost(struct ispsoftc *, u_int32_t);
 static int isp_handle_platform_notify_scsi(struct ispsoftc *, in_entry_t *);
 static int isp_handle_platform_notify_fc(struct ispsoftc *, in_fcentry_t *);
 
@@ -1272,7 +1273,7 @@
 		hp = &cto->ct_syshandle;
 	}
 
-	if (isp_save_xs(isp, (XS_T *)ccb, hp)) {
+	if (isp_save_xs_tgt(isp, ccb, hp)) {
 		xpt_print_path(ccb->ccb_h.path);
 		printf("No XFLIST pointers for isp_target_start_ctio\n");
 		return (CAM_RESRC_UNAVAIL);
@@ -1297,11 +1298,11 @@
 
 	case CMD_EAGAIN:
 		ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
-		isp_destroy_handle(isp, save_handle);
+		isp_destroy_tgt_handle(isp, save_handle);
 		return (CAM_RESRC_UNAVAIL);
 
 	default:
-		isp_destroy_handle(isp, save_handle);
+		isp_destroy_tgt_handle(isp, save_handle);
 		return (XS_ERR(ccb));
 	}
 }
@@ -1637,9 +1638,9 @@
 	 * CTIO and CTIO2 are close enough....
 	 */
 
-	ccb = (union ccb *) isp_find_xs(isp, ((ct_entry_t *)arg)->ct_syshandle);
+	ccb = isp_find_xs_tgt(isp, ((ct_entry_t *)arg)->ct_syshandle);
 	KASSERT((ccb != NULL), ("null ccb in isp_handle_platform_ctio"));
-	isp_destroy_handle(isp, ((ct_entry_t *)arg)->ct_syshandle);
+	isp_destroy_tgt_handle(isp, ((ct_entry_t *)arg)->ct_syshandle);
 
 	if (IS_FC(isp)) {
 		ct2_entry_t *ct = arg;
@@ -1734,6 +1735,19 @@
 	return (0);
 }
 
+static void
+isp_handle_platform_ctio_fastpost(struct ispsoftc *isp, u_int32_t token)
+{
+	union ccb *ccb;
+	ccb = isp_find_xs_tgt(isp, token & 0xffff);
+	KASSERT((ccb != NULL),
+	    ("null ccb in isp_handle_platform_ctio_fastpost"));
+	isp_destroy_tgt_handle(isp, token & 0xffff);
+	isp_prt(isp, ISP_LOGTDEBUG1, "CTIOx[%x] fastpost complete",
+	    token & 0xffff);
+	isp_complete_ctio(ccb);
+}
+
 static int
 isp_handle_platform_notify_scsi(struct ispsoftc *isp, in_entry_t *inp)
 {
@@ -3019,6 +3033,15 @@
 	case ISPASYNC_TARGET_EVENT:
 	{
 		tmd_event_t *ep = arg;
+		if (ep->ev_event == ASYNC_CTIO_DONE) {
+			/*
+			 * ACK the interrupt first
+			 */
+			ISP_WRITE(isp, BIU_SEMA, 0);
+			ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT);
+			isp_handle_platform_ctio_fastpost(isp, ep->ev_bus);
+			break;
+		}
 		isp_prt(isp, ISP_LOGALL,
 		    "bus %d event code 0x%x", ep->ev_bus, ep->ev_event);
 		break;

==== //depot/projects/netperf_socket/sys/dev/isp/isp_inline.h#2 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/isp/isp_inline.h,v 1.29 2003/09/13 01:57:31 mjacob Exp $ */
+/* $FreeBSD: src/sys/dev/isp/isp_inline.h,v 1.30 2004/05/24 07:02:25 njl Exp $ */
 /*
  * Qlogic Host Adapter Inline Functions
  *
@@ -43,8 +43,8 @@
 static INLINE XS_T *isp_find_xs(struct ispsoftc *, u_int16_t);
 static INLINE u_int16_t isp_find_handle(struct ispsoftc *, XS_T *);
 static INLINE int isp_handle_index(u_int16_t);
+static INLINE u_int16_t isp_index_handle(int);
 static INLINE void isp_destroy_handle(struct ispsoftc *, u_int16_t);
-static INLINE void isp_remove_handle(struct ispsoftc *, XS_T *);
 
 static INLINE int
 isp_save_xs(struct ispsoftc *isp, XS_T *xs, u_int16_t *handlep)
@@ -100,19 +100,76 @@
 	return (handle-1);
 }
 
+static INLINE u_int16_t
+isp_index_handle(int index)
+{
+	return (index+1);
+}
+
 static INLINE void
 isp_destroy_handle(struct ispsoftc *isp, u_int16_t handle)
 {
 	if (handle > 0 && handle <= (u_int16_t) isp->isp_maxcmds) {
-		isp->isp_xflist[isp_handle_index(handle)] = NULL;
+		isp->isp_xflist[handle - 1] = NULL;
+	}
+}
+
+#ifdef	ISP_TARGET_MODE
+static INLINE int isp_save_xs_tgt(struct ispsoftc *, void *, u_int16_t *);
+static INLINE void *isp_find_xs_tgt(struct ispsoftc *, u_int16_t);
+static INLINE void isp_destroy_tgt_handle(struct ispsoftc *, u_int16_t);
+
+static INLINE int
+isp_save_xs_tgt(struct ispsoftc *isp, void *xs, u_int16_t *handlep)
+{
+	int i;
+
+	for (i = 0; i < (int) isp->isp_maxcmds; i++) {
+		if (isp->isp_tgtlist[i] == NULL) {
+			break;
+		}
+	}
+	if (i == isp->isp_maxcmds) {
+		return (-1);
+	}
+	isp->isp_tgtlist[i] = xs;
+	*handlep = i+1;
+	return (0);
+}
+
+static INLINE void *
+isp_find_xs_tgt(struct ispsoftc *isp, u_int16_t handle)
+{
+	if (handle < 1 || handle > (u_int16_t) isp->isp_maxcmds) {
+		return (NULL);
+	} else {
+		return (isp->isp_tgtlist[handle - 1]);
+	}
+}
+
+static INLINE u_int16_t
+isp_find_tgt_handle(struct ispsoftc *isp, void *xs)
+{
+	int i;
+	if (xs != NULL) {
+		for (i = 0; i < isp->isp_maxcmds; i++) {
+			if (isp->isp_tgtlist[i] == xs) {
+				return ((u_int16_t) i+1);
+			}
+		}
 	}
+	return (0);
 }
 
 static INLINE void
-isp_remove_handle(struct ispsoftc *isp, XS_T *xs)
+isp_destroy_tgt_handle(struct ispsoftc *isp, u_int16_t handle)
 {
-	isp_destroy_handle(isp, isp_find_handle(isp, xs));
+	if (handle > 0 && handle <= (u_int16_t) isp->isp_maxcmds) {
+		isp->isp_tgtlist[handle - 1] = NULL;
+	}
 }
+#endif
+
 
 static INLINE int
 isp_getrqentry(struct ispsoftc *, u_int16_t *, u_int16_t *, void **);

==== //depot/projects/netperf_socket/sys/dev/isp/isp_pci.c#4 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.97 2004/03/17 17:50:36 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.98 2004/05/24 07:02:25 njl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1113,11 +1113,23 @@
 		ISP_LOCK(isp);
 		return (1);
 	}
+#ifdef	ISP_TARGET_MODE
+	len = sizeof (void **) * isp->isp_maxcmds;
+	isp->isp_tgtlist = (void **) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
+	if (isp->isp_tgtlist == NULL) {
+		isp_prt(isp, ISP_LOGERR, "cannot alloc tgtlist array");
+		ISP_LOCK(isp);
+		return (1);
+	}
+#endif
 	len = sizeof (bus_dmamap_t) * isp->isp_maxcmds;
 	pcs->dmaps = (bus_dmamap_t *) malloc(len, M_DEVBUF,  M_WAITOK);
 	if (pcs->dmaps == NULL) {
 		isp_prt(isp, ISP_LOGERR, "can't alloc dma map storage");
 		free(isp->isp_xflist, M_DEVBUF);
+#ifdef	ISP_TARGET_MODE
+		free(isp->isp_tgtlist, M_DEVBUF);
+#endif
 		ISP_LOCK(isp);
 		return (1);
 	}
@@ -1139,6 +1151,9 @@
 		    "cannot create a dma tag for control spaces");
 		free(pcs->dmaps, M_DEVBUF);
 		free(isp->isp_xflist, M_DEVBUF);
+#ifdef	ISP_TARGET_MODE
+		free(isp->isp_tgtlist, M_DEVBUF);
+#endif
 		ISP_LOCK(isp);
 		return (1);
 	}
@@ -1149,6 +1164,9 @@
 		    "cannot allocate %d bytes of CCB memory", len);
 		bus_dma_tag_destroy(isp->isp_cdmat);
 		free(isp->isp_xflist, M_DEVBUF);
+#ifdef	ISP_TARGET_MODE
+		free(isp->isp_tgtlist, M_DEVBUF);
+#endif
 		free(pcs->dmaps, M_DEVBUF);
 		ISP_LOCK(isp);
 		return (1);
@@ -1189,6 +1207,9 @@
 	bus_dmamem_free(isp->isp_cdmat, base, isp->isp_cdmap);
 	bus_dma_tag_destroy(isp->isp_cdmat);
 	free(isp->isp_xflist, M_DEVBUF);
+#ifdef	ISP_TARGET_MODE
+	free(isp->isp_tgtlist, M_DEVBUF);
+#endif
 	free(pcs->dmaps, M_DEVBUF);
 	ISP_LOCK(isp);
 	isp->isp_rquest = NULL;

==== //depot/projects/netperf_socket/sys/dev/isp/isp_target.c#3 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/isp/isp_target.c,v 1.29 2004/01/29 06:36:30 mjacob Exp $ */
+/* $FreeBSD: src/sys/dev/isp/isp_target.c,v 1.30 2004/05/24 07:02:25 njl Exp $ */
 /*
  * Machine and OS Independent Target Mode Code for the Qlogic SCSI/FC adapters.
  *
@@ -882,7 +882,7 @@
 	char *fmsg = NULL;
 
 	if (ct->ct_syshandle) {
-		xs = isp_find_xs(isp, ct->ct_syshandle);
+		xs = isp_find_xs_tgt(isp, ct->ct_syshandle);
 		if (xs == NULL)
 			pl = ISP_LOGALL;
 	} else {
@@ -1042,7 +1042,7 @@
 	char *fmsg = NULL;
 
 	if (ct->ct_syshandle) {
-		xs = isp_find_xs(isp, ct->ct_syshandle);
+		xs = isp_find_xs_tgt(isp, ct->ct_syshandle);
 		if (xs == NULL)
 			pl = ISP_LOGALL;
 	} else {

==== //depot/projects/netperf_socket/sys/dev/isp/ispvar.h#4 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/isp/ispvar.h,v 1.65 2004/03/12 21:45:27 trhodes Exp $ */
+/* $FreeBSD: src/sys/dev/isp/ispvar.h,v 1.66 2004/05/24 07:02:25 njl Exp $ */
 /*
  * Soft Definitions for for Qlogic ISP SCSI adapters.
  *
@@ -54,7 +54,7 @@
 #endif
 
 #define	ISP_CORE_VERSION_MAJOR	2
-#define	ISP_CORE_VERSION_MINOR	7
+#define	ISP_CORE_VERSION_MINOR	8
 
 /*
  * Vector for bus specific code to provide specific services.
@@ -426,6 +426,13 @@
 	 */
 	XS_T **isp_xflist;
 
+#ifdef	ISP_TARGET_MODE
+	/*
+	 * Active target commands are stored here, indexed by handle function.
+	 */
+	void **isp_tgtlist;
+#endif
+
 	/*
 	 * request/result queue pointers and DMA handles for them.
 	 */

==== //depot/projects/netperf_socket/sys/dev/musycc/musycc.c#3 (text+ko) ====

@@ -8,7 +8,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/musycc/musycc.c,v 1.31 2004/03/17 17:50:37 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/musycc/musycc.c,v 1.32 2004/05/24 20:45:53 julian Exp $");
 
 /*
  * Card state machine:
@@ -222,7 +222,7 @@
 	struct mdesc *mdt[NHDLC];
 	struct mdesc *mdr[NHDLC];
 	node_p node;			/* NG node */
-	char nodename[NG_NODELEN + 1];	/* NG nodename */
+	char nodename[NG_NODESIZ];	/* NG nodename */
 	struct schan *chan[NHDLC];
 	u_long		cnt_ferr;
 	u_long		cnt_cerr;

==== //depot/projects/netperf_socket/sys/dev/pci/pci.c#7 (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.259 2004/05/21 19:47:55 imp Exp $
+ * $FreeBSD: src/sys/dev/pci/pci.c,v 1.261 2004/05/24 17:41:05 imp Exp $
  *
  */
 
@@ -183,15 +183,6 @@
     "Power down devices into D3 state when no driver attaches to them.\n\
 Otherwise, leave the device in D0 state when no driver attaches.");
 
-/*
- * Enable restoring all the registers, even the ones that are nominally
- * read-only.  If this causes problems for you, please report them to
- * imp@freebsd.org and remove this line in your local tree.  The problems
- * would be seen if the device is transitioning from D3 to D0 or has ever
- * made that transition under FreeBSD this boot.
- */
-#define PCI_RESTORE_EXTRA
-
 /* Find a device_t by bus/slot/function */
 
 device_t
@@ -1843,14 +1834,8 @@
 		pci_set_powerstate(dev, PCI_POWERSTATE_D0);
 	}
 	for (i = 0; i < dinfo->cfg.nummaps; i++)
-		pci_write_config(dev, PCIR_MAPS + i * 4, dinfo->cfg.bar[i], 4);
+		pci_write_config(dev, PCIR_BAR(i), dinfo->cfg.bar[i], 4);
 	pci_write_config(dev, PCIR_BIOS, dinfo->cfg.bios, 4);
-#ifdef PCI_RESTORE_EXTRA
-	pci_write_config(dev, PCIR_SUBVEND_0, dinfo->cfg.subvendor, 2);
-	pci_write_config(dev, PCIR_SUBDEV_0, dinfo->cfg.subdevice, 2);
-	pci_write_config(dev, PCIR_VENDOR, dinfo->cfg.vendor, 2);
-	pci_write_config(dev, PCIR_DEVICE, dinfo->cfg.device, 2);
-#endif
 	pci_write_config(dev, PCIR_COMMAND, dinfo->cfg.cmdreg, 2);
 	pci_write_config(dev, PCIR_INTLINE, dinfo->cfg.intline, 1);
 	pci_write_config(dev, PCIR_INTPIN, dinfo->cfg.intpin, 1);
@@ -1858,11 +1843,7 @@
 	pci_write_config(dev, PCIR_MAXLAT, dinfo->cfg.maxlat, 1);
 	pci_write_config(dev, PCIR_CACHELNSZ, dinfo->cfg.cachelnsz, 1);
 	pci_write_config(dev, PCIR_LATTIMER, dinfo->cfg.lattimer, 1);
-#ifdef PCI_RESTORE_EXTRA
-	pci_write_config(dev, PCIR_CLASS, dinfo->cfg.baseclass, 1);
-	pci_write_config(dev, PCIR_SUBCLASS, dinfo->cfg.subclass, 1);
 	pci_write_config(dev, PCIR_PROGIF, dinfo->cfg.progif, 1);
-#endif
 	pci_write_config(dev, PCIR_REVID, dinfo->cfg.revid, 1);
 }
 
@@ -1883,7 +1864,7 @@
 	if (dinfo->cfg.hdrtype != 0)
 		return;
 	for (i = 0; i < dinfo->cfg.nummaps; i++)
-		dinfo->cfg.bar[i] = pci_read_config(dev, PCIR_MAPS + i * 4, 4);
+		dinfo->cfg.bar[i] = pci_read_config(dev, PCIR_BAR(i), 4);
 	dinfo->cfg.bios = pci_read_config(dev, PCIR_BIOS, 4);
 
 	/*

==== //depot/projects/netperf_socket/sys/dev/re/if_re.c#7 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.22 2004/05/23 21:05:08 yar Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.23 2004/05/24 19:39:23 jhb Exp $");
 
 /*
  * RealTek 8139C+/8169/8169S/8110S PCI NIC driver
@@ -2420,19 +2420,23 @@
 re_suspend(dev)
 	device_t		dev;
 {
+#ifndef BURN_BRIDGES
 	register int		i;
+#endif
 	struct rl_softc		*sc;
 
 	sc = device_get_softc(dev);
 
 	re_stop(sc);
 
+#ifndef BURN_BRIDGES
 	for (i = 0; i < 5; i++)
 		sc->saved_maps[i] = pci_read_config(dev, PCIR_MAPS + i * 4, 4);
 	sc->saved_biosaddr = pci_read_config(dev, PCIR_BIOS, 4);
 	sc->saved_intline = pci_read_config(dev, PCIR_INTLINE, 1);
 	sc->saved_cachelnsz = pci_read_config(dev, PCIR_CACHELNSZ, 1);
 	sc->saved_lattimer = pci_read_config(dev, PCIR_LATTIMER, 1);
+#endif
 
 	sc->suspended = 1;
 
@@ -2448,13 +2452,16 @@
 re_resume(dev)
 	device_t		dev;
 {
+#ifndef BURN_BRIDGES
 	register int		i;
+#endif
 	struct rl_softc		*sc;
 	struct ifnet		*ifp;
 
 	sc = device_get_softc(dev);
 	ifp = &sc->arpcom.ac_if;
 
+#ifndef BURN_BRIDGES
 	/* better way to do this? */
 	for (i = 0; i < 5; i++)
 		pci_write_config(dev, PCIR_MAPS + i * 4, sc->saved_maps[i], 4);
@@ -2466,6 +2473,7 @@
 	/* reenable busmastering */
 	pci_enable_busmaster(dev);
 	pci_enable_io(dev, RL_RES);
+#endif
 
 	/* reinitialize interface if necessary */
 	if (ifp->if_flags & IFF_UP)

==== //depot/projects/netperf_socket/sys/i386/i386/mptable.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/mptable.c,v 1.232 2004/05/10 18:49:58 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/mptable.c,v 1.233 2004/05/24 15:51:46 jhb Exp $");
 
 #include "opt_mptable_force_htt.h"
 #include <sys/param.h>
@@ -549,17 +549,10 @@
 	KASSERT(src_bus <= mptable_maxbusid, ("bus id %d too large", src_bus));
 	switch (busses[src_bus].bus_type) {
 	case ISA:
+	case EISA:
 		return (INTR_POLARITY_HIGH);
 	case PCI:
 		return (INTR_POLARITY_LOW);
-#ifndef PC98
-	case EISA:
-		KASSERT(src_bus_irq < 16, ("Invalid EISA IRQ %d", src_bus_irq));
-		if (elcr_read_trigger(src_bus_irq) == INTR_TRIGGER_LEVEL)
-			return (INTR_POLARITY_LOW);
-		else
-			return (INTR_POLARITY_HIGH);
-#endif
 	default:
 		panic("%s: unknown bus type %d", __func__,
 		    busses[src_bus].bus_type);

==== //depot/projects/netperf_socket/sys/net/if_ef.c#2 (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/net/if_ef.c,v 1.28 2003/12/28 03:55:59 sam Exp $
+ * $FreeBSD: src/sys/net/if_ef.c,v 1.29 2004/05/24 11:01:45 mux Exp $
  */
 
 #include "opt_inet.h"
@@ -120,7 +120,6 @@
 	struct ifaddr *ifa2;
 	struct sockaddr_dl *sdl2;
 
-	ifp->if_output = ether_output;
 	ifp->if_start = ef_start;
 	ifp->if_watchdog = NULL;
 	ifp->if_init = ef_init;

==== //depot/projects/netperf_socket/sys/netgraph/ng_hole.c#3 (text+ko) ====

@@ -36,7 +36,7 @@
  *
  * Author: Julian Elisher <julian@freebsd.org>
  *
- * $FreeBSD: src/sys/netgraph/ng_hole.c,v 1.11 2004/05/19 11:26:33 ru Exp $
+ * $FreeBSD: src/sys/netgraph/ng_hole.c,v 1.12 2004/05/24 20:41:40 julian Exp $
  * $Whistle: ng_hole.c,v 1.10 1999/11/01 09:24:51 julian Exp $
  */
 
@@ -162,7 +162,7 @@
 		case NGM_HOLE_CLR_STATS:
 		case NGM_HOLE_GETCLR_STATS:
 			/* Sanity check. */
-			if (msg->header.arglen != NG_HOOKLEN + 1) {
+			if (msg->header.arglen != NG_HOOKSIZ) {
 				error = EINVAL;
 				break;
 			}

==== //depot/projects/netperf_socket/sys/pci/if_rl.c#9 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.136 2004/05/23 21:05:07 yar Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.137 2004/05/24 19:39:23 jhb Exp $");
 
 /*
  * RealTek 8129/8139 PCI NIC driver
@@ -1916,19 +1916,23 @@
 rl_suspend(dev)
 	device_t		dev;
 {
+#ifndef BURN_BRIDGES
 	register int		i;
+#endif
 	struct rl_softc		*sc;
 
 	sc = device_get_softc(dev);
 
 	rl_stop(sc);
 
+#ifndef BURN_BRIDGES
 	for (i = 0; i < 5; i++)
 		sc->saved_maps[i] = pci_read_config(dev, PCIR_MAPS + i * 4, 4);
 	sc->saved_biosaddr = pci_read_config(dev, PCIR_BIOS, 4);
 	sc->saved_intline = pci_read_config(dev, PCIR_INTLINE, 1);
 	sc->saved_cachelnsz = pci_read_config(dev, PCIR_CACHELNSZ, 1);
 	sc->saved_lattimer = pci_read_config(dev, PCIR_LATTIMER, 1);
+#endif
 
 	sc->suspended = 1;
 
@@ -1944,13 +1948,16 @@
 rl_resume(dev)
 	device_t		dev;
 {
+#ifndef BURN_BRIDGES
 	register int		i;
+#endif
 	struct rl_softc		*sc;
 	struct ifnet		*ifp;
 
 	sc = device_get_softc(dev);
 	ifp = &sc->arpcom.ac_if;
 
+#ifndef BURN_BRIDGES
 	/* better way to do this? */
 	for (i = 0; i < 5; i++)
 		pci_write_config(dev, PCIR_MAPS + i * 4, sc->saved_maps[i], 4);
@@ -1962,6 +1969,7 @@
 	/* reenable busmastering */
 	pci_enable_busmaster(dev);
 	pci_enable_io(dev, RL_RES);
+#endif
 
 	/* reinitialize interface if necessary */
 	if (ifp->if_flags & IFF_UP)

==== //depot/projects/netperf_socket/sys/pci/if_rlreg.h#2 (text+ko) ====


>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405250126.i4P1Q6sF002293>