PERFORCE change 79170 for review

John Baldwin jhb at FreeBSD.org
Wed Jun 29 18:48:33 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=79170

Change 79170 by jhb at jhb_slimer on 2005/06/29 18:47:53

	IFC @79168.  Wanted to get Robert's fixes to the ibcs2 alternate
	syscall masters.

Affected files ...

.. //depot/projects/smpng/sys/amd64/amd64/trap.c#28 integrate
.. //depot/projects/smpng/sys/amd64/include/param.h#15 integrate
.. //depot/projects/smpng/sys/arm/arm/busdma_machdep.c#13 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#21 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_util.h#3 integrate
.. //depot/projects/smpng/sys/conf/Makefile.arm#9 integrate
.. //depot/projects/smpng/sys/conf/options#101 integrate
.. //depot/projects/smpng/sys/contrib/pf/net/if_pfsync.c#13 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpi_quirks#5 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-disk.c#51 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-queue.c#27 integrate
.. //depot/projects/smpng/sys/dev/bge/if_bge.c#56 integrate
.. //depot/projects/smpng/sys/dev/drm/radeon_cp.c#12 integrate
.. //depot/projects/smpng/sys/dev/ep/if_ep.c#21 integrate
.. //depot/projects/smpng/sys/dev/ep/if_ep_isa.c#12 integrate
.. //depot/projects/smpng/sys/dev/ep/if_ep_pccard.c#19 integrate
.. //depot/projects/smpng/sys/dev/ep/if_epvar.h#9 integrate
.. //depot/projects/smpng/sys/dev/iicbus/if_ic.c#13 integrate
.. //depot/projects/smpng/sys/dev/ral/if_ral.c#3 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/csa.c#14 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/csapcm.c#13 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/csareg.h#2 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/csavar.h#2 integrate
.. //depot/projects/smpng/sys/i386/i386/trap.c#79 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_isc_syscall.h#4 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_isc_sysent.c#5 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_xenix.h#6 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_xenix_syscall.h#5 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_xenix_sysent.c#6 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/syscalls.isc#4 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/syscalls.xenix#4 integrate
.. //depot/projects/smpng/sys/i4b/driver/i4b_ipr.c#23 integrate
.. //depot/projects/smpng/sys/ia64/ia64/trap.c#74 integrate
.. //depot/projects/smpng/sys/kern/kern_descrip.c#81 integrate
.. //depot/projects/smpng/sys/kern/kern_mbuf.c#7 integrate
.. //depot/projects/smpng/sys/modules/bge/Makefile#3 integrate
.. //depot/projects/smpng/sys/net/bpf.c#51 integrate
.. //depot/projects/smpng/sys/net/if_bridge.c#2 integrate
.. //depot/projects/smpng/sys/net/if_disc.c#19 integrate
.. //depot/projects/smpng/sys/net/if_faith.c#27 integrate
.. //depot/projects/smpng/sys/net/if_gif.c#26 integrate
.. //depot/projects/smpng/sys/net/if_gre.c#23 integrate
.. //depot/projects/smpng/sys/net/if_loop.c#37 integrate
.. //depot/projects/smpng/sys/net/if_stf.c#32 integrate
.. //depot/projects/smpng/sys/net/if_tun.c#43 integrate
.. //depot/projects/smpng/sys/net/route.c#26 integrate
.. //depot/projects/smpng/sys/netgraph/ng_iface.c#23 integrate
.. //depot/projects/smpng/sys/netgraph/ng_nat.c#2 integrate
.. //depot/projects/smpng/sys/netgraph/ng_sppp.c#8 integrate
.. //depot/projects/smpng/sys/netinet/ip_carp.c#7 integrate
.. //depot/projects/smpng/sys/netinet/libalias/alias.c#2 integrate
.. //depot/projects/smpng/sys/netinet/libalias/alias_ftp.c#2 integrate
.. //depot/projects/smpng/sys/netinet/libalias/alias_irc.c#2 integrate
.. //depot/projects/smpng/sys/netinet/libalias/alias_local.h#2 integrate
.. //depot/projects/smpng/sys/netinet/libalias/alias_proxy.c#2 integrate
.. //depot/projects/smpng/sys/netinet/libalias/alias_skinny.c#2 integrate
.. //depot/projects/smpng/sys/netinet/libalias/alias_smedia.c#2 integrate
.. //depot/projects/smpng/sys/netinet/libalias/alias_util.c#3 integrate
.. //depot/projects/smpng/sys/netinet/tcp_input.c#73 integrate
.. //depot/projects/smpng/sys/netinet/tcp_sack.c#13 integrate
.. //depot/projects/smpng/sys/netinet/tcp_var.h#39 integrate
.. //depot/projects/smpng/sys/pci/agp_via.c#16 integrate
.. //depot/projects/smpng/sys/sys/ucred.h#26 integrate
.. //depot/projects/smpng/sys/vm/uma_dbg.c#14 integrate

Differences ...

==== //depot/projects/smpng/sys/amd64/amd64/trap.c#28 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.287 2005/06/24 00:16:56 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.288 2005/06/25 22:14:42 ups Exp $");
 
 /*
  * AMD64 Trap and System call handling
@@ -648,8 +648,15 @@
 	}
 
 #ifdef KDB
-	if ((debugger_on_panic || kdb_active) && kdb_trap(type, 0, frame))
-		return;
+	if (debugger_on_panic || kdb_active) {
+		register_t rflags;
+		rflags = intr_disable();
+		if (kdb_trap(type, 0, frame)) {
+			intr_restore(rflags);
+			return;
+		}
+		intr_restore(rflags);
+	}
 #endif
 	printf("trap number		= %d\n", type);
 	if (type <= MAX_TRAP_MSG)

==== //depot/projects/smpng/sys/amd64/include/param.h#15 (text+ko) ====

@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)param.h	8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/amd64/include/param.h,v 1.17 2005/01/21 05:56:41 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/param.h,v 1.18 2005/06/29 15:13:25 jhb Exp $
  */
 
 /*
@@ -84,7 +84,7 @@
 #endif
 
 #ifdef SMP
-#define MAXCPU		8
+#define MAXCPU		16
 #else
 #define MAXCPU		1
 #endif

==== //depot/projects/smpng/sys/arm/arm/busdma_machdep.c#13 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.21 2005/05/24 22:10:35 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.22 2005/06/24 23:57:27 cognet Exp $");
 
 /*
  * MacPPC bus dma support routines
@@ -87,16 +87,19 @@
 #define DMAMAP_MBUF		0x2
 #define DMAMAP_UIO		0x4
 #define DMAMAP_ALLOCATED	0x10
-#define DMAMAP_STATIC_BUSY	0x20
 #define DMAMAP_TYPE_MASK	(DMAMAP_LINEAR|DMAMAP_MBUF|DMAMAP_UIO)
 #define DMAMAP_COHERENT		0x8
 struct bus_dmamap {
         bus_dma_tag_t	dmat;
 	int		flags;
 	void 		*buffer;
+	TAILQ_ENTRY(bus_dmamap)	freelist;
 	int		len;
 };
 
+static TAILQ_HEAD(,bus_dmamap) dmamap_freelist = 
+	TAILQ_HEAD_INITIALIZER(dmamap_freelist);
+
 #define BUSDMA_STATIC_MAPS	500
 static struct bus_dmamap map_pool[BUSDMA_STATIC_MAPS];
 
@@ -104,6 +107,17 @@
 
 MTX_SYSINIT(busdma_mtx, &busdma_mtx, "busdma lock", MTX_DEF);
 
+static void
+arm_dmamap_freelist_init(void *dummy)
+{
+	int i;
+
+	for (i = 0; i < BUSDMA_STATIC_MAPS; i++) 
+		TAILQ_INSERT_HEAD(&dmamap_freelist, &map_pool[i], freelist);
+}
+
+SYSINIT(busdma, SI_SUB_VM, SI_ORDER_ANY, arm_dmamap_freelist_init, NULL);
+
 /*
  * Check to see if the specified page is in an allowed DMA range.
  */
@@ -168,35 +182,32 @@
 #endif
 }
 
-static bus_dmamap_t
+static __inline bus_dmamap_t
 _busdma_alloc_dmamap(void)
 {
-	int i;
 	bus_dmamap_t map;
 
 	mtx_lock(&busdma_mtx);
-	for (i = 0; i < BUSDMA_STATIC_MAPS; i++)
-		if (!(map_pool[i].flags & DMAMAP_STATIC_BUSY)) {
-			bzero(&map_pool[i], sizeof(map_pool[i]));
-			map_pool[i].flags |= DMAMAP_STATIC_BUSY;
-			mtx_unlock(&busdma_mtx);
-			return (&map_pool[i]);
-		}
+	map = TAILQ_FIRST(&dmamap_freelist);
+	TAILQ_REMOVE(&dmamap_freelist, map, freelist);
 	mtx_unlock(&busdma_mtx);
-	map = malloc(sizeof(*map), M_DEVBUF, M_NOWAIT | M_ZERO);
-	if (map)
-		map->flags |= DMAMAP_ALLOCATED;
+	if (!map) {
+		map = malloc(sizeof(*map), M_DEVBUF, M_NOWAIT);
+		if (map)
+			map->flags = DMAMAP_ALLOCATED;
+	} else
+		map->flags = 0;
 	return (map);
 }
 
-static void
+static __inline void 
 _busdma_free_dmamap(bus_dmamap_t map)
 {
 	if (map->flags & DMAMAP_ALLOCATED)
 		free(map, M_DEVBUF);
 	else {
 		mtx_lock(&busdma_mtx);
-		map->flags &= ~DMAMAP_STATIC_BUSY;
+		TAILQ_INSERT_HEAD(&dmamap_freelist, map, freelist);
 		mtx_unlock(&busdma_mtx);
 	}
 }
@@ -430,7 +441,7 @@
  * the starting segment on entrance, and the ending segment on exit.
  * first indicates if this is the first invocation of this function.
  */
-static int __inline
+static __inline int
 bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t *segs,
     bus_dmamap_t map, void *buf, bus_size_t buflen, struct pmap *pmap,
     int flags, vm_offset_t *lastaddrp, int *segp)
@@ -457,7 +468,7 @@
 		 * XXX Don't support checking for coherent mappings
 		 * XXX in user address space.
 		 */
-		if (0 && __predict_true(pmap == pmap_kernel())) {
+		if (__predict_true(pmap == pmap_kernel())) {
 			(void) pmap_get_pde_pte(pmap, vaddr, &pde, &ptep);
 			if (__predict_false(pmap_pde_section(pde))) {
 				curaddr = (*pde & L1_S_FRAME) |
@@ -763,7 +774,7 @@
 	return;
 }
 
-static void
+static __inline void
 bus_dmamap_sync_buf(void *buf, int len, bus_dmasync_op_t op)
 {
 
@@ -790,7 +801,7 @@
 		return;
 	if (map->flags & DMAMAP_COHERENT)
 		return;
-	if (map->len > PAGE_SIZE) {
+	if ((op && BUS_DMASYNC_POSTREAD) && (map->len > PAGE_SIZE)) {
 		cpu_dcache_wbinv_all();
 		return;
 	}
@@ -802,7 +813,8 @@
 	case DMAMAP_MBUF:
 		m = map->buffer;
 		while (m) {
-			bus_dmamap_sync_buf(m->m_data, m->m_len, op);
+			if (m->m_len > 0)
+				bus_dmamap_sync_buf(m->m_data, m->m_len, op);
 			m = m->m_next;
 		}
 		break;

==== //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#21 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.36 2005/06/24 17:41:28 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.37 2005/06/29 15:16:20 jhb Exp $");
 
 #include "opt_compat.h"
 
@@ -1232,30 +1232,20 @@
 freebsd32_xxx(struct thread *td, struct freebsd32_xxx_args *uap)
 {
 	int error;
-	caddr_t sg;
 	struct yyy32 *p32, s32;
 	struct yyy *p = NULL, s;
 
-	p32 = uap->zzz;
-	if (p32) {
-		sg = stackgap_init();
-		p = stackgap_alloc(&sg, sizeof(struct yyy));
-		uap->zzz = (struct yyy32 *)p;
-		error = copyin(p32, &s32, sizeof(s32));
+	if (uap->zzz) {
+		error = copyin(uap->zzz, &s32, sizeof(s32));
 		if (error)
 			return (error);
 		/* translate in */
-		error = copyout(&s, p, sizeof(s));
-		if (error)
-			return (error);
+		p = &s;
 	}
-	error = xxx(td, (struct xxx_args *) uap);
+	error = kern_xxx(td, p);
 	if (error)
 		return (error);
-	if (p32) {
-		error = copyin(p, &s, sizeof(s));
-		if (error)
-			return (error);
+	if (uap->zzz) {
 		/* translate out */
 		error = copyout(&s32, p32, sizeof(s32));
 	}

==== //depot/projects/smpng/sys/compat/freebsd32/freebsd32_util.h#3 (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/compat/freebsd32/freebsd32_util.h,v 1.9 2003/12/23 02:48:11 peter Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_util.h,v 1.10 2005/06/29 15:16:20 jhb Exp $
  */
 
 #include <vm/vm.h>
@@ -50,27 +50,3 @@
 
 #define FREEBSD32_PS_STRINGS	\
 	(FREEBSD32_USRSTACK - sizeof(struct freebsd32_ps_strings))
-
-static __inline caddr_t stackgap_init(void);
-static __inline void *stackgap_alloc(caddr_t *, size_t);
-
-static __inline caddr_t
-stackgap_init()
-{
-#define	szsigcode (*(curproc->p_sysent->sv_szsigcode))
-	return (caddr_t)(((caddr_t)FREEBSD32_PS_STRINGS) - szsigcode -
-	    SPARE_USRSPACE);
-#undef szsigcode
-}
-
-static __inline void *
-stackgap_alloc(sgp, sz)
-	caddr_t *sgp;
-	size_t   sz;
-{
-	void *p;
-
-	p = (void *) *sgp;
-	*sgp += ALIGN(sz);
-	return p;
-}

==== //depot/projects/smpng/sys/conf/Makefile.arm#9 (text+ko) ====

@@ -1,7 +1,7 @@
 # Makefile.arm -- with config changes.
 # Copyright 1990 W. Jolitz
 #	from: @(#)Makefile.i386	7.1 5/10/91
-# $FreeBSD: src/sys/conf/Makefile.arm,v 1.9 2005/04/13 14:49:57 imp Exp $
+# $FreeBSD: src/sys/conf/Makefile.arm,v 1.10 2005/06/27 14:33:32 cognet Exp $
 #
 # Makefile for FreeBSD
 #
@@ -41,6 +41,9 @@
 SYSTEM_LD += -EB
 .endif
 
+.if !defined(DEBUG)
+CFLAGS += -mno-apcs-frame
+.endif
 %BEFORE_DEPEND
 
 %OBJS

==== //depot/projects/smpng/sys/conf/options#101 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.508 2005/06/24 00:16:57 peter Exp $
+# $FreeBSD: src/sys/conf/options,v 1.509 2005/06/24 21:43:46 dwhite Exp $
 #
 #        On the handling of kernel options
 #
@@ -624,6 +624,9 @@
 ED_3C503		opt_ed.h
 ED_SIC			opt_ed.h
 
+# bge driver
+BGE_FAKE_AUTONEG	opt_bge.h
+
 # wi driver
 WI_SYMBOL_FIRMWARE	opt_wi.h
 

==== //depot/projects/smpng/sys/contrib/pf/net/if_pfsync.c#13 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/contrib/pf/net/if_pfsync.c,v 1.18 2005/06/12 16:46:20 mlaier Exp $	*/
+/*	$FreeBSD: src/sys/contrib/pf/net/if_pfsync.c,v 1.19 2005/06/26 21:00:52 mlaier Exp $	*/
 /*	$OpenBSD: if_pfsync.c,v 1.46 2005/02/20 15:58:38 mcbride Exp $	*/
 
 /*
@@ -224,6 +224,7 @@
 	callout_init(&sc->sc_bulk_tmo, NET_CALLOUT_MPSAFE);
 	callout_init(&sc->sc_bulkfail_tmo, NET_CALLOUT_MPSAFE);
 	callout_init(&sc->sc_send_tmo, NET_CALLOUT_MPSAFE);
+	sc->sc_ifq.ifq_maxlen = ifqmaxlen;
 	mtx_init(&sc->sc_ifq.ifq_mtx, ifp->if_xname, "pfsync send queue",
 	    MTX_DEF);
 	if_attach(ifp);
@@ -1797,7 +1798,7 @@
 
 		pfsyncstats.pfsyncs_opackets++;
 #ifdef __FreeBSD__
-		if (IF_HANDOFF(&sc->sc_ifq, m, NULL))
+		if (!IF_HANDOFF(&sc->sc_ifq, m, NULL))
 			pfsyncstats.pfsyncs_oerrors++;
 		callout_reset(&sc->sc_send_tmo, 1, pfsync_senddef, sc);
 #else

==== //depot/projects/smpng/sys/dev/acpica/acpi_quirks#5 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/dev/acpica/acpi_quirks,v 1.5 2005/02/22 21:54:20 jhb Exp $
+# $FreeBSD: src/sys/dev/acpica/acpi_quirks,v 1.6 2005/06/26 18:19:14 dwmalone Exp $
 #
 # Quirks for ACPI tables can be added here.
 #
@@ -260,6 +260,14 @@
 oem_rev:	FADT = 0
 quirks:		ACPI_Q_BROKEN
 
+# GA-5AX (Rev 4)
+# Testing indicates that the ACPI timer runs twice as fast but otherwise
+# this system works normally.
+name:		GBT_AWRDACPI
+oem:		FADT "GBT   " "AWRDACPI"
+oem_rev:	FADT <= 0x42302e31
+quirks:		ACPI_Q_TIMER
+
 # Hitachi Flora 220CX
 name:		Hitachi_Flora_220CX
 oem:		FADT "HTCLTD" "HTC2041 "

==== //depot/projects/smpng/sys/dev/ata/ata-disk.c#51 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.188 2005/05/16 13:07:26 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.189 2005/06/27 09:12:11 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -203,8 +203,7 @@
     struct ata_channel *ch = device_get_softc(device_get_parent(dev));
     struct ata_device *atadev = device_get_softc(dev);
 
-    /* if detach pending flag set, return error */
-
+    /* if detach pending, return error */
     if (((atadev->unit == ATA_MASTER) && !(ch->devices & ATA_ATA_MASTER)) ||
 	((atadev->unit == ATA_SLAVE) && !(ch->devices & ATA_ATA_SLAVE))) {
 	return 1;
@@ -327,7 +326,6 @@
 	do {
 	    DELAY(20);
 	} while (ch->hw.end_transaction(&request) == ATA_OP_CONTINUES);
-	ata_finish(&request);
     }
     if (request.status & ATA_S_ERROR)
 	return EIO;
@@ -341,14 +339,17 @@
 
     ATA_SETMODE(device_get_parent(dev), dev);
 
-    /* enable read caching */
-    ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_ENAB_RCACHE, 0, 0);
+    /* enable readahead caching */
+    if (atadev->param.support.command1 & ATA_SUPPORT_LOOKAHEAD)
+	ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_ENAB_RCACHE, 0, 0);
 
-    /* enable write caching if enabled */
-    if (ata_wc)
-	ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_ENAB_WCACHE, 0, 0);
-    else
-	ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_DIS_WCACHE, 0, 0);
+    /* enable write caching if supported and configured */
+    if (atadev->param.support.command1 & ATA_SUPPORT_WRITECACHE) {
+	if (ata_wc)
+	    ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_ENAB_WCACHE, 0, 0);
+	else
+	    ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_DIS_WCACHE, 0, 0);
+    }
 
     /* use multiple sectors/interrupt if device supports it */
     if (ad_version(atadev->param.version_major)) {

==== //depot/projects/smpng/sys/dev/ata/ata-queue.c#27 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.49 2005/05/11 14:36:26 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.50 2005/06/28 09:06:52 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -355,6 +355,7 @@
 	    bcopy(ccb, request->u.atapi.ccb, 16);
 	    request->data = (caddr_t)&request->u.atapi.sense_data;
 	    request->bytecount = sizeof(struct atapi_sense);
+	    request->donecount = 0;
 	    request->transfersize = sizeof(struct atapi_sense);
 	    request->timeout = 5;
 	    request->flags &= (ATA_R_ATAPI | ATA_R_QUIET);

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

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.90 2005/06/10 16:49:05 brooks Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.91 2005/06/24 21:43:46 dwhite Exp $");
 
 /*
  * Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
@@ -108,6 +108,8 @@
 
 #include <dev/bge/if_bgereg.h>
 
+#include "opt_bge.h"
+
 #define BGE_CSUM_FEATURES	(CSUM_IP | CSUM_TCP | CSUM_UDP)
 
 MODULE_DEPEND(bge, pci, 1, 1, 1);
@@ -3454,6 +3456,25 @@
 			return(EINVAL);
 		switch(IFM_SUBTYPE(ifm->ifm_media)) {
 		case IFM_AUTO:
+#ifndef BGE_FAKE_AUTONEG
+			/*
+			 * The BCM5704 ASIC appears to have a special
+			 * mechanism for programming the autoneg
+			 * advertisement registers in TBI mode.
+			 */
+			if (sc->bge_asicrev == BGE_ASICREV_BCM5704) {
+				uint32_t sgdig;
+				CSR_WRITE_4(sc, BGE_TX_TBI_AUTONEG, 0);
+				sgdig = CSR_READ_4(sc, BGE_SGDIG_CFG);
+				sgdig |= BGE_SGDIGCFG_AUTO|
+				    BGE_SGDIGCFG_PAUSE_CAP|
+				    BGE_SGDIGCFG_ASYM_PAUSE;
+				CSR_WRITE_4(sc, BGE_SGDIG_CFG,
+				    sgdig|BGE_SGDIGCFG_SEND);
+				DELAY(5);
+				CSR_WRITE_4(sc, BGE_SGDIG_CFG, sgdig);
+			}
+#endif
 			break;
 		case IFM_1000_SX:
 			if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {

==== //depot/projects/smpng/sys/dev/drm/radeon_cp.c#12 (text+ko) ====

@@ -27,7 +27,7 @@
  *    Kevin E. Martin <martin at valinux.com>
  *    Gareth Hughes <gareth at valinux.com>
  *
- * $FreeBSD: src/sys/dev/drm/radeon_cp.c,v 1.13 2005/04/16 03:44:44 anholt Exp $
+ * $FreeBSD: src/sys/dev/drm/radeon_cp.c,v 1.15 2005/06/28 21:38:08 anholt Exp $
  */
 
 #include "dev/drm/drmP.h"
@@ -2031,8 +2031,14 @@
 		break;
 	}
 
+	/* Disable initmaps because it is broken on FreeBSD, and results in
+	 * crashes on startup for some.  The proper fix will involve being
+	 * smarter about allocating PCI resources.
+	 */
+	/*
 	ret = drm_initmap(dev, drm_get_resource_start(dev, 2),
-			  drm_get_resource_len(dev, 2), 2, _DRM_REGISTERS, 0);
+			  drm_get_resource_len(dev, 2), 2, _DRM_REGISTERS,
+			  _DRM_READ_ONLY);
 	if (ret != 0)
 		return ret;
 
@@ -2041,6 +2047,7 @@
 			  _DRM_WRITE_COMBINING);
 	if (ret != 0)
 		return ret;
+	*/
 
 	/* The original method of detecting AGP is known to not work correctly,
 	 * according to Mike Harris.  The solution is to walk the capabilities

==== //depot/projects/smpng/sys/dev/ep/if_ep.c#21 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ep/if_ep.c,v 1.137 2005/06/10 16:49:07 brooks Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ep/if_ep.c,v 1.138 2005/06/26 04:19:45 imp Exp $");
 
 /*
  *	Modified from the FreeBSD 1.1.5.1 version by:
@@ -129,7 +129,7 @@
  * before
  */
 int
-get_e(struct ep_softc *sc, uint16_t offset, uint16_t *result)
+ep_get_e(struct ep_softc *sc, uint16_t offset, uint16_t *result)
 {
 
 	if (eeprom_rdy(sc))
@@ -158,7 +158,7 @@
 
 	GO_WINDOW(sc, 0);
 	for (i = EEPROM_NODE_ADDR_0; i <= EEPROM_NODE_ADDR_2; i++) {
-		error = get_e(sc, i, &result);
+		error = ep_get_e(sc, i, &result);
 		if (error)
 			return (error);
 		macaddr[i] = htons(result);
@@ -203,12 +203,12 @@
 	GO_WINDOW(sc, 0);
 	sc->epb.cmd_off = 0;
 
-	error = get_e(sc, EEPROM_PROD_ID, &result);
+	error = ep_get_e(sc, EEPROM_PROD_ID, &result);
 	if (error)
 		goto bad;
 	sc->epb.prod_id = result;
 
-	error = get_e(sc, EEPROM_RESOURCE_CFG, &result);
+	error = ep_get_e(sc, EEPROM_RESOURCE_CFG, &result);
 	if (error)
 		goto bad;
 	sc->epb.res_cfg = result;

==== //depot/projects/smpng/sys/dev/ep/if_ep_isa.c#12 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ep/if_ep_isa.c,v 1.26 2005/01/20 19:39:33 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ep/if_ep_isa.c,v 1.27 2005/06/26 04:19:45 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -361,13 +361,13 @@
 	uint8_t cksum_high = 0;
 	uint8_t cksum_low = 0;
 
-	error = get_e(sc, 0x0f, &val);
+	error = ep_get_e(sc, 0x0f, &val);
 	if (error)
 		return (ENXIO);
 	cksum = val;
 
 	for (i = 0; i < 0x0f; i++) {
-		error = get_e(sc, i, &val);
+		error = ep_get_e(sc, i, &val);
 		if (error)
 			return (ENXIO);
 		switch (i) {

==== //depot/projects/smpng/sys/dev/ep/if_ep_pccard.c#19 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ep/if_ep_pccard.c,v 1.44 2005/06/24 14:36:52 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ep/if_ep_pccard.c,v 1.46 2005/06/28 21:56:04 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -58,121 +58,57 @@
 #include <dev/pccard/pccardvar.h>
 #include <dev/pccard/pccard_cis.h>
 
-#include "card_if.h"
 #include "pccarddevs.h"
 
-static const char *ep_pccard_identify(u_short id);
-
-/*
- * Initialize the device - called from Slot manager.
- */
-static int
-ep_pccard_probe(device_t dev)
+struct ep_pccard_product
 {
-	struct ep_softc *sc = device_get_softc(dev);
-	struct ep_board *epb = &sc->epb;
-	const char *desc;
-	uint16_t result;
-	int error;
+	struct pccard_product prod;
+	int chipset;
+};
 
-	error = ep_alloc(dev);
-	if (error)
-		return (error);
+#define EP_CHIP_589	1	/* Classic 3c5x9 chipset */
+#define EP_CHIP_574	2	/* Roadrunner */
 
-	/*
-	 * It appears that the eeprom comes in two sizes.  There's
-	 * a 512 byte eeprom and a 2k eeprom.  Bit 13 of the eeprom
-	 * command register is supposed to contain the size of the
-	 * eeprom.
-	 */
-	/*
-	 * XXX - Certain (newer?) 3Com cards need epb->cmd_off ==
-	 * 2. Sadly, you need to have a correct cmd_off in order to
-	 * identify the card.  So we have to hit it with both and
-	 * cross our virtual fingers.  There's got to be a better way
-	 * to do this.  jyoung at accessus.net 09/11/1999
-	 */
+static const struct ep_pccard_product ep_pccard_products[] = {
+	{ PCMCIA_CARD(3COM, 3C1),		EP_CHIP_589 },
+	{ PCMCIA_CARD(3COM, 3C562),		EP_CHIP_589 },
+	{ PCMCIA_CARD(3COM, 3C589),		EP_CHIP_589 },
+	{ PCMCIA_CARD(3COM, 3CXEM556),		EP_CHIP_589 },
+	{ PCMCIA_CARD(3COM, 3CXEM556INT),	EP_CHIP_589 },
+	{ PCMCIA_CARD(3COM, 3C574),		EP_CHIP_574 },
+	{ PCMCIA_CARD(3COM, 3CCFEM556BI),	EP_CHIP_574 },
+	{ { NULL } }
+};
 
-	epb->cmd_off = 0;
-
-	/* XXX check return */
-	error = get_e(sc, EEPROM_PROD_ID, &result);
-	epb->prod_id = result;
-
-	if ((desc = ep_pccard_identify(epb->prod_id)) == NULL) {
-		if (bootverbose)
-			device_printf(dev, "Pass 1 of 2 detection "
-			    "failed (nonfatal) id 0x%x\n", epb->prod_id);
-		epb->cmd_off = 2;
-		/* XXX check return */
-		error = get_e(sc, EEPROM_PROD_ID, &result);
-		epb->prod_id = result;
-		if ((desc = ep_pccard_identify(epb->prod_id)) == NULL) {
-			device_printf(dev, "Unit failed to come ready or "
-			    "product ID unknown! (id 0x%x)\n", epb->prod_id);
-			ep_free(dev);
-			return (ENXIO);
-		}
-	}
-	device_set_desc(dev, desc);
-
-	/*
-	 * Newer cards supported by this device need to have their
-	 * MAC address set.
-	 */
-	error = ep_get_macaddr(sc, (u_char *)&IFP2ENADDR(sc->ifp));
-
-	ep_free(dev);
-	return (0);
-}
-
-static const char *
-ep_pccard_identify(u_short id)
+static const struct ep_pccard_product *
+ep_pccard_lookup(device_t dev)
 {
-	/* Determine device type and associated MII capabilities  */
-	switch (id) {
-	case 0x6055:	/* 3C556 */
-		return ("3Com 3C556");
-	case 0x4057:		/* 3C574 */
-		return ("3Com 3C574");
-	case 0x4b57:		/* 3C574B */
-		return ("3Com 3C574B, Megahertz 3CCFE574BT or "
-		    "Fast Etherlink 3C574-TX");
-	case 0x2b57:		/* 3CXSH572BT */
-		return ("3Com OfficeConnect 572BT");
-	case 0x9058:		/* 3C589 */
-		return ("3Com Etherlink III 3C589");
-	case 0x2056:		/* 3C562/3C563 */
-		return ("3Com 3C562D/3C563D");
-	case 0x0010:		/* 3C1 */
-		return ("3Com Megahertz C1");
-	case 0x0035:
-		return ("3Com 3CCEM556");
-	default:
-		return (NULL);
-	}
+	return ((const struct ep_pccard_product *)pccard_product_lookup(dev,
+	    (const struct pccard_product *)ep_pccard_products,
+	    sizeof(ep_pccard_products[0]), NULL));
 }
 
 static int
-ep_pccard_card_attach(struct ep_board * epb)
+ep_pccard_probe(device_t dev)
 {
-	/* Determine device type and associated MII capabilities  */
-	switch (epb->prod_id) {
-	case 0x6055:		/* 3C556 */
-	case 0x2b57:		/* 3C572BT */
-	case 0x4057:		/* 3C574, 3C574-TX */
-	case 0x4b57:		/* 3C574B */
-		epb->mii_trans = 1;
-		return (1);
-	case 0x2056:		/* 3C562D/3C563D */
-	case 0x9058:		/* 3C589 */
-	case 0x0010:		/* 3C1 */
-	case 0x0035:		/* 3C[XC]EM556 */
-		epb->mii_trans = 0;
-		return (1);
-	default:
-		return (0);
-	}
+	const struct ep_pccard_product *pp;
+	int		error;
+	uint32_t	fcn = PCCARD_FUNCTION_UNSPEC;
+
+	/* Make sure we're a network function */
+	error = pccard_get_function(dev, &fcn);
+	if (error != 0)
+		return (error);
+	if (fcn != PCCARD_FUNCTION_NETWORK)
+		return (ENXIO);
+
+	/* Check to see if we know about this card */
+	if ((pp = ep_pccard_lookup(dev)) == NULL)
+		return EIO;
+	if (pp->prod.pp_name != NULL)
+		device_set_desc(dev, pp->prod.pp_name);
+
+	return 0;
 }
 
 static int
@@ -181,34 +117,30 @@
 	struct ep_softc *sc = device_get_softc(dev);
 	uint16_t result;
 	int error = 0;
+	const struct ep_pccard_product *pp;
 
+	if ((pp = ep_pccard_lookup(dev)) == NULL)
+		panic("ep_pccard_attach: can't find product in attach.");
+
 	if ((error = ep_alloc(dev))) {
 		device_printf(dev, "ep_alloc() failed! (%d)\n", error);
 		goto bad;
 	}
-	sc->epb.cmd_off = 0;
 
-	/* XXX check return */
-	error = get_e(sc, EEPROM_PROD_ID, &result);
-	sc->epb.prod_id = result;
-
-	if (!ep_pccard_card_attach(&sc->epb)) {
+	if (pp->chipset == EP_CHIP_589) {
+		sc->epb.mii_trans = 0;
+		sc->epb.cmd_off = 0;
+	} else {
+		sc->epb.mii_trans = 1;
 		sc->epb.cmd_off = 2;
-		error = get_e(sc, EEPROM_PROD_ID, &result);
-		sc->epb.prod_id = result;
-		error = get_e(sc, EEPROM_RESOURCE_CFG, &result);
-		sc->epb.res_cfg = result;
-		if (!ep_pccard_card_attach(&sc->epb)) {
-			device_printf(dev,
-			    "Probe found ID, attach failed so ignore card!\n");
-			error = ENXIO;
-			goto bad;
-		}
 	}
-	error = get_e(sc, EEPROM_ADDR_CFG, &result);
+
+	error = ep_get_e(sc, EEPROM_PROD_ID, &result);
+	sc->epb.prod_id = result;
 
 	/* ROM size = 0, ROM base = 0 */
 	/* For now, ignore AUTO SELECT feature of 3C589B and later. */
+	error = ep_get_e(sc, EEPROM_ADDR_CFG, &result);
 	CSR_WRITE_2(sc, EP_W0_ADDRESS_CFG, result & 0xc000);
 
 	/* 
@@ -240,8 +172,8 @@
 		device_printf(dev, "ep_attach() failed! (%d)\n", error);
 		goto bad;
 	}
-	if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, ep_intr,
-		    sc, &sc->ep_intrhand))) {
+	if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE,
+	    ep_intr, sc, &sc->ep_intrhand))) {
 		device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
 		goto bad;
 	}
@@ -251,51 +183,12 @@
 	return (error);
 }
 
-static const struct pccard_product ep_pccard_products[] = {
-	PCMCIA_CARD(3COM, 3C1),
-	PCMCIA_CARD(3COM, 3C562),
-	PCMCIA_CARD(3COM, 3C574),	/* ROADRUNNER */
-	PCMCIA_CARD(3COM, 3C589),
-	PCMCIA_CARD(3COM, 3CCFEM556BI),	/* ROADRUNNER */
-	PCMCIA_CARD(3COM, 3CXEM556),
-	PCMCIA_CARD(3COM, 3CXEM556INT),
-	{NULL}
-};
-
-static int
-ep_pccard_match(device_t dev)
-{
-	const struct pccard_product *pp;
-	int		error;
-	uint32_t	fcn = PCCARD_FUNCTION_UNSPEC;
-
-	/* Make sure we're a network function */
-	error = pccard_get_function(dev, &fcn);
-	if (error != 0)
-		return (error);
-	if (fcn != PCCARD_FUNCTION_NETWORK)
-		return (ENXIO);
-
-	if ((pp = pccard_product_lookup(dev, ep_pccard_products,
-		    sizeof(ep_pccard_products[0]), NULL)) != NULL) {
-		if (pp->pp_name != NULL)
-			device_set_desc(dev, pp->pp_name);
-		return 0;
-	}
-	return EIO;
-}
-
 static device_method_t ep_pccard_methods[] = {
 	/* Device interface */
-	DEVMETHOD(device_probe, pccard_compat_probe),
-	DEVMETHOD(device_attach, pccard_compat_attach),
+	DEVMETHOD(device_probe, ep_pccard_probe),
+	DEVMETHOD(device_attach, ep_pccard_attach),
 	DEVMETHOD(device_detach, ep_detach),
 
-	/* Card interface */
-	DEVMETHOD(card_compat_match, ep_pccard_match),
-	DEVMETHOD(card_compat_probe, ep_pccard_probe),
-	DEVMETHOD(card_compat_attach, ep_pccard_attach),
-
 	{0, 0}
 };
 

==== //depot/projects/smpng/sys/dev/ep/if_epvar.h#9 (text+ko) ====

@@ -19,7 +19,7 @@
  * 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/ep/if_epvar.h,v 1.16 2005/06/10 16:49:07 brooks Exp $
+ * $FreeBSD: src/sys/dev/ep/if_epvar.h,v 1.17 2005/06/26 04:19:45 imp Exp $
  */
 
 struct ep_board {
@@ -79,7 +79,7 @@
 void ep_get_media(struct ep_softc *);
 int ep_attach(struct ep_softc *);
 void ep_intr(void *);
-int get_e(struct ep_softc *, uint16_t, uint16_t *);
+int ep_get_e(struct ep_softc *, uint16_t, uint16_t *);
 int ep_get_macaddr(struct ep_softc *, u_char *);
 
 #define CSR_READ_1(sc, off) (bus_space_read_1((sc)->bst, (sc)->bsh, off))

==== //depot/projects/smpng/sys/dev/iicbus/if_ic.c#13 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/iicbus/if_ic.c,v 1.22 2005/06/10 16:49:10 brooks Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/iicbus/if_ic.c,v 1.23 2005/06/26 18:11:09 dwmalone Exp $");
 
 /*
  * I2C bus IP driver
@@ -374,7 +374,13 @@
 	int s, len, sent;

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


More information about the p4-projects mailing list