I am writing a driver for a usb device that contains a hardware watchdog. At
this time, as well as during firmware updates, the device can be reset. The
PC then shows the device (using usbview) as failing enumeration and of course
my driver is unloaded.

If I try to reset the device using devcon restart usb* I get the "requires
reboot" message next to my device. But then it sometimes works anyway?

I'm thinking that I need IOCTL_INTERNAL_USB_RESET_PORT but I can't quite
figure out where to use it. My driver is unloading, do I send it on the way
down? Or do I then do it on the driver restarting and I still need the
devcon functionality.

thanks

Re: USB Reset by Tim

Tim
Sat Jan 15 00:46:16 CST 2005

"John" <johnnypav@community.nospam.com> wrote:
>
>I am writing a driver for a usb device that contains a hardware watchdog. At
>this time, as well as during firmware updates, the device can be reset. The
>PC then shows the device (using usbview) as failing enumeration and of course
>my driver is unloaded.
>
>If I try to reset the device using devcon restart usb* I get the "requires
>reboot" message next to my device. But then it sometimes works anyway?

"devcon restart" does not do anything to the device. All it does is unload
and reload your driver. If the driver is already unloaded, "devcon
restart" should fail.

>I'm thinking that I need IOCTL_INTERNAL_USB_RESET_PORT but I can't quite
>figure out where to use it. My driver is unloading, do I send it on the way
>down? Or do I then do it on the driver restarting and I still need the
>devcon functionality.

If your driver is unloading because the device is no longer operational,
then you aren't going to be able to send any requests to it. The device
isn't listening.

What happens when the watchdog expires? Does the device go to sleep? Or
does it disconnect and then reconnect?
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc

Re: USB Reset by johnnypav

johnnypav
Mon Jan 17 08:45:10 CST 2005


> What happens when the watchdog expires? Does the device go to sleep? Or
> does it disconnect and then reconnect?

The device reboots. At that point, I can use UsbView and the status of the
device is DeviceFailedEnumeration. Plugging and unplugging the device makes
it work again but unfortunately it is an embedded device and this is not a
viable solution.

I guess the first question is whether or not this is a device or host driver
problem?

thanks,

John

Re: USB Reset by Marc

Marc
Tue Jan 18 11:56:24 CST 2005

This is a bad architecture. The USB device should notify the driver that it
wants to go to sleep and let the driver coordinate the action.

Once the host has determined that the enumeration failed, you don't really
have a way of communicating with the device.

-Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics

"John" <johnnypav@community.nospam.com> wrote in message
news:FDA43181-510B-4728-80B0-214D2D899D90@microsoft.com...
>I am writing a driver for a usb device that contains a hardware watchdog.
>At
> this time, as well as during firmware updates, the device can be reset.
> The
> PC then shows the device (using usbview) as failing enumeration and of
> course
> my driver is unloaded.
>
> If I try to reset the device using devcon restart usb* I get the
> "requires
> reboot" message next to my device. But then it sometimes works anyway?
>
> I'm thinking that I need IOCTL_INTERNAL_USB_RESET_PORT but I can't quite
> figure out where to use it. My driver is unloading, do I send it on the
> way
> down? Or do I then do it on the driver restarting and I still need the
> devcon functionality.
>
> thanks
>
>



Re: USB Reset by Tim

Tim
Tue Jan 18 23:17:13 CST 2005

"John" <johnnypav@community.nospam.com> wrote:

>
>> What happens when the watchdog expires? Does the device go to sleep? Or
>> does it disconnect and then reconnect?
>
>The device reboots. At that point, I can use UsbView and the status of the
>device is DeviceFailedEnumeration. Plugging and unplugging the device makes
>it work again but unfortunately it is an embedded device and this is not a
>viable solution.
>
>I guess the first question is whether or not this is a device or host driver
>problem?

Marc is right -- this is a design problem in your device. The host is
behaving as it should -- when a device disappears, it remains disabled
until it unplug/replugs.

There are well-defined ways in USB for a device to go to sleep in a
controlled way. Your device needs to do that.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc