Browse Source

ztex: Use consistent device ids for logging

Luke Dashjr 13 years ago
parent
commit
0e5cd4ca33
1 changed files with 7 additions and 8 deletions
  1. 7 8
      driver-ztex.c

+ 7 - 8
driver-ztex.c

@@ -1,5 +1,5 @@
 /**
- *   ztex.c - BFGMiner worker for Ztex 1.15x fpga board
+ *   ztex.c - BFGMiner worker for Ztex 1.15x/y fpga board
  *
  *   Copyright (c) 2012 nelisky.btc@gmail.com
  *
@@ -64,7 +64,7 @@ static void ztex_detect(void)
 
 	cnt = libztex_scanDevices(&ztex_devices);
 	if (cnt > 0)
-		applog(LOG_WARNING, "Found %d ztex board%s", cnt, cnt > 1 ? "s" : "");
+		applog(LOG_INFO, "Found %d ztex board%s", cnt, cnt > 1 ? "s" : "");
 
 	for (i = 0; i < cnt; i++) {
 		ztex = calloc(1, sizeof(struct cgpu_info));
@@ -74,6 +74,8 @@ static void ztex_detect(void)
 		ztex->device_ztex->fpgaNum = 0;
 		ztex->device_ztex->root = ztex->device_ztex;
 		add_cgpu(ztex);
+		sprintf(ztex->device_ztex->repr, "%s %u", ztex->api->name, ztex->device_id);
+		applog(LOG_INFO, "%s %u: Found Ztex (ZTEX %s-%u)", ztex->api->name, ztex->device_id, ztex->device_ztex->snString, 1);
 
 		fpgacount = libztex_numberOfFpgas(ztex->device_ztex);
 
@@ -89,11 +91,10 @@ static void ztex_detect(void)
 			ztex->threads = 1;
 			ztex_slave->fpgaNum = j;
 			ztex_slave->root = ztex_devices[i]->dev;
-			ztex_slave->repr[strlen(ztex_slave->repr) - 1] = ('1' + j);
 			add_cgpu(ztex);
+			sprintf(ztex->device_ztex->repr, "%s %u", ztex->api->name, ztex->device_id);
+			applog(LOG_INFO, "%s %u: Found Ztex (ZTEX %s-%u)", ztex->api->name, ztex->device_id, ztex->device_ztex->snString, j+1);
 		}
-
-		applog(LOG_WARNING,"%s: Found Ztex (fpga count = %d) , mark as %d", ztex->device_ztex->repr, fpgacount, ztex->device_id);
 	}
 
 	if (cnt > 0)
@@ -303,7 +304,6 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work,
 						}
 					}
 					if (!found) {
-						applog(LOG_DEBUG, "%s: Share found N%dE%d", ztex->repr, i, j);
 						backlog[backlog_p++] = nonce;
 						if (backlog_p >= backlog_max)
 							backlog_p = 0;
@@ -312,7 +312,7 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work,
 #endif
 						work->blk.nonce = 0xffffffff;
 						rv = submit_nonce(thr, work, nonce);
-						applog(LOG_DEBUG, "%s: submitted %0.8x %d", ztex->repr, nonce, rv);
+						applog(LOG_DEBUG, "%s: submitted %0.8x (from N%dE%d) %d", ztex->repr, nonce, i, j, rv);
 					}
 				}
 			}
@@ -413,4 +413,3 @@ struct device_api ztex_api = {
 	.scanhash = ztex_scanhash,
 	.thread_shutdown = ztex_shutdown,
 };
-