* Switched from the old v2 callback status codes to the new v3 codes

This means that the usb_callback_func now takes a status_t instead of a uint32 status.
Also the error codes are now different. I don't see this as a real problem in binary compatibility, as the status codes were never really documented and most drivers just assumed that a nonzero status meant an error.
Source compatibility breaks for callback functions and error defines. I fixed (hopefully) all places in the tree that are currenty included in the image and affected by the change.
* Corrected error reporting in UHCI and EHCI using the new status codes.
* Fixed a memory leak in EHCI where the async advance interrupt was not triggered in time.
* Fixed another race condition in usb_raw that could cause a crash when a device is removed while a transfer is pending.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18916 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2006-09-24 20:17:56 +00:00
parent 8a278a1bb7
commit 17f83b219d
20 changed files with 175 additions and 150 deletions
+1 -19
View File
@@ -73,7 +73,7 @@ struct usb_configuration_info {
usb_interface_list *interface;
};
typedef void (*usb_callback_func)(void *cookie, uint32 status, void *data,
typedef void (*usb_callback_func)(void *cookie, status_t status, void *data,
size_t actualLength);
@@ -203,24 +203,6 @@ struct usb_module_info {
};
/*
* These status are passed to the usb_callback_func callbacks. They indicate
* the status of a completed queued transfer. Multiple of these status codes
* may be combined. For example it is possible to have:
* B_USB_STATUS_DEVICE_TIMEOUT | B_USB_STATUS_DEVICE_STALLED
* This indicates that a timeout happened and that the used pipe is now
* stalled.
*/
#define B_USB_STATUS_SUCCESS 0x0000
#define B_USB_STATUS_DEVICE_CRC_ERROR 0x0002
#define B_USB_STATUS_DEVICE_TIMEOUT 0x0004
#define B_USB_STATUS_DEVICE_STALLED 0x0008
#define B_USB_STATUS_IRP_CANCELLED_BY_REQUEST 0x0010
#define B_USB_STATUS_DRIVER_INTERNAL_ERROR 0x0020
#define B_USB_STATUS_ADAPTER_HARDWARE_ERROR 0x0040
#define B_USB_STATUS_ISOCH_IRP_ABORTED 0x0080
#define B_USB_MODULE_NAME "bus_managers/usb/v2"