aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeongyo Jeong <weongyo@FreeBSD.org>2010-11-25 03:02:53 +0000
committerWeongyo Jeong <weongyo@FreeBSD.org>2010-11-25 03:02:53 +0000
commit537e254f0afd1b09e0e2487719c62440d6efc604 (patch)
tree3adaec044f1f5bee805b16b222511ef788f7f4b1
parent12203744da726301c87073524984535565380a7a (diff)
downloadsrc-537e254f0afd1b09e0e2487719c62440d6efc604.tar.gz
src-537e254f0afd1b09e0e2487719c62440d6efc604.zip
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.
Notes
Notes: svn path=/head/; revision=215810
-rw-r--r--sys/dev/usb/usb_pf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/usb/usb_pf.c b/sys/dev/usb/usb_pf.c
index e4ee6254b7b0..16cf8d7952ce 100644
--- a/sys/dev/usb/usb_pf.c
+++ b/sys/dev/usb/usb_pf.c
@@ -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,