From owner-svn-src-head@FreeBSD.ORG Tue Jan 13 19:01:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A9911065673; Tue, 13 Jan 2009 19:01:36 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 380488FC08; Tue, 13 Jan 2009 19:01:36 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ1ahN012061; Tue, 13 Jan 2009 19:01:36 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ1ail012059; Tue, 13 Jan 2009 19:01:36 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131901.n0DJ1ail012059@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187164 - head/sys/dev/usb2/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:01:37 -0000 Author: thompsa Date: Tue Jan 13 19:01:35 2009 New Revision: 187164 URL: http://svn.freebsd.org/changeset/base/187164 Log: MFp4: //depot/projects/usb@155750 Patch to resolve problems with power mode off. Reported by Alexander Best. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/core/usb2_generic.c head/sys/dev/usb2/core/usb2_hub.c Modified: head/sys/dev/usb2/core/usb2_generic.c ============================================================================== --- head/sys/dev/usb2/core/usb2_generic.c Tue Jan 13 19:01:25 2009 (r187163) +++ head/sys/dev/usb2/core/usb2_generic.c Tue Jan 13 19:01:35 2009 (r187164) @@ -1699,11 +1699,12 @@ ugen_set_power_mode(struct usb2_fifo *f, } switch (mode) { case USB_POWER_MODE_OFF: - /* clear suspend */ - err = usb2_req_clear_port_feature(udev->parent_hub, - NULL, udev->port_no, UHF_PORT_SUSPEND); - if (err) - break; + /* get the device unconfigured */ + err = ugen_set_config(f, USB_UNCONFIG_INDEX); + if (err) { + DPRINTFN(0, "Could not unconfigure " + "device (ignored)\n"); + } /* clear port enable */ err = usb2_req_clear_port_feature(udev->parent_hub, Modified: head/sys/dev/usb2/core/usb2_hub.c ============================================================================== --- head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:01:25 2009 (r187163) +++ head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:01:35 2009 (r187164) @@ -1823,7 +1823,8 @@ void usb2_set_power_mode(struct usb2_device *udev, uint8_t power_mode) { /* filter input argument */ - if (power_mode != USB_POWER_MODE_ON) { + if ((power_mode != USB_POWER_MODE_ON) && + (power_mode != USB_POWER_MODE_OFF)) { power_mode = USB_POWER_MODE_SAVE; } udev->power_mode = power_mode; /* update copy of power mode */