/system/core/fastboot/ |
H A D | protocol.c | 50 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 D | fastboot.h | 32 #include "usb.h" 37 int fb_command(usb_handle *usb, const char *cmd); 38 int fb_command_response(usb_handle *usb, const char *cmd, char *response); 39 int fb_download_data(usb_handle *usb, const void *data, unsigned size); 40 int fb_download_data_sparse(usb_handle *usb, struct sparse_file *s); 47 int fb_getvar(struct usb_handle *usb, char *response, const char *fmt, ...); 48 int fb_format_supported(usb_handle *usb, const char *partition, const char *type_override); 62 int fb_execute_queue(usb_handle *usb);
|
H A D | usbtest.c | 36 #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 D | usb_linux.c | 47 #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); 249 "/sys/bus/usb/devices/%s/%s", sysfs_name, sysfs_node); 297 snprintf(devname, devname_size, "/dev/bus/usb/%03d/%03d", busnum, devnum); 303 usb_handle *usb = 0; local 316 while((de = readdir(busdir)) && (usb 474 usb_wait_for_disconnect(usb_handle *usb) argument [all...] |
H A D | fastboot.c | 70 static usb_handle *usb = 0; variable 259 static usb_handle *usb = 0; local 262 if(usb) return usb; 265 usb = usb_open(match_fastboot); 266 if(usb) return usb; 581 static int64_t get_target_sparse_limit(struct usb_handle *usb) argument 585 int status = fb_getvar(usb, response, "max-download-size"); 598 static int64_t get_sparse_limit(struct usb_handle *usb, int64_ argument 636 load_buf_fd(usb_handle *usb, int fd, struct fastboot_buffer *buf) argument 670 load_buf(usb_handle *usb, const char *fname, struct fastboot_buffer *buf) argument 703 do_flash(usb_handle *usb, const char *pname, const char *fname) argument 723 do_update(usb_handle *usb, char *fn, int erase_first) argument 801 do_flashall(usb_handle *usb, int erase_first) argument [all...] |
H A D | engine.c | 87 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 D | Android.mk | 49 LOCAL_C_INCLUDES += development/host/windows/usb/api
|
H A D | usb_osx.c | 33 #include <IOKit/usb/IOUSBLib.h> 37 #include "usb.h" 52 /** An open usb device */ 331 snprintf(handle->info.device_path, sizeof(handle->info.device_path), "usb:%lX", locationId); 470 int usb_wait_for_disconnect(usb_handle *usb) { argument
|
H A D | usb_windows.c | 37 #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 D | usb_linux.c | 33 #include <linux/usb/ch9.h> 45 /* usb scan debugging is waaaay too verbose */ 87 usb_handle *usb; local 90 for(usb = handle_list.next; usb != &handle_list; usb = usb->next){ 91 if(!strcmp(usb->fname, dev_name)) { 93 usb->mark = 1; 104 usb_handle *usb; local 564 usb_handle* usb = 0; local [all...] |
H A D | transport_usb.c | 55 if(usb_read(t->usb, &p->msg, sizeof(amessage))){ 56 D("remote usb: read terminated (message)\n"); 63 D("remote usb: check_header failed\n"); 68 if(usb_read(t->usb, p->data, p->msg.data_length)){ 69 D("remote usb: terminated (data)\n"); 75 D("remote usb: check_data failed\n"); 88 if(usb_write(t->usb, &p->msg, sizeof(amessage))) { 89 D("remote usb: 1 - write terminated\n"); 93 if(usb_write(t->usb, &p->data, size)) { 94 D("remote usb [all...] |
H A D | usb_libusb.c | 332 struct usb_handle *usb= NULL; local 334 usb = calloc(1, sizeof(struct usb_handle)); 335 memcpy(usb, uh, sizeof(struct usb_handle)); 336 strcpy(usb->serial, uh->serial); 338 adb_cond_init(&usb->notify, 0); 339 adb_mutex_init(&usb->lock, 0); 343 usb->next = &handle_list; 344 usb->prev = handle_list.prev; 345 usb->prev->next = usb; 358 struct usb_handle *usb= NULL; local 562 struct usb_handle *usb= NULL; local [all...] |
H A D | usb_linux_client.c | 22 #include <linux/usb/ch9.h> 23 #include <linux/usb/functionfs.h> 151 struct usb_handle *usb = (struct usb_handle *)x; local 156 adb_mutex_lock(&usb->lock); 157 while (usb->fd != -1) 158 adb_cond_wait(&usb->notify, &usb->lock); 159 adb_mutex_unlock(&usb->lock); 176 usb->fd = fd; 179 register_usb_transport(usb, 320 struct usb_handle *usb = (struct usb_handle *)x; local [all...] |
H A D | usb_windows.c | 31 /** Structure usb_handle describes our connection to the usb device via 36 /// Previous entry in the list of opened usb handles 39 /// Next entry in the list of opened usb handles 61 /// List of opened usb handles 67 /// Locker for the list of opened usb handles 70 /// Checks if there is opened usb handle in handle_list for this device. 73 /// Checks if there is opened usb handle in handle_list for this device. 77 /// Registers opened usb handle (adds it to handle_list). 84 /// registers usb transport for them. 87 /// Entry point for thread that polls (every second) for new usb interface 119 usb_handle* usb; local [all...] |
H A D | Android.mk | 12 # Default to a virtual (sockets) usb interface 48 LOCAL_C_INCLUDES += development/host/windows/usb/api/
|
H A D | adb.h | 159 ** connects through TCP (for the emulator), while a "usb transport" through 194 /* usb handle or socket fd as needed */ 195 usb_handle *usb; member in struct:atransport 293 void init_usb_transport(atransport *t, usb_handle *usb, int state); 308 void unregister_usb_transport(usb_handle *usb); 366 /* usb host/client interface */ 407 #define USB_FFS_ADB_PATH "/dev/usb-ffs/adb/"
|
H A D | transport.c | 1099 void register_usb_transport(usb_handle *usb, const char *serial, const char *devpath, unsigned writeable) argument 1102 D("transport: %p init'ing for usb_handle %p (sn='%s')\n", t, usb, 1104 init_usb_transport(t, usb, (writeable ? CS_OFFLINE : CS_NOPERM)); 1123 void unregister_usb_transport(usb_handle *usb) argument 1128 if (t->usb == usb && t->connection_state == CS_NOPERM) {
|
H A D | adb.c | 106 { "usb", TRACE_USB }, 225 //Close the associated usb 1393 int usb = 0; local 1397 usb = 1; 1401 // If one of the properties isn't set and we couldn't listen on usb, 1411 } else if (!usb) { 1569 // "transport-usb:" is used for switching transport to the only USB transport 1576 if (!strncmp(service, "transport-usb", strlen("transport-usb"))) {
|
H A D | usb_osx.c | 21 #include <IOKit/usb/IOUSBLib.h> 200 snprintf(devpathBuf, sizeof(devpathBuf), "usb:%lX", locationId);
|
/system/core/include/usbhost/ |
H A D | usbhost.h | 28 #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/fastbootd/ |
H A D | usb_linux_client.c | 28 #include <linux/usb/ch9.h> 29 #include <linux/usb/functionfs.h> 47 #define USB_FFS_FASTBOOT_PATH "/dev/usb-ffs/adb/" 283 D(ERR, "usb connect: failed to initialize usb transport");
|