Commit a5b284509654e0fcffc5896984c28024d4dae642

Denis Ahrens 2012-12-02T00:05:20

libztex: Verify that the mining firmware is not a dummy firmware

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/libztex.c b/libztex.c
index f179c68..14cdba6 100644
--- a/libztex.c
+++ b/libztex.c
@@ -161,6 +161,13 @@ static enum check_result libztex_checkDevice(struct libusb_device *dev)
 		goto done;
 	}
 
+	// check for dummy firmware
+	if (rv[8] == 0)
+	{
+		applog(LOG_ERR, "%s: found a ZTEX dummy firmware", __func__);
+		goto done;
+	}
+
 	// reset 1
 	buf[0] = 1;
 	cnt = libusb_control_transfer(hndl, 0x40, 0xA0, 0xE600, 0, buf, 1,1000);