Commit b6b1abb5d998ddb662f95972e24f90c790f6aac2

Con Kolivas 2013-05-26T01:24:14

Add more debugging to avalon reads.

diff --git a/driver-avalon.c b/driver-avalon.c
index abcb3d0..670dd5b 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -627,7 +627,8 @@ static void avalon_parse_results(struct cgpu_info *avalon, struct avalon_info *i
 		struct work *work;
 
 		ar = (struct avalon_result *)&buf[i];
-		if ((work = avalon_valid_result(avalon, ar)) != NULL) {
+		work = avalon_valid_result(avalon, ar);
+		if (work) {
 			bool gettemp = false;
 
 			found = true;
@@ -651,6 +652,7 @@ static void avalon_parse_results(struct cgpu_info *avalon, struct avalon_info *i
 		spare = *offset - AVALON_READ_SIZE - 1;
 	else
 		spare = AVALON_READ_SIZE + i;
+	applog(LOG_WARNING, "Avalon: Discarding %d bytes from buffer", spare);
 	*offset -= spare;
 	memmove(buf, buf + spare, *offset);
 	if (!found) {
@@ -703,6 +705,11 @@ static void *avalon_get_results(void *userdata)
 			continue;
 		}
 
+		if (opt_debug) {
+			applog(LOG_DEBUG, "Avalon: get:");
+			hexdump((uint8_t *)buf, ret);
+		}
+
 		memcpy(&readbuf[offset], buf, ret);
 		offset += ret;