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

2010-11-25 Thread Hans Petter Selasky
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
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2010-11-24 Thread Weongyo Jeong
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,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org