Name the work request and result usb commands for BF1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
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,