summaryrefslogtreecommitdiffstats
path: root/adb/usb_linux_client.c
Commit message (Collapse)AuthorAgeFilesLines
* FunctionFS: initial implementationAndrzej Pietrasiewicz2012-05-311-16/+351
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* adb: Add ability to specify device pathScott Anderson2012-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For manufacturing and testing, there is a need to talk to whatever device is connected to a given port on the host. This change modifies adb's "-s" option to take either a serial number or a device path. The device paths of the connected devices can be listed using "adb devices -l" whose output will resemble: List of devices attached 016B75D60A00600D usb:2-5 device 3031D0B2E71D00EC usb:1-4.3 device The second column lists the device paths. If the -l option is not given, the output from "adb devices" will be the same as it used to be (i.e. the paths will not be printed). The device path can also be obtained with the get-devpath command: $adb -s 3031D0B2E71D00EC get-devpath usb:1-4.3 Note that the format of the device paths are platform dependent. The example above is from Linux. On OS-X, the paths will be "usb:" followed by hex digits. For other platforms, the device paths will be printed as "????????????" and the -s option will not be able to select a device until someone implements the underlying functionality. Change-Id: I057d5d9f8c5bb72eddf5b8088aae110763f809d7 Signed-off-by: Scott Anderson <saa@android.com>
* adb: fix subprocess exit handling, oom adjust fixes, extra debugging.JP Abgrall2011-03-281-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add support for correctly handling subprocess termination in shell service (b/3400254 b/3482112 b/2249397) - have a waitpid() track the subprocess, then notify the fdevent via a socket - force an eof on the pty master in fdevent's new subproc handler. - modify fdevent to force-read the pty after an exit. * Migrate the "shell:blabla" handling to "#if !ADB_HOST" sections, where it belongs. * Fix the race around OOM adjusting. - Do it in the child before exec() instead of the in the parent as the child could already have started or not (no /proc/pid/... yet). * Allow for multi-threaded D() invocations to not clobber each other. - Allow locks across object files. - Add lock within D() - Make sure sysdesp init (mutex init also) is called early. * Add some missing close(fd) calls - Match similar existing practices near dup2() * Add extra D() invocations related to FD handling. * Warn about using debugging as stderr/stdout is used for protocol. * Fix some errno handling and make D() correctly handle it. * Add new adb trace_mask: services. * Make fdevent_loop's handle BADFDs more gracefully (could occur some subproc closed its pts explicitely). * Remove obsolete commandline args reported in help. (b/3509092) Change-Id: I928287fdf4f1a86777e22ce105f9581685f46e35
* Revert "Fix adb hang when subprocess dies early."JP Abgrall2011-02-231-8/+7
| | | | | | | | This is for http://b/3482112 "adb interactions with device causing test harness failures". This reverts commit 69c5c4c45bd4f1575ae8bdba13795297be7deb8c. Change-Id: I630bf2e04d2ecf0223bd2af4e87136754ff880d3
* Fix adb hang when subprocess dies early.JP Abgrall2011-02-181-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | * Handling of the subprocess and its FD. This fixes http://b/3400254 "Many bugreports getting hung at the end in monkey" - Start up a service thread that waits on the subprocess to terminate, then closes the FD associated with it. - Have the event handler select() with a timeout so that it can detect the closed FD. Select() with no timeout does not return when an FD is closed. - Have the event handler force a read on the closed FD to trigger the close sequence. - Migrate the "shell:blabla" handling to "#if !ADB_HOST" sections. * Fix the race around OOM adjusting. - Do it in the child before exec() instead of the in the parent as the child could already have started or not (no /proc/pid/... yet). * Allow for multi-threaded D() invocations to not clobber each other. - Allow locks across object files. - Add lock within D() * Add some missing close(fd) calls - Match similar existing practices near dup2() * Add extra D() invocations related to FD handling. * Warn about using debugging as stderr/stdout is used for protocol. Change-Id: Ie5c4a5e6bfbe3f22201adf5f9a205d32e069bf9d Signed-off-by: JP Abgrall <jpa@google.com>
* adb: On Linux, detect USB devices for which adb does not have permissions to ↵Mike Lockwood2009-08-081-1/+1
| | | | | | | | | | | communicate with. adb devices will now list devices without adequate file system permissions in /dev/bus/usb as: List of devices attached ???????????? no permissions Signed-off-by: Mike Lockwood <lockwood@android.com>
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+156
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-156/+0
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-1/+1
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+156