Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Mar 2003 13:38:31 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 27305 for review
Message-ID:  <200303242138.h2OLcVY0054580@repoman.freebsd.org>

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

Change 27305 by jhb@jhb_laptop on 2003/03/24 13:38:25

	IFC @27302.

Affected files ...

.. //depot/projects/smpng/sys/alpha/conf/GENERIC#27 integrate
.. //depot/projects/smpng/sys/alpha/linux/linux_sysvec.c#11 integrate
.. //depot/projects/smpng/sys/alpha/osf1/imgact_osf1.c#9 integrate
.. //depot/projects/smpng/sys/compat/svr4/svr4_sysvec.c#11 integrate
.. //depot/projects/smpng/sys/conf/NOTES#39 integrate
.. //depot/projects/smpng/sys/conf/files.i386#37 integrate
.. //depot/projects/smpng/sys/conf/files.pc98#37 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-all.c#33 integrate
.. //depot/projects/smpng/sys/dev/awi/if_awi_pccard.c#5 integrate
.. //depot/projects/smpng/sys/dev/em/LICENSE#2 integrate
.. //depot/projects/smpng/sys/dev/em/README#6 integrate
.. //depot/projects/smpng/sys/dev/em/if_em.c#17 integrate
.. //depot/projects/smpng/sys/dev/em/if_em.h#12 integrate
.. //depot/projects/smpng/sys/dev/em/if_em_hw.c#7 integrate
.. //depot/projects/smpng/sys/dev/em/if_em_hw.h#7 integrate
.. //depot/projects/smpng/sys/dev/em/if_em_osdep.h#10 integrate
.. //depot/projects/smpng/sys/dev/firewire/firewire.c#12 integrate
.. //depot/projects/smpng/sys/dev/firewire/fwmem.c#7 integrate
.. //depot/projects/smpng/sys/dev/firewire/fwohci.c#13 integrate
.. //depot/projects/smpng/sys/dev/firewire/fwohci_pci.c#9 integrate
.. //depot/projects/smpng/sys/dev/md/md.c#31 integrate
.. //depot/projects/smpng/sys/dev/syscons/apm/apm_saver.c#4 integrate
.. //depot/projects/smpng/sys/dev/syscons/syscons.c#27 integrate
.. //depot/projects/smpng/sys/dev/usb/if_cue.c#10 integrate
.. //depot/projects/smpng/sys/dev/wi/if_wi.c#47 integrate
.. //depot/projects/smpng/sys/fs/fifofs/fifo_vnops.c#21 integrate
.. //depot/projects/smpng/sys/fs/pseudofs/pseudofs_vncache.c#15 integrate
.. //depot/projects/smpng/sys/geom/bde/g_bde.c#6 integrate
.. //depot/projects/smpng/sys/geom/geom.h#21 integrate
.. //depot/projects/smpng/sys/geom/geom_aes.c#7 integrate
.. //depot/projects/smpng/sys/geom/geom_apple.c#2 integrate
.. //depot/projects/smpng/sys/geom/geom_bsd.c#23 integrate
.. //depot/projects/smpng/sys/geom/geom_ctl.c#5 integrate
.. //depot/projects/smpng/sys/geom/geom_ctl.h#1 branch
.. //depot/projects/smpng/sys/geom/geom_dev.c#20 integrate
.. //depot/projects/smpng/sys/geom/geom_disk.c#20 integrate
.. //depot/projects/smpng/sys/geom/geom_event.c#13 integrate
.. //depot/projects/smpng/sys/geom/geom_ext.h#1 branch
.. //depot/projects/smpng/sys/geom/geom_gpt.c#9 integrate
.. //depot/projects/smpng/sys/geom/geom_int.h#8 integrate
.. //depot/projects/smpng/sys/geom/geom_kern.c#12 integrate
.. //depot/projects/smpng/sys/geom/geom_mbr.c#16 integrate
.. //depot/projects/smpng/sys/geom/geom_mirror.c#2 integrate
.. //depot/projects/smpng/sys/geom/geom_pc98.c#14 integrate
.. //depot/projects/smpng/sys/geom/geom_subr.c#20 integrate
.. //depot/projects/smpng/sys/geom/geom_sunlabel.c#15 integrate
.. //depot/projects/smpng/sys/geom/geom_vol_ffs.c#2 integrate
.. //depot/projects/smpng/sys/geom/notes#2 integrate
.. //depot/projects/smpng/sys/i386/acpica/acpi_machdep.c#7 integrate
.. //depot/projects/smpng/sys/i386/apm/apm.c#9 delete
.. //depot/projects/smpng/sys/i386/apm/apm.h#2 delete
.. //depot/projects/smpng/sys/i386/bios/apm.c#1 branch
.. //depot/projects/smpng/sys/i386/bios/apm.h#1 branch
.. //depot/projects/smpng/sys/i386/bios/mca_machdep.c#1 branch
.. //depot/projects/smpng/sys/i386/bios/mca_machdep.h#1 branch
.. //depot/projects/smpng/sys/i386/bios/smapi.c#1 branch
.. //depot/projects/smpng/sys/i386/bios/smapi_bios.S#1 branch
.. //depot/projects/smpng/sys/i386/bios/smbios.c#1 branch
.. //depot/projects/smpng/sys/i386/bios/vpd.c#1 branch
.. //depot/projects/smpng/sys/i386/conf/GENERIC#33 integrate
.. //depot/projects/smpng/sys/i386/i386/db_interface.c#15 integrate
.. //depot/projects/smpng/sys/i386/include/smapi.h#2 integrate
.. //depot/projects/smpng/sys/i386/isa/clock.c#23 integrate
.. //depot/projects/smpng/sys/i386/isa/if_le.c#9 integrate
.. //depot/projects/smpng/sys/i386/isa/intr_machdep.c#18 integrate
.. //depot/projects/smpng/sys/i386/isa/mca_machdep.c#3 integrate
.. //depot/projects/smpng/sys/i386/isa/spkr.c#11 integrate
.. //depot/projects/smpng/sys/i386/linux/linux_sysvec.c#28 integrate
.. //depot/projects/smpng/sys/i386/smapi/smapi.c#3 delete
.. //depot/projects/smpng/sys/i386/smapi/smapi_bios.S#2 delete
.. //depot/projects/smpng/sys/i386/smapi/smapi_isa.c#2 delete
.. //depot/projects/smpng/sys/i386/smapi/smapi_var.h#2 delete
.. //depot/projects/smpng/sys/ia64/conf/GENERIC#29 integrate
.. //depot/projects/smpng/sys/ia64/conf/SKI#11 integrate
.. //depot/projects/smpng/sys/kern/kern_exec.c#55 integrate
.. //depot/projects/smpng/sys/kern/kern_exit.c#58 integrate
.. //depot/projects/smpng/sys/kern/kern_fork.c#53 integrate
.. //depot/projects/smpng/sys/kern/kern_mutex.c#66 integrate
.. //depot/projects/smpng/sys/kern/sched_4bsd.c#6 integrate
.. //depot/projects/smpng/sys/kern/subr_witness.c#95 integrate
.. //depot/projects/smpng/sys/kern/sysv_sem.c#18 integrate
.. //depot/projects/smpng/sys/kern/uipc_sem.c#6 integrate
.. //depot/projects/smpng/sys/kern/uipc_usrreq.c#27 integrate
.. //depot/projects/smpng/sys/kern/vfs_aio.c#35 integrate
.. //depot/projects/smpng/sys/kern/vfs_subr.c#45 integrate
.. //depot/projects/smpng/sys/modules/apm/Makefile#5 integrate
.. //depot/projects/smpng/sys/modules/smapi/Makefile#2 integrate
.. //depot/projects/smpng/sys/net/bpf.c#23 integrate
.. //depot/projects/smpng/sys/net/if_arp.h#3 integrate
.. //depot/projects/smpng/sys/net/if_ethersubr.c#29 integrate
.. //depot/projects/smpng/sys/netatalk/aarp.c#6 integrate
.. //depot/projects/smpng/sys/netinet/ip.h#4 integrate
.. //depot/projects/smpng/sys/netinet/ip_icmp.c#17 integrate
.. //depot/projects/smpng/sys/netinet/ip_icmp.h#5 integrate
.. //depot/projects/smpng/sys/netncp/ncp_subr.c#4 integrate
.. //depot/projects/smpng/sys/nfsclient/nfs_vnops.c#25 integrate
.. //depot/projects/smpng/sys/pc98/conf/GENERIC#31 integrate
.. //depot/projects/smpng/sys/pc98/pc98/clock.c#15 integrate
.. //depot/projects/smpng/sys/pc98/pc98/spkr.c#9 delete
.. //depot/projects/smpng/sys/pci/if_dc.c#27 integrate
.. //depot/projects/smpng/sys/pci/if_de.c#8 integrate
.. //depot/projects/smpng/sys/powerpc/conf/GENERIC#15 integrate
.. //depot/projects/smpng/sys/sparc64/conf/GENERIC#26 integrate
.. //depot/projects/smpng/sys/sys/ata.h#12 integrate
.. //depot/projects/smpng/sys/sys/eventhandler.h#17 integrate
.. //depot/projects/smpng/sys/sys/mac.h#13 integrate
.. //depot/projects/smpng/sys/sys/mutex.h#35 integrate
.. //depot/projects/smpng/sys/sys/systm.h#39 integrate

Differences ...

==== //depot/projects/smpng/sys/alpha/conf/GENERIC#27 (text+ko) ====

@@ -18,13 +18,12 @@
 #
 # For hardware specific information check HARDWARE.TXT
 #
-# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.156 2003/02/13 22:24:43 obrien Exp $
+# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.157 2003/03/22 14:18:22 ru Exp $
 
 machine		alpha
 cpu		EV4
 cpu		EV5
 ident		GENERIC
-maxusers	0
 
 #To statically compile in device wiring instead of /boot/device.hints
 #hints		"GENERIC.hints"

==== //depot/projects/smpng/sys/alpha/linux/linux_sysvec.c#11 (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/alpha/linux/linux_sysvec.c,v 1.84 2002/09/01 21:41:22 jake Exp $
+ * $FreeBSD: src/sys/alpha/linux/linux_sysvec.c,v 1.85 2003/03/21 19:49:33 jhb Exp $
  */
 
 /* XXX we use functions that might not exist. */
@@ -75,25 +75,26 @@
 
 void osendsig(sig_t catcher, int sig, sigset_t *mask, u_long code);
 
-static int	elf_linux_fixup(long **stack_base,
+static int	elf_linux_fixup(register_t **stack_base,
     struct image_params *iparams);
 static int	exec_linux_imgact_try(struct image_params *iparams);
 
 static int
-elf_linux_fixup(long **stack_base, struct image_params *imgp)
+elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
 {
-	long *pos;
 	Elf64_Auxargs *args;
+	register_t *pos;
 
+	KASSERT(curthread->td_proc == imgp->proc &&
+	    (curthread->td_proc->p_flag & P_THREADED) == 0,
+	    ("unsafe elf_linux_fixup(), should be curproc"));
 	args = (Elf64_Auxargs *)imgp->auxargs;
 	pos = *stack_base + (imgp->argc + imgp->envc + 2);
 
-	if (args->trace) {
+	if (args->trace)
 		AUXARGS_ENTRY(pos, AT_DEBUG, 1);
-	}
-	if (args->execfd != -1) {
+	if (args->execfd != -1)
 		AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
-	}       
 	AUXARGS_ENTRY(pos, AT_PHDR, args->phdr);
 	AUXARGS_ENTRY(pos, AT_PHENT, args->phent);
 	AUXARGS_ENTRY(pos, AT_PHNUM, args->phnum);
@@ -101,19 +102,17 @@
 	AUXARGS_ENTRY(pos, AT_FLAGS, args->flags);
 	AUXARGS_ENTRY(pos, AT_ENTRY, args->entry);
 	AUXARGS_ENTRY(pos, AT_BASE, args->base);
-	PROC_LOCK(imgp->proc);
 	AUXARGS_ENTRY(pos, AT_UID, imgp->proc->p_ucred->cr_ruid);
 	AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid);
 	AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
 	AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
-	PROC_UNLOCK(imgp->proc);
 	AUXARGS_ENTRY(pos, AT_NULL, 0);
 	
 	free(imgp->auxargs, M_TEMP);      
 	imgp->auxargs = NULL;
 
 	(*stack_base)--;
-	**stack_base = (long)imgp->argc;
+	**stack_base = (register_t)imgp->argc;
 	return 0;
 }
 

==== //depot/projects/smpng/sys/alpha/osf1/imgact_osf1.c#9 (text+ko) ====

@@ -30,7 +30,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/alpha/osf1/imgact_osf1.c,v 1.17 2003/02/19 05:46:56 imp Exp $
+ * $FreeBSD: src/sys/alpha/osf1/imgact_osf1.c,v 1.18 2003/03/21 21:49:52 jhb Exp $
  */
 
 #include <sys/types.h>
@@ -96,12 +96,14 @@
         vm_offset_t  tsize;
 	struct nameidata *ndp;
 	Osf_Auxargs *osf_auxargs;
+	struct thread *td;
 
 	GIANT_REQUIRED;
 
 	execp = (const struct ecoff_exechdr*)imgp->image_header;
 	eap = &execp->a;
 	ndp = NULL;
+	td = FIRST_THREAD_IN_PROC(imgp->proc);
 
 /* check to make sure we have an alpha ecoff executable */
 	if (ECOFF_BADMAG(execp))
@@ -137,14 +139,15 @@
 		ndp = (struct nameidata *)malloc(sizeof(struct nameidata),
 		    M_TEMP, M_WAITOK);
 		NDINIT(ndp, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME, UIO_SYSSPACE,
-		    "/compat/osf1/sbin/loader",
-		    FIRST_THREAD_IN_PROC(imgp->proc));
+		    "/compat/osf1/sbin/loader", td);
 		error = namei(ndp);
 		if (error) {
 			uprintf("imgact_osf1: can't read /compat/osf1/sbin/loader\n");
 			free(imgp->auxargs, M_TEMP);
+			free(ndp, M_TEMP);
 			return(error);
-		} 
+		}
+		NDFREE(ndp, NDF_ONLY_PNBUF);
 		if (imgp->vp) {
 			vput(imgp->vp);
 		/* leaking in the nameizone ??? XXX */
@@ -192,7 +195,7 @@
 	    VM_PROT_READ|VM_PROT_EXECUTE, VM_PROT_ALL, MAP_FIXED|MAP_COPY,
 	    (caddr_t)imgp->vp, ECOFF_TXTOFF(execp)))) {
 		DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error));
-		return error;
+		goto bail;
 	}
 	/* .. data .. */
 	if ((error = vm_mmap(&vmspace->vm_map, &daddr, dsize,
@@ -238,9 +241,9 @@
  bail:
 	free(imgp->auxargs, M_TEMP);
 	if (ndp) {
-		VOP_CLOSE(ndp->ni_vp, FREAD, imgp->proc->p_ucred,
-		    FIRST_THREAD_IN_PROC(imgp->proc));
+		VOP_CLOSE(ndp->ni_vp, FREAD, td->td_ucred, td);
 		vrele(ndp->ni_vp);
+		free(ndp, M_TEMP);
 	}
 	return(error);
 }

==== //depot/projects/smpng/sys/compat/svr4/svr4_sysvec.c#11 (text+ko) ====

@@ -27,7 +27,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/svr4/svr4_sysvec.c,v 1.29 2003/02/19 05:46:59 imp Exp $
+ * $FreeBSD: src/sys/compat/svr4/svr4_sysvec.c,v 1.30 2003/03/21 19:49:34 jhb Exp $
  */
 
 /* XXX we use functions that might not exist. */
@@ -206,17 +206,19 @@
 static int
 svr4_fixup(register_t **stack_base, struct image_params *imgp)
 {
-	Elf32_Auxargs *args = (Elf32_Auxargs *)imgp->auxargs;
+	Elf32_Auxargs *args;
 	register_t *pos;
              
+	KASSERT(curthread->td_proc == imgp->proc &&
+	    (curthread->td_proc->p_flag & P_THREADED) == 0,
+	    ("unsafe svr4_fixup(), should be curproc"));
+	args = (Elf32_Auxargs *)imgp->auxargs;
 	pos = *stack_base + (imgp->argc + imgp->envc + 2);  
     
-	if (args->trace) {
+	if (args->trace)
 		AUXARGS_ENTRY(pos, AT_DEBUG, 1);
-	}
-	if (args->execfd != -1) {
+	if (args->execfd != -1)
 		AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
-	}       
 	AUXARGS_ENTRY(pos, AT_PHDR, args->phdr);
 	AUXARGS_ENTRY(pos, AT_PHENT, args->phent);
 	AUXARGS_ENTRY(pos, AT_PHNUM, args->phnum);
@@ -224,19 +226,17 @@
 	AUXARGS_ENTRY(pos, AT_FLAGS, args->flags);
 	AUXARGS_ENTRY(pos, AT_ENTRY, args->entry);
 	AUXARGS_ENTRY(pos, AT_BASE, args->base);
-	PROC_LOCK(imgp->proc);
 	AUXARGS_ENTRY(pos, AT_UID, imgp->proc->p_ucred->cr_ruid);
 	AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid);
 	AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
 	AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
-	PROC_UNLOCK(imgp->proc);
 	AUXARGS_ENTRY(pos, AT_NULL, 0);
 	
 	free(imgp->auxargs, M_TEMP);      
 	imgp->auxargs = NULL;
 
 	(*stack_base)--;
-	**stack_base = (int)imgp->argc;
+	**stack_base = (register_t)imgp->argc;
 	return 0;
 }
 

==== //depot/projects/smpng/sys/conf/NOTES#39 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1139 2003/03/11 22:47:05 sam Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1140 2003/03/22 14:18:21 ru Exp $
 #
 # NOTES -- Lines that can be cut/pasted into kernel and hints configs.
 #
@@ -44,9 +44,9 @@
 
 #
 # The `maxusers' parameter controls the static sizing of a number of
-# internal system tables by a formula defined in subr_param.c.  Setting
-# maxusers to 0 will cause the system to auto-size based on physical 
-# memory.
+# internal system tables by a formula defined in subr_param.c.
+# Omitting this parameter or setting it to 0 will cause the system to
+# auto-size based on physical memory.
 #
 maxusers	10
 

==== //depot/projects/smpng/sys/conf/files.i386#37 (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.i386,v 1.438 2003/02/28 21:59:13 ru Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.441 2003/03/24 19:40:54 mdodd Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -189,7 +189,12 @@
 	no-obj no-implicit-rule before-depend				\
 	clean		"acpi_wakecode.h acpi_wakecode.o acpi_wakecode.bin"
 #
-i386/apm/apm.c			optional	apm
+i386/bios/apm.c			optional	apm
+i386/bios/mca_machdep.c		optional	mca
+i386/bios/smapi.c		optional	smapi
+i386/bios/smapi_bios.S		optional	smapi
+i386/bios/smbios.c		optional	smbios
+i386/bios/vpd.c			optional	vpd
 i386/i386/atomic.c		standard				\
 	compile-with	"${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
 i386/i386/autoconf.c		standard
@@ -271,7 +276,6 @@
 i386/isa/isa_dma.c		optional	isa
 i386/isa/istallion.c		optional	stli nowerror
 i386/isa/loran.c		optional	loran
-i386/isa/mca_machdep.c		optional	mca
 i386/isa/mse.c			optional	mse
 i386/isa/npx.c			optional	npx
 i386/isa/pcaudio.c		optional	pca
@@ -301,9 +305,6 @@
 i386/linux/linux_sysvec.c	optional	compat_linux
 i386/pci/pci_cfgreg.c		optional	pci
 i386/pci/pci_bus.c		optional	pci
-i386/smapi/smapi.c		optional	smapi isa
-i386/smapi/smapi_isa.c		optional	smapi isa
-i386/smapi/smapi_bios.S		optional	smapi isa
 i386/svr4/svr4_locore.s		optional	compat_svr4		\
 	dependency	"svr4_assym.h"	\
 	warning "COMPAT_SVR4 is broken and should be avoided"

==== //depot/projects/smpng/sys/conf/files.pc98#37 (text+ko) ====

@@ -3,7 +3,7 @@
 #
 # modified for PC-9801
 #
-# $FreeBSD: src/sys/conf/files.pc98,v 1.265 2003/02/28 21:59:13 ru Exp $
+# $FreeBSD: src/sys/conf/files.pc98,v 1.266 2003/03/24 21:01:53 mdodd Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -239,6 +239,7 @@
 i386/isa/npx.c			optional	npx
 i386/isa/pmtimer.c		optional	pmtimer
 i386/isa/prof_machdep.c		optional	profiling-routine
+i386/isa/spkr.c			optional	speaker
 i386/isa/spigot.c		count		spigot
 i386/isa/stallion.c		optional	stl nowerror
 i386/isa/tw.c			count		tw
@@ -379,7 +380,6 @@
 pc98/pc98/scvtbpc98.c		optional	sc
 pc98/pc98/sio.c			optional	sio
 pc98/pc98/sio_cbus.c		optional	sio isa
-pc98/pc98/spkr.c		optional	speaker
 pc98/pc98/syscons.c		optional	sc
 pc98/pc98/syscons_pc98.c	optional	sc
 pc98/pc98/wd.c			count		wdc

==== //depot/projects/smpng/sys/dev/ata/ata-all.c#33 (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/ata/ata-all.c,v 1.172 2003/03/18 08:45:20 phk Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-all.c,v 1.173 2003/03/22 12:18:20 mux Exp $
  */
 
 #include "opt_ata.h"
@@ -304,6 +304,11 @@
     if (cmd != IOCATA)
 	return ENOTTY;
     
+    if (iocmd->cmd == ATAGMAXCHANNEL) {
+	iocmd->u.maxchan = devclass_get_maxunit(ata_devclass);
+	return 0;
+    }
+
     if (iocmd->channel < -1 || iocmd->device < -1 || iocmd->device > SLAVE)
 	return ENXIO;
 

==== //depot/projects/smpng/sys/dev/awi/if_awi_pccard.c#5 (text+ko) ====

@@ -22,7 +22,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/awi/if_awi_pccard.c,v 1.8 2002/11/14 23:54:49 sam Exp $
+ * $FreeBSD: src/sys/dev/awi/if_awi_pccard.c,v 1.9 2003/03/21 22:02:58 ru Exp $
  */
 
 #include <sys/param.h>
@@ -281,3 +281,4 @@
 extern devclass_t awi_devclass;
 
 DRIVER_MODULE(awi, pccard, awi_pccard_driver, awi_devclass, 0, 0);
+MODULE_DEPEND(awi, rc4, 1, 1, 1);

==== //depot/projects/smpng/sys/dev/em/LICENSE#2 (text+ko) ====

@@ -1,5 +1,5 @@
-$FreeBSD: src/sys/dev/em/LICENSE,v 1.1 2003/01/07 19:36:00 pdeuskar Exp $
-Copyright (c) 2001-2002, Intel Corporation 
+$FreeBSD: src/sys/dev/em/LICENSE,v 1.2 2003/03/21 21:47:30 pdeuskar Exp $
+Copyright (c) 2001-2003, Intel Corporation 
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without 

==== //depot/projects/smpng/sys/dev/em/README#6 (text+ko) ====

@@ -1,14 +1,14 @@
-$FreeBSD: src/sys/dev/em/README,v 1.5 2002/12/23 19:11:23 pdeuskar Exp $
+$FreeBSD: src/sys/dev/em/README,v 1.6 2003/03/21 21:47:30 pdeuskar Exp $
 FreeBSD* Driver for the Intel(R) PRO/1000 Family of Adapters
 ============================================================
 
-November 12, 2002
+February 5, 2003
 
 
 Contents
 ========
 
-- In This Release
+- Overview
 - Supported Adapters
 - Building and Installation
 - Speed and Duplex Configuration
@@ -18,17 +18,12 @@
 - License
 
 
-In This Release
-===============
+Overview
+========
 
-This file describes the FreeBSD* driver, version 1.4.x, for the Intel(R)
+This file describes the FreeBSD* driver, version 1.5.x, for the Intel(R)
 PRO/1000 Family of Adapters. This driver has been developed for use with 
-FreeBSD, version 4.7. As a new feature for this release, the driver is now 
-compiled by default into the FreeBSD 4.7 kernel.
-
-The driver supports Transmit/Receive Checksum Offload and Jumbo Frames on 
-all but the 82542-based adapters. For specific adapters, refer to the 
-Supported Adapters section below.
+FreeBSD, version 4.7. 
 
 For questions related to hardware requirements, refer to the documentation 
 supplied with your Intel PRO/1000 adapter. All hardware requirements listed 
@@ -56,8 +51,9 @@
    82544       PRO/1000 XF Server Adapter           A50484-xxx
 
    82544       PRO/1000 T Desktop Adapter           A62947-xxx
-
-   82540       PRO/1000 MT Desktop Adapter          A78708-xxx
+ 
+   82540       PRO/1000 MT Desktop Adapter          A78408-xxx
+   82541                                            C91016-xxx
 
    82545       PRO/1000 MT Server Adapter           A92165-xxx
 
@@ -70,6 +66,7 @@
    82546       PRO/1000 MF Dual Port Server Adapter A91620-xxx
 
 
+
 To verify your Intel adapter is supported, find the board ID number on the
 adapter. Look for a label that has a barcode and a number in the format of
 123456-001 (six digits hyphen three digits). Match this to the list of 
@@ -88,77 +85,90 @@
 Building and Installation
 =========================
 
-NOTE: You must have kernel sources installed in order to compile the driver
-      module.
+NOTE: The driver can be installed as a dynamic loadable kernel module or 
+      compiled into the kernel. You must have kernel sources installed in 
+      order to compile the driver module.
 
-      In the instructions below, x.x.x is the driver version as indicated in
-      the name of the driver tar.
-
+In the instructions below, x.x.x is the driver version as indicated in the 
+name of the driver tar file.
 
 1. Move the base driver tar file to the directory of your choice. For 
    example, use /home/username/em or /usr/local/src/em.
 
 2. Untar/unzip the archive:
 
-        tar xfz em-x.x.x.tar.gz
+        tar xvfz em-x.x.x.tar.gz
+
+   This will create an em-x.x.x directory.
+
+3. To create a loadable module, perform the following steps. 
+   NOTE: To compile the driver into the kernel, go directly to step 4.
+
+	a. To compile the module
+
+	          cd em-x.x.x
+      	          make
+
+   	b. To install the compiled module in system directory:
+	 
+		  make install
+		
+   	c. If you want the driver to load automatically when the system is booted:
 
-3. To load the driver onto a running system:
+      	      1. Follow steps a, and b above to compile and install the module
+	      2. Edit /boot/loader.conf, and add the following line:
 
-        cd em-x.x.x/modules
-        kldload ./if_em.ko
+      	          if_em_load="YES"
 
-4. To assign an IP address to the interface, enter the following:
+4. To compile the driver into the kernel:
 
-        ifconfig em<interface_num> <IP_address>
+        cd em-x.x.x/src
 
-5. Verify that the interface works. Enter the following, where <IP_address>
-   is the IP address for another machine on the same subnet as the interface
-   that is being tested:
+        cp if_em* /usr/src/sys/dev/em
 
-        ping <IP_address>
+        cp Makefile /usr/src/sys/modules/em
 
-6. If you want the driver to load automatically when the system is booted:
+   Edit the /usr/src/sys/conf/files.i386 file, and add the following lines:
 
-        cd em-x.x.x/modules
-        cp if_em.ko /modules
-        
-   Edit /boot/loader.conf, and add the following line:
-        
-             if_em_load="YES"
+        dev/em/if_em.c optional em
 
-               OR
+        dev/em/if_em_hw.c optional em 
 
-        compile the driver into the kernel (see item 7).
+   Remove the following lines from the /usr/src/sys/conf/files.i386 file, 
+   if they exist:
 
+        dev/em/if_em_fxhw.c optional em
+        dev/em/if_em_phy.c optional em
 
-   Edit /etc/rc.conf, and create the appropriate ifconfig_em<interface_num> 
-   entry:
+   Edit the kernel configuration file (i.e., GENERIC or MYKERNEL) in 
+   /usr/src/sys/i386/conf, and ensure the following line is present:
 
-        ifconfig_em<interface_num>="<ifconfig_settings>"
+        device em
 
-     Example usage:
+   Compile and install the kernel. The system must be rebooted for the kernel
+   updates to take effect. For additional information on compiling the 
+   kernel, consult the FreeBSD operating system documentation.
 
-        ifconfig_em0="inet 192.168.10.1 netmask 255.255.255.0"
+5. To assign an IP address to the interface, enter the following:
 
-     NOTE: For assistance, see the ifconfig man page.
+        ifconfig em<interface_num> <IP_address>
 
-7. If you want to compile the driver into the kernel, enter:
+6. Verify that the interface works. Enter the following, where <IP_address>
+   is the IP address for another machine on the same subnet as the interface
+   that is being tested:
 
-        cd em-x.x.x/src
-        cp if_em* /usr/src/sys/dev/em   
-        cp Makefile /usr/src/sys/modules/em
+        ping <IP_address>
 
-   Edit the /usr/src/sys/conf/files.i386 file, and add the following line:
+7. To configure the IP address to remain after reboot, edit /etc/rc.conf, 
+   and create the appropriate ifconfig_em<interface_num> entry:
 
-        dev/em/if_em_hw.c optional em
+        ifconfig_em<interface_num>="<ifconfig_settings>"
 
-   Remove the following lines from the /usr/src/sys/conf/files.i386 file, if 
-   they exist:
+   Example usage:
 
-        /dev/em/if_em_fx_hw.c optional em
-        /dev/em/if_em_phy.c optional em
+        ifconfig_em0="inet 192.168.10.1 netmask 255.255.255.0"
 
-   Compile and install the kernel.
+   NOTE: For assistance, see the ifconfig man page.
 
 
 Speed and Duplex Configuration
@@ -198,47 +208,79 @@
 Additional Configurations
 =========================
 
+The driver supports Transmit/Receive Checksum Offload and Jumbo Frames on 
+all but the 82542-based adapters. For specific adapters, refer to the 
+Supported Adapters section.
+
   Jumbo Frames
   ------------
-
   To enable Jumbo Frames, use the ifconfig utility to increase the MTU 
   beyond 1500 bytes. 
 
-  NOTE: Only enable Jumbo Frames if your network infrastructure supports 
-        them.
+  NOTES: Only enable Jumbo Frames if your network infrastructure supports 
+         them.
+   
+         The Jumbo Frames setting on the switch must be set to at least 
+         22 bytes larger than that of the adapter.
+
+  The Jumbo Frames MTU range for Intel Adapters is 1500 to 16114. The default 
+  MTU range is 1500. To modify the setting, enter the following:
+
+        ifconfig em<interface_num> <hostname or IP address> mtu 9000
 
-  The MTU range for Jumbo Frames is 1500 to 16114. For example, enter the 
-  following:
+  To confirm an interface's MTU value, use the ifconfig command. To confirm
+  the MTU used between two specific devices, use:
 
-        ifconfig em<interface_num> mtu 9000
+        route get <destination_IP_address>
 
   VLANs
   -----
+  To create a new VLAN pseudo-interface:
+
+        ifconfig <vlan_name> create
+
+  To associate the VLAN pseudo-interface with a physical interface and 
+  assign a VLAN ID, IP address, and netmask:
+
+        ifconfig <vlan_name> <ip_address> netmask <subnet_mask> vlan 
+           <vlan_id> vlandev <physical_interface>
+
+  Example:
+
+        ifconfig vlan10 10.0.0.1 netmask 255.255.255.0 vlan10 vlandev em0
+
+  In this example, all packets will be marked on egress with  802.1Q VLAN 
+  tags, specifying a VLAN ID of 10.
 
-  To enable VLANs in the kernel, modify the config file as follows:
+  To remove a VLAN pseudo-interface:
+
+        ifconfig <vlan_name> destroy
 
-        pseudo-device  vlan <num_VLANs>
+  Polling
+  -------
+  To enable polling in the driver, add the following options to the kernel 
+  configuration, and then recompile the kernel:
 
-  Then, recompile the kernel and reboot.
+        options DEVICE_POLLING
+        options HZ=1000
 
-  To see the VLAN device entries, use ifconfig.
+  At runtime, use the following command to turn on polling mode. Similarly,
+  turn off polling mode by setting the variable to 0:
 
-  To attach a VLAN to the driver enter the following:
+        sysctl kern.polling.enable=1
 
-        ifconfig vlan0 inet 10.0.0.1 netmask 255.255.255.0 vlan 1 vlandev 
-             em0 mtu 1500 up
 
-  Also, bring the driver up by entering:
+  NOTES: DEVICE POLLING is only valid for non-SMP kernels.
 
-        ifconfig em0 up
+         The driver has to be built into the kernel for DEVICE POLLING to be
+         enabled in the driver.
 
 
 Known Limitations
 =================
  
-There are known performance problems with this driver when running UDP 
-traffic with Jumbo Frames. Intel recommends not using Jumbo Frames for UDP
-traffic.
+There are known performance issues with this driver when running UDP traffic
+with Jumbo Frames. Intel recommends not using Jumbo Frames for UDP traffic.
 
 
 Support

==== //depot/projects/smpng/sys/dev/em/if_em.c#17 (text+ko) ====

@@ -1,6 +1,6 @@
 /**************************************************************************
 
-Copyright (c) 2001-2002, Intel Corporation
+Copyright (c) 2001-2003, Intel Corporation
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,7 @@
 
 ***************************************************************************/
 
-/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.19 2003/02/19 05:47:03 imp Exp $*/
+/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.20 2003/03/21 21:47:30 pdeuskar Exp $*/
 
 #include <dev/em/if_em.h>
 
@@ -51,7 +51,7 @@
  *  Driver version
  *********************************************************************/
 
-char em_driver_version[] = "1.4.10";
+char em_driver_version[] = "1.5.31";
 
 
 /*********************************************************************
@@ -63,6 +63,7 @@
  *
  *  { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index }
  *********************************************************************/
+
 static em_vendor_info_t em_vendor_info_array[] =
 {
         /* Intel(R) PRO/1000 Network Connection */
@@ -78,10 +79,15 @@
         { 0x8086, 0x1010, PCI_ANY_ID, PCI_ANY_ID, 0},
         { 0x8086, 0x1011, PCI_ANY_ID, PCI_ANY_ID, 0},
         { 0x8086, 0x1012, PCI_ANY_ID, PCI_ANY_ID, 0},
+        { 0x8086, 0x1013, PCI_ANY_ID, PCI_ANY_ID, 0},
+        { 0x8086, 0x1014, PCI_ANY_ID, PCI_ANY_ID, 0},
         { 0x8086, 0x1015, PCI_ANY_ID, PCI_ANY_ID, 0},
         { 0x8086, 0x1016, PCI_ANY_ID, PCI_ANY_ID, 0},
         { 0x8086, 0x1017, PCI_ANY_ID, PCI_ANY_ID, 0},
-        { 0x8086, 0x101E, PCI_ANY_ID, PCI_ANY_ID, 0},
+        { 0x8086, 0x1018, PCI_ANY_ID, PCI_ANY_ID, 0},
+        { 0x8086, 0x1019, PCI_ANY_ID, PCI_ANY_ID, 0},
+        { 0x8086, 0x101A, PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, 0x101E, PCI_ANY_ID, PCI_ANY_ID, 0},
         /* required last entry */
         { 0, 0, 0, 0, 0}
 };
@@ -103,7 +109,7 @@
 static int  em_shutdown(device_t);
 static void em_intr(void *);
 static void em_start(struct ifnet *);
-static int  em_ioctl(struct ifnet *, IOCTL_CMD_TYPE, caddr_t);
+static int  em_ioctl(struct ifnet *, u_long, caddr_t);
 static void em_watchdog(struct ifnet *);
 static void em_init(void *);
 static void em_stop(void *);
@@ -129,7 +135,7 @@
 static int  em_allocate_transmit_structures(struct adapter *);
 static void em_process_receive_interrupts(struct adapter *, int);
 static void em_receive_checksum(struct adapter *, 
-				struct em_rx_desc * rx_desc,
+				struct em_rx_desc *,
 				struct mbuf *);
 static void em_transmit_checksum_setup(struct adapter *,
 				       struct mbuf *,
@@ -142,8 +148,13 @@
 static void em_print_link_status(struct adapter *);
 static int  em_get_buf(int i, struct adapter *,
 		       struct mbuf *);
-static void em_enable_vlans(struct adapter *adapter);
-static int  em_encap(struct adapter *adapter, struct mbuf *m_head);
+static void em_enable_vlans(struct adapter *);
+static int  em_encap(struct adapter *, struct mbuf *);
+static void em_smartspeed(struct adapter *);
+static int  em_82547_fifo_workaround(struct adapter *, int);
+static void em_82547_update_fifo_head(struct adapter *, int);
+static int  em_82547_tx_fifo_reset(struct adapter *);
+static void em_82547_move_tail(void *arg);
 
 /*********************************************************************
  *  FreeBSD Device Interface Entry Points                    
@@ -254,6 +265,7 @@
 	em_adapter_list = adapter;
 
 	callout_handle_init(&adapter->timer_handle);
+	callout_handle_init(&adapter->tx_fifo_timer_handle);
 
 	/* Determine hardware revision */
 	em_identify_hardware(adapter);
@@ -271,30 +283,33 @@
         adapter->hw.tbi_compatibility_en = TRUE;
         adapter->rx_buffer_len = EM_RXBUFFER_2048;
                         
+	/* These parameters control the automatic generation(Tx) and 
+	 * response(Rx) to Ethernet PAUSE frames.
+	 */
         adapter->hw.fc_high_water = FC_DEFAULT_HI_THRESH;
         adapter->hw.fc_low_water  = FC_DEFAULT_LO_THRESH;
         adapter->hw.fc_pause_time = FC_DEFAULT_TX_TIMER;
         adapter->hw.fc_send_xon   = TRUE;
         adapter->hw.fc = em_fc_full;
 
+	adapter->hw.phy_init_script = 1;
 
-	/* Set the max frame size assuming standard ethernet sized frames */   
+	/* 
+	 * Set the max frame size assuming standard ethernet 
+	 * sized frames 
+	 */   
 	adapter->hw.max_frame_size = 
 		ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN;
 
 	adapter->hw.min_frame_size = 
 		MINIMUM_ETHERNET_PACKET_SIZE + ETHER_CRC_LEN;
 
-	/* This controls when hardware reports transmit completion status. */
-	if ((EM_REPORT_TX_EARLY == 0) || (EM_REPORT_TX_EARLY == 1)) {
-		adapter->hw.report_tx_early = EM_REPORT_TX_EARLY;
-	} else {
-		if (adapter->hw.mac_type < em_82543) {
-			adapter->hw.report_tx_early = 0;
-		} else {
-			adapter->hw.report_tx_early = 1;
-		}
-	}
+	/* 
+	 * This controls when hardware reports transmit completion 
+	 * status. 
+	 */
+	adapter->hw.report_tx_early = 1;
+
 
 	if (em_allocate_pci_resources(adapter)) {
 		printf("em%d: Allocation of PCI resources failed\n", 
@@ -305,6 +320,9 @@
 	}
   
 	
+	/* Initialize eeprom parameters */
+        em_init_eeprom_params(&adapter->hw);
+
 	tsize = EM_ROUNDUP(adapter->num_tx_desc *
 			   sizeof(struct em_tx_desc), 4096);
 
@@ -347,11 +365,15 @@
 	if (em_read_mac_addr(&adapter->hw) < 0) {
 		printf("em%d: EEPROM read error while reading mac address\n",
 		       adapter->unit);
+		em_free_pci_resources(adapter);
+		contigfree(adapter->tx_desc_base, tsize, M_DEVBUF);
+		contigfree(adapter->rx_desc_base, rsize, M_DEVBUF);
+		splx(s);
 		return(EIO);
 	}
 
-	memcpy(adapter->interface_data.ac_enaddr, adapter->hw.mac_addr,
-	       ETH_LENGTH_OF_ADDRESS);
+	bcopy(adapter->hw.mac_addr, adapter->interface_data.ac_enaddr,
+	      ETHER_ADDR_LEN);
 
 	/* Setup OS specific network interface */
 	em_setup_interface(dev, adapter);
@@ -373,7 +395,6 @@
 	} else
 		printf("em%d:  Speed:N/A  Duplex:N/A\n", adapter->unit);
 
-
 	INIT_DEBUGOUT("em_attach: end");
 	splx(s);
 	return(0);
@@ -403,9 +424,9 @@
 	em_stop(adapter);
 	em_phy_hw_reset(&adapter->hw);
 #if __FreeBSD_version < 500000
-	ether_ifdetach(&adapter->interface_data.ac_if, ETHER_BPF_SUPPORTED);
+        ether_ifdetach(&adapter->interface_data.ac_if, ETHER_BPF_SUPPORTED);
 #else
-	ether_ifdetach(&adapter->interface_data.ac_if);
+        ether_ifdetach(&adapter->interface_data.ac_if);
 #endif
 	em_free_pci_resources(adapter);
 
@@ -470,10 +491,10 @@
 static void
 em_start(struct ifnet *ifp)
 {
-        int             s; 
+        int             s;
         struct mbuf    *m_head;
         struct adapter *adapter = ifp->if_softc;
-        
+
         if (!adapter->link_active)
                 return;
 
@@ -484,14 +505,13 @@
                 
                 if (m_head == NULL) break;
                         
-                if (em_encap(adapter, m_head)) { 
-                        ifp->if_flags |= IFF_OACTIVE;
-                        IF_PREPEND(&ifp->if_snd, m_head);
-                        break;
+		if (em_encap(adapter, m_head)) { 
+			ifp->if_flags |= IFF_OACTIVE;
+			IF_PREPEND(&ifp->if_snd, m_head);
+			break;
                 }
 
-
-                /* Send a copy of the frame to the BPF listener */
+		/* Send a copy of the frame to the BPF listener */
 #if __FreeBSD_version < 500000
                 if (ifp->if_bpf)
                         bpf_mtap(ifp, m_head);
@@ -517,7 +537,7 @@
  **********************************************************************/
 
 static int
-em_ioctl(struct ifnet *ifp, IOCTL_CMD_TYPE command, caddr_t data)
+em_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
 {
 	int             s, mask, error = 0;
 	struct ifreq   *ifr = (struct ifreq *) data;
@@ -541,20 +561,20 @@
 			em_init(adapter);
 		}
 		break;

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

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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