summaryrefslogtreecommitdiff
path: root/include/usbhost
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-12-12 14:17:02 -0800
committerMike Lockwood <lockwood@android.com>2010-12-13 19:08:14 -0800
commitcd185f23cc6f062b252d1d19bca55e721290ee62 (patch)
tree41c5e6bdb183e430732f9eb1cab4e820a2c471f6 /include/usbhost
parent127fd070f038825fc05624e2e3632c47999ffb19 (diff)
libusbhost: Add support for creating a usb_device struct from an existing fd
We will use this for sharing USB file descriptors across address spaces via Binder Change-Id: Iadbd3e0a4178f79d1d778fdfd5175f6fe0e2aaf5 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'include/usbhost')
-rw-r--r--include/usbhost/usbhost.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/usbhost/usbhost.h b/include/usbhost/usbhost.h
index 5332acd30..57d9c37e9 100644
--- a/include/usbhost/usbhost.h
+++ b/include/usbhost/usbhost.h
@@ -81,6 +81,16 @@ struct usb_device *usb_device_open(const char *dev_name);
/* Releases all resources associated with the USB device */
void usb_device_close(struct usb_device *device);
+/* Creates a usb_device object for already open USB device.
+ * This is intended to facilitate sharing USB devices across address spaces.
+ */
+struct usb_device *usb_device_new(const char *dev_name, int fd);
+
+/* Returns the file descriptor for the usb_device. Used in conjunction with
+ * usb_device_new() for sharing USB devices across address spaces.
+ */
+int usb_device_get_fd(struct usb_device *device);
+
/* Returns the name for the USB device, which is the same as
* the dev_name passed to usb_device_open()
*/