|
Android-cuttlefish cvd tool
|
#include <ctype.h>#include <dirent.h>#include <errno.h>#include <fcntl.h>#include <pthread.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/ioctl.h>#include <sys/stat.h>#include <sys/types.h>#include <unistd.h>#include <linux/usbdevice_fs.h>#include <linux/version.h>#include <linux/usb/ch9.h>#include <android-base/file.h>#include <android-base/stringprintf.h>#include <chrono>#include <memory>#include <thread>#include "usb.h"#include "util.h"
Classes | |
| struct | usb_handle |
| class | LinuxUsbTransport |
Macros | |
| #define | MAX_RETRIES 2 |
| #define | WAIT_FOR_DISCONNECT_TIMEOUT 3 |
| #define | DBG(x...) |
| #define | DBG1(x...) |
| #define | MAX_USBFS_BULK_WRITE_SIZE (256 * 1024) |
| #define | MAX_USBFS_BULK_READ_SIZE (16 * 1024) |
| #define | MIN_USBFS_BULK_WRITE_SIZE (16 * 1024) |
Functions | |
| static int | badname (const char *name) |
| static int | check (void *_desc, int len, unsigned type, int size) |
| static int | filter_usb_device (char *sysfs_name, char *ptr, int len, int writable, ifc_match_func callback, int *ept_in_id, int *ept_out_id, int *ifc_id) |
| static int | read_sysfs_string (const char *sysfs_name, const char *sysfs_node, char *buf, int bufsize) |
| static int | read_sysfs_number (const char *sysfs_name, const char *sysfs_node) |
| static int | convert_to_devfs_name (const char *sysfs_name, char *devname, int devname_size) |
| static std::unique_ptr< usb_handle > | find_usb_device (const char *base, ifc_match_func callback) |
| std::unique_ptr< UsbTransport > | usb_open (ifc_match_func callback, uint32_t timeout_ms) |
| #define DBG | ( | x... | ) |
| #define DBG1 | ( | x... | ) |
| #define MAX_RETRIES 2 |
| #define MAX_USBFS_BULK_READ_SIZE (16 * 1024) |
| #define MAX_USBFS_BULK_WRITE_SIZE (256 * 1024) |
| #define MIN_USBFS_BULK_WRITE_SIZE (16 * 1024) |
| #define WAIT_FOR_DISCONNECT_TIMEOUT 3 |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| std::unique_ptr< UsbTransport > usb_open | ( | ifc_match_func | callback, |
| uint32_t | timeout_ms | ||
| ) |