Commit c2b1504e505882a94487ce01b7eac714599191ed

Kano 2012-09-30T17:44:36

Icarus USB write failure is also a comms error

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/driver-icarus.c b/driver-icarus.c
index cc74df2..b3aa34b 100644
--- a/driver-icarus.c
+++ b/driver-icarus.c
@@ -691,6 +691,10 @@ static int64_t icarus_scanhash(struct thr_info *thr, struct work *work,
 	ret = icarus_write(fd, ob_bin, sizeof(ob_bin));
 	if (ret) {
 		do_icarus_close(thr);
+		applog(LOG_ERR, "ICA%i: Comms error", icarus->device_id);
+		icarus->device_last_not_well = time(NULL);
+		icarus->device_not_well_reason = REASON_DEV_COMMS_ERROR;
+		icarus->dev_comms_error_count++;
 		return 0;	/* This should never happen */
 	}