Merge remote-tracking branch 'conman/master'
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/driver-bitfury.c b/driver-bitfury.c
index 8d18694..30f8647 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -146,6 +146,9 @@ static bool bxf_send_msg(struct cgpu_info *bitfury, char *buf, enum usb_cmds cmd
{
int err, amount, len;
+ if (unlikely(bitfury->usbinfo.nodev))
+ return false;
+
len = strlen(buf);
applog(LOG_DEBUG, "%s %d: Sending %s", bitfury->drv->name, bitfury->device_id, buf);
err = usb_write(bitfury, buf, len, &amount, cmd);
@@ -324,13 +327,15 @@ static void parse_bxf_submit(struct cgpu_info *bitfury, struct bitfury_info *inf
struct work *match_work, *tmp, *work = NULL;
struct thr_info *thr = info->thr;
uint32_t nonce, timestamp;
- int workid;
+ int workid, chip = -1;
- if (!sscanf(&buf[7], "%x %x %x", &nonce, &workid, ×tamp)) {
+ if (!sscanf(&buf[7], "%x %x %x %d", &nonce, &workid, ×tamp, &chip)) {
applog(LOG_WARNING, "%s %d: Failed to parse submit response",
bitfury->drv->name, bitfury->device_id);
return;
}
+ if (chip > -1 && chip < 2)
+ info->submits[chip]++;
applog(LOG_DEBUG, "%s %d: Parsed nonce %u workid %d timestamp %u",
bitfury->drv->name, bitfury->device_id, nonce, workid, timestamp);
@@ -811,6 +816,9 @@ static void bxf_update_work(struct cgpu_info *bitfury, struct bitfury_info *info
struct thr_info *thr = info->thr;
struct work *work;
+ if (unlikely(bitfury->usbinfo.nodev))
+ return;
+
work = get_queue_work(thr, bitfury, thr->id);
if (work->drv_rolllimit != info->maxroll) {
info->maxroll = work->drv_rolllimit;
@@ -891,6 +899,8 @@ static struct api_data *bxf_api_stats(struct bitfury_info *info)
root = api_add_int(root, "Core1 hwerror", &info->filtered_hw[1], false);
root = api_add_int(root, "Core0 jobs", &info->job[0], false);
root = api_add_int(root, "Core1 jobs", &info->job[1], false);
+ root = api_add_int(root, "Core0 submits", &info->submits[0], false);
+ root = api_add_int(root, "Core1 submits", &info->submits[1], false);
return root;
}
diff --git a/driver-bitfury.h b/driver-bitfury.h
index 42a805e..9412076 100644
--- a/driver-bitfury.h
+++ b/driver-bitfury.h
@@ -57,6 +57,7 @@ struct bitfury_info {
uint8_t clocks; // There are two but we set them equal
int filtered_hw[2]; // Hardware errors we're told about but are filtered
int job[2]; // Completed jobs we're told about
+ int submits[2]; // Submitted responses
};
#endif /* BITFURY_H */