summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Mikkel Kamstrup Erlandsen2014-03-19 21:28:29 +0100
committerGravatar Martin Szulecki2014-03-24 17:01:30 +0100
commitd06ea10f14a806f2770507cd179b62c0d4eda6a2 (patch)
tree66211f7e5314664e92f5bb2d5a97b788ecd87da9
parent427da9b898ad6d6d6b091b375f9fc38f155b4813 (diff)
downloadusbmuxd-d06ea10f14a806f2770507cd179b62c0d4eda6a2.tar.gz
usbmuxd-d06ea10f14a806f2770507cd179b62c0d4eda6a2.tar.bz2
usb-linux: add some explanatory comments to usb-linux.c
-rw-r--r--src/usb-linux.c5
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
96static void tx_callback(struct libusb_transfer *xfer) 97static 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
165static void rx_callback(struct libusb_transfer *xfer) 169static 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
209static int start_rx(struct usb_device *dev) 214static int start_rx(struct usb_device *dev)
210{ 215{
211 int res; 216 int res;