Browse Source

ztex: Include device serial number and FPGA number in cgpu name field

Luke Dashjr 13 years ago
parent
commit
d4e0be51fe
1 changed files with 4 additions and 1 deletions
  1. 4 1
      driver-ztex.c

+ 4 - 1
driver-ztex.c

@@ -59,6 +59,7 @@ static void ztex_releaseFpga(struct libztex_device* ztex)
 static struct cgpu_info *ztex_setup(struct libztex_device *dev, int j)
 static struct cgpu_info *ztex_setup(struct libztex_device *dev, int j)
 {
 {
 	struct cgpu_info *ztex;
 	struct cgpu_info *ztex;
+	char fpganame[LIBZTEX_SNSTRING_LEN+3+1];
 
 
 	ztex = calloc(1, sizeof(struct cgpu_info));
 	ztex = calloc(1, sizeof(struct cgpu_info));
 	ztex->api = &ztex_api;
 	ztex->api = &ztex_api;
@@ -67,7 +68,9 @@ static struct cgpu_info *ztex_setup(struct libztex_device *dev, int j)
 	dev->fpgaNum = j;
 	dev->fpgaNum = j;
 	add_cgpu(ztex);
 	add_cgpu(ztex);
 	sprintf(ztex->device_ztex->repr, "%s %u", ztex->api->name, ztex->device_id);
 	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);
+	sprintf(fpganame, "%s-%u", ztex->device_ztex->snString, j+1);
+	ztex->name = strdup(fpganame);
+	applog(LOG_INFO, "%s %u: Found Ztex (ZTEX %s)", ztex->api->name, ztex->device_id, fpganame);
 
 
 	return ztex;
 	return ztex;
 }
 }