1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 20:44:19 +00:00

Name the work request and result usb commands for BF1

This commit is contained in:
Con Kolivas 2013-09-25 16:31:37 +10:00
parent edcea78a61
commit 55c6e55c84
2 changed files with 8 additions and 5 deletions

View File

@ -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;
}

View File

@ -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,