From d21a622bba09d8841faedb2b868bfbaf8df99c0c Mon Sep 17 00:00:00 2001 From: thompsa Date: Sun, 5 Apr 2009 18:20:49 +0000 Subject: MFp4 //depot/projects/usb@159922 Refactor how we interface with the root HUB. This cuts around 1200 lines of code totally and saves one thread per USB bus. Submitted by: Hans Petter Selasky --- sys/dev/usb/usb_bus.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sys/dev/usb/usb_bus.h') diff --git a/sys/dev/usb/usb_bus.h b/sys/dev/usb/usb_bus.h index 8a4575f..ac84950 100644 --- a/sys/dev/usb/usb_bus.h +++ b/sys/dev/usb/usb_bus.h @@ -45,6 +45,17 @@ struct usb2_bus_stat { }; /* + * The following structure is used to keep the state of a standard + * root transfer. + */ +struct usb2_sw_transfer { + struct usb2_device_request req; + uint8_t *ptr; + uint16_t len; + usb2_error_t err; +}; + +/* * The following structure defines an USB BUS. There is one USB BUS * for every Host or Device controller. */ @@ -52,7 +63,7 @@ struct usb2_bus { struct usb2_bus_stat stats_err; struct usb2_bus_stat stats_ok; struct usb2_process explore_proc; - struct usb2_process roothub_proc; + struct usb2_sw_transfer roothub_req; struct root_hold_token *bus_roothold; /* * There are two callback processes. One for Giant locked @@ -64,7 +75,6 @@ struct usb2_bus { struct usb2_bus_msg explore_msg[2]; struct usb2_bus_msg detach_msg[2]; struct usb2_bus_msg attach_msg[2]; - struct usb2_bus_msg roothub_msg[2]; /* * This mutex protects the USB hardware: */ -- cgit v1.1