Commit d66ebfee711b924fc679cf69d74fa22d4cdbb053

Con Kolivas 2014-01-03T16:46:07

Use correct endpoint order for nanofury devices and read with a short timeout on return loop from send_recv.

diff --git a/mcp2210.c b/mcp2210.c
index 511d7c6..cb846af 100644
--- a/mcp2210.c
+++ b/mcp2210.c
@@ -26,7 +26,7 @@ bool mcp2210_send_recv(struct cgpu_info *cgpu, char *buf, enum usb_cmds cmd)
 		return false;
 	}
 
-	err = usb_read(cgpu, buf, MCP2210_BUFFER_LENGTH, &amount, cmd);
+	err = usb_read_timeout(cgpu, buf, MCP2210_BUFFER_LENGTH, &amount, 10, cmd);
 	if (err || amount != MCP2210_BUFFER_LENGTH) {
 		applog(LOG_WARNING, "%s %d: Error %d receiving %s received %d of %d",
 		       cgpu->drv->name, cgpu->device_id, err, usb_cmdname(cmd),
diff --git a/usbutils.c b/usbutils.c
index 4879c21..96896f4 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -155,8 +155,8 @@ static struct usb_intinfo bxf_ints[] = {
 };
 
 static struct usb_epinfo nf1_epinfos[] = {
-	{ LIBUSB_TRANSFER_TYPE_INTERRUPT,	64,	EPO(1), 0, 0 },
 	{ LIBUSB_TRANSFER_TYPE_INTERRUPT,	64,	EPI(1), 0, 0 },
+	{ LIBUSB_TRANSFER_TYPE_INTERRUPT,	64,	EPO(1), 0, 0 },
 };
 
 static struct usb_intinfo nf1_ints[] = {