Commit 55c6e55c84f67be11681490ca7eee0ab0dfd16e7

Con Kolivas 2013-09-25T16:31:37

Name the work request and result usb commands for BF1

diff --git a/driver-bitfury.c b/driver-bitfury.c
index 5cd4d8b..7fa298a 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -229,18 +229,18 @@ static int64_t bitfury_scanhash(struct thr_info *thr, struct work *work,
 	sendbuf[0] = 'W';
 	memcpy(sendbuf + 1, work->midstate, 32);
 	memcpy(sendbuf + 33, work->data + 64, 12);
-	usb_write(bitfury, sendbuf, 45, &amount, C_PING);
-	usb_read(bitfury, buf, 7, &amount, C_PING);
+	usb_write(bitfury, sendbuf, 45, &amount, C_BFO_REQWORK);
+	usb_read(bitfury, buf, 7, &amount, C_BFO_GETWORK);
 
 	if (unlikely(!info->prevwork)) {
 		info->prevwork = copy_work(work);
 		return 0;
 	}
 
-	usb_read_once_timeout(bitfury, buf, 7, &amount, BF1WAIT, C_PING);
+	usb_read_once_timeout(bitfury, buf, 7, &amount, BF1WAIT, C_BFO_GETRES);
 	tot = amount;
 	while (amount) {
-		usb_read_once_timeout(bitfury, buf + tot, 512, &amount, 10, C_PING);
+		usb_read_once_timeout(bitfury, buf + tot, 512, &amount, 10, C_BFO_GETRES);
 		tot += amount;
 	}
 
diff --git a/usbutils.h b/usbutils.h
index 3119e4a..79695f4 100644
--- a/usbutils.h
+++ b/usbutils.h
@@ -327,7 +327,10 @@ struct cg_usb_info {
 	USB_ADD_COMMAND(C_BFO_REQINFO, "BF1RequestInfo") \
 	USB_ADD_COMMAND(C_BFO_GETINFO, "BF1GetInfo") \
 	USB_ADD_COMMAND(C_BFO_REQRESET, "BF1RequestReset") \
-	USB_ADD_COMMAND(C_BFO_GETRESET, "BF1GetReset")
+	USB_ADD_COMMAND(C_BFO_GETRESET, "BF1GetReset") \
+	USB_ADD_COMMAND(C_BFO_REQWORK, "BF1RequestWork") \
+	USB_ADD_COMMAND(C_BFO_GETWORK, "BF1GetWork") \
+	USB_ADD_COMMAND(C_BFO_GETRES, "BF1GetResults")
 
 /* Create usb_cmds enum from USB_PARSE_COMMANDS macro */
 #define USB_ADD_COMMAND(X, Y) X,