Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Nov 2010 03:02:53 +0000 (UTC)
From:      Weongyo Jeong <weongyo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r215810 - head/sys/dev/usb
Message-ID:  <201011250302.oAP32r6R091758@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: weongyo
Date: Thu Nov 25 03:02:53 2010
New Revision: 215810
URL: http://svn.freebsd.org/changeset/base/215810

Log:
  Assigning the unit number for each interfaces could not use ubus->parent
  because it could differ depending on the host controller type.  It could
  lead the duplicate unit number assignment.

Modified:
  head/sys/dev/usb/usb_pf.c

Modified: head/sys/dev/usb/usb_pf.c
==============================================================================
--- head/sys/dev/usb/usb_pf.c	Wed Nov 24 22:44:10 2010	(r215809)
+++ head/sys/dev/usb/usb_pf.c	Thu Nov 25 03:02:53 2010	(r215810)
@@ -61,9 +61,10 @@ void
 usbpf_attach(struct usb_bus *ubus)
 {
 	struct ifnet *ifp;
+	devclass_t dc = devclass_find("usbus");
 
 	ifp = ubus->ifp = if_alloc(IFT_USB);
-	if_initname(ifp, "usbus", device_get_unit(ubus->parent));
+	if_initname(ifp, "usbus", devclass_get_count(dc));
 	if_attach(ifp);
 
 	KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN,



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