Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jan 2004 18:22:29 -0800 (PST)
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 45183 for review
Message-ID:  <200401120222.i0C2MTlR087461@repoman.freebsd.org>

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

Change 45183 by imp@imp_pacopaco on 2004/01/11 18:22:05

	Power branch: IFC @45176

Affected files ...

.. //depot/projects/power/sys/alpha/alpha/mp_machdep.c#4 integrate
.. //depot/projects/power/sys/alpha/include/sysarch.h#2 integrate
.. //depot/projects/power/sys/amd64/include/sysarch.h#3 integrate
.. //depot/projects/power/sys/boot/forth/beastie.4th#4 integrate
.. //depot/projects/power/sys/compat/ndis/kern_ndis.c#4 integrate
.. //depot/projects/power/sys/compat/ndis/ndis_var.h#4 integrate
.. //depot/projects/power/sys/compat/ndis/subr_ndis.c#4 integrate
.. //depot/projects/power/sys/conf/files.i386#4 integrate
.. //depot/projects/power/sys/conf/majors#6 integrate
.. //depot/projects/power/sys/conf/newvers.sh#4 integrate
.. //depot/projects/power/sys/conf/options.i386#5 integrate
.. //depot/projects/power/sys/dev/acpica/Osd/OsdTable.c#2 integrate
.. //depot/projects/power/sys/dev/acpica/acpi.c#9 integrate
.. //depot/projects/power/sys/dev/an/if_an.c#4 integrate
.. //depot/projects/power/sys/dev/ata/ata-all.c#5 integrate
.. //depot/projects/power/sys/dev/ata/ata-all.h#5 integrate
.. //depot/projects/power/sys/dev/ata/ata-card.c#4 integrate
.. //depot/projects/power/sys/dev/ata/ata-cbus.c#2 integrate
.. //depot/projects/power/sys/dev/ata/ata-chipset.c#7 integrate
.. //depot/projects/power/sys/dev/ata/ata-disk.c#4 integrate
.. //depot/projects/power/sys/dev/ata/ata-dma.c#4 integrate
.. //depot/projects/power/sys/dev/ata/ata-isa.c#3 integrate
.. //depot/projects/power/sys/dev/ata/ata-lowlevel.c#5 integrate
.. //depot/projects/power/sys/dev/ata/ata-pci.c#5 integrate
.. //depot/projects/power/sys/dev/ata/ata-queue.c#4 integrate
.. //depot/projects/power/sys/dev/ata/ata-raid.c#4 integrate
.. //depot/projects/power/sys/dev/ata/atapi-cd.c#6 integrate
.. //depot/projects/power/sys/dev/ata/atapi-fd.c#3 integrate
.. //depot/projects/power/sys/dev/ata/atapi-tape.c#3 integrate
.. //depot/projects/power/sys/dev/bge/if_bge.c#5 integrate
.. //depot/projects/power/sys/dev/bge/if_bgereg.h#3 integrate
.. //depot/projects/power/sys/dev/firewire/firewire.c#8 integrate
.. //depot/projects/power/sys/dev/firewire/fwohci.c#8 integrate
.. //depot/projects/power/sys/dev/firewire/if_fwe.c#7 integrate
.. //depot/projects/power/sys/dev/firewire/sbp.c#7 integrate
.. //depot/projects/power/sys/dev/if_ndis/if_ndis.c#4 integrate
.. //depot/projects/power/sys/dev/if_ndis/if_ndisvar.h#3 integrate
.. //depot/projects/power/sys/dev/pci/pci_pci.c#6 integrate
.. //depot/projects/power/sys/dev/pci/pci_user.c#5 integrate
.. //depot/projects/power/sys/dev/pci/pcib_private.h#4 integrate
.. //depot/projects/power/sys/dev/sound/pci/emu10k1.c#2 integrate
.. //depot/projects/power/sys/dev/trm/trm.c#2 integrate
.. //depot/projects/power/sys/fs/smbfs/smbfs_vnops.c#4 integrate
.. //depot/projects/power/sys/geom/geom_subr.c#4 integrate
.. //depot/projects/power/sys/gnu/dev/sound/pci/emu10k1-ac97.h#2 integrate
.. //depot/projects/power/sys/gnu/dev/sound/pci/emu10k1-alsa.h#2 integrate
.. //depot/projects/power/sys/gnu/dev/sound/pci/emu10k1.h#2 integrate
.. //depot/projects/power/sys/i386/acpica/acpi_toshiba.c#1 branch
.. //depot/projects/power/sys/i386/conf/NOTES#7 integrate
.. //depot/projects/power/sys/i386/i386/pmap.c#6 integrate
.. //depot/projects/power/sys/i386/include/sysarch.h#2 integrate
.. //depot/projects/power/sys/ia64/include/sysarch.h#3 integrate
.. //depot/projects/power/sys/kern/kern_descrip.c#4 integrate
.. //depot/projects/power/sys/kern/kern_fork.c#4 integrate
.. //depot/projects/power/sys/kern/kern_sig.c#7 integrate
.. //depot/projects/power/sys/kern/kern_thread.c#4 integrate
.. //depot/projects/power/sys/kern/sys_pipe.c#5 integrate
.. //depot/projects/power/sys/kern/tty.c#3 integrate
.. //depot/projects/power/sys/kern/uipc_syscalls.c#5 integrate
.. //depot/projects/power/sys/kern/uipc_usrreq.c#3 integrate
.. //depot/projects/power/sys/kern/vfs_syscalls.c#5 integrate
.. //depot/projects/power/sys/modules/Makefile#6 integrate
.. //depot/projects/power/sys/modules/acpi/acpi/Makefile#2 integrate
.. //depot/projects/power/sys/modules/acpi/acpi_toshiba/Makefile#1 branch
.. //depot/projects/power/sys/modules/ida/Makefile#1 branch
.. //depot/projects/power/sys/modules/ndis/Makefile#2 integrate
.. //depot/projects/power/sys/modules/sound/driver/emu10k1/Makefile#2 integrate
.. //depot/projects/power/sys/net/if_atmsubr.c#3 integrate
.. //depot/projects/power/sys/net/route.c#6 integrate
.. //depot/projects/power/sys/netgraph/ng_ether.c#4 integrate
.. //depot/projects/power/sys/netinet/ip_icmp.c#6 integrate
.. //depot/projects/power/sys/netinet/ip_output.c#4 integrate
.. //depot/projects/power/sys/netinet/tcp.h#2 integrate
.. //depot/projects/power/sys/netinet/tcp_input.c#7 integrate
.. //depot/projects/power/sys/netinet/tcp_subr.c#8 integrate
.. //depot/projects/power/sys/netinet/tcp_usrreq.c#5 integrate
.. //depot/projects/power/sys/netinet/tcp_var.h#3 integrate
.. //depot/projects/power/sys/netinet6/in6.c#4 integrate
.. //depot/projects/power/sys/netinet6/in6_ifattach.c#4 integrate
.. //depot/projects/power/sys/netinet6/in6_pcb.c#5 integrate
.. //depot/projects/power/sys/pc98/i386/machdep.c#5 integrate
.. //depot/projects/power/sys/pci/if_dc.c#8 integrate
.. //depot/projects/power/sys/pci/if_dcreg.h#6 integrate
.. //depot/projects/power/sys/rpc/rpcclnt.c#2 integrate
.. //depot/projects/power/sys/sparc64/include/ofw_machdep.h#2 integrate
.. //depot/projects/power/sys/sparc64/include/sysarch.h#2 integrate
.. //depot/projects/power/sys/sparc64/sparc64/ofw_machdep.c#4 integrate
.. //depot/projects/power/sys/sys/filedesc.h#3 integrate
.. //depot/projects/power/sys/vm/vm_contig.c#4 integrate
.. //depot/projects/power/sys/vm/vm_extern.h#3 integrate
.. //depot/projects/power/sys/vm/vm_kern.c#6 integrate
.. //depot/projects/power/sys/vm/vm_page.c#5 integrate

Differences ...

==== //depot/projects/power/sys/alpha/alpha/mp_machdep.c#4 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.51 2003/12/03 14:57:25 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.52 2004/01/07 23:00:20 jhb Exp $");
 
 #include "opt_kstack_pages.h"
 
@@ -351,7 +351,7 @@
 	boot_cpu_id = PCPU_GET(cpuid);
 	KASSERT(boot_cpu_id == hwrpb->rpb_primary_cpu_id,
 	    ("cpu_mp_probe() called on non-primary CPU"));
-	all_cpus = 1 << boot_cpu_id;
+	all_cpus = PCPU_GET(cpumask);
 
 	mp_ncpus = 1;
 
@@ -413,12 +413,12 @@
 		all_cpus |= (1 << i);
 		mp_ncpus++;
 	}
-	PCPU_SET(other_cpus, all_cpus & ~(1 << boot_cpu_id));
+	PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
 
 	for (i = 0; i < hwrpb->rpb_pcs_cnt; i++) {
 		if (i == boot_cpu_id)
 			continue;
-		if (all_cpus & (1 << i))
+		if (!CPU_ABSENT(i))
 			smp_start_secondary(i);
 	}
 }
@@ -476,7 +476,7 @@
 void
 ipi_self(u_int64_t ipi)
 {
-	ipi_selected(1 << PCPU_GET(cpuid), ipi);
+	ipi_selected(PCPU_GET(cpumask), ipi);
 }
 
 /*
@@ -489,7 +489,7 @@
 	u_int64_t ipi;
 	int cpumask;
 
-	cpumask = 1 << PCPU_GET(cpuid);
+	cpumask = PCPU_GET(cpumask);
 
 	CTR1(KTR_SMP, "smp_handle_ipi(), ipis=%lx", ipis);
 	while (ipis) {

==== //depot/projects/power/sys/alpha/include/sysarch.h#2 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/alpha/include/sysarch.h,v 1.6 2002/03/20 18:58:45 obrien Exp $
+ * $FreeBSD: src/sys/alpha/include/sysarch.h,v 1.7 2004/01/09 16:52:08 nectar Exp $
  */
 
 /*
@@ -52,6 +52,7 @@
 
 __BEGIN_DECLS
 int		alpha_sethae(u_int64_t);
+int		sysarch(int, void *);
 __END_DECLS
 #endif
 

==== //depot/projects/power/sys/amd64/include/sysarch.h#3 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/sysarch.h,v 1.21 2003/10/23 06:06:14 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/sysarch.h,v 1.22 2004/01/09 16:52:08 nectar Exp $
  */
 
 /*
@@ -50,9 +50,10 @@
 
 __BEGIN_DECLS
 int amd64_get_fsbase(void **);
+int amd64_get_gsbase(void **);
 int amd64_set_fsbase(void *);
-int amd64_get_gsbase(void **);
 int amd64_set_gsbase(void *);
+int sysarch(int, void *);
 __END_DECLS
 #endif
 

==== //depot/projects/power/sys/boot/forth/beastie.4th#4 (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/boot/forth/beastie.4th,v 1.7 2003/10/28 17:18:42 scottl Exp $
+\ $FreeBSD: src/sys/boot/forth/beastie.4th,v 1.8 2004/01/09 19:20:47 scottl Exp $
 
 marker task-beastie.4th
 
@@ -228,6 +228,7 @@
 				s" acpi_load" unsetenv
 				s" 1" s" hint.acpi.0.disabled" setenv
 				s" 1" s" loader.acpi_disabled_by_user" setenv
+				s" 1" s" hint.apic.0.disabled" setenv
 			then
 			s" 0" s" hw.ata.ata_dma" setenv
 			s" 0" s" hw.ata.atapi_dma" setenv

==== //depot/projects/power/sys/compat/ndis/kern_ndis.c#4 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.23 2004/01/07 06:15:56 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.25 2004/01/09 06:53:49 wpaul Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -305,17 +305,17 @@
 	    "NDIS API Version", "0x00050001", CTLFLAG_RD);
 
 	/* Bus type (PCI, PCMCIA, etc...) */
-	sprintf(buf, "%d\n", (int)sc->ndis_iftype);
+	sprintf(buf, "%d", (int)sc->ndis_iftype);
 	ndis_add_sysctl(sc, "BusType", "Bus Type", buf, CTLFLAG_RD);
 
 	if (sc->ndis_res_io != NULL) {
-		sprintf(buf, "0x%lx\n", rman_get_start(sc->ndis_res_io));
+		sprintf(buf, "0x%lx", rman_get_start(sc->ndis_res_io));
 		ndis_add_sysctl(sc, "IOBaseAddress",
 		    "Base I/O Address", buf, CTLFLAG_RD);
 	}
 
 	if (sc->ndis_irq != NULL) {
-		sprintf(buf, "%lu\n", rman_get_start(sc->ndis_irq));
+		sprintf(buf, "%lu", rman_get_start(sc->ndis_irq));
 		ndis_add_sysctl(sc, "InterruptNumber",
 		    "Interrupt Number", buf, CTLFLAG_RD);
 	}
@@ -600,6 +600,7 @@
 	priv = &(*p)->np_private;
 	priv->npp_totlen = m0->m_pkthdr.len;
         priv->npp_packetooboffset = offsetof(ndis_packet, np_oob);
+	priv->npp_ndispktflags = NDIS_PACKET_ALLOCATED_BY_NDIS;
 
 	for (m = m0; m != NULL; m = m->m_next) {
 		if (m->m_len == 0)

==== //depot/projects/power/sys/compat/ndis/ndis_var.h#4 (text+ko) ====

@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/compat/ndis/ndis_var.h,v 1.12 2004/01/06 07:09:26 wpaul Exp $
+ * $FreeBSD: src/sys/compat/ndis/ndis_var.h,v 1.14 2004/01/09 06:53:49 wpaul Exp $
  */
 
 #ifndef _NDIS_VAR_H_
@@ -808,7 +808,7 @@
  */
 struct ndis_miniport_interrupt {
 	void			*ni_introbj;
-	ndis_spin_lock		ni_dpccountlock;
+	ndis_kspin_lock		ni_dpccountlock;
 	void			*ni_rsvd;
 	void			*ni_isrfunc;
 	void			*ni_dpcfunc;
@@ -919,6 +919,10 @@
 #define NDIS_FLAGS_SENT_AT_DPC                  0x00001000
 #define NDIS_FLAGS_USES_SG_BUFFER_LIST          0x00002000
 
+#define NDIS_PACKET_WRAPPER_RESERVED			0x3F
+#define NDIS_PACKET_CONTAINS_MEDIA_SPECIFIC_INFO	0x40
+#define NDIS_PACKET_ALLOCATED_BY_NDIS			0x80
+
 #define NDIS_PROTOCOL_ID_DEFAULT        0x00
 #define NDIS_PROTOCOL_ID_TCP_IP         0x02
 #define NDIS_PROTOCOL_ID_IPX            0x06
@@ -1157,6 +1161,14 @@
 
 TAILQ_HEAD(nte_head, ndis_timer_entry);
 
+struct ndis_fh {
+	void			*nf_vp;
+	void			*nf_map;
+	uint32_t		nf_maplen; 
+};
+
+typedef struct ndis_fh ndis_fh;
+
 /*
  * The miniport block is basically the internal NDIS handle. We need
  * to define this because, unfortunately, it is not entirely opaque

==== //depot/projects/power/sys/compat/ndis/subr_ndis.c#4 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.30 2004/01/07 19:26:47 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.32 2004/01/09 06:53:49 wpaul Exp $");
 
 /*
  * This file implements a translation layer between the BSD networking
@@ -65,6 +65,10 @@
 #include <sys/smp.h>
 #include <sys/queue.h>
 #include <sys/taskqueue.h>
+#include <sys/proc.h>
+#include <sys/namei.h>
+#include <sys/fcntl.h>
+#include <sys/vnode.h>
 
 #include <net/if.h>
 #include <net/if_arp.h>
@@ -100,7 +104,11 @@
 #define FUNC void(*)(void)
 
 static struct mtx ndis_interlock;
+static char ndis_filepath[MAXPATHLEN];
 
+SYSCTL_STRING(_hw, OID_AUTO, ndis_filepath, CTLFLAG_RW, ndis_filepath,
+        MAXPATHLEN, "Path used by NdisOpenFile() to search for files");
+
 __stdcall static void ndis_initwrap(ndis_handle,
 	ndis_driver_object *, void *, void *);
 __stdcall static ndis_status ndis_register_miniport(ndis_handle,
@@ -272,6 +280,7 @@
 {
 	mtx_init(&ndis_interlock, "ndislock", MTX_NETWORK_LOCK,
 	    MTX_DEF | MTX_RECURSE | MTX_DUPOK);
+	strcpy(ndis_filepath, "/compat/ndis");
 
 	return(0);
 }
@@ -1539,6 +1548,13 @@
 	pkt->np_private.npp_packetooboffset =
 	    offsetof(ndis_packet, np_oob);
 
+	/*
+	 * We must initialize the packet flags correctly in order
+	 * for the NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO() and
+	 * NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO() to work correctly.
+	 */
+	pkt->np_private.npp_ndispktflags = NDIS_PACKET_ALLOCATED_BY_NDIS;
+
 	*packet = pkt;
 
 	head->np_private.npp_count++;
@@ -2323,12 +2339,50 @@
 	ndis_physaddr		highestaddr;
 {
 	char			*afilename = NULL;
+	struct thread		*td = curthread;
+	struct nameidata	nd;
+	int			flags, error;
+	struct vattr		vat;
+	struct vattr		*vap = &vat;
+	ndis_fh			*fh;
+	char			path[MAXPATHLEN];
 
-	ndis_unicode_to_ascii(filename->nus_buf, filename->nus_len, &afilename);
-	printf("ndis_open_file(\"%s\", %ju)\n", afilename,
-	    highestaddr.np_quad);
+	ndis_unicode_to_ascii(filename->nus_buf,
+	    filename->nus_len, &afilename);
+
+	sprintf(path, "%s/%s", ndis_filepath, afilename);
 	free(afilename, M_DEVBUF);
-	*status = NDIS_STATUS_FILE_NOT_FOUND;
+
+	fh = malloc(sizeof(ndis_fh), M_TEMP, M_NOWAIT);
+	if (fh == NULL) {
+		*status = NDIS_STATUS_RESOURCES;
+		return;
+	}
+
+	mtx_lock(&Giant);
+	NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, td);
+
+	flags = FREAD;
+	error = vn_open(&nd, &flags, 0, -1);
+	if (error) {
+		mtx_unlock(&Giant);
+		*status = NDIS_STATUS_FILE_NOT_FOUND;
+		free(fh, M_TEMP);
+		return;
+	}
+
+	NDFREE(&nd, NDF_ONLY_PNBUF);
+
+	/* Get the file size. */
+	VOP_GETATTR(nd.ni_vp, vap, NOCRED, td);
+	VOP_UNLOCK(nd.ni_vp, 0, td);
+	mtx_unlock(&Giant);
+
+	fh->nf_vp = nd.ni_vp;
+	fh->nf_map = NULL;
+	*filehandle = fh;
+	*filelength = fh->nf_maplen = vap->va_size & 0xFFFFFFFF;
+	*status = NDIS_STATUS_SUCCESS;
 	return;
 }
 
@@ -2338,8 +2392,46 @@
 	void			**mappedbuffer;
 	ndis_handle		filehandle;
 {
+	ndis_fh			*fh;
+	struct thread		*td = curthread;
+	int			error, resid;
 
-	*status = NDIS_STATUS_ALREADY_MAPPED;
+	if (filehandle == NULL) {
+		*status = NDIS_STATUS_FAILURE;
+		return;
+	}
+
+	fh = (ndis_fh *)filehandle;
+
+	if (fh->nf_vp == NULL) {
+		*status = NDIS_STATUS_FAILURE;
+		return;
+	}
+
+	if (fh->nf_map != NULL) {
+		*status = NDIS_STATUS_ALREADY_MAPPED;
+		return;
+	}
+
+	fh->nf_map = malloc(fh->nf_maplen, M_DEVBUF, M_NOWAIT);
+
+	if (fh->nf_map == NULL) {
+		*status = NDIS_STATUS_RESOURCES;
+		return;
+	}
+
+	mtx_lock(&Giant);
+	error = vn_rdwr(UIO_READ, fh->nf_vp, fh->nf_map, fh->nf_maplen, 0,
+	    UIO_SYSSPACE, 0, td->td_ucred, NOCRED, &resid, td);
+	mtx_unlock(&Giant);
+
+	if (error)
+		*status = NDIS_STATUS_FAILURE;
+	else {
+		*status = NDIS_STATUS_SUCCESS;
+		*mappedbuffer = fh->nf_map;
+	}
+
 	return;
 }
 
@@ -2347,6 +2439,14 @@
 ndis_unmap_file(filehandle)
 	ndis_handle		filehandle;
 {
+	ndis_fh			*fh;
+	fh = (ndis_fh *)filehandle;
+
+	if (fh->nf_map == NULL)
+		return;
+	free(fh->nf_map, M_DEVBUF);
+	fh->nf_map = NULL;
+
 	return;
 }
 
@@ -2354,6 +2454,28 @@
 ndis_close_file(filehandle)
 	ndis_handle		filehandle;
 {
+	struct thread		*td = curthread;
+	ndis_fh			*fh;
+
+	if (filehandle == NULL)
+		return;
+
+	fh = (ndis_fh *)filehandle;
+	if (fh->nf_map != NULL) {
+		free(fh->nf_map, M_DEVBUF);
+		fh->nf_map = NULL;
+	}
+
+	if (fh->nf_vp == NULL)
+		return;
+
+	mtx_lock(&Giant);
+	vn_close(fh->nf_vp, FREAD, td->td_ucred, td);
+	mtx_unlock(&Giant);
+
+	fh->nf_vp = NULL;
+	free(fh, M_DEVBUF);
+
 	return;
 }
 

==== //depot/projects/power/sys/conf/files.i386#4 (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.460 2003/12/11 22:34:36 wpaul Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.461 2004/01/11 19:18:38 njl Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -168,6 +168,7 @@
 geom/geom_mbr_enc.c		standard
 i386/acpica/OsdEnvironment.c	optional	acpi
 i386/acpica/acpi_machdep.c	optional	acpi
+i386/acpica/acpi_toshiba.c	optional	acpi_toshiba acpi
 i386/acpica/acpi_wakeup.c	optional	acpi
 acpi_wakecode.h			optional	acpi			\
 	dependency 	"$S/i386/acpica/acpi_wakecode.S"		\

==== //depot/projects/power/sys/conf/majors#6 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/majors,v 1.186 2003/12/13 18:12:57 phk Exp $
+# $FreeBSD: src/sys/conf/majors,v 1.187 2004/01/11 06:24:34 rwatson Exp $
 #
 # This list is semi-obsoleted by DEVFS, but for now it still contains
 # the current allocation of device major numbers.
@@ -118,7 +118,6 @@
 115	dag		University of Waikato DAG network capture boards
 117	*acd		ATAPI CDROM
 119	*ast		ATAPI tape
-120	aud		Audit Device <rwatson@FreeBSD.org>
 121	onew		Dallas Semiconductor One-Wire bus <phk@freebsd.org>
 122	*uhid		USB HID devices <n_hibma>
 123	*fb		frame buffer

==== //depot/projects/power/sys/conf/newvers.sh#4 (text+ko) ====

@@ -32,7 +32,7 @@
 # SUCH DAMAGE.
 #
 #	@(#)newvers.sh	8.1 (Berkeley) 4/20/94
-# $FreeBSD: src/sys/conf/newvers.sh,v 1.57 2003/12/07 03:56:12 scottl Exp $
+# $FreeBSD: src/sys/conf/newvers.sh,v 1.60 2004/01/11 14:13:29 ru Exp $
 
 TYPE="FreeBSD"
 REVISION="5.2"
@@ -56,9 +56,9 @@
 do
 	if [ -r "$bsd_copyright" ]; then
 		COPYRIGHT=`sed \
-		    -e "s/\[year\]/$year/" \
-		    -e 's/\[your name here\]\.* /FreeBSD Inc./' \
-		    -e 's/\[your name\]\.*/FreeBSD Inc./' \
+		    -e "s/\[year\]/1992-$year/" \
+		    -e 's/\[your name here\]\.* /The FreeBSD Project./' \
+		    -e 's/\[your name\]\.*/The FreeBSD Project./' \
 		    -e '/\[id for your version control system, if any\]/d' \
 		    $bsd_copyright` 
 		break
@@ -68,8 +68,8 @@
 # no copyright found, use a dummy
 if [ X"$COPYRIGHT" = X ]; then
 	COPYRIGHT="/*
- * Copyright (c) $year
- *	FreeBSD Inc. All rights reserved.
+ * Copyright (c) 1992-$year The FreeBSD Project.
+ * All rights reserved.
  *
  */"
 fi

==== //depot/projects/power/sys/conf/options.i386#5 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options.i386,v 1.206 2003/12/30 07:28:53 bde Exp $
+# $FreeBSD: src/sys/conf/options.i386,v 1.207 2004/01/08 17:13:10 wpaul Exp $
 # Options specific to the i386 platform kernels
 
 AUTO_EOI_1		opt_auto_eoi.h
@@ -27,6 +27,7 @@
 DEBUG_SVR4		opt_svr4.h
 PECOFF_SUPPORT		opt_dontuse.h
 PECOFF_DEBUG		opt_pecoff.h
+NDISAPI			opt_dontuse.h
 
 # Change KVM size.  Changes things all over the kernel.
 KVA_PAGES		opt_global.h

==== //depot/projects/power/sys/dev/acpica/Osd/OsdTable.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/dev/acpica/Osd/OsdTable.c,v 1.3 2003/04/29 18:50:34 njl Exp $
+ *	$FreeBSD: src/sys/dev/acpica/Osd/OsdTable.c,v 1.4 2004/01/09 20:01:42 njl Exp $
  */
 
 /*
@@ -46,16 +46,19 @@
     ACPI_STRING                 *NewVal)
 {
     if (InitVal == NULL || NewVal == NULL)
-        return(AE_BAD_PARAMETER);
+	return (AE_BAD_PARAMETER);
 
     *NewVal = NULL;
-    if (strncmp(InitVal->Name, "_OS_", 4) == 0 &&
-      getenv_string("hw.acpi.os_name", acpi_os_name, sizeof(acpi_os_name))) {
-        printf("ACPI: Overriding _OS definition with \"%s\"\n", acpi_os_name);
-        *NewVal = acpi_os_name;
+
+    /* Allow both _OS and _OS_ to be overridden. */
+    if (strncmp(InitVal->Name, "_OS", 3) == 0 &&
+	getenv_string("hw.acpi.os_name", acpi_os_name, sizeof(acpi_os_name))) {
+
+	printf("ACPI: Overriding _OS definition with \"%s\"\n", acpi_os_name);
+	*NewVal = acpi_os_name;
     }
 
-    return(AE_OK);
+    return (AE_OK);
 }
 
 ACPI_STATUS
@@ -93,4 +96,3 @@
 
     return(AE_OK);
 }
-

==== //depot/projects/power/sys/dev/acpica/acpi.c#9 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.112 2003/12/26 15:42:13 jhb Exp $
+ *	$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.113 2004/01/09 21:04:28 njl Exp $
  */
 
 #include "opt_acpi.h"
@@ -268,8 +268,9 @@
 {
     ACPI_TABLE_HEADER	th;
     char		buf[20];
+    int			error;
+    struct sbuf		sb;
     ACPI_STATUS		status;
-    int			error;
     ACPI_LOCK_DECL;
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
@@ -288,8 +289,15 @@
 		      AcpiFormatException(status));
 	error = ENXIO;
     } else {
-	sprintf(buf, "%.6s %.8s", th.OemId, th.OemTableId);
-	device_set_desc_copy(dev, buf);
+	sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN);
+	sbuf_bcat(&sb, th.OemId, 6);
+	sbuf_trim(&sb);
+	sbuf_putc(&sb, ' ');
+	sbuf_bcat(&sb, th.OemTableId, 8);
+	sbuf_trim(&sb);
+	sbuf_finish(&sb);
+	device_set_desc_copy(dev, sbuf_data(&sb));
+	sbuf_delete(&sb);
 	error = 0;
     }
     ACPI_UNLOCK;

==== //depot/projects/power/sys/dev/an/if_an.c#4 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/an/if_an.c,v 1.57 2003/12/30 01:07:12 ambrisko Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/an/if_an.c,v 1.58 2004/01/10 03:02:04 ambrisko Exp $");
 
 /*
  * The Aironet 4500/4800 series cards come in PCMCIA, ISA and PCI form.
@@ -2729,27 +2729,6 @@
 			ifp->if_timer = 5;
 		}
 	} else { /* MPI-350 */
-/* HACK */
-		{
-			struct an_command	cmd_struct;
-			struct an_reply		reply;
-			/*
-			 * Allocate TX descriptor
-			 */
-			
-			bzero(&reply,sizeof(reply));
-			cmd_struct.an_cmd   = AN_CMD_ALLOC_DESC;
-			cmd_struct.an_parm0 = AN_DESCRIPTOR_TX;
-			cmd_struct.an_parm1 = AN_TX_DESC_OFFSET;
-			cmd_struct.an_parm2 = AN_MAX_TX_DESC;
-			if (an_cmd_struct(sc, &cmd_struct, &reply)) {
-				printf("an%d: failed to allocate TX "
-				    "descriptor\n", 
-				    sc->an_unit);
-				return;
-			}
-		}
-/* HACK */
 		while (sc->an_rdata.an_tx_empty ||
 		    idx != sc->an_rdata.an_tx_cons) {
 			IF_DEQUEUE(&ifp->if_snd, m0);

==== //depot/projects/power/sys/dev/ata/ata-all.c#5 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
+ * Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.198 2003/11/30 16:27:58 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.199 2004/01/11 22:08:34 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -40,7 +40,7 @@
 #include <sys/bus.h>
 #include <sys/bio.h>
 #include <sys/malloc.h>
-#include <sys/mutex.h>
+#include <sys/sema.h>
 #include <sys/sysctl.h>
 #include <sys/taskqueue.h>
 #include <machine/stdarg.h>
@@ -60,13 +60,13 @@
 static struct cdevsw ata_cdevsw = {  
 	.d_ioctl =	ata_ioctl,
 	.d_name =	"ata",
-	.d_maj =	159,
 };
 
 /* prototypes */
 static void ata_shutdown(void *, int);
 static int ata_getparam(struct ata_device *, u_int8_t);
 static void ata_identify_devices(struct ata_channel *);
+static void ata_fail_requests(struct ata_channel *ch,struct ata_device *device);
 static void ata_boot_attach(void);
 static void bswap(int8_t *, int);
 static void btrim(int8_t *, int);
@@ -175,7 +175,6 @@
 ata_detach(device_t dev)
 {
     struct ata_channel *ch;
-    struct ata_request *request;
  
     if (!dev || !(ch = device_get_softc(dev)) || !ch->r_irq)
 	return ENXIO;
@@ -190,16 +189,9 @@
 #endif
 
     /* fail outstanding requests on this channel */
-    mtx_lock(&ch->queue_mtx);
-    while ((request = TAILQ_FIRST(&ch->ata_queue))) {
-	TAILQ_REMOVE(&ch->ata_queue, request, chain);
-	request->status = ATA_S_ERROR;
-	mtx_unlock(&ch->queue_mtx);
-	ata_finish(request);
-	mtx_lock(&ch->queue_mtx);
-    }
-    mtx_unlock(&ch->queue_mtx);
+    ata_fail_requests(ch, NULL);
 
+    /* flush cache and powerdown device */
     if (ch->device[MASTER].param) {
 	if (ch->device[MASTER].param->support.command2 & ATA_SUPPORT_FLUSHCACHE)
 	    ata_controlcmd(&ch->device[MASTER], ATA_FLUSHCACHE, 0, 0, 0);
@@ -237,42 +229,51 @@
 	return ENXIO;
 
     /* reset the HW */
-    ata_printf(ch, -1, "resetting devices ..\n");
+    if (bootverbose)
+	ata_printf(ch, -1, "reiniting channel ..\n");
     ATA_FORCELOCK_CH(ch, ATA_CONTROL);
+    ch->flags |= ATA_IMMEDIATE_MODE;
     ch->running = NULL;
     devices = ch->devices;
     ch->hw.reset(ch);
     ATA_UNLOCK_CH(ch);
 
+    if (bootverbose)
+	ata_printf(ch, -1, "resetting done ..\n");
+
     /* detach what left the channel during reset */
     if ((misdev = devices & ~ch->devices)) {
 	if ((misdev & (ATA_ATA_MASTER | ATA_ATAPI_MASTER)) &&
 	    ch->device[MASTER].detach) {
 	    if (request && (request->device == &ch->device[MASTER])) {
 		request->result = ENXIO;
-		request->flags |= ATA_R_DONE;
 		if (request->callback)
 		    (request->callback)(request);
 		else
-        	    wakeup(request);
+        	    sema_post(&request->done);
 	    }
 	    ch->device[MASTER].detach(&ch->device[MASTER]);
+	    ata_fail_requests(ch, &ch->device[MASTER]);
+	    free(ch->device[MASTER].param, M_ATA);
+	    ch->device[MASTER].param = NULL;
 	}
 	if ((misdev & (ATA_ATA_SLAVE | ATA_ATAPI_SLAVE)) &&
 	    ch->device[SLAVE].detach) {
 	    if (request && (request->device == &ch->device[SLAVE])) {
 		request->result = ENXIO;
-		request->flags |= ATA_R_DONE;
 		if (request->callback)
 		    (request->callback)(request);
 		else
-        	    wakeup(request);
+        	    sema_post(&request->done);
 	    }
 	    ch->device[SLAVE].detach(&ch->device[SLAVE]);
+	    ata_fail_requests(ch, &ch->device[SLAVE]);
+	    free(ch->device[SLAVE].param, M_ATA);
+	    ch->device[SLAVE].param = NULL;
 	}
     }
-
-    /* identify whats present on this channel now */
+    
+    /* identify what is present on the channel now */
     ata_identify_devices(ch);
 
     /* attach new devices that appeared during reset */
@@ -285,17 +286,26 @@
 	    ch->device[SLAVE].attach(&ch->device[SLAVE]);
     }
 
-    /* restore transfermode on devices */
-    if (ch->devices & (ATA_ATA_MASTER | ATA_ATAPI_MASTER))
+    /* restore device config and transfermode on devices */
+    if (ch->devices & (ATA_ATA_MASTER | ATA_ATAPI_MASTER)) {
+	if (ch->device[MASTER].config)
+	    ch->device[MASTER].config(&ch->device[MASTER]);
 	ch->device[MASTER].setmode(&ch->device[MASTER],ch->device[MASTER].mode);
-    if (ch->devices & (ATA_ATA_SLAVE | ATA_ATAPI_SLAVE))
+    }
+    if (ch->devices & (ATA_ATA_SLAVE | ATA_ATAPI_SLAVE)) {
+	if (ch->device[SLAVE].config)
+	    ch->device[SLAVE].config(&ch->device[SLAVE]);
 	ch->device[SLAVE].setmode(&ch->device[SLAVE], ch->device[SLAVE].mode);
+    }
 
 #ifdef DEV_ATAPICAM
     atapi_cam_reinit_bus(ch);
 #endif
 
-    printf("done\n");
+    if (bootverbose)
+	ata_printf(ch, -1, "device config done ..\n");
+    ch->flags &= ~ATA_IMMEDIATE_MODE;
+    ata_start(ch);
     return 0;
 }
 
@@ -543,21 +553,18 @@
 static int 
 ata_getparam(struct ata_device *atadev, u_int8_t command)
 {
-    struct ata_params *atacap;
     struct ata_request *request;
     int error = ENOMEM;
 
-    if (atadev->param)
-	atacap = atadev->param;
-    else
-	atacap = malloc(sizeof(struct ata_params), M_ATA, M_NOWAIT);
-    if (atacap) {
+    if (!atadev->param)
+	atadev->param = malloc(sizeof(struct ata_params), M_ATA, M_NOWAIT);
+    if (atadev->param) {
 	request = ata_alloc_request(); 
 	if (request) {
 	    request->device = atadev;
 	    request->u.ata.command = command;
-	    request->flags = (ATA_R_READ | ATA_R_QUIET);
-	    request->data = (caddr_t)atacap;
+	    request->flags = (ATA_R_READ | ATA_R_AT_HEAD);
+	    request->data = (caddr_t)atadev->param;
 	    request->timeout = 2;
 	    request->retries = 3;
 	    request->bytecount = sizeof(struct ata_params);
@@ -566,18 +573,19 @@
 		ata_queue_request(request);
 		if (!(error = request->result))
 		    break;
-		request->flags &= ~ATA_R_QUIET;
 		request->retries--;
 	    }
 	    ata_free_request(request);
 	}
-	if (!isprint(atacap->model[0]) || !isprint(atacap->model[1]))
+	if (!isprint(atadev->param->model[0]) ||
+	    !isprint(atadev->param->model[1]))
 	    error = ENXIO;
 	if (error) {
+	    free(atadev->param, M_ATA);
 	    atadev->param = NULL;
-	    free(atacap, M_ATA);
 	}
 	else {
+	    struct ata_params *atacap = atadev->param;
 #if BYTE_ORDER == BIG_ENDIAN
 	    int16_t *ptr;
 
@@ -598,7 +606,6 @@
 	    bswap(atacap->serial, sizeof(atacap->serial));
 	    btrim(atacap->serial, sizeof(atacap->serial));
 	    bpack(atacap->serial, atacap->serial, sizeof(atacap->serial));
-	    atadev->param = atacap;
 	    if (bootverbose)
 		ata_prtdev(atadev,
 			   "pio=0x%02x wdma=0x%02x udma=0x%02x cable=%spin\n",
@@ -694,6 +701,24 @@
     }
 }
 
+static void
+ata_fail_requests(struct ata_channel *ch, struct ata_device *device)
+{
+    struct ata_request *request;
+
+    mtx_lock(&ch->queue_mtx);
+    while ((request = TAILQ_FIRST(&ch->ata_queue))) {
+	if (device == NULL || request->device == device) {
+	    TAILQ_REMOVE(&ch->ata_queue, request, chain);
+	    request->result = ENXIO;
+	    mtx_unlock(&ch->queue_mtx);
+	    ata_finish(request);
+	    mtx_lock(&ch->queue_mtx);
+	}
+    }
+    mtx_unlock(&ch->queue_mtx);
+}
+
 static void 
 ata_boot_attach(void)
 {
@@ -964,12 +989,12 @@
 	printf("ata: malloc of delayed attach hook failed\n");
 	return;
     }
-
     ata_delayed_attach->ich_func = (void*)ata_boot_attach;
     if (config_intrhook_establish(ata_delayed_attach) != 0) {
 	printf("ata: config_intrhook_establish failed\n");
 	free(ata_delayed_attach, M_TEMP);
     }
+
     /* Register a handler to flush write caches on shutdown */
     if ((EVENTHANDLER_REGISTER(shutdown_post_sync, ata_shutdown,
 			       NULL, SHUTDOWN_PRI_DEFAULT)) == NULL)

==== //depot/projects/power/sys/dev/ata/ata-all.h#5 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
+ * Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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.h,v 1.68 2003/11/28 19:01:28 sos Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.69 2004/01/11 22:08:34 sos Exp $
  */
 
 /* ATA register defines */

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



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