blob: fbdfec163f56c822d2ddf210289ba0582276e38f [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.bus;
using zx;
using fuchsia.hardware.usb.hub;
using fuchsia.hardware.usb.hubdescriptor;
enum UsbSpeed : uint32 {
};
// Note: the "uint64 foo_device" parameters should be interpreted as zx_device_t*.
// TODO(fxb/69023): restore types.
[Transport = "Banjo", BanjoLayout = "ddk-protocol"]
protocol UsbBus {
/// Configures a new hub based on its USB hub descriptor.
ConfigureHub([InOut] uint64 hub_device, UsbSpeed speed,
fuchsia.hardware.usb.hubdescriptor.UsbHubDescriptor desc, bool multi_tt) -> (zx.status s);
/// Informs the USB bus that a new device has been added.
DeviceAdded([InOut] uint64 hub_device, uint32 port, UsbSpeed speed) -> (zx.status s);
/// Informs the USB bus that a device has been removed.
DeviceRemoved([InOut] uint64 hub_device, uint32 port) -> (zx.status s);
/// Used by USB hub driver to register its USB hub protocol with the USB bus driver.
SetHubInterface([InOut] uint64 usb_device, fuchsia.hardware.usb.hub.UsbHubInterface hub)
-> (zx.status s);
};
/// Interface for use by the HCI controller to use to notify when devices are added and removed.
[Transport = "Banjo", BanjoLayout = "ddk-interface"]
protocol UsbBusInterface {
/// Notifies the USB bus driver that a new device has been added.
AddDevice(uint32 device_id, uint32 hub_id, UsbSpeed speed) -> (zx.status s);
/// Notifies the USB bus driver that a device has been removed.
RemoveDevice(uint32 device_id) -> (zx.status s);
/// Used by the HCI controller to reset a port on a USB hub.
ResetPort(uint32 hub_id, uint32 port, bool enumerating) -> (zx.status s);
/// Used by the HCI controller to reinitialize a device after it has been reset.
ReinitializeDevice(uint32 device_id) -> (zx.status s);
};