|
@@ -59,7 +59,7 @@
|
|
|
|
|
|
|
|
#include "compat.h"
|
|
#include "compat.h"
|
|
|
#include "dynclock.h"
|
|
#include "dynclock.h"
|
|
|
-#include "icarus-common.h"
|
|
|
|
|
|
|
+#include "driver-icarus.h"
|
|
|
#include "lowl-vcom.h"
|
|
#include "lowl-vcom.h"
|
|
|
|
|
|
|
|
// The serial I/O speed - Linux uses a define 'B115200' in bits/termios.h
|
|
// The serial I/O speed - Linux uses a define 'B115200' in bits/termios.h
|
|
@@ -493,6 +493,7 @@ bool icarus_detect_custom(const char *devpath, struct device_drv *api, struct IC
|
|
|
|
|
|
|
|
// Set a default so that individual drivers need not specify
|
|
// Set a default so that individual drivers need not specify
|
|
|
// e.g. Cairnsmore
|
|
// e.g. Cairnsmore
|
|
|
|
|
+ BFGINIT(info->probe_read_count, 1);
|
|
|
if (info->read_size == 0)
|
|
if (info->read_size == 0)
|
|
|
info->read_size = ICARUS_DEFAULT_READ_SIZE;
|
|
info->read_size = ICARUS_DEFAULT_READ_SIZE;
|
|
|
|
|
|
|
@@ -532,7 +533,7 @@ bool icarus_detect_custom(const char *devpath, struct device_drv *api, struct IC
|
|
|
// Do not use info->read_size here, instead read exactly ICARUS_NONCE_SIZE
|
|
// Do not use info->read_size here, instead read exactly ICARUS_NONCE_SIZE
|
|
|
// We will then compare the bytes left in fd with info->read_size to determine
|
|
// We will then compare the bytes left in fd with info->read_size to determine
|
|
|
// if this is a valid device
|
|
// if this is a valid device
|
|
|
- icarus_gets(nonce_bin, fd, &tv_finish, NULL, 1, ICARUS_NONCE_SIZE);
|
|
|
|
|
|
|
+ icarus_gets(nonce_bin, fd, &tv_finish, NULL, info->probe_read_count, ICARUS_NONCE_SIZE);
|
|
|
|
|
|
|
|
// How many bytes were left after reading the above nonce
|
|
// How many bytes were left after reading the above nonce
|
|
|
int bytes_left = icarus_excess_nonce_size(fd, info);
|
|
int bytes_left = icarus_excess_nonce_size(fd, info);
|
|
@@ -1282,6 +1283,14 @@ const char *icarus_set_baud(struct cgpu_info * const proc, const char * const op
|
|
|
return NULL;
|
|
return NULL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static
|
|
|
|
|
+const char *icarus_set_probe_timeout(struct cgpu_info * const proc, const char * const optname, const char * const newvalue, char * const replybuf, enum bfg_set_device_replytype * const out_success)
|
|
|
|
|
+{
|
|
|
|
|
+ struct ICARUS_INFO * const info = proc->device_data;
|
|
|
|
|
+ info->probe_read_count = atof(newvalue) * 10.0 / ICARUS_READ_FAULT_DECISECONDS;
|
|
|
|
|
+ return NULL;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
static
|
|
static
|
|
|
const char *icarus_set_work_division(struct cgpu_info * const proc, const char * const optname, const char * const newvalue, char * const replybuf, enum bfg_set_device_replytype * const out_success)
|
|
const char *icarus_set_work_division(struct cgpu_info * const proc, const char * const optname, const char * const newvalue, char * const replybuf, enum bfg_set_device_replytype * const out_success)
|
|
|
{
|
|
{
|
|
@@ -1346,6 +1355,7 @@ const struct bfg_set_device_definition icarus_set_device_funcs[] = {
|
|
|
{"fpga_count" , icarus_set_fpga_count , "number of chips working on pieces"},
|
|
{"fpga_count" , icarus_set_fpga_count , "number of chips working on pieces"},
|
|
|
{"reopen" , icarus_set_reopen , "how often to reopen device: never, timeout, cycle, (or now for a one-shot reopen)"},
|
|
{"reopen" , icarus_set_reopen , "how often to reopen device: never, timeout, cycle, (or now for a one-shot reopen)"},
|
|
|
// NOTE: Below here, order is irrelevant
|
|
// NOTE: Below here, order is irrelevant
|
|
|
|
|
+ {"probe_timeout", icarus_set_probe_timeout},
|
|
|
{"timing" , icarus_set_timing , "timing of device; see README.FPGA"},
|
|
{"timing" , icarus_set_timing , "timing of device; see README.FPGA"},
|
|
|
{NULL},
|
|
{NULL},
|
|
|
};
|
|
};
|