diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-03-23 20:24:20 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-03-23 20:24:20 +0000 |
commit | f557794ab3ccae444653a25b889cc51d10e6f0c3 (patch) | |
tree | 2034d103fa624aec631180d201c3c4aa4a50607d /src/include/ipxe/usb.h | |
parent | 026b3446b953fcec30afb66c2c197d382378dddd (diff) | |
download | ipxe-f557794ab3ccae444653a25b889cc51d10e6f0c3.tar.gz |
[xhci] Support USB1 devices attached via transaction translators
xHCI provides a somewhat convoluted mechanism for specifying details
of a transaction translator. Hubs must be marked as such in the
device slot context. The only opportunity to do so is as part of a
Configure Endpoint command, which can be executed only when opening
the hub's interrupt endpoint.
We add a mechanism for host controllers to intercept the opening of
hub devices, providing xHCI with an opportunity to update the internal
device slot structure for the corresponding USB device to indicate
that the device is a hub. We then include the hub-specific details in
the input context whenever any Configure Endpoint command is issued.
When a device is opened, we record the device slot and port for its
transaction translator (if any), and supply these as part of the
Address Device command.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/usb.h')
-rw-r--r-- | src/include/ipxe/usb.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/include/ipxe/usb.h b/src/include/ipxe/usb.h index 6f67e0619..b3803cd18 100644 --- a/src/include/ipxe/usb.h +++ b/src/include/ipxe/usb.h @@ -777,6 +777,8 @@ struct usb_hub { /** List of hubs */ struct list_head list; + /** Host controller operations */ + struct usb_hub_host_operations *host; /** Driver operations */ struct usb_hub_driver_operations *driver; /** Driver private data */ @@ -789,7 +791,22 @@ struct usb_hub { struct usb_port port[0]; }; -/** USB hub operations */ +/** USB hub host controller operations */ +struct usb_hub_host_operations { + /** Open hub + * + * @v hub USB hub + * @ret rc Return status code + */ + int ( * open ) ( struct usb_hub *hub ); + /** Close hub + * + * @v hub USB hub + */ + void ( * close ) ( struct usb_hub *hub ); +}; + +/** USB hub driver operations */ struct usb_hub_driver_operations { /** Open hub * @@ -940,8 +957,10 @@ struct usb_host_operations { struct usb_device_host_operations device; /** Bus operations */ struct usb_bus_host_operations bus; + /** Hub operations */ + struct usb_hub_host_operations hub; /** Root hub operations */ - struct usb_hub_driver_operations hub; + struct usb_hub_driver_operations root; }; /** |