Hi all!
My devices uses bulk pipes to exchange data. If a transaction fails, I
follow the guidelines from Mr. Oney book to recover: 1. read the port
status (IOCTL_INTERNAL_USB_GET_PORT_STATUS) and if it shows that the
devices is connected but the port is disabled, I abort the pipe (via
URB_FUNCTION_RESET_PIPE) and then reset the device via
IOCTL_INTERNAL_USB_RESET_PORT followed by resetting the failed pipe. All
this works fine while operating our device behind a USB1.1 hub. But if
the device is operated behind a USB2.0 hub,
IOCTL_INTERNAL_USB_RESET_PORT fails with STATUS_DEVICE_DATA_ERROR after
5 seconds. Additionally, the device gets stopped, the driver unloaded,
reloaded and the device stated again. If there is still a handle open,
the driver receives an additional IRP_MN_REMOVE_DEVICE after the
IRP_MJ_CLOSE. All this only seems to happens, if the Port status is 2
(USBD_PORT_CONNECTED but not enabled).
Can anyone please advice me how to handle failures of bulk pipes
correctly while the device is below a USB2.0 hub? Thank You!
Best Regards
Jan