From d06ea10f14a806f2770507cd179b62c0d4eda6a2 Mon Sep 17 00:00:00 2001 From: Mikkel Kamstrup Erlandsen Date: Wed, 19 Mar 2014 21:28:29 +0100 Subject: usb-linux: add some explanatory comments to usb-linux.c --- src/usb-linux.c | 5 +++++ 1 file changed, 5 insertions(+) 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) free(dev); } +// Callback from write operation static void tx_callback(struct libusb_transfer *xfer) { struct usb_device *dev = xfer->user_data; @@ -162,6 +163,9 @@ int usb_send(struct usb_device *dev, const unsigned char *buf, int length) return 0; } +// Callback from read operation +// Under normal operation this issues a new read transfer request immediately, +// doing a kind of read-callback loop static void rx_callback(struct libusb_transfer *xfer) { struct usb_device *dev = xfer->user_data; @@ -206,6 +210,7 @@ static void rx_callback(struct libusb_transfer *xfer) } } +// Start a read-callback loop for this device static int start_rx(struct usb_device *dev) { int res; -- cgit v1.1-32-gdbae