From owner-p4-projects@FreeBSD.ORG Wed Jun 11 08:40:29 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1A1E01065682; Wed, 11 Jun 2008 08:40:29 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFA01106568C for ; Wed, 11 Jun 2008 08:40:28 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C02588FC2E for ; Wed, 11 Jun 2008 08:40:28 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m5B8eSaY062142 for ; Wed, 11 Jun 2008 08:40:28 GMT (envelope-from weongyo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5B8eS1U062140 for perforce@freebsd.org; Wed, 11 Jun 2008 08:40:28 GMT (envelope-from weongyo@FreeBSD.org) Date: Wed, 11 Jun 2008 08:40:28 GMT Message-Id: <200806110840.m5B8eS1U062140@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to weongyo@FreeBSD.org using -f From: Weongyo Jeong To: Perforce Change Reviews Cc: Subject: PERFORCE change 143282 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2008 08:40:29 -0000 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;