libnjb: /root/tmp/build-libnjb/libnjb-2.2.7/src/usb_io.h Source File

libnjb 2.2.7

usb_io.h
1 #ifndef __NJB__USB__IO__H
2 #define __NJB__USB__IO__H
3
4 #include "libnjb.h"
5
6 /* Timeout floor, 5 seconds */
7 #define USBTIMEOUT 5000
8
9 #include <usb.h>
10
11 /*
12 * Legacy #defines that map native *BSD USB #defines to those used by
13 * libusb. Some day we'll get rid of these.
14 */
15
16 #ifndef UT_WRITE
17 #define UT_WRITE USB_ENDPOINT_OUT
18 #endif
19
20 #ifndef UT_READ
21 #define UT_READ USB_ENDPOINT_IN
22 #endif
23
24 #ifndef UT_CLASS
25 #define UT_CLASS USB_TYPE_CLASS
26 #endif
27
28 #ifndef UT_STANDARD
29 #define UT_STANDARD USB_TYPE_STANDARD
30 #endif
31
32 #ifndef UT_WRITE_VENDOR_OTHER
33 #define UT_WRITE_VENDOR_OTHER (UT_WRITE | USB_TYPE_VENDOR | USB_RECIP_OTHER )
34 #endif
35
36 #ifndef UT_READ_VENDOR_OTHER
37 #define UT_READ_VENDOR_OTHER (UT_READ | USB_TYPE_VENDOR | USB_RECIP_OTHER )
38 #endif
39
40 ssize_t usb_pipe_read (njb_t *njb, void *buf, size_t nbytes);
41 ssize_t usb_pipe_write (njb_t *njb, void *buf, size_t nbytes);
42 int usb_setup (njb_t *njb, int type, int request, int value,
43 int index, int length, void *data);
44
45 #endif
libnjb.h
njb_struct
Definition: libnjb.h:182
usb_pipe_write
ssize_t usb_pipe_write(njb_t *njb, void *buf, size_t nbytes)
Definition: usb_io.c:67
DD_USBCTL
#define DD_USBCTL
Definition: libnjb.h:135
__sub_depth
int __sub_depth
Definition: base.c:62
DD_USBBLKLIM
#define DD_USBBLKLIM
Definition: libnjb.h:136
njb_struct::dev
usb_dev_handle * dev
Definition: libnjb.h:184
usb_setup
int usb_setup(njb_t *njb, int type, int request, int value, int index, int length, void *data)
Definition: usb_io.c:190
njb_struct::usb_bulk_out_ep
u_int8_t usb_bulk_out_ep
Definition: libnjb.h:188
data_dump
void data_dump(FILE *f, void *buf, size_t n)
Definition: ioutil.c:35
data_dump_ascii
void data_dump_ascii(FILE *f, void *buf, size_t n, size_t dump_boundry)
Definition: ioutil.c:60
DD_USBBLK
#define DD_USBBLK
Definition: libnjb.h:137
njb_debug
int njb_debug(int flags)
Definition: base.c:361
njb_struct::usb_bulk_in_ep
u_int8_t usb_bulk_in_ep
Definition: libnjb.h:187
usb_pipe_read
ssize_t usb_pipe_read(njb_t *njb, void *buf, size_t nbytes)
Definition: usb_io.c:118