Some tweaks to reporting and logging. - Adding fpga number to the ztex string representation - Removing usb details from the ztex string representation - First frequency set no longer reports a bogus old freq
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
diff --git a/driver-ztex.c b/driver-ztex.c
index bbfd9b1..c881cd7 100644
--- a/driver-ztex.c
+++ b/driver-ztex.c
@@ -90,6 +90,7 @@ 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);
}
@@ -346,7 +347,7 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work,
static void ztex_statline_before(char *buf, struct cgpu_info *cgpu)
{
if (cgpu->deven == DEV_ENABLED) {
- tailsprintf(buf, "%s | ", cgpu->device_ztex->snString);
+ tailsprintf(buf, "%s-%d | ", cgpu->device_ztex->snString, cgpu->device_ztex->fpgaNum+1);
tailsprintf(buf, "%0.2fMhz | ", cgpu->device_ztex->freqM1 * (cgpu->device_ztex->freqM + 1));
}
}
@@ -364,8 +365,9 @@ static bool ztex_prepare(struct thr_info *thr)
if (libztex_configureFpga(ztex) != 0)
return false;
ztex_releaseFpga(ztex);
- ztex->freqM = -1;
- ztex_updateFreq(ztex);
+ ztex->freqM = ztex->freqMaxM+1;;
+ //ztex_updateFreq(ztex);
+ libztex_setFreq(ztex, ztex->freqMDefault);
applog(LOG_DEBUG, "%s: prepare", ztex->repr);
return true;
}
diff --git a/libztex.c b/libztex.c
index 1762a48..ffc2e67 100644
--- a/libztex.c
+++ b/libztex.c
@@ -381,7 +381,7 @@ int libztex_setFreq(struct libztex_device *ztex, uint16_t freq) {
return cnt;
}
ztex->freqM = freq;
- if (oldfreq == -1)
+ if (oldfreq > ztex->freqMaxM)
applog(LOG_WARNING, "%s: Frequency set to %0.2f Mhz",
ztex->repr, ztex->freqM1 * (ztex->freqM + 1));
else
@@ -535,7 +535,7 @@ int libztex_prepare_device(struct libusb_device *dev, struct libztex_device** zt
newdev->usbbus = libusb_get_bus_number(dev);
newdev->usbaddress = libusb_get_device_address(dev);
- sprintf(newdev->repr, "ZTEX %.3d:%.3d-%s", newdev->usbbus, newdev->usbaddress, newdev->snString);
+ sprintf(newdev->repr, "ZTEX %s-1", newdev->snString);
newdev->valid = true;
return 0;
}
diff --git a/libztex.h b/libztex.h
index 287b618..d424545 100644
--- a/libztex.h
+++ b/libztex.h
@@ -78,7 +78,7 @@ struct libztex_device {
int selectedFpga;
bool parallelConfigSupport;
- char repr[64];
+ char repr[20];
};
struct libztex_dev_list {