svn commit: r215810 - head/sys/dev/usb

Weongyo Jeong weongyo at FreeBSD.org
Thu Nov 25 03:02:54 UTC 2010


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,


More information about the svn-src-head mailing list