blob: 74ecf7c7fe88174d3a89eceb7dc5dd71f5aed567 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.hardware.usb.hci;
using zx;
using fuchsia.hardware.usb.bus;
using fuchsia.hardware.usb.hubdescriptor;
using fuchsia.hardware.usb.request;
[Transport = "Banjo", BanjoLayout="ddk-protocol"]
protocol UsbHci {
/// Queues a USB request with the HCI driver.
RequestQueue([InOut] fuchsia.hardware.usb.request.UsbRequest usb_request,
[InOut] fuchsia.hardware.usb.request.UsbRequestComplete complete_cb) -> ();
/// Registers callbacks to the USB bus driver with the HCI driver.
SetBusInterface(fuchsia.hardware.usb.bus.UsbBusInterface bus_intf) -> ();
/// Returns the maximum number of USB devices that might be connected to the controller.
GetMaxDeviceCount() -> (uint64 count);
/// Enables or disables an endpoint using parameters derived from |ep_desc|.
EnableEndpoint(uint32 device_id, fuchsia.hardware.usb.descriptor.UsbEndpointDescriptor ep_desc,
fuchsia.hardware.usb.descriptor.UsbSsEpCompDescriptor ss_com_desc, bool enable) -> (zx.status s);
/// Returns the current frame (in milliseconds), used for isochronous transfers.
GetCurrentFrame() -> (uint64 frame);
/// Used by the USB hub driver to configure a newly enumerated USB hub.
ConfigureHub(uint32 device_id, fuchsia.hardware.usb.descriptor.UsbSpeed speed,
fuchsia.hardware.usb.hubdescriptor.UsbHubDescriptor desc, bool multi_tt) -> (zx.status s);
/// Used by the USB hub driver to notify the HCI driver when a new device is attached.
HubDeviceAdded(uint32 device_id, uint32 port, fuchsia.hardware.usb.descriptor.UsbSpeed speed) -> (zx.status s);
/// Used by the USB hub driver to notify the HCI driver when a device has been removed.
HubDeviceRemoved(uint32 device_id, uint32 port) -> (zx.status s);
/// Used by the USB hub driver to notify the HCI driver when a device has been reset.
HubDeviceReset(uint32 device_id, uint32 port) -> (zx.status s);
/// Resets an endpoint on the specified device.
ResetEndpoint(uint32 device_id, uint8 ep_address) -> (zx.status s);
/// Resets the specified device.
ResetDevice(uint32 hub_address, uint32 device_id) -> (zx.status s);
/// Returns the maximum size of a packet that can be queued on the specified endpoint.
GetMaxTransferSize(uint32 device_id, uint8 ep_address) -> (uint64 size);
/// Cancels all transactions currently queued on the specified endpoint.
CancelAll(uint32 device_id, uint8 ep_address) -> (zx.status s);
/// Returns the size needed for a |usb_request_t|, including private storage needed by the
/// HCI driver.
GetRequestSize() -> (uint64 size);
};