Searched refs:usb (Results 1 - 21 of 21) sorted by relevance

/system/core/fastboot/
H A Dprotocol.c50 static int check_response(usb_handle *usb, unsigned int size, char *response) argument
56 r = usb_read(usb, status, 64);
59 usb_close(usb);
66 usb_close(usb);
95 usb_close(usb);
102 usb_close(usb);
109 static int _command_start(usb_handle *usb, const char *cmd, unsigned size, argument
123 if(usb_write(usb, cmd, cmdsize) != cmdsize) {
125 usb_close(usb);
129 return check_response(usb, siz
132 _command_data(usb_handle *usb, const void *data, unsigned size) argument
151 _command_end(usb_handle *usb) argument
161 _command_send(usb_handle *usb, const char *cmd, const void *data, unsigned size, char *response) argument
188 _command_send_no_data(usb_handle *usb, const char *cmd, char *response) argument
194 fb_command(usb_handle *usb, const char *cmd) argument
199 fb_command_response(usb_handle *usb, const char *cmd, char *response) argument
204 fb_download_data(usb_handle *usb, const void *data, unsigned size) argument
226 usb_handle *usb = priv; local
273 fb_download_data_sparse_flush(usb_handle *usb) argument
288 fb_download_data_sparse(usb_handle *usb, struct sparse_file *s) argument
[all...]
H A Dfastboot.h32 #include "usb.h"
41 int fb_command(usb_handle *usb, const char *cmd);
42 int fb_command_response(usb_handle *usb, const char *cmd, char *response);
43 int fb_download_data(usb_handle *usb, const void *data, unsigned size);
44 int fb_download_data_sparse(usb_handle *usb, struct sparse_file *s);
51 int fb_getvar(struct usb_handle *usb, char *response, const char *fmt, ...);
52 int fb_format_supported(usb_handle *usb, const char *partition, const char *type_override);
66 int fb_execute_queue(usb_handle *usb);
H A Dusbtest.c36 #include "usb.h"
89 int test_null(usb_handle *usb) argument
98 if(usb_write(usb, buf, arg_size) != (int)arg_size) {
108 int test_zero(usb_handle *usb) argument
116 if(usb_read(usb, buf, arg_size) != (int)arg_size) {
130 int (*test)(usb_handle *usb);
180 usb_handle *usb; local
193 usb = usb_open(tests[i].match);
195 if(usb == 0) {
200 if(tests[i].test(usb)) {
[all...]
H A Dfastboot.cpp248 static usb_handle *usb = 0; local
251 if(usb) return usb;
254 usb = usb_open(match_fastboot);
255 if(usb) return usb;
593 static int64_t get_target_sparse_limit(struct usb_handle *usb) argument
597 int status = fb_getvar(usb, response, "max-download-size");
610 static int64_t get_sparse_limit(struct usb_handle *usb, int64_t size) argument
620 target_sparse_limit = get_target_sparse_limit(usb);
640 needs_erase(usb_handle* usb, const char *part) argument
648 load_buf_fd(usb_handle *usb, int fd, struct fastboot_buffer *buf) argument
682 load_buf(usb_handle *usb, const char *fname, struct fastboot_buffer *buf) argument
715 do_flash(usb_handle *usb, const char *pname, const char *fname) argument
734 do_update(usb_handle *usb, const char *filename, int erase_first) argument
800 do_flashall(usb_handle *usb, int erase_first) argument
892 fb_perform_format(usb_handle* usb, const char *partition, int skip_if_not_supported, const char *type_override, const char *size_override) argument
1100 usb_handle* usb = open_device(); local
[all...]
H A Dusb_linux.c47 #include <linux/usb/ch9.h>
54 #include "usb.h"
73 * in drivers/usb/core/devio.c.
85 /* True if name isn't a valid name for a USB device in /sys/bus/usb/devices.
147 snprintf(info.device_path, sizeof(info.device_path), "usb:%s", sysfs_name);
161 "/sys/bus/usb/devices/%s/serial", sysfs_name);
256 "/sys/bus/usb/devices/%s/%s", sysfs_name, sysfs_node);
304 snprintf(devname, devname_size, "/dev/bus/usb/%03d/%03d", busnum, devnum);
310 usb_handle *usb = 0; local
323 while((de = readdir(busdir)) && (usb
481 usb_wait_for_disconnect(usb_handle *usb) argument
[all...]
H A Dengine.c87 int fb_getvar(struct usb_handle *usb, char *response, const char *fmt, ...) argument
98 return fb_command_response(usb, cmd, response);
109 int fb_format_supported(usb_handle *usb, const char *partition, const char *type_override) argument
117 status = fb_getvar(usb, fs_type, "partition-type:%s", partition);
367 int fb_execute_queue(usb_handle *usb) argument
387 status = fb_download_data(usb, a->data, a->size);
391 status = fb_command(usb, a->cmd);
395 status = fb_command_response(usb, a->cmd, resp);
401 status = fb_download_data_sparse(usb, a->data);
405 usb_wait_for_disconnect(usb);
[all...]
H A Dusb_osx.c33 #include <IOKit/usb/IOUSBLib.h>
37 #include "usb.h"
52 /** An open usb device */
332 "usb:%" PRIu32 "X", (unsigned int)locationId);
471 int usb_wait_for_disconnect(usb_handle *usb) { argument
H A DAndroid.mk54 LOCAL_C_INCLUDES += development/host/windows/usb/api
H A Dusb_windows.c37 #include "usb.h"
48 /** Structure usb_handle describes our connection to the usb device via
73 /// Opens usb interface (device) by interface (device) name.
76 /// Writes data to the opened usb handle
79 /// Reads data using the opened usb handle
82 /// Cleans up opened usb handle
85 /// Cleans up (but don't close) opened usb handle
88 /// Closes opened usb handle
273 int usb_wait_for_disconnect(usb_handle *usb) { argument
/system/core/adb/
H A Dtransport_usb.cpp30 if(usb_read(t->usb, &p->msg, sizeof(amessage))){
31 D("remote usb: read terminated (message)\n");
36 D("remote usb: check_header failed\n");
41 if(usb_read(t->usb, p->data, p->msg.data_length)){
42 D("remote usb: terminated (data)\n");
48 D("remote usb: check_data failed\n");
59 if(usb_write(t->usb, &p->msg, sizeof(amessage))) {
60 D("remote usb: 1 - write terminated\n");
64 if(usb_write(t->usb, &p->data, size)) {
65 D("remote usb
[all...]
H A Dusb_linux.cpp34 #include <linux/usb/ch9.h>
43 /* usb scan debugging is waaaay too verbose */
85 usb_handle *usb; local
88 for(usb = handle_list.next; usb != &handle_list; usb = usb->next){
89 if(!strcmp(usb->fname, dev_name)) {
91 usb->mark = 1;
102 usb_handle *usb; local
591 usb_handle* usb = reinterpret_cast<usb_handle*>(calloc(1, sizeof(usb_handle))); local
[all...]
H A Dusb_linux_client.cpp24 #include <linux/usb/ch9.h>
25 #include <linux/usb/functionfs.h>
164 struct usb_handle *usb = (struct usb_handle *)x; local
169 adb_mutex_lock(&usb->lock);
170 while (usb->fd != -1)
171 adb_cond_wait(&usb->notify, &usb->lock);
172 adb_mutex_unlock(&usb->lock);
189 usb->fd = fd;
192 register_usb_transport(usb,
351 struct usb_handle *usb = (struct usb_handle *)x; local
[all...]
H A Dtransport.h54 void unregister_usb_transport(usb_handle* usb);
H A Dusb_windows.cpp33 /** Structure usb_handle describes our connection to the usb device via
38 /// Previous entry in the list of opened usb handles
41 /// Next entry in the list of opened usb handles
63 /// List of opened usb handles
69 /// Locker for the list of opened usb handles
72 /// Checks if there is opened usb handle in handle_list for this device.
75 /// Checks if there is opened usb handle in handle_list for this device.
79 /// Registers opened usb handle (adds it to handle_list).
86 /// registers usb transport for them.
89 /// Entry point for thread that polls (every second) for new usb interface
121 usb_handle* usb; local
[all...]
H A Dadb_main.cpp302 int usb = 0; local
306 usb = 1;
310 // If one of the properties isn't set and we couldn't listen on usb,
320 } else if (!usb) {
H A Dadb.h157 ** connects through TCP (for the emulator), while a "usb transport" through
192 /* usb handle or socket fd as needed */
193 usb_handle *usb; member in struct:atransport
269 void init_usb_transport(atransport *t, usb_handle *usb, int state);
325 /* usb host/client interface */
366 #define USB_FFS_ADB_PATH "/dev/usb-ffs/adb/"
H A Dtransport.cpp1020 void register_usb_transport(usb_handle *usb, const char *serial, const char *devpath, unsigned writeable) argument
1024 D("transport: %p init'ing for usb_handle %p (sn='%s')\n", t, usb,
1026 init_usb_transport(t, usb, (writeable ? CS_OFFLINE : CS_NOPERM));
1045 void unregister_usb_transport(usb_handle *usb) argument
1050 if (t->usb == usb && t->connection_state == CS_NOPERM) {
H A DAndroid.mk98 LOCAL_C_INCLUDES += development/host/windows/usb/api/
H A Dusb_osx.cpp25 #include <IOKit/usb/IOUSBLib.h>
196 snprintf(devpathBuf, sizeof(devpathBuf), "usb:%" PRIu32 "X",
/system/core/include/usbhost/
H A Dusbhost.h28 #include <linux/usb/ch9.h>
78 /* Call this to initialize the usb host context. */
85 /* Call this to read and handle occuring usb event. */
/system/core/adb/tests/
H A Dtest_adb.py185 def usb(self): member in class:AdbWrapper
186 return call_checked(self.adb_cmd + "usb")

Completed in 127 milliseconds