LibUSB v1.0:
- Significantly improve libusb10 support. - Many minor issues fixed. - P4 ID: 166189, 165853, 165991, 166052, 166069 Submitted by: hps Approved by: re
This commit is contained in:
parent
ed190ad06a
commit
390065b18e
@ -294,7 +294,7 @@ LIBUSB_ERROR code on failure.
|
|||||||
.
|
.
|
||||||
.Pp
|
.Pp
|
||||||
.Ft void
|
.Ft void
|
||||||
.Fn libusb_free_config_descriptor "libusb_config_descriptor *config`"
|
.Fn libusb_free_config_descriptor "libusb_config_descriptor *config"
|
||||||
Free a configuration descriptor.
|
Free a configuration descriptor.
|
||||||
.
|
.
|
||||||
.Pp
|
.Pp
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/endian.h>
|
#include <sys/endian.h>
|
||||||
#include <sys/queue.h>
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -181,95 +180,25 @@ enum libusb_debug_level {
|
|||||||
LIBUSB_DEBUG_TRANSFER=2,
|
LIBUSB_DEBUG_TRANSFER=2,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* internal structures */
|
|
||||||
|
|
||||||
typedef struct libusb_pollfd {
|
|
||||||
int fd;
|
|
||||||
short events;
|
|
||||||
} libusb_pollfd;
|
|
||||||
|
|
||||||
struct usb_pollfd {
|
|
||||||
TAILQ_ENTRY(usb_pollfd) list;
|
|
||||||
struct libusb_pollfd pollfd;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct usb_transfer {
|
|
||||||
TAILQ_ENTRY(usb_transfer) list;
|
|
||||||
int num_iso_packets;
|
|
||||||
struct timeval timeout;
|
|
||||||
int transferred;
|
|
||||||
uint8_t flags;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct usb_ep_tr {
|
|
||||||
TAILQ_ENTRY(usb_ep_tr) list;
|
|
||||||
uint8_t addr;
|
|
||||||
uint8_t idx;
|
|
||||||
uint8_t flags;
|
|
||||||
void *os_priv;
|
|
||||||
};
|
|
||||||
/* libusb structures */
|
/* libusb structures */
|
||||||
|
|
||||||
|
struct libusb_context;
|
||||||
|
struct libusb_device;
|
||||||
|
struct libusb_transfer;
|
||||||
|
struct libusb20_device;
|
||||||
|
|
||||||
|
struct libusb_pollfd {
|
||||||
|
int fd;
|
||||||
|
short events;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct libusb_context libusb_context;
|
||||||
|
typedef struct libusb_device libusb_device;
|
||||||
|
typedef struct libusb20_device libusb_device_handle;
|
||||||
|
typedef struct libusb_pollfd libusb_pollfd;
|
||||||
typedef void (*libusb_pollfd_added_cb) (int fd, short events, void *user_data);
|
typedef void (*libusb_pollfd_added_cb) (int fd, short events, void *user_data);
|
||||||
typedef void (*libusb_pollfd_removed_cb) (int fd, void *user_data);
|
typedef void (*libusb_pollfd_removed_cb) (int fd, void *user_data);
|
||||||
|
|
||||||
typedef struct libusb_context {
|
|
||||||
int debug;
|
|
||||||
int debug_fixed;
|
|
||||||
|
|
||||||
int ctrl_pipe[2];
|
|
||||||
|
|
||||||
TAILQ_HEAD(usb_devs_list, libusb_device) usb_devs;
|
|
||||||
pthread_mutex_t usb_devs_lock;
|
|
||||||
|
|
||||||
TAILQ_HEAD(open_devs_list, libusb_device_handle) open_devs;
|
|
||||||
pthread_mutex_t open_devs_lock;
|
|
||||||
|
|
||||||
TAILQ_HEAD(flying_transfers_list, usb_transfer) flying_transfers;
|
|
||||||
pthread_mutex_t flying_transfers_lock;
|
|
||||||
|
|
||||||
TAILQ_HEAD(pollfds_list, usb_pollfd) pollfds;
|
|
||||||
pthread_mutex_t pollfds_lock;
|
|
||||||
|
|
||||||
unsigned int pollfd_modify;
|
|
||||||
pthread_mutex_t pollfd_modify_lock;
|
|
||||||
|
|
||||||
libusb_pollfd_added_cb fd_added_cb;
|
|
||||||
libusb_pollfd_removed_cb fd_removed_cb;
|
|
||||||
void *fd_cb_user_data;
|
|
||||||
|
|
||||||
pthread_mutex_t events_lock;
|
|
||||||
int event_handler_active;
|
|
||||||
|
|
||||||
pthread_mutex_t event_waiters_lock;
|
|
||||||
pthread_cond_t event_waiters_cond;
|
|
||||||
} libusb_context;
|
|
||||||
|
|
||||||
typedef struct libusb_device {
|
|
||||||
pthread_mutex_t lock;
|
|
||||||
int refcnt;
|
|
||||||
|
|
||||||
struct libusb_context *ctx;
|
|
||||||
|
|
||||||
uint8_t bus_number;
|
|
||||||
uint8_t device_address;
|
|
||||||
uint8_t num_configurations;
|
|
||||||
|
|
||||||
TAILQ_ENTRY(libusb_device) list;
|
|
||||||
unsigned long session_data;
|
|
||||||
void *os_priv;
|
|
||||||
} libusb_device;
|
|
||||||
|
|
||||||
typedef struct libusb_device_handle {
|
|
||||||
pthread_mutex_t lock;
|
|
||||||
unsigned long claimed_interfaces;
|
|
||||||
|
|
||||||
TAILQ_ENTRY(libusb_device_handle) list;
|
|
||||||
struct libusb_device *dev;
|
|
||||||
void *os_priv;
|
|
||||||
TAILQ_HEAD(ep_list, usb_ep_tr) ep_list;
|
|
||||||
} libusb_device_handle;
|
|
||||||
|
|
||||||
typedef struct libusb_device_descriptor {
|
typedef struct libusb_device_descriptor {
|
||||||
uint8_t bLength;
|
uint8_t bLength;
|
||||||
uint8_t bDescriptorType;
|
uint8_t bDescriptorType;
|
||||||
@ -296,7 +225,7 @@ typedef struct libusb_endpoint_descriptor {
|
|||||||
uint8_t bInterval;
|
uint8_t bInterval;
|
||||||
uint8_t bRefresh;
|
uint8_t bRefresh;
|
||||||
uint8_t bSynchAddress;
|
uint8_t bSynchAddress;
|
||||||
unsigned char *extra;
|
uint8_t *extra;
|
||||||
int extra_length;
|
int extra_length;
|
||||||
} libusb_endpoint_descriptor __aligned(sizeof(void *));
|
} libusb_endpoint_descriptor __aligned(sizeof(void *));
|
||||||
|
|
||||||
@ -311,7 +240,7 @@ typedef struct libusb_interface_descriptor {
|
|||||||
uint8_t bInterfaceProtocol;
|
uint8_t bInterfaceProtocol;
|
||||||
uint8_t iInterface;
|
uint8_t iInterface;
|
||||||
struct libusb_endpoint_descriptor *endpoint;
|
struct libusb_endpoint_descriptor *endpoint;
|
||||||
unsigned char *extra;
|
uint8_t *extra;
|
||||||
int extra_length;
|
int extra_length;
|
||||||
} libusb_interface_descriptor __aligned(sizeof(void *));
|
} libusb_interface_descriptor __aligned(sizeof(void *));
|
||||||
|
|
||||||
@ -330,7 +259,7 @@ typedef struct libusb_config_descriptor {
|
|||||||
uint8_t bmAttributes;
|
uint8_t bmAttributes;
|
||||||
uint8_t MaxPower;
|
uint8_t MaxPower;
|
||||||
struct libusb_interface *interface;
|
struct libusb_interface *interface;
|
||||||
unsigned char *extra;
|
uint8_t *extra;
|
||||||
int extra_length;
|
int extra_length;
|
||||||
} libusb_config_descriptor __aligned(sizeof(void *));
|
} libusb_config_descriptor __aligned(sizeof(void *));
|
||||||
|
|
||||||
@ -348,22 +277,20 @@ typedef struct libusb_iso_packet_descriptor {
|
|||||||
enum libusb_transfer_status status;
|
enum libusb_transfer_status status;
|
||||||
} libusb_iso_packet_descriptor __aligned(sizeof(void *));
|
} libusb_iso_packet_descriptor __aligned(sizeof(void *));
|
||||||
|
|
||||||
struct libusb_transfer;
|
|
||||||
|
|
||||||
typedef void (*libusb_transfer_cb_fn) (struct libusb_transfer *transfer);
|
typedef void (*libusb_transfer_cb_fn) (struct libusb_transfer *transfer);
|
||||||
|
|
||||||
typedef struct libusb_transfer {
|
typedef struct libusb_transfer {
|
||||||
libusb_device_handle *dev_handle;
|
libusb_device_handle *dev_handle;
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
unsigned int endpoint;
|
unsigned int endpoint;
|
||||||
unsigned char type;
|
uint8_t type;
|
||||||
unsigned int timeout;
|
unsigned int timeout;
|
||||||
enum libusb_transfer_status status;
|
enum libusb_transfer_status status;
|
||||||
int length;
|
int length;
|
||||||
int actual_length;
|
int actual_length;
|
||||||
libusb_transfer_cb_fn callback;
|
libusb_transfer_cb_fn callback;
|
||||||
void *user_data;
|
void *user_data;
|
||||||
unsigned char *buffer;
|
uint8_t *buffer;
|
||||||
void *os_priv;
|
void *os_priv;
|
||||||
int num_iso_packets;
|
int num_iso_packets;
|
||||||
struct libusb_iso_packet_descriptor iso_packet_desc[0];
|
struct libusb_iso_packet_descriptor iso_packet_desc[0];
|
||||||
@ -381,8 +308,8 @@ ssize_t libusb_get_device_list(libusb_context * ctx, libusb_device *** list);
|
|||||||
void libusb_free_device_list(libusb_device ** list, int unref_devices);
|
void libusb_free_device_list(libusb_device ** list, int unref_devices);
|
||||||
uint8_t libusb_get_bus_number(libusb_device * dev);
|
uint8_t libusb_get_bus_number(libusb_device * dev);
|
||||||
uint8_t libusb_get_device_address(libusb_device * dev);
|
uint8_t libusb_get_device_address(libusb_device * dev);
|
||||||
int libusb_clear_halt(libusb_device_handle *devh, unsigned char endpoint);
|
int libusb_clear_halt(libusb_device_handle *devh, uint8_t endpoint);
|
||||||
int libusb_get_max_packet_size(libusb_device * dev, unsigned char endpoint);
|
int libusb_get_max_packet_size(libusb_device * dev, uint8_t endpoint);
|
||||||
libusb_device *libusb_ref_device(libusb_device * dev);
|
libusb_device *libusb_ref_device(libusb_device * dev);
|
||||||
void libusb_unref_device(libusb_device * dev);
|
void libusb_unref_device(libusb_device * dev);
|
||||||
int libusb_open(libusb_device * dev, libusb_device_handle ** devh);
|
int libusb_open(libusb_device * dev, libusb_device_handle ** devh);
|
||||||
@ -393,6 +320,7 @@ int libusb_get_configuration(libusb_device_handle * devh, int *config);
|
|||||||
int libusb_set_configuration(libusb_device_handle * devh, int configuration);
|
int libusb_set_configuration(libusb_device_handle * devh, int configuration);
|
||||||
int libusb_claim_interface(libusb_device_handle * devh, int interface_number);
|
int libusb_claim_interface(libusb_device_handle * devh, int interface_number);
|
||||||
int libusb_release_interface(libusb_device_handle * devh, int interface_number);
|
int libusb_release_interface(libusb_device_handle * devh, int interface_number);
|
||||||
|
int libusb_reset_device(libusb_device_handle * dev);
|
||||||
int libusb_kernel_driver_active(libusb_device_handle * devh, int interface);
|
int libusb_kernel_driver_active(libusb_device_handle * devh, int interface);
|
||||||
int libusb_detach_kernel_driver(libusb_device_handle * devh, int interface);
|
int libusb_detach_kernel_driver(libusb_device_handle * devh, int interface);
|
||||||
int libusb_attach_kernel_driver(libusb_device_handle * devh, int interface);
|
int libusb_attach_kernel_driver(libusb_device_handle * devh, int interface);
|
||||||
@ -405,15 +333,15 @@ int libusb_get_active_config_descriptor(libusb_device * dev, struct libusb_confi
|
|||||||
int libusb_get_config_descriptor(libusb_device * dev, uint8_t config_index, struct libusb_config_descriptor **config);
|
int libusb_get_config_descriptor(libusb_device * dev, uint8_t config_index, struct libusb_config_descriptor **config);
|
||||||
int libusb_get_config_descriptor_by_value(libusb_device * dev, uint8_t bConfigurationValue, struct libusb_config_descriptor **config);
|
int libusb_get_config_descriptor_by_value(libusb_device * dev, uint8_t bConfigurationValue, struct libusb_config_descriptor **config);
|
||||||
void libusb_free_config_descriptor(struct libusb_config_descriptor *config);
|
void libusb_free_config_descriptor(struct libusb_config_descriptor *config);
|
||||||
int libusb_get_string_descriptor_ascii(libusb_device_handle * dev, uint8_t desc_index, unsigned char *data, int length);
|
int libusb_get_string_descriptor_ascii(libusb_device_handle * dev, uint8_t desc_index, uint8_t *data, int length);
|
||||||
|
|
||||||
/* Asynchronous device I/O*/
|
/* Asynchronous device I/O */
|
||||||
|
|
||||||
struct libusb_transfer *libusb_alloc_transfer(int iso_packets);
|
struct libusb_transfer *libusb_alloc_transfer(int iso_packets);
|
||||||
void libusb_free_transfer(struct libusb_transfer *transfer);
|
void libusb_free_transfer(struct libusb_transfer *transfer);
|
||||||
int libusb_submit_transfer(struct libusb_transfer *transfer);
|
int libusb_submit_transfer(struct libusb_transfer *transfer);
|
||||||
int libusb_cancel_transfer(struct libusb_transfer *transfer);
|
int libusb_cancel_transfer(struct libusb_transfer *transfer);
|
||||||
unsigned char *libusb_get_iso_packet_buffer_simple(struct libusb_transfer *transfer, unsigned int packet);
|
uint8_t *libusb_get_iso_packet_buffer_simple(struct libusb_transfer *transfer, unsigned int packet);
|
||||||
|
|
||||||
/* Polling and timing */
|
/* Polling and timing */
|
||||||
|
|
||||||
@ -434,9 +362,9 @@ struct libusb_pollfd **libusb_get_pollfds(libusb_context * ctx);
|
|||||||
|
|
||||||
/* Synchronous device I/O */
|
/* Synchronous device I/O */
|
||||||
|
|
||||||
int libusb_control_transfer(libusb_device_handle * devh, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, unsigned char *data, uint16_t wLength, unsigned int timeout);
|
int libusb_control_transfer(libusb_device_handle * devh, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint8_t *data, uint16_t wLength, unsigned int timeout);
|
||||||
int libusb_bulk_transfer(struct libusb_device_handle *devh, unsigned char endpoint, unsigned char *data, int length, int *transferred, unsigned int timeout);
|
int libusb_bulk_transfer(libusb_device_handle *devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, unsigned int timeout);
|
||||||
int libusb_interrupt_transfer(struct libusb_device_handle *devh, unsigned char endpoint, unsigned char *data, int length, int *transferred, unsigned int timeout);
|
int libusb_interrupt_transfer(libusb_device_handle *devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, unsigned int timeout);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
{ /* indent fix */
|
{ /* indent fix */
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -27,44 +27,87 @@
|
|||||||
#ifndef __LIBUSB10_H__
|
#ifndef __LIBUSB10_H__
|
||||||
#define __LIBUSB10_H__
|
#define __LIBUSB10_H__
|
||||||
|
|
||||||
/*
|
#include <sys/queue.h>
|
||||||
* The two following macros were taken from the original LibUSB v1.0
|
|
||||||
* for sake of compatibility:
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int get_next_timeout(libusb_context *ctx, struct timeval *tv, struct timeval *out);
|
#define GET_CONTEXT(ctx) (((ctx) == NULL) ? usbi_default_context : (ctx))
|
||||||
static int handle_timeouts(struct libusb_context *ctx);
|
|
||||||
static int handle_events(struct libusb_context *ctx, struct timeval *tv);
|
|
||||||
extern struct libusb_context *usbi_default_context;
|
|
||||||
extern pthread_mutex_t libusb20_lock;
|
|
||||||
|
|
||||||
/* if ctx is NULL use default context*/
|
|
||||||
|
|
||||||
#define GET_CONTEXT(ctx) \
|
|
||||||
if (ctx == NULL) ctx = usbi_default_context;
|
|
||||||
|
|
||||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
|
||||||
#define USB_TIMED_OUT (1<<0)
|
|
||||||
#define UNEXPORTED __attribute__((__visibility__("hidden")))
|
#define UNEXPORTED __attribute__((__visibility__("hidden")))
|
||||||
|
#define CTX_LOCK(ctx) pthread_mutex_lock(&(ctx)->ctx_lock)
|
||||||
|
#define CTX_TRYLOCK(ctx) pthread_mutex_trylock(&(ctx)->ctx_lock)
|
||||||
|
#define CTX_UNLOCK(ctx) pthread_mutex_unlock(&(ctx)->ctx_lock)
|
||||||
|
|
||||||
#define DPRINTF(ctx, dbg, format, args...) \
|
#define DPRINTF(ctx, dbg, format, args...) do { \
|
||||||
if (ctx->debug == dbg) { \
|
if ((ctx)->debug == dbg) { \
|
||||||
printf("LIBUSB_%s : ", (ctx->debug == LIBUSB_DEBUG_FUNCTION) ? "FUNCTION" : "TRANSFER"); \
|
switch (dbg) { \
|
||||||
switch(ctx->debug) { \
|
|
||||||
case LIBUSB_DEBUG_FUNCTION: \
|
case LIBUSB_DEBUG_FUNCTION: \
|
||||||
printf(format, ## args);\
|
printf("LIBUSB_FUNCTION: " \
|
||||||
break ; \
|
format "\n", ## args); \
|
||||||
|
break; \
|
||||||
case LIBUSB_DEBUG_TRANSFER: \
|
case LIBUSB_DEBUG_TRANSFER: \
|
||||||
printf(format, ## args);\
|
printf("LIBUSB_TRANSFER: " \
|
||||||
break ; \
|
format "\n", ## args); \
|
||||||
|
break; \
|
||||||
|
default: \
|
||||||
|
break; \
|
||||||
} \
|
} \
|
||||||
printf("\n"); \
|
} \
|
||||||
}
|
} while(0)
|
||||||
|
|
||||||
UNEXPORTED int usb_add_pollfd(libusb_context *ctx, int fd, short events);
|
/* internal structures */
|
||||||
UNEXPORTED void usb_remove_pollfd(libusb_context *ctx, int fd);
|
|
||||||
UNEXPORTED void usb_handle_transfer_completion(struct usb_transfer *uxfer,
|
|
||||||
enum libusb_transfer_status status);
|
|
||||||
UNEXPORTED void usb_handle_disconnect(struct libusb_device_handle *devh);
|
|
||||||
|
|
||||||
#endif /*__LIBUSB10_H__*/
|
struct libusb_super_pollfd {
|
||||||
|
TAILQ_ENTRY(libusb_super_pollfd) entry;
|
||||||
|
struct libusb20_device *pdev;
|
||||||
|
struct libusb_pollfd pollfd;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct libusb_super_transfer {
|
||||||
|
TAILQ_ENTRY(libusb_super_transfer) entry;
|
||||||
|
uint8_t *curr_data;
|
||||||
|
uint32_t rem_len;
|
||||||
|
uint32_t last_len;
|
||||||
|
uint8_t flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct libusb_context {
|
||||||
|
int debug;
|
||||||
|
int debug_fixed;
|
||||||
|
int ctrl_pipe[2];
|
||||||
|
int tr_done_ref;
|
||||||
|
int tr_done_gen;
|
||||||
|
|
||||||
|
pthread_mutex_t ctx_lock;
|
||||||
|
pthread_cond_t ctx_cond;
|
||||||
|
pthread_t ctx_handler;
|
||||||
|
#define NO_THREAD ((pthread_t)-1)
|
||||||
|
|
||||||
|
TAILQ_HEAD(, libusb_super_pollfd) pollfds;
|
||||||
|
TAILQ_HEAD(, libusb_super_transfer) tr_done;
|
||||||
|
|
||||||
|
struct libusb_super_pollfd ctx_poll;
|
||||||
|
|
||||||
|
libusb_pollfd_added_cb fd_added_cb;
|
||||||
|
libusb_pollfd_removed_cb fd_removed_cb;
|
||||||
|
void *fd_cb_user_data;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct libusb_device {
|
||||||
|
int refcnt;
|
||||||
|
|
||||||
|
uint32_t claimed_interfaces;
|
||||||
|
|
||||||
|
struct libusb_super_pollfd dev_poll;
|
||||||
|
|
||||||
|
struct libusb_context *ctx;
|
||||||
|
|
||||||
|
TAILQ_HEAD(, libusb_super_transfer) tr_head;
|
||||||
|
|
||||||
|
struct libusb20_device *os_priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern struct libusb_context *usbi_default_context;
|
||||||
|
|
||||||
|
void libusb10_add_pollfd(libusb_context *ctx, struct libusb_super_pollfd *pollfd, struct libusb20_device *pdev, int fd, short events);
|
||||||
|
void libusb10_remove_pollfd(libusb_context *ctx, struct libusb_super_pollfd *pollfd);
|
||||||
|
void libusb10_cancel_all_transfer(libusb_device *dev);
|
||||||
|
|
||||||
|
#endif /* __LIBUSB10_H__ */
|
||||||
|
@ -24,10 +24,10 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/queue.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#include <sys/queue.h>
|
||||||
|
|
||||||
#include "libusb20.h"
|
#include "libusb20.h"
|
||||||
#include "libusb20_desc.h"
|
#include "libusb20_desc.h"
|
||||||
@ -38,16 +38,11 @@
|
|||||||
/* USB descriptors */
|
/* USB descriptors */
|
||||||
|
|
||||||
int
|
int
|
||||||
libusb_get_device_descriptor(libusb_device * dev,
|
libusb_get_device_descriptor(libusb_device *dev,
|
||||||
struct libusb_device_descriptor *desc)
|
struct libusb_device_descriptor *desc)
|
||||||
{
|
{
|
||||||
struct LIBUSB20_DEVICE_DESC_DECODED *pdesc;
|
struct LIBUSB20_DEVICE_DESC_DECODED *pdesc;
|
||||||
struct libusb20_device *pdev;
|
struct libusb20_device *pdev;
|
||||||
libusb_context *ctx;
|
|
||||||
|
|
||||||
ctx = NULL;
|
|
||||||
GET_CONTEXT(ctx);
|
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_device_descriptor enter");
|
|
||||||
|
|
||||||
if ((dev == NULL) || (desc == NULL))
|
if ((dev == NULL) || (desc == NULL))
|
||||||
return (LIBUSB_ERROR_INVALID_PARAM);
|
return (LIBUSB_ERROR_INVALID_PARAM);
|
||||||
@ -70,54 +65,47 @@ libusb_get_device_descriptor(libusb_device * dev,
|
|||||||
desc->iSerialNumber = pdesc->iSerialNumber;
|
desc->iSerialNumber = pdesc->iSerialNumber;
|
||||||
desc->bNumConfigurations = pdesc->bNumConfigurations;
|
desc->bNumConfigurations = pdesc->bNumConfigurations;
|
||||||
|
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_device_descriptor leave");
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
libusb_get_active_config_descriptor(libusb_device * dev,
|
libusb_get_active_config_descriptor(libusb_device *dev,
|
||||||
struct libusb_config_descriptor **config)
|
struct libusb_config_descriptor **config)
|
||||||
{
|
{
|
||||||
struct libusb20_device *pdev;
|
struct libusb20_device *pdev;
|
||||||
libusb_context *ctx;
|
uint8_t config_index;
|
||||||
uint8_t idx;
|
|
||||||
|
|
||||||
ctx = NULL;
|
|
||||||
GET_CONTEXT(ctx);
|
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_active_config_descriptor enter");
|
|
||||||
|
|
||||||
pdev = dev->os_priv;
|
pdev = dev->os_priv;
|
||||||
idx = libusb20_dev_get_config_index(pdev);
|
config_index = libusb20_dev_get_config_index(pdev);
|
||||||
|
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_active_config_descriptor leave");
|
return (libusb_get_config_descriptor(dev, config_index, config));
|
||||||
return (libusb_get_config_descriptor(dev, idx, config));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* XXX Need to check if extra need a dup because
|
|
||||||
* XXX free pconf could free this char *
|
|
||||||
*/
|
|
||||||
int
|
int
|
||||||
libusb_get_config_descriptor(libusb_device * dev, uint8_t config_index,
|
libusb_get_config_descriptor(libusb_device *dev, uint8_t config_index,
|
||||||
struct libusb_config_descriptor **config)
|
struct libusb_config_descriptor **config)
|
||||||
{
|
{
|
||||||
struct libusb20_device *pdev;
|
struct libusb20_device *pdev;
|
||||||
struct libusb20_config *pconf;
|
struct libusb20_config *pconf;
|
||||||
struct libusb20_interface *pinf;
|
struct libusb20_interface *pinf;
|
||||||
struct libusb20_endpoint *pend;
|
struct libusb20_endpoint *pend;
|
||||||
libusb_interface_descriptor *ifd;
|
struct libusb_config_descriptor *pconfd;
|
||||||
libusb_endpoint_descriptor *endd;
|
struct libusb_interface_descriptor *ifd;
|
||||||
libusb_context *ctx;
|
struct libusb_endpoint_descriptor *endd;
|
||||||
uint8_t nif, nend, nalt, i, j, k;
|
uint8_t *pextra;
|
||||||
uint32_t if_idx, endp_idx;
|
uint16_t nextra;
|
||||||
|
uint8_t nif;
|
||||||
ctx = NULL;
|
uint8_t nep;
|
||||||
GET_CONTEXT(ctx);
|
uint8_t nalt;
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_config_descriptor enter");
|
uint8_t i;
|
||||||
|
uint8_t j;
|
||||||
|
uint8_t k;
|
||||||
|
|
||||||
if (dev == NULL || config == NULL)
|
if (dev == NULL || config == NULL)
|
||||||
return (LIBUSB_ERROR_INVALID_PARAM);
|
return (LIBUSB_ERROR_INVALID_PARAM);
|
||||||
|
|
||||||
|
*config = NULL;
|
||||||
|
|
||||||
pdev = dev->os_priv;
|
pdev = dev->os_priv;
|
||||||
pconf = libusb20_dev_alloc_config(pdev, config_index);
|
pconf = libusb20_dev_alloc_config(pdev, config_index);
|
||||||
|
|
||||||
@ -125,75 +113,101 @@ libusb_get_config_descriptor(libusb_device * dev, uint8_t config_index,
|
|||||||
return (LIBUSB_ERROR_NOT_FOUND);
|
return (LIBUSB_ERROR_NOT_FOUND);
|
||||||
|
|
||||||
nalt = nif = pconf->num_interface;
|
nalt = nif = pconf->num_interface;
|
||||||
nend = 0;
|
nep = 0;
|
||||||
for (i = 0 ; i < nif ; i++) {
|
nextra = pconf->extra.len;
|
||||||
if (pconf->interface[i].num_altsetting > 0)
|
|
||||||
{
|
for (i = 0; i < nif; i++) {
|
||||||
nalt += pconf->interface[i].num_altsetting;
|
|
||||||
for (j = 0 ; j < nalt ; j++) {
|
pinf = pconf->interface + i;
|
||||||
nend += pconf->interface[i].altsetting[j].num_endpoints;
|
nextra += pinf->extra.len;
|
||||||
}
|
nep += pinf->num_endpoints;
|
||||||
}
|
k = pinf->num_endpoints;
|
||||||
nend += pconf->interface[i].num_endpoints;
|
pend = pinf->endpoints;
|
||||||
|
while (k--) {
|
||||||
|
nextra += pend->extra.len;
|
||||||
|
pend++;
|
||||||
}
|
}
|
||||||
|
|
||||||
*config = malloc(sizeof(libusb_config_descriptor) +
|
j = pinf->num_altsetting;
|
||||||
|
nalt += pinf->num_altsetting;
|
||||||
|
pinf = pinf->altsetting;
|
||||||
|
while (j--) {
|
||||||
|
nextra += pinf->extra.len;
|
||||||
|
nep += pinf->num_endpoints;
|
||||||
|
k = pinf->num_endpoints;
|
||||||
|
pend = pinf->endpoints;
|
||||||
|
while (k--) {
|
||||||
|
nextra += pend->extra.len;
|
||||||
|
pend++;
|
||||||
|
}
|
||||||
|
pinf++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nextra = nextra +
|
||||||
|
(1 * sizeof(libusb_config_descriptor)) +
|
||||||
(nif * sizeof(libusb_interface)) +
|
(nif * sizeof(libusb_interface)) +
|
||||||
(nalt * sizeof(libusb_interface_descriptor)) +
|
(nalt * sizeof(libusb_interface_descriptor)) +
|
||||||
(nend * sizeof(libusb_endpoint_descriptor)));
|
(nep * sizeof(libusb_endpoint_descriptor));
|
||||||
if (*config == NULL) {
|
|
||||||
|
pconfd = malloc(nextra);
|
||||||
|
|
||||||
|
if (pconfd == NULL) {
|
||||||
free(pconf);
|
free(pconf);
|
||||||
return (LIBUSB_ERROR_NO_MEM);
|
return (LIBUSB_ERROR_NO_MEM);
|
||||||
}
|
}
|
||||||
|
/* make sure memory is clean */
|
||||||
|
memset(pconfd, 0, nextra);
|
||||||
|
|
||||||
(*config)->interface = (libusb_interface *)(*config +
|
pconfd->interface = (libusb_interface *) (pconfd +
|
||||||
sizeof(libusb_config_descriptor));
|
sizeof(libusb_config_descriptor));
|
||||||
for (i = if_idx = endp_idx = 0 ; i < nif ; if_idx, i++) {
|
|
||||||
(*config)->interface[i].altsetting = (libusb_interface_descriptor *)
|
|
||||||
(*config + sizeof(libusb_config_descriptor) +
|
|
||||||
(nif * sizeof(libusb_interface)) +
|
|
||||||
(if_idx * sizeof(libusb_interface_descriptor)));
|
|
||||||
(*config)->interface[i].altsetting[0].endpoint =
|
|
||||||
(libusb_endpoint_descriptor *) (*config +
|
|
||||||
sizeof(libusb_config_descriptor) +
|
|
||||||
(nif * sizeof(libusb_interface)) +
|
|
||||||
(nalt * sizeof(libusb_interface_descriptor)) +
|
|
||||||
(endp_idx * sizeof(libusb_endpoint_descriptor)));
|
|
||||||
endp_idx += pconf->interface[i].num_endpoints;
|
|
||||||
|
|
||||||
if (pconf->interface[i].num_altsetting > 0)
|
ifd = (libusb_interface_descriptor *) (pconfd->interface + nif);
|
||||||
{
|
endd = (libusb_endpoint_descriptor *) (ifd + nalt);
|
||||||
for (j = 0 ; j < pconf->interface[i].num_altsetting ; j++, if_idx++) {
|
pextra = (uint8_t *)(endd + nep);
|
||||||
(*config)->interface[i].altsetting[j + 1].endpoint =
|
|
||||||
(libusb_endpoint_descriptor *) (*config +
|
/* fill in config descriptor */
|
||||||
sizeof(libusb_config_descriptor) +
|
|
||||||
(nif * sizeof(libusb_interface)) +
|
pconfd->bLength = pconf->desc.bLength;
|
||||||
(nalt * sizeof(libusb_interface_descriptor)) +
|
pconfd->bDescriptorType = pconf->desc.bDescriptorType;
|
||||||
(endp_idx * sizeof(libusb_endpoint_descriptor)));
|
pconfd->wTotalLength = pconf->desc.wTotalLength;
|
||||||
endp_idx += pconf->interface[i].altsetting[j].num_endpoints;
|
pconfd->bNumInterfaces = pconf->desc.bNumInterfaces;
|
||||||
|
pconfd->bConfigurationValue = pconf->desc.bConfigurationValue;
|
||||||
|
pconfd->iConfiguration = pconf->desc.iConfiguration;
|
||||||
|
pconfd->bmAttributes = pconf->desc.bmAttributes;
|
||||||
|
pconfd->MaxPower = pconf->desc.bMaxPower;
|
||||||
|
|
||||||
|
if (pconf->extra.len != 0) {
|
||||||
|
pconfd->extra_length = pconf->extra.len;
|
||||||
|
pconfd->extra = pextra;
|
||||||
|
memcpy(pextra, pconf->extra.ptr, pconfd->extra_length);
|
||||||
|
pextra += pconfd->extra_length;
|
||||||
}
|
}
|
||||||
|
/* setup all interface and endpoint pointers */
|
||||||
|
|
||||||
|
for (i = 0; i < nif; i++) {
|
||||||
|
|
||||||
|
pconfd->interface[i].altsetting = ifd;
|
||||||
|
ifd->endpoint = endd;
|
||||||
|
endd += pconf->interface[i].num_endpoints;
|
||||||
|
ifd++;
|
||||||
|
|
||||||
|
for (j = 0; j < pconf->interface[i].num_altsetting; j++) {
|
||||||
|
ifd->endpoint = endd;
|
||||||
|
endd += pconf->interface[i].altsetting[j].num_endpoints;
|
||||||
|
ifd++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(*config)->bLength = pconf->desc.bLength;
|
/* fill in all interface and endpoint data */
|
||||||
(*config)->bDescriptorType = pconf->desc.bDescriptorType;
|
|
||||||
(*config)->wTotalLength = pconf->desc.wTotalLength;
|
|
||||||
(*config)->bNumInterfaces = pconf->desc.bNumInterfaces;
|
|
||||||
(*config)->bConfigurationValue = pconf->desc.bConfigurationValue;
|
|
||||||
(*config)->iConfiguration = pconf->desc.iConfiguration;
|
|
||||||
(*config)->bmAttributes = pconf->desc.bmAttributes;
|
|
||||||
(*config)->MaxPower = pconf->desc.bMaxPower;
|
|
||||||
(*config)->extra_length = pconf->extra.len;
|
|
||||||
if ((*config)->extra_length != 0)
|
|
||||||
(*config)->extra = pconf->extra.ptr;
|
|
||||||
|
|
||||||
for (i = 0 ; i < nif ; i++) {
|
for (i = 0; i < nif; i++) {
|
||||||
pinf = &pconf->interface[i];
|
pinf = &pconf->interface[i];
|
||||||
(*config)->interface[i].num_altsetting = pinf->num_altsetting + 1;
|
pconfd->interface[i].num_altsetting = pinf->num_altsetting + 1;
|
||||||
for (j = 0 ; j < (*config)->interface[i].num_altsetting ; j++) {
|
for (j = 0; j < pconfd->interface[i].num_altsetting; j++) {
|
||||||
if (j != 0)
|
if (j != 0)
|
||||||
pinf = &pconf->interface[i].altsetting[j - 1];
|
pinf = &pconf->interface[i].altsetting[j - 1];
|
||||||
ifd = &(*config)->interface[i].altsetting[j];
|
ifd = &pconfd->interface[i].altsetting[j];
|
||||||
ifd->bLength = pinf->desc.bLength;
|
ifd->bLength = pinf->desc.bLength;
|
||||||
ifd->bDescriptorType = pinf->desc.bDescriptorType;
|
ifd->bDescriptorType = pinf->desc.bDescriptorType;
|
||||||
ifd->bInterfaceNumber = pinf->desc.bInterfaceNumber;
|
ifd->bInterfaceNumber = pinf->desc.bInterfaceNumber;
|
||||||
@ -203,10 +217,13 @@ libusb_get_config_descriptor(libusb_device * dev, uint8_t config_index,
|
|||||||
ifd->bInterfaceSubClass = pinf->desc.bInterfaceSubClass;
|
ifd->bInterfaceSubClass = pinf->desc.bInterfaceSubClass;
|
||||||
ifd->bInterfaceProtocol = pinf->desc.bInterfaceProtocol;
|
ifd->bInterfaceProtocol = pinf->desc.bInterfaceProtocol;
|
||||||
ifd->iInterface = pinf->desc.iInterface;
|
ifd->iInterface = pinf->desc.iInterface;
|
||||||
|
if (pinf->extra.len != 0) {
|
||||||
ifd->extra_length = pinf->extra.len;
|
ifd->extra_length = pinf->extra.len;
|
||||||
if (ifd->extra_length != 0)
|
ifd->extra = pextra;
|
||||||
ifd->extra = pinf->extra.ptr;
|
memcpy(pextra, pinf->extra.ptr, pinf->extra.len);
|
||||||
for (k = 0 ; k < pinf->num_endpoints ; k++) {
|
pextra += pinf->extra.len;
|
||||||
|
}
|
||||||
|
for (k = 0; k < pinf->num_endpoints; k++) {
|
||||||
pend = &pinf->endpoints[k];
|
pend = &pinf->endpoints[k];
|
||||||
endd = &ifd->endpoint[k];
|
endd = &ifd->endpoint[k];
|
||||||
endd->bLength = pend->desc.bLength;
|
endd->bLength = pend->desc.bLength;
|
||||||
@ -217,31 +234,31 @@ libusb_get_config_descriptor(libusb_device * dev, uint8_t config_index,
|
|||||||
endd->bInterval = pend->desc.bInterval;
|
endd->bInterval = pend->desc.bInterval;
|
||||||
endd->bRefresh = pend->desc.bRefresh;
|
endd->bRefresh = pend->desc.bRefresh;
|
||||||
endd->bSynchAddress = pend->desc.bSynchAddress;
|
endd->bSynchAddress = pend->desc.bSynchAddress;
|
||||||
|
if (pend->extra.len != 0) {
|
||||||
endd->extra_length = pend->extra.len;
|
endd->extra_length = pend->extra.len;
|
||||||
if (endd->extra_length != 0)
|
endd->extra = pextra;
|
||||||
endd->extra = pend->extra.ptr;
|
memcpy(pextra, pend->extra.ptr, pend->extra.len);
|
||||||
|
pextra += pend->extra.len;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(pconf);
|
free(pconf);
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_config_descriptor leave");
|
|
||||||
return (0);
|
*config = pconfd;
|
||||||
|
|
||||||
|
return (0); /* success */
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
libusb_get_config_descriptor_by_value(libusb_device * dev,
|
libusb_get_config_descriptor_by_value(libusb_device *dev,
|
||||||
uint8_t bConfigurationValue, struct libusb_config_descriptor **config)
|
uint8_t bConfigurationValue, struct libusb_config_descriptor **config)
|
||||||
{
|
{
|
||||||
struct LIBUSB20_DEVICE_DESC_DECODED *pdesc;
|
struct LIBUSB20_DEVICE_DESC_DECODED *pdesc;
|
||||||
struct libusb20_device *pdev;
|
struct libusb20_device *pdev;
|
||||||
struct libusb20_config *pconf;
|
|
||||||
libusb_context *ctx;
|
|
||||||
int i;
|
int i;
|
||||||
|
int err;
|
||||||
ctx = NULL;
|
|
||||||
GET_CONTEXT(ctx);
|
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_config_descriptor_by_value enter");
|
|
||||||
|
|
||||||
if (dev == NULL || config == NULL)
|
if (dev == NULL || config == NULL)
|
||||||
return (LIBUSB_ERROR_INVALID_PARAM);
|
return (LIBUSB_ERROR_INVALID_PARAM);
|
||||||
@ -249,49 +266,38 @@ libusb_get_config_descriptor_by_value(libusb_device * dev,
|
|||||||
pdev = dev->os_priv;
|
pdev = dev->os_priv;
|
||||||
pdesc = libusb20_dev_get_device_desc(pdev);
|
pdesc = libusb20_dev_get_device_desc(pdev);
|
||||||
|
|
||||||
for (i = 0 ; i < pdesc->bNumConfigurations ; i++) {
|
for (i = 0; i < pdesc->bNumConfigurations; i++) {
|
||||||
pconf = libusb20_dev_alloc_config(pdev, i);
|
err = libusb_get_config_descriptor(dev, i, config);
|
||||||
if (pconf->desc.bConfigurationValue == bConfigurationValue) {
|
if (err)
|
||||||
free(pconf);
|
return (err);
|
||||||
return libusb_get_config_descriptor(dev, i, config);
|
|
||||||
|
|
||||||
}
|
if ((*config)->bConfigurationValue == bConfigurationValue)
|
||||||
free(pconf);
|
return (0); /* success */
|
||||||
|
|
||||||
|
libusb_free_config_descriptor(*config);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_config_descriptor_by_value leave");
|
*config = NULL;
|
||||||
|
|
||||||
return (LIBUSB_ERROR_NOT_FOUND);
|
return (LIBUSB_ERROR_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
libusb_free_config_descriptor(struct libusb_config_descriptor *config)
|
libusb_free_config_descriptor(struct libusb_config_descriptor *config)
|
||||||
{
|
{
|
||||||
libusb_context *ctx;
|
|
||||||
|
|
||||||
ctx = NULL;
|
|
||||||
GET_CONTEXT(ctx);
|
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_free_config_descriptor enter");
|
|
||||||
|
|
||||||
free(config);
|
free(config);
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_free_config_descriptor leave");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
libusb_get_string_descriptor_ascii(libusb_device_handle * dev,
|
libusb_get_string_descriptor_ascii(libusb_device_handle *pdev,
|
||||||
uint8_t desc_index, unsigned char *data, int length)
|
uint8_t desc_index, unsigned char *data, int length)
|
||||||
{
|
{
|
||||||
struct libusb20_device *pdev;
|
if (pdev == NULL || data == NULL || length < 1)
|
||||||
libusb_context *ctx;
|
|
||||||
|
|
||||||
ctx = NULL;
|
|
||||||
GET_CONTEXT(ctx);
|
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_string_descriptor_ascii enter");
|
|
||||||
|
|
||||||
if (dev == NULL || data == NULL)
|
|
||||||
return (LIBUSB20_ERROR_INVALID_PARAM);
|
return (LIBUSB20_ERROR_INVALID_PARAM);
|
||||||
|
|
||||||
pdev = dev->os_priv;
|
/* put some default data into the destination buffer */
|
||||||
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_string_descriptor_ascii leave");
|
data[0] = 0;
|
||||||
|
|
||||||
if (libusb20_dev_req_string_simple_sync(pdev, desc_index,
|
if (libusb20_dev_req_string_simple_sync(pdev, desc_index,
|
||||||
data, length) == 0)
|
data, length) == 0)
|
||||||
return (strlen(data));
|
return (strlen(data));
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -310,8 +310,13 @@ packets are avoided for proxy buffers.
|
|||||||
.Pp
|
.Pp
|
||||||
.
|
.
|
||||||
.Fn libusb20_tr_get_max_total_length
|
.Fn libusb20_tr_get_max_total_length
|
||||||
function will return the maximum value for the length sum of all
|
function will return the maximum value for the data length sum of all USB
|
||||||
USB frames associated with an USB transfer.
|
frames associated with an USB transfer.
|
||||||
|
In case of control transfers the value returned does not include the
|
||||||
|
length of the SETUP packet, 8 bytes, which is part of frame zero.
|
||||||
|
The returned value of this function is always aligned to the maximum
|
||||||
|
packet size, wMaxPacketSize, of the endpoint which the USB transfer is
|
||||||
|
bound to.
|
||||||
.
|
.
|
||||||
.Pp
|
.Pp
|
||||||
.
|
.
|
||||||
|
@ -835,7 +835,7 @@ usb_find_devices(void)
|
|||||||
/* close all opened devices, if any */
|
/* close all opened devices, if any */
|
||||||
|
|
||||||
while ((pdev = libusb20_be_device_foreach(usb_backend, NULL))) {
|
while ((pdev = libusb20_be_device_foreach(usb_backend, NULL))) {
|
||||||
udev = pdev->priv01Data;
|
udev = pdev->privLuData;
|
||||||
libusb20_be_dequeue_device(usb_backend, pdev);
|
libusb20_be_dequeue_device(usb_backend, pdev);
|
||||||
libusb20_dev_free(pdev);
|
libusb20_dev_free(pdev);
|
||||||
if (udev != NULL) {
|
if (udev != NULL) {
|
||||||
@ -893,7 +893,7 @@ usb_find_devices(void)
|
|||||||
}
|
}
|
||||||
/* link together the two structures */
|
/* link together the two structures */
|
||||||
udev->dev = pdev;
|
udev->dev = pdev;
|
||||||
pdev->priv01Data = udev;
|
pdev->privLuData = udev;
|
||||||
|
|
||||||
err = libusb20_dev_open(pdev, 0);
|
err = libusb20_dev_open(pdev, 0);
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
@ -914,7 +914,7 @@ usb_device(usb_dev_handle * dev)
|
|||||||
|
|
||||||
pdev = (void *)dev;
|
pdev = (void *)dev;
|
||||||
|
|
||||||
return (pdev->priv01Data);
|
return (pdev->privLuData);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct usb_bus *
|
struct usb_bus *
|
||||||
|
@ -191,8 +191,8 @@ struct libusb20_device {
|
|||||||
/* private backend data */
|
/* private backend data */
|
||||||
void *privBeData;
|
void *privBeData;
|
||||||
|
|
||||||
/* libUSB v0.1 compat data */
|
/* libUSB v0.1 and v1.0 compat data */
|
||||||
void *priv01Data;
|
void *privLuData;
|
||||||
|
|
||||||
/* claimed interface */
|
/* claimed interface */
|
||||||
uint8_t claimed_interface;
|
uint8_t claimed_interface;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user