1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Revert "Give a generous timeout whenever we expect an OK message for working bflsc communications."

This reverts commit 3d8cf60b96.
This commit is contained in:
Con Kolivas 2013-06-09 23:00:36 +10:00
parent 3d8cf60b96
commit 6fdc068f1b

View File

@ -497,8 +497,7 @@ static bool getok(struct cgpu_info *bflsc, enum usb_cmds cmd, int *err, int *amo
{ {
char buf[BFLSC_BUFSIZ+1]; char buf[BFLSC_BUFSIZ+1];
*err = usb_read_ok_timeout(bflsc, buf, sizeof(buf)-1, amount, *err = usb_read_nl(bflsc, buf, sizeof(buf)-1, amount, cmd);
BFLSC_INFO_TIMEOUT, cmd);
if (*err < 0 || *amount < (int)BFLSC_OK_LEN) if (*err < 0 || *amount < (int)BFLSC_OK_LEN)
return false; return false;
else else
@ -507,8 +506,7 @@ static bool getok(struct cgpu_info *bflsc, enum usb_cmds cmd, int *err, int *amo
static bool getokerr(struct cgpu_info *bflsc, enum usb_cmds cmd, int *err, int *amount, char *buf, size_t bufsiz) static bool getokerr(struct cgpu_info *bflsc, enum usb_cmds cmd, int *err, int *amount, char *buf, size_t bufsiz)
{ {
*err = usb_read_ok_timeout(bflsc, buf, bufsiz-1, amount, *err = usb_read_nl(bflsc, buf, bufsiz-1, amount, cmd);
BFLSC_INFO_TIMEOUT, cmd);
if (*err < 0 || *amount < (int)BFLSC_OK_LEN) if (*err < 0 || *amount < (int)BFLSC_OK_LEN)
return false; return false;
else { else {
@ -562,8 +560,7 @@ static bool bflsc_qres(struct cgpu_info *bflsc, char *buf, size_t bufsiz, int de
// of course all other I/O must also be failing ... // of course all other I/O must also be failing ...
} else { } else {
readok = true; readok = true;
*err = usb_read_ok_timeout(bflsc, buf, bufsiz-1, amount, *err = usb_read_ok(bflsc, buf, bufsiz-1, amount, C_GETRESULTS);
BFLSC_INFO_TIMEOUT, C_GETRESULTS);
mutex_unlock(&(bflsc->device_mutex)); mutex_unlock(&(bflsc->device_mutex));
if (*err < 0 || *amount < 1) { if (*err < 0 || *amount < 1) {