sandbox: usb: Allow finding a USB emulator for a device
Each USB device has an emulator. Currently this can only be found by supplying the 'pipe' value, which contains the device number. Add a way to find it directly from the emulated device. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -949,6 +949,16 @@ int usb_emul_bulk(struct udevice *emul, struct usb_device *udev,
|
||||
*/
|
||||
int usb_emul_find(struct udevice *bus, ulong pipe, struct udevice **emulp);
|
||||
|
||||
/**
|
||||
* usb_emul_find_for_dev() - Find an emulator for a particular device
|
||||
*
|
||||
* @bus: USB bus (controller)
|
||||
* @dev: USB device to check
|
||||
* @emulp: Returns pointer to emulator, or NULL if not found
|
||||
* @return 0 if found, -ve on error
|
||||
*/
|
||||
int usb_emul_find_for_dev(struct udevice *dev, struct udevice **emulp);
|
||||
|
||||
/**
|
||||
* usb_emul_reset() - Reset all emulators ready for use
|
||||
*
|
||||
|
Reference in New Issue
Block a user