Date: Tue, 14 Sep 2010 01:52:16 +0000 (UTC) From: Weongyo Jeong <weongyo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r212595 - in user/weongyo/usb/sys/dev/usb: . controller Message-ID: <201009140152.o8E1qGE0054300@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: weongyo Date: Tue Sep 14 01:52:16 2010 New Revision: 212595 URL: http://svn.freebsd.org/changeset/base/212595 Log: Renames `driver_added_refcount' to `generation' that it's not a reference counter. Modified: user/weongyo/usb/sys/dev/usb/controller/usb_controller.c user/weongyo/usb/sys/dev/usb/usb_bus.h user/weongyo/usb/sys/dev/usb/usb_device.h user/weongyo/usb/sys/dev/usb/usb_hub.c Modified: user/weongyo/usb/sys/dev/usb/controller/usb_controller.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/usb_controller.c Tue Sep 14 01:51:04 2010 (r212594) +++ user/weongyo/usb/sys/dev/usb/controller/usb_controller.c Tue Sep 14 01:52:16 2010 (r212595) @@ -196,11 +196,11 @@ usb_bus_explore(void *arg, int npending) if (udev && udev->hub) { if (bus->do_probe) { bus->do_probe = 0; - bus->driver_added_refcount++; + bus->generation++; } - if (bus->driver_added_refcount == 0) { + if (bus->generation == 0) { /* avoid zero, hence that is memory default */ - bus->driver_added_refcount = 1; + bus->generation = 1; } #ifdef DDB Modified: user/weongyo/usb/sys/dev/usb/usb_bus.h ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_bus.h Tue Sep 14 01:51:04 2010 (r212594) +++ user/weongyo/usb/sys/dev/usb/usb_bus.h Tue Sep 14 01:52:16 2010 (r212595) @@ -88,7 +88,7 @@ struct usb_bus { uint16_t isoc_time_last; /* in milliseconds */ uint8_t alloc_failed; /* Set if memory allocation failed. */ - uint8_t driver_added_refcount; /* Current driver generation count */ + uint8_t generation; /* Current driver generation count */ enum usb_revision usbrev; /* USB revision. See "USB_REV_XXX". */ uint8_t devices_max; /* maximum number of USB devices */ Modified: user/weongyo/usb/sys/dev/usb/usb_device.h ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_device.h Tue Sep 14 01:51:04 2010 (r212594) +++ user/weongyo/usb/sys/dev/usb/usb_device.h Tue Sep 14 01:52:16 2010 (r212595) @@ -155,7 +155,7 @@ struct usb_device { uint8_t port_no; /* parent HUB port number */ uint8_t hs_hub_addr; /* high-speed HUB address */ uint8_t hs_port_no; /* high-speed HUB port number */ - uint8_t driver_added_refcount; /* our driver added generation count */ + uint8_t generation; /* our driver added generation count */ uint8_t power_mode; /* see USB_POWER_XXX */ uint8_t ifaces_max; /* number of interfaces present */ uint8_t endpoints_max; /* number of endpoints present */ Modified: user/weongyo/usb/sys/dev/usb/usb_hub.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_hub.c Tue Sep 14 01:51:04 2010 (r212594) +++ user/weongyo/usb/sys/dev/usb/usb_hub.c Tue Sep 14 01:52:16 2010 (r212595) @@ -220,14 +220,14 @@ uhub_explore_sub(struct uhub_softc *sc, { struct usb_bus *bus; struct usb_device *child; - uint8_t refcount; + uint8_t generation; usb_error_t err; bus = sc->sc_udev->bus; err = 0; - /* get driver added refcount from USB bus */ - refcount = bus->driver_added_refcount; + /* get driver generation from USB bus */ + generation = bus->generation; /* get device assosiated with the given port */ child = usb_bus_port_get_device(bus, up); @@ -237,8 +237,8 @@ uhub_explore_sub(struct uhub_softc *sc, } /* check if probe and attach should be done */ - if (child->driver_added_refcount != refcount) { - child->driver_added_refcount = refcount; + if (child->generation != generation) { + child->generation = generation; err = usb_probe_and_attach(child, USB_IFACE_INDEX_ANY); if (err) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009140152.o8E1qGE0054300>