diff options
author | Mike Lockwood <lockwood@android.com> | 2010-12-12 14:17:02 -0800 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2010-12-13 19:08:14 -0800 |
commit | cd185f23cc6f062b252d1d19bca55e721290ee62 (patch) | |
tree | 41c5e6bdb183e430732f9eb1cab4e820a2c471f6 /include/usbhost | |
parent | 127fd070f038825fc05624e2e3632c47999ffb19 (diff) | |
download | system_core-cd185f23cc6f062b252d1d19bca55e721290ee62.zip system_core-cd185f23cc6f062b252d1d19bca55e721290ee62.tar.gz system_core-cd185f23cc6f062b252d1d19bca55e721290ee62.tar.bz2 |
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.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/usbhost/usbhost.h b/include/usbhost/usbhost.h index 5332acd..57d9c37 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() */ |