Re: Powercycling USB device on hub

2011-07-26 Thread Peer Stritzinger
On Sat, Jul 23, 2011 at 11:47 PM, Hans Petter Selasky hsela...@c2i.net wrote:
 On Saturday 23 July 2011 18:53:46 Peer Stritzinger wrote:

 In newer libusb there is a function to get the parent HUB address.

Ah great, I've to update the production systems soon.

Is it already in 8 stable?

-- Peer
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: Powercycling USB device on hub

2011-07-26 Thread Hans Petter Selasky
On Tuesday 26 July 2011 19:11:31 Peer Stritzinger wrote:
 On Sat, Jul 23, 2011 at 11:47 PM, Hans Petter Selasky hsela...@c2i.net 
wrote:
  On Saturday 23 July 2011 18:53:46 Peer Stritzinger wrote:
  
  In newer libusb there is a function to get the parent HUB address.
 
 Ah great, I've to update the production systems soon.
 
 Is it already in 8 stable?
 
 -- Peer

Yes, see man libusb.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: Powercycling USB device on hub

2011-07-23 Thread Peer Stritzinger
Hi,

On Thu, Jul 21, 2011 at 12:49 PM, Hans Petter Selasky hsela...@c2i.net wrote:
  Using the usbconfig utility in 8 stable and 9 current, you can set the
  configuration to 255 which means unconfigured and then 0 for the root
  HUB. For non-root HUBs you can BUS-reset the devices usbconfig -d X.Y
  reset or set_config aswell.

 Have you tried usbconfig -d X.Y reset ?

Problem is that the production system where I need to do this is still
running 8.0 ...

But I got it working with usbconfig -u X -a Y reset, did not work
first because I got the wrong device.

Not since I'm reseting the correct (non root) HUB I see a powercycle
on the USB device, so it works.

 Do a power_off command before the parent HUB reset, if the parent HUB reset is
 not enough. Beware that some motherboards hardwire the powersupply to the USB
 port. I.E. it is not possible to power-cycle the root HUB USB port.

Even worse: after trying to reset one of the root HUBS I get:

 $ sudo usbconfig -u 3 -a 1 reset
usbconfig: could not reset device: Device not configured

and after this all devices hat are on this bus are no longer visible
to usbconfig until the next reboot.

Cheers
-- Peer

 --HPS

___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: Powercycling USB device on hub

2011-07-23 Thread Peer Stritzinger
Hi,

On Sat, Jul 23, 2011 at 5:17 PM, Hans Petter Selasky hsela...@c2i.net wrote:
 On Saturday 23 July 2011 17:18:34 Peer Stritzinger wrote:
  $ sudo usbconfig -u 3 -a 1 reset
 usbconfig: could not reset device: Device not configured

 and after this all devices hat are on this bus are no longer visible
 to usbconfig until the next reboot.

 This is a known issue which was fixed in stable.

Great.

Since power-cycling needs to reset the HUB I now have the problem to
find out on which HUB in the system my device hangs.

There are two HUB's on the same root HUB and I don't want to
power-cycle all devices.  Is there a way to learn the physical
structure of a USB bus?

-- Peer


 --HPS

___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: Powercycling USB device on hub

2011-07-23 Thread Hans Petter Selasky
On Saturday 23 July 2011 17:44:11 Peer Stritzinger wrote:
 Hi,
 
 On Sat, Jul 23, 2011 at 5:17 PM, Hans Petter Selasky hsela...@c2i.net 
wrote:
  On Saturday 23 July 2011 17:18:34 Peer Stritzinger wrote:
   $ sudo usbconfig -u 3 -a 1 reset
  usbconfig: could not reset device: Device not configured
  
  and after this all devices hat are on this bus are no longer visible
  to usbconfig until the next reboot.
  
  This is a known issue which was fixed in stable.
 
 Great.
 
 Since power-cycling needs to reset the HUB I now have the problem to
 find out on which HUB in the system my device hangs.
 
 There are two HUB's on the same root HUB and I don't want to
 power-cycle all devices.  Is there a way to learn the physical
 structure of a USB bus?

devinfo

Address 1 is always the root HUB.

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: Powercycling USB device on hub

2011-07-23 Thread Peer Stritzinger
On Sat, Jul 23, 2011 at 5:55 PM, Hans Petter Selasky hsela...@c2i.net wrote:
 Since power-cycling needs to reset the HUB I now have the problem to
 find out on which HUB in the system my device hangs.

 There are two HUB's on the same root HUB and I don't want to
 power-cycle all devices.  Is there a way to learn the physical
 structure of a USB bus?

 devinfo

 Address 1 is always the root HUB.

Tried this already but it only shows the hubs but none of my devices
because they have no driver (custom built USB devices, only talk to
them via libusb).

e.g.

  usbus3
uhub3
  uhub4 pnpinfo vendor=0x0424 product=0x2514 devclass=0x09
devsubclass=0x00 sernum= release=0x0bb3 intclass=0x09
intsubclass=0x00 at port=7 interface=0
  uhub5 pnpinfo vendor=0x0424 product=0x2514 devclass=0x09
devsubclass=0x00 sernum= release=0x0bb3 intclass=0x09
intsubclass=0x00 at port=8 interface=0

There is one of the devices attached either to uhub4 or uhub5 (visible
in usbconfig) but nothing shown in devinfo (even with -v).

-- Peer
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: Powercycling USB device on hub

2011-07-23 Thread Hans Petter Selasky
On Saturday 23 July 2011 18:53:46 Peer Stritzinger wrote:
 On Sat, Jul 23, 2011 at 5:55 PM, Hans Petter Selasky hsela...@c2i.net 
wrote:
  Since power-cycling needs to reset the HUB I now have the problem to
  find out on which HUB in the system my device hangs.
  
  There are two HUB's on the same root HUB and I don't want to
  power-cycle all devices.  Is there a way to learn the physical
  structure of a USB bus?
  
  devinfo
  
  Address 1 is always the root HUB.
 
 Tried this already but it only shows the hubs but none of my devices
 because they have no driver (custom built USB devices, only talk to
 them via libusb).
 
 e.g.
 
   usbus3
 uhub3
   uhub4 pnpinfo vendor=0x0424 product=0x2514 devclass=0x09
 devsubclass=0x00 sernum= release=0x0bb3 intclass=0x09
 intsubclass=0x00 at port=7 interface=0
   uhub5 pnpinfo vendor=0x0424 product=0x2514 devclass=0x09
 devsubclass=0x00 sernum= release=0x0bb3 intclass=0x09
 intsubclass=0x00 at port=8 interface=0
 
 There is one of the devices attached either to uhub4 or uhub5 (visible
 in usbconfig) but nothing shown in devinfo (even with -v).
 
 -- Peer


In newer libusb there is a function to get the parent HUB address.

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: Powercycling USB device on hub

2011-07-21 Thread Peer Stritzinger
Hi,

On Wed, Jul 20, 2011 at 3:19 PM, Hans Petter Selasky hsela...@c2i.net wrote:
 On Wednesday 20 July 2011 14:30:37 Peer Stritzinger wrote:
...
 Using the usbconfig utility in 8 stable and 9 current, you can set the
 configuration to 255 which means unconfigured and then 0 for the root HUB. For
 non-root HUBs you can BUS-reset the devices usbconfig -d X.Y reset or
 set_config aswell.

Do I understand this right: I reset the USB Hub device to powercycle
all devices connected to it?

There is also a power_off command, but your device might
 not come back after that.

This would probably really not help since I try to reboot a USB device
with hung software, so it won't recognize any commands itself.

-- Peer
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: Powercycling USB device on hub

2011-07-21 Thread Hans Petter Selasky
On Thursday 21 July 2011 12:47:55 Peer Stritzinger wrote:
 Hi,
 
 On Wed, Jul 20, 2011 at 3:19 PM, Hans Petter Selasky hsela...@c2i.net 
wrote:
  On Wednesday 20 July 2011 14:30:37 Peer Stritzinger wrote:
 ...
 
  Using the usbconfig utility in 8 stable and 9 current, you can set the
  configuration to 255 which means unconfigured and then 0 for the root
  HUB. For non-root HUBs you can BUS-reset the devices usbconfig -d X.Y
  reset or set_config aswell.
 

Hi,

 Do I understand this right: I reset the USB Hub device to powercycle
 all devices connected to it?

Yes. That is correct.

 
 There is also a power_off command, but your device might
 
  not come back after that.
 
 This would probably really not help since I try to reboot a USB device
 with hung software, so it won't recognize any commands itself.

Have you tried usbconfig -d X.Y reset ?

Do a power_off command before the parent HUB reset, if the parent HUB reset is 
not enough. Beware that some motherboards hardwire the powersupply to the USB 
port. I.E. it is not possible to power-cycle the root HUB USB port.

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Powercycling USB device on hub

2011-07-20 Thread Peer Stritzinger
Hi,

is ist possible to power-cycle the HUB port of a USB device by
programmatic means (via script or libusb or some ioctl)?

It would be perfect if I could power-off/on just a certain device but
it would also help to power-cycle all devices on a HUB.

Cheers,
Peer Stritzinger
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: Powercycling USB device on hub

2011-07-20 Thread Hans Petter Selasky
On Wednesday 20 July 2011 14:30:37 Peer Stritzinger wrote:
 Hi,
 
 is ist possible to power-cycle the HUB port of a USB device by
 programmatic means (via script or libusb or some ioctl)?
 
 It would be perfect if I could power-off/on just a certain device but
 it would also help to power-cycle all devices on a HUB.
 

Hi,

Using the usbconfig utility in 8 stable and 9 current, you can set the 
configuration to 255 which means unconfigured and then 0 for the root HUB. For 
non-root HUBs you can BUS-reset the devices usbconfig -d X.Y reset or 
set_config aswell. There is also a power_off command, but your device might 
not come back after that.

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org