Commit 66b18833cb39c2097bab493e5bd50716b3e7b5e2

Con Kolivas 2014-02-23T23:58:02

Match hfa devices to old ones based on OP_NAME values before serial numbers if possible.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/driver-hashfast.c b/driver-hashfast.c
index d75d334..9446078 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -575,7 +575,15 @@ static struct cgpu_info *hfa_old_device(struct cgpu_info *hashfast, struct hashf
 		cinfo = cgpu->device_data;
 		if (!cinfo)
 			continue;
+		if (info->op_name[0] != '\0' && !strncmp(info->op_name, cinfo->op_name, 32)) {
+			applog(LOG_DEBUG, "%s %d: Found old device based on OP_NAME %s",
+			       hashfast->drv->name, hashfast->device_id, info->op_name);
+			found = cgpu;
+			break;
+		}
 		if (info->serial_number == cinfo->serial_number) {
+			applog(LOG_DEBUG, "%s %d: Found old device based on serial number %x",
+			       hashfast->drv->name, hashfast->device_id, info->serial_number);
 			found = cgpu;
 			break;
 		}