usbip_common.h | usbip_common.h | |||
---|---|---|---|---|
skipping to change at line 21 | skipping to change at line 21 | |||
#include <errno.h> | #include <errno.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <string.h> | #include <string.h> | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <strings.h> | #include <strings.h> | |||
#include <sysfs/libsysfs.h> | #include <sysfs/libsysfs.h> | |||
#include <netdb.h> | #include <netdb.h> | |||
#include <sys/socket.h> | #include <sys/socket.h> | |||
/* | ||||
* logging has moved to this file | ||||
*/ | ||||
#include "log_util.h" | ||||
#ifndef USBIDS_FILE | #ifndef USBIDS_FILE | |||
#define USBIDS_FILE "/usr/share/hwdata/usb.ids" | #define USBIDS_FILE "/usr/share/hwdata/usb.ids" | |||
#endif | #endif | |||
//#include <linux/usb_ch9.h> | //#include <linux/usb_ch9.h> | |||
enum usb_device_speed { | enum usb_device_speed { | |||
USB_SPEED_UNKNOWN = 0, /* enumerating */ | USB_SPEED_UNKNOWN = 0, /* enumerating */ | |||
USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ | USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ | |||
USB_SPEED_HIGH, /* usb 2.0 */ | USB_SPEED_HIGH, /* usb 2.0 */ | |||
USB_SPEED_VARIABLE /* wireless (usb 2.5) */ | USB_SPEED_VARIABLE /* wireless (usb 2.5) */ | |||
skipping to change at line 55 | skipping to change at line 50 | |||
SDEV_ST_ERROR, | SDEV_ST_ERROR, | |||
/* vdev does not connect a remote device. */ | /* vdev does not connect a remote device. */ | |||
VDEV_ST_NULL, | VDEV_ST_NULL, | |||
/* vdev is used, but the USB address is not assigned yet */ | /* vdev is used, but the USB address is not assigned yet */ | |||
VDEV_ST_NOTASSIGNED, | VDEV_ST_NOTASSIGNED, | |||
VDEV_ST_USED, | VDEV_ST_USED, | |||
VDEV_ST_ERROR | VDEV_ST_ERROR | |||
}; | }; | |||
/* | ||||
extern int usbip_use_syslog; | extern int usbip_use_syslog; | |||
extern int usbip_use_stderr; | extern int usbip_use_stderr; | |||
extern int usbip_use_debug ; | extern int usbip_use_debug ; | |||
#define err(fmt, args...) do { \ | #define err(fmt, args...) do { \ | |||
if (usbip_use_syslog) { \ | if (usbip_use_syslog) { \ | |||
syslog(LOG_ERR, "usbip err: %13s:%4d (%-12s) " fmt "\n", \ | syslog(LOG_ERR, "usbip err: %13s:%4d (%-12s) " fmt "\n", \ | |||
__FILE__, __LINE__, __FUNCTION__, ##args); \ | __FILE__, __LINE__, __FUNCTION__, ##args); \ | |||
} \ | } \ | |||
if (usbip_use_stderr) { \ | if (usbip_use_stderr) { \ | |||
skipping to change at line 103 | skipping to change at line 97 | |||
__FILE__, __LINE__, __FUNCTION__, ##args); \ | __FILE__, __LINE__, __FUNCTION__, ##args); \ | |||
} \ | } \ | |||
if (usbip_use_stderr) { \ | if (usbip_use_stderr) { \ | |||
fprintf(stderr, "usbip dbg: %13s:%4d (%-12s) " fmt " \n", \ | fprintf(stderr, "usbip dbg: %13s:%4d (%-12s) " fmt " \n", \ | |||
__FILE__, __LINE__, __FUNCTION__, ##args); \ | __FILE__, __LINE__, __FUNCTION__, ##args); \ | |||
} \ | } \ | |||
} \ | } \ | |||
} while (0) | } while (0) | |||
#define BUG() do { err("sorry, it's a bug"); abort(); } while (0) | #define BUG() do { err("sorry, it's a bug"); abort(); } while (0) | |||
*/ | ||||
struct usb_interface { | struct usb_interface { | |||
uint8_t bInterfaceClass; | uint8_t bInterfaceClass; | |||
uint8_t bInterfaceSubClass; | uint8_t bInterfaceSubClass; | |||
uint8_t bInterfaceProtocol; | uint8_t bInterfaceProtocol; | |||
uint8_t padding; /* alignment */ | uint8_t padding; /* alignment */ | |||
} __attribute__((packed)); | } __attribute__((packed)); | |||
struct usb_device { | struct usb_device { | |||
char path[SYSFS_PATH_MAX]; | char path[SYSFS_PATH_MAX]; | |||
End of changes. 3 change blocks. | ||||
7 lines changed or deleted | 0 lines changed or added | |||