diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/usb-linux.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/usb-linux.c b/src/usb-linux.c index 127446a..94db8f2 100644 --- a/src/usb-linux.c +++ b/src/usb-linux.c | |||
| @@ -93,6 +93,7 @@ static void usb_disconnect(struct usb_device *dev) | |||
| 93 | free(dev); | 93 | free(dev); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | // Callback from write operation | ||
| 96 | static void tx_callback(struct libusb_transfer *xfer) | 97 | static void tx_callback(struct libusb_transfer *xfer) |
| 97 | { | 98 | { |
| 98 | struct usb_device *dev = xfer->user_data; | 99 | struct usb_device *dev = xfer->user_data; |
| @@ -162,6 +163,9 @@ int usb_send(struct usb_device *dev, const unsigned char *buf, int length) | |||
| 162 | return 0; | 163 | return 0; |
| 163 | } | 164 | } |
| 164 | 165 | ||
| 166 | // Callback from read operation | ||
| 167 | // Under normal operation this issues a new read transfer request immediately, | ||
| 168 | // doing a kind of read-callback loop | ||
| 165 | static void rx_callback(struct libusb_transfer *xfer) | 169 | static void rx_callback(struct libusb_transfer *xfer) |
| 166 | { | 170 | { |
| 167 | struct usb_device *dev = xfer->user_data; | 171 | struct usb_device *dev = xfer->user_data; |
| @@ -206,6 +210,7 @@ static void rx_callback(struct libusb_transfer *xfer) | |||
| 206 | } | 210 | } |
| 207 | } | 211 | } |
| 208 | 212 | ||
| 213 | // Start a read-callback loop for this device | ||
| 209 | static int start_rx(struct usb_device *dev) | 214 | static int start_rx(struct usb_device *dev) |
| 210 | { | 215 | { |
| 211 | int res; | 216 | int res; |
