Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Mar 2011 12:15:48 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        gnixua@gmail.com
Cc:        freebsd-usb@freebsd.org
Subject:   Re: usbconfig power_off is not working correctly on FreeBSD 8.2
Message-ID:  <201103071215.48922.hselasky@c2i.net>
In-Reply-To: <4D74BB9B.8090407@gmail.com>
References:  <4D74B3CB.6010902@gmail.com> <201103071144.56729.hselasky@c2i.net> <4D74BB9B.8090407@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 07 March 2011 12:03:55 Gritsuk Anton wrote:
> On 07.03.2011 12:44, Hans Petter Selasky wrote:
> > On Monday 07 March 2011 11:30:35 Gritsuk Anton wrote:
> >> I see that usbconfig is not working correctly. When i type:
> >>    # usbconfig -u 4 -a 3 power_off
> >> 
> >> really usb device will detached
> >> 
> >> But i cannot return device back when I type:
> >>    usbconfig -u 4 -a 3 power_on
> > 
> > Hi,
> > 
> > There has been some changes in this area. When an USB device is powered
> > off, then you need to reset the parent hub to get it back.
> > 
> > --HPS
> 
> How I can reset the parent hub to get usb device back?
> 

Hi,

> When I type:
> # usbconfig reset
> my terminal is freeze and nothing happens.

Is your keyboard on USB and you are in X? Then try:

CTRL+ALT+F1, then CTRL+ALT+F9

The command you did will reset all USB devices. You should specify a 
particular device:

usbconfig -d ugenX.Y reset

I see there is a bug if trying to reset the root HUB. You can try instead:

usbconfig -d ugenX.Y set_config 255

Then

usbconfig -d ugenX.Y set_config 0

For the root HUB.

Currently there is no easy way to find the HUB directly. One way is to find 
the root HUB on the same bus like your device:

Device:

ugen4.2: <...> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON

Associated root HUB:

ugen4.1: <UHCI root HUB Intel> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) 
pwr=SAVE

You see they are both at the same bus ugen4.Y.

> 
> > I recommend only using power_save. Then the USB stack will manage power
> > saving.

The power_save is done like this:

usbconfig -d ugenX.Y power_save

The timeout until power save triggers can be set by:

sysctl hw.usb.power_timeout=30

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103071215.48922.hselasky>