Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 May 2005 00:04:29 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 76720 for review
Message-ID:  <200505090004.j4904TbM010050@repoman.freebsd.org>

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

Change 76720 by marcel@marcel_nfs on 2005/05/09 00:03:29

	IFC @76719

Affected files ...

.. //depot/projects/tty/share/man/man4/man4.i386/ep.4#9 integrate
.. //depot/projects/tty/sys/compat/ndis/kern_windrv.c#3 integrate
.. //depot/projects/tty/sys/compat/ndis/ntoskrnl_var.h#7 integrate
.. //depot/projects/tty/sys/compat/ndis/subr_hal.c#7 integrate
.. //depot/projects/tty/sys/dev/if_ndis/if_ndis_pccard.c#6 integrate
.. //depot/projects/tty/sys/dev/if_ndis/if_ndis_pci.c#7 integrate
.. //depot/projects/tty/sys/vm/vm_meter.c#8 integrate
.. //depot/projects/tty/usr.sbin/ndiscvt/windrv_stub.c#2 integrate

Differences ...

==== //depot/projects/tty/share/man/man4/man4.i386/ep.4#9 (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/share/man/man4/man4.i386/ep.4,v 1.34 2005/02/13 23:45:49 ru Exp $
+.\" $FreeBSD: src/share/man/man4/man4.i386/ep.4,v 1.35 2005/05/08 22:36:10 imp Exp $
 .\"
 .Dd September 5, 2004
 .Dt EP 4 i386
@@ -94,7 +94,7 @@
 .It
 3Com 3C569B-J-TPO, 3C569B-J-COMBO CBUS
 .It
-3Com 3C574-TX, 3CCFE574BT, 3CXFE574BT, 3C3FE574BT PCMCIA
+3Com 3C574, 3C574TX, 3C574-TX, 3CCFE574BT, 3CXFE574BT, 3C3FE574BT PCMCIA
 .It
 3Com 3C579-TP, 3C579-BNC EISA
 .It

==== //depot/projects/tty/sys/compat/ndis/kern_windrv.c#3 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_windrv.c,v 1.8 2005/04/24 20:21:21 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_windrv.c,v 1.10 2005/05/08 23:19:20 wpaul Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -204,7 +204,7 @@
 	STAILQ_FOREACH(d, &drvdb_head, link) {
 		if (d->windrv_devlist == NULL)
 			continue;
-		match = matchfunc(d->windrv_devlist, ctx);
+		match = matchfunc(d->windrv_bustype, d->windrv_devlist, ctx);
 		if (match == TRUE) {
 			mtx_unlock(&drvdb_mtx);
 			return(d);
@@ -307,6 +307,8 @@
 	return(0);
 }
 
+#define WINDRV_LOADED		htonl(0x42534F44)
+
 /*
  * Loader routine for actual Windows driver modules, ultimately
  * calls the driver's DriverEntry() routine.
@@ -327,12 +329,17 @@
 	struct drvdb_ent	*new;
 	struct driver_object	*drv;
 	int			status;
+	uint32_t		*ptr;
 
 	/*
 	 * First step: try to relocate and dynalink the executable
 	 * driver image.
 	 */
 
+	ptr = (uint32_t *)(img + 8);
+        if (*ptr == WINDRV_LOADED)
+		goto skipreloc;
+
 	/* Perform text relocation */
 	if (pe_relocate(img))
 		return(ENOEXEC);
@@ -357,6 +364,10 @@
 			return(ENOEXEC);
 	}
 
+	*ptr = WINDRV_LOADED;
+
+skipreloc:
+
 	/* Next step: find the driver entry point. */
 
 	pe_get_optional_header(img, &opt_hdr);

==== //depot/projects/tty/sys/compat/ndis/ntoskrnl_var.h#7 (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/ntoskrnl_var.h,v 1.34 2005/05/05 03:56:09 wpaul Exp $
+ * $FreeBSD: src/sys/compat/ndis/ntoskrnl_var.h,v 1.35 2005/05/08 23:19:20 wpaul Exp $
  */
 
 #ifndef _NTOSKRNL_VAR_H_
@@ -1225,7 +1225,7 @@
 
 extern image_patch_table ntoskrnl_functbl[];
 typedef void (*funcptr)(void);
-typedef int (*matchfuncptr)(void *, void *);
+typedef int (*matchfuncptr)(interface_type, void *, void *);
 
 __BEGIN_DECLS
 extern int windrv_libinit(void);

==== //depot/projects/tty/sys/compat/ndis/subr_hal.c#7 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_hal.c,v 1.22 2005/05/05 03:56:09 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_hal.c,v 1.23 2005/05/08 23:07:50 wpaul Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -394,9 +394,9 @@
 	IMPORT_SFUNC(READ_PORT_ULONG, 1),
 	IMPORT_SFUNC(READ_PORT_USHORT, 1),
 	IMPORT_SFUNC(READ_PORT_UCHAR, 1),
-	IMPORT_SFUNC(READ_PORT_BUFFER_ULONG, 2),
-	IMPORT_SFUNC(READ_PORT_BUFFER_USHORT, 2),
-	IMPORT_SFUNC(READ_PORT_BUFFER_UCHAR, 2),
+	IMPORT_SFUNC(READ_PORT_BUFFER_ULONG, 3),
+	IMPORT_SFUNC(READ_PORT_BUFFER_USHORT, 3),
+	IMPORT_SFUNC(READ_PORT_BUFFER_UCHAR, 3),
 	IMPORT_FFUNC(KfAcquireSpinLock, 1),
 	IMPORT_FFUNC(KfReleaseSpinLock, 1),
 	IMPORT_SFUNC(KeGetCurrentIrql, 0),

==== //depot/projects/tty/sys/dev/if_ndis/if_ndis_pccard.c#6 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_pccard.c,v 1.11 2005/04/24 20:21:22 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_pccard.c,v 1.13 2005/05/08 23:19:20 wpaul Exp $");
 
 #include <sys/ctype.h>
 #include <sys/param.h>
@@ -69,7 +69,8 @@
 static int ndis_attach_pccard	(device_t);
 static struct resource_list *ndis_get_resource_list
 				(device_t, device_t);
-static int ndis_devcompare	(struct ndis_pccard_type *, device_t);
+static int ndis_devcompare	(interface_type,
+				 struct ndis_pccard_type *, device_t);
 extern int ndisdrv_modevent	(module_t, int, void *);
 extern int ndis_attach		(device_t);
 extern int ndis_shutdown	(device_t);
@@ -111,13 +112,17 @@
 DRIVER_MODULE(ndis, pccard, ndis_driver, ndis_devclass, ndisdrv_modevent, 0);
 
 static int
-ndis_devcompare(t, dev)
+ndis_devcompare(bustype, t, dev)
+	interface_type		bustype;
 	struct ndis_pccard_type	*t;
 	device_t		dev;
 {
 	const char		*prodstr, *vendstr;
 	int			error;
 
+	if (bustype != PCMCIABus)
+		return(FALSE);
+
 	error = pccard_get_product_str(dev, &prodstr);
 	if (error)
 		return(FALSE);
@@ -185,7 +190,8 @@
 	db = windrv_match((matchfuncptr)ndis_devcompare, dev);
 	if (db == NULL)
 		return (ENXIO);
-
+	sc->ndis_dobj = db->windrv_object;
+	sc->ndis_regvals = db->windrv_regvals;
 	resource_list_init(&sc->ndis_rl);
 
 	sc->ndis_io_rid = 0;

==== //depot/projects/tty/sys/dev/if_ndis/if_ndis_pci.c#7 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_pci.c,v 1.16 2005/05/08 02:06:57 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_pci.c,v 1.17 2005/05/08 23:19:20 wpaul Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -68,7 +68,8 @@
 static int ndis_attach_pci	(device_t);
 static struct resource_list *ndis_get_resource_list
 				(device_t, device_t);
-static int ndis_devcompare	(struct ndis_pci_type *, device_t);
+static int ndis_devcompare	(interface_type,
+				 struct ndis_pci_type *, device_t);
 extern int ndisdrv_modevent	(module_t, int, void *);
 extern int ndis_attach		(device_t);
 extern int ndis_shutdown	(device_t);
@@ -103,10 +104,14 @@
 DRIVER_MODULE(ndis, cardbus, ndis_driver, ndis_devclass, ndisdrv_modevent, 0);
 
 static int
-ndis_devcompare(t, dev)
+ndis_devcompare(bustype, t, dev)
+	interface_type		bustype;
 	struct ndis_pci_type	*t;
 	device_t		dev;
 {
+	if (bustype != PCIBus)
+		return(FALSE);
+
 	while(t->ndis_name != NULL) {
 		if ((pci_get_vendor(dev) == t->ndis_vid) &&
 		    (pci_get_device(dev) == t->ndis_did) &&

==== //depot/projects/tty/sys/vm/vm_meter.c#8 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_meter.c,v 1.84 2005/04/12 23:15:28 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_meter.c,v 1.85 2005/05/08 23:56:16 marcel Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -55,7 +55,7 @@
 /*
  * Virtual memory MPSAFE temporary workarounds.
  */
-#if defined(__alpha__) || defined(__amd64__) || defined(__i386__) || defined(__sparc64__)
+#if !defined(__arm__) && !defined(__powerpc__)
 int debug_mpsafevm = 1;
 #else
 int debug_mpsafevm;

==== //depot/projects/tty/usr.sbin/ndiscvt/windrv_stub.c#2 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/ndiscvt/windrv_stub.c,v 1.1 2005/04/24 20:21:22 wpaul Exp $");
+__FBSDID("$FreeBSD: src/usr.sbin/ndiscvt/windrv_stub.c,v 1.2 2005/05/08 23:07:51 wpaul Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -71,14 +71,14 @@
 
 
 #ifdef NDIS_PCI_DEV_TABLE
-static struct ndis_pci_type ndis_devs[] = {
+static struct ndis_pci_type ndis_devs_pci[] = {
         NDIS_PCI_DEV_TABLE
         { 0, 0, 0, NULL }
 };
 #endif
 
 #ifdef NDIS_PCMCIA_DEV_TABLE
-static struct ndis_pccard_type ndis_devs[] = {
+static struct ndis_pccard_type ndis_devs_pccard[] = {
         NDIS_PCMCIA_DEV_TABLE
         { NULL, NULL, NULL }
 };
@@ -206,15 +206,6 @@
 	int			error = 0;
 	vm_offset_t		drv_data_start;
 	vm_offset_t		drv_data_end;
-	interface_type		drv_type;
-
-#ifdef NDIS_PCI_DEV_TABLE
-	drv_type = PCIBus;
-#endif
-
-#ifdef NDIS_PCMCIA_DEV_TABLE
-	drv_type = PCMCIABus;
-#endif
 
 	drv_data_start = (vm_offset_t)&DRV_DATA_START;
 	drv_data_end = (vm_offset_t)&DRV_DATA_END;
@@ -225,14 +216,25 @@
 		windrv_loaded++;
 		if (windrv_loaded > 1)
 			break;
-		windrv_load(mod, drv_data_start, drv_data_len, drv_type,
-		    ndis_devs, &ndis_regvals);
+#ifdef NDIS_PCI_DEV_TABLE
+		windrv_load(mod, drv_data_start, drv_data_len, PCIBus,
+		    ndis_devs_pci, &ndis_regvals);
+#endif
+#ifdef NDIS_PCMCIA_DEV_TABLE
+		windrv_load(mod, drv_data_start, drv_data_len, PCMCIABus,
+		    ndis_devs_pccard, &ndis_regvals);
+#endif
 		break;
 	case MOD_UNLOAD:
 		windrv_loaded--;
 		if (windrv_loaded > 0)
 			break;
+#ifdef NDIS_PCI_DEV_TABLE
 		windrv_unload(mod, drv_data_start, drv_data_len);
+#endif
+#ifdef NDIS_PCMCIA_DEV_TABLE
+		windrv_unload(mod, drv_data_start, drv_data_len);
+#endif
 		break;
 	case MOD_SHUTDOWN:
 		break;



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