PERFORCE change 143282 for review

Weongyo Jeong weongyo at FreeBSD.org
Wed Jun 11 08:40:29 UTC 2008


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

Change 143282 by weongyo at weongyo_ws on 2008/06/11 08:39:39

	figure out exactly which device we matched.  If we can't find a match
	ID then we just keep sc->ndis_devidx value as 0.
	
	Because a INF file can include various product IDs, it's important to
	set sc->ndis_devidx value correctly which would be used to set and
	get sysctl variables.  These variables not only could be used by NDIS
	driver, but also affect the operation of NDIS driver. 

Affected files ...

.. //depot/projects/ndisusb/sys/dev/if_ndis/if_ndis_usb.c#3 edit

Differences ...

==== //depot/projects/ndisusb/sys/dev/if_ndis/if_ndis_usb.c#3 (text+ko) ====

@@ -156,7 +156,9 @@
 	struct ndisusb_softc *dummy = device_get_softc(self);
 	struct usb_attach_arg *uaa = device_get_ivars(self);
 	struct ndis_softc	*sc;
+	struct ndis_usb_type	*t;
 	driver_object		*drv;
+	int			devidx = 0;
 	usbd_status		status;
 
 	sc = (struct ndis_softc *)dummy;
@@ -184,6 +186,20 @@
 		return (ENXIO);
 	}
 
+	/* Figure out exactly which device we matched. */
+
+	t = db->windrv_devlist;
+
+	while (t->ndis_name != NULL) {
+		if ((uaa->vendor == t->ndis_vid) &&
+		    (uaa->product == t->ndis_did)) {
+			sc->ndis_devidx = devidx;
+			break;
+		}
+		t++;
+		devidx++;
+	}
+
 	if (ndis_attach(self) != 0)
 		return ENXIO;
 


More information about the p4-projects mailing list