From owner-svn-src-all@FreeBSD.ORG Sun May 8 08:17:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 621FA106566B; Sun, 8 May 2011 08:17:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 537458FC0A; Sun, 8 May 2011 08:17:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p488HHLD035909; Sun, 8 May 2011 08:17:17 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p488HHp0035906; Sun, 8 May 2011 08:17:17 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201105080817.p488HHp0035906@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 8 May 2011 08:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221621 - stable/8/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 08:17:17 -0000 Author: hselasky Date: Sun May 8 08:17:16 2011 New Revision: 221621 URL: http://svn.freebsd.org/changeset/base/221621 Log: MFC r214221, r216072 and r214809. Make configuration of USB stack more flexible. Modified: stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_freebsd.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Sun May 8 07:21:09 2011 (r221620) +++ stable/8/sys/dev/usb/usb_device.c Sun May 8 08:17:16 2011 (r221621) @@ -97,8 +97,10 @@ static void usb_suspend_resume_sub(struc static void usbd_clear_stall_proc(struct usb_proc_msg *_pm); static usb_error_t usb_config_parse(struct usb_device *, uint8_t, uint8_t); static void usbd_set_device_strings(struct usb_device *); -#if USB_HAVE_UGEN +#if USB_HAVE_DEVCTL static void usb_notify_addq(const char *type, struct usb_device *); +#endif +#if USB_HAVE_UGEN static void usb_fifo_free_wrap(struct usb_device *, uint8_t, uint8_t); static struct cdev *usb_make_dev(struct usb_device *, int, int); static void usb_cdev_create(struct usb_device *); @@ -1865,7 +1867,9 @@ config_done: printf("%s: <%s> at %s\n", udev->ugen_name, usb_get_manufacturer(udev), device_get_nameunit(udev->bus->bdev)); +#endif +#if USB_HAVE_DEVCTL usb_notify_addq("ATTACH", udev); #endif done: @@ -2011,9 +2015,11 @@ usb_free_device(struct usb_device *udev, bus = udev->bus; usb_set_device_state(udev, USB_STATE_DETACHED); -#if USB_HAVE_UGEN +#if USB_HAVE_DEVCTL usb_notify_addq("DETACH", udev); +#endif +#if USB_HAVE_UGEN printf("%s: <%s> at %s (disconnected)\n", udev->ugen_name, usb_get_manufacturer(udev), device_get_nameunit(bus->bdev)); @@ -2380,7 +2386,7 @@ usbd_get_device_index(struct usb_device return (udev->device_index); } -#if USB_HAVE_UGEN +#if USB_HAVE_DEVCTL /*------------------------------------------------------------------------* * usb_notify_addq * @@ -2416,7 +2422,9 @@ usb_notify_addq_compat(const char *type, /* String it all together. */ snprintf(data, buf_size, "%s" +#if USB_HAVE_UGEN "%s " +#endif "at port=%u " "vendor=0x%04x " "product=0x%04x " @@ -2424,20 +2432,27 @@ usb_notify_addq_compat(const char *type, "devsubclass=0x%02x " "sernum=\"%s\" " "release=0x%04x " - "on " - "%s\n", +#if USB_HAVE_UGEN + "on %s\n" +#endif + "", ntype, +#if USB_HAVE_UGEN udev->ugen_name, +#endif udev->port_no, UGETW(udev->ddesc.idVendor), UGETW(udev->ddesc.idProduct), udev->ddesc.bDeviceClass, udev->ddesc.bDeviceSubClass, usb_get_serial(udev), - UGETW(udev->ddesc.bcdDevice), - udev->parent_hub != NULL ? + UGETW(udev->ddesc.bcdDevice) +#if USB_HAVE_UGEN + , udev->parent_hub != NULL ? udev->parent_hub->ugen_name : - device_get_nameunit(device_get_parent(udev->bus->bdev))); + device_get_nameunit(device_get_parent(udev->bus->bdev)) +#endif + ); devctl_queue_data(data); } @@ -2457,7 +2472,10 @@ usb_notify_addq(const char *type, struct /* announce the device */ sb = sbuf_new_auto(); sbuf_printf(sb, +#if USB_HAVE_UGEN + "ugen=%s " "cdev=%s " +#endif "vendor=0x%04x " "product=0x%04x " "devclass=0x%02x " @@ -2466,8 +2484,14 @@ usb_notify_addq(const char *type, struct "release=0x%04x " "mode=%s " "port=%u " - "parent=%s", +#if USB_HAVE_UGEN + "parent=%s" +#endif + "", +#if USB_HAVE_UGEN + udev->ugen_name, udev->ugen_name, +#endif UGETW(udev->ddesc.idVendor), UGETW(udev->ddesc.idProduct), udev->ddesc.bDeviceClass, @@ -2475,10 +2499,13 @@ usb_notify_addq(const char *type, struct usb_get_serial(udev), UGETW(udev->ddesc.bcdDevice), (udev->flags.usb_mode == USB_MODE_HOST) ? "host" : "device", - udev->port_no, - udev->parent_hub != NULL ? - udev->parent_hub->ugen_name : - device_get_nameunit(device_get_parent(udev->bus->bdev))); + udev->port_no +#if USB_HAVE_UGEN + , udev->parent_hub != NULL ? + udev->parent_hub->ugen_name : + device_get_nameunit(device_get_parent(udev->bus->bdev)) +#endif + ); sbuf_finish(sb); devctl_notify("USB", "DEVICE", type, sbuf_data(sb)); sbuf_delete(sb); @@ -2493,7 +2520,10 @@ usb_notify_addq(const char *type, struct sb = sbuf_new_auto(); sbuf_printf(sb, +#if USB_HAVE_UGEN + "ugen=%s " "cdev=%s " +#endif "vendor=0x%04x " "product=0x%04x " "devclass=0x%02x " @@ -2506,7 +2536,10 @@ usb_notify_addq(const char *type, struct "intclass=0x%02x " "intsubclass=0x%02x " "intprotocol=0x%02x", +#if USB_HAVE_UGEN udev->ugen_name, + udev->ugen_name, +#endif UGETW(udev->ddesc.idVendor), UGETW(udev->ddesc.idProduct), udev->ddesc.bDeviceClass, @@ -2524,7 +2557,9 @@ usb_notify_addq(const char *type, struct sbuf_delete(sb); } } +#endif +#if USB_HAVE_UGEN /*------------------------------------------------------------------------* * usb_fifo_free_wrap * Modified: stable/8/sys/dev/usb/usb_freebsd.h ============================================================================== --- stable/8/sys/dev/usb/usb_freebsd.h Sun May 8 07:21:09 2011 (r221620) +++ stable/8/sys/dev/usb/usb_freebsd.h Sun May 8 08:17:16 2011 (r221621) @@ -33,6 +33,7 @@ /* Default USB configuration */ #define USB_HAVE_UGEN 1 +#define USB_HAVE_DEVCTL 1 #define USB_HAVE_BUSDMA 1 #define USB_HAVE_COMPAT_LINUX 1 #define USB_HAVE_USER_IO 1