summaryrefslogtreecommitdiffstats
path: root/adb/adb.h
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2012-01-13 15:13:46 +0100
committerBenoit Goby <benoit@android.com>2012-05-31 15:00:41 -0700
commitfd96db17b7f07eb6615af01fd1908b74383bf04b (patch)
tree49dae6eb9d222399a2d2da737a0a018eef15fcb2 /adb/adb.h
parenta1cd8b94fbcf690a2f60661806e8b013e54689a7 (diff)
downloadcore-fd96db17b7f07eb6615af01fd1908b74383bf04b.tar.gz
core-fd96db17b7f07eb6615af01fd1908b74383bf04b.tar.bz2
core-fd96db17b7f07eb6615af01fd1908b74383bf04b.zip
FunctionFS: initial implementation
This is the second version of a patch which demonstrates the possibility of using adbd (Android Debug Bridge daemon) with a generic FunctionFS gadget instead of a custom adb usb gadget in the Linux kernel. It contains changes introduced after Benoit's review - thank you Benoit. The patch adds a new usb access layer to adbd using FunctionFS. The former usb access method is still available. The method is chosen at runtime depending if /dev/usb-ffs/adb/ep0 or /dev/android_adb is accessible. How to use on the target device: $ insmod g_ffs.ko idVendor=<vendor ID> iSerialNumber=<some string> $ mount -t functionfs adb /dev/usb-ffs/adb -o uid=2000,gid=2000 $ ./adbd This patch requires a patch to bionic which adds <linux/usb_functionfs.h> which is an exact copy of the relevant file in the linux kernel. Change-Id: I4b42eb267ffa50fca7a5fba46f388a2f083e8b2d Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> [benoit@android.com: detect at runtime if functionfs is mounted or fallback using f_adb] Signed-off-by: Benoit Goby <benoit@android.com>
Diffstat (limited to 'adb/adb.h')
-rw-r--r--adb/adb.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/adb/adb.h b/adb/adb.h
index 4a9b53c53..815e4e60f 100644
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -462,6 +462,17 @@ extern int SHELL_EXIT_NOTIFY_FD;
#define CHUNK_SIZE (64*1024)
+#if !ADB_HOST
+#define USB_ADB_PATH "/dev/android_adb"
+
+#define USB_FFS_ADB_PATH "/dev/usb-ffs/adb/"
+#define USB_FFS_ADB_EP(x) USB_FFS_ADB_PATH#x
+
+#define USB_FFS_ADB_EP0 USB_FFS_ADB_EP(ep0)
+#define USB_FFS_ADB_OUT USB_FFS_ADB_EP(ep1)
+#define USB_FFS_ADB_IN USB_FFS_ADB_EP(ep2)
+#endif
+
int sendfailmsg(int fd, const char *reason);
int handle_host_request(char *service, transport_type ttype, char* serial, int reply_fd, asocket *s);