Date: Thu, 25 Nov 2010 09:32:04 +0100 From: Hans Petter Selasky <hselasky@c2i.net> To: Weongyo Jeong <weongyo@freebsd.org> Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org> Subject: Re: svn commit: r215810 - head/sys/dev/usb Message-ID: <201011250932.04579.hselasky@c2i.net> In-Reply-To: <201011250302.oAP32r6R091758@svn.freebsd.org> References: <201011250302.oAP32r6R091758@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 25 November 2010 04:02:53 Weongyo Jeong wrote: > 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, I think you will get a multiple unit number if you unload+load a driver like EHCI/OHCI/UHCI. I suggest that you only make one ifp instance and route all traffic through that one. --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011250932.04579.hselasky>