Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jun 2008 08:40:28 GMT
From:      Weongyo Jeong <weongyo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 143282 for review
Message-ID:  <200806110840.m5B8eS1U062140@repoman.freebsd.org>

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

Change 143282 by weongyo@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;
 



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