summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorweongyo <weongyo@FreeBSD.org>2010-11-25 03:02:53 +0000
committerweongyo <weongyo@FreeBSD.org>2010-11-25 03:02:53 +0000
commit597c003458963a9d5b94e49b797277b2196a08d7 (patch)
tree3adaec044f1f5bee805b16b222511ef788f7f4b1 /sys/dev
parenta0f20794078b6e9c703227cfc2438a2ba45ca7ea (diff)
downloadFreeBSD-src-597c003458963a9d5b94e49b797277b2196a08d7.zip
FreeBSD-src-597c003458963a9d5b94e49b797277b2196a08d7.tar.gz
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.
Diffstat (limited to 'sys/dev')
-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 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,
OpenPOWER on IntegriCloud