From 597c003458963a9d5b94e49b797277b2196a08d7 Mon Sep 17 00:00:00 2001 From: weongyo Date: Thu, 25 Nov 2010 03:02:53 +0000 Subject: 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. --- sys/dev/usb/usb_pf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/dev') diff --git a/sys/dev/usb/usb_pf.c b/sys/dev/usb/usb_pf.c index e4ee625..16cf8d7 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, -- cgit v1.1