ztex updateFreq was always reporting on fpga 0
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
diff --git a/driver-ztex.c b/driver-ztex.c
index 89bccec..8b8b0e4 100644
--- a/driver-ztex.c
+++ b/driver-ztex.c
@@ -129,7 +129,7 @@ static bool ztex_updateFreq(struct libztex_device* ztex)
if (bestM != ztex->freqM) {
ztex_selectFpga(ztex);
- libztex_setFreq(ztex->root, bestM);
+ libztex_setFreq(ztex, bestM);
ztex_releaseFpga(ztex);
}
@@ -138,7 +138,7 @@ static bool ztex_updateFreq(struct libztex_device* ztex)
maxM++;
if ((bestM < (1.0 - LIBZTEX_OVERHEATTHRESHOLD) * maxM) && bestM < maxM - 1) {
ztex_selectFpga(ztex);
- libztex_resetFpga(ztex->root);
+ libztex_resetFpga(ztex);
ztex_releaseFpga(ztex);
applog(LOG_ERR, "%s: frequency drop of %.1f%% detect. This may be caused by overheating. FPGA is shut down to prevent damage.",
ztex->repr, (1.0 - 1.0 * bestM / maxM) * 100);
@@ -206,12 +206,12 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work,
memcpy(sendbuf + 12, work->midstate, 32);
ztex_selectFpga(ztex);
- i = libztex_sendHashData(ztex->root, sendbuf);
+ i = libztex_sendHashData(ztex, sendbuf);
if (i < 0) {
// Something wrong happened in send
applog(LOG_ERR, "%s: Failed to send hash data with err %d, retrying", ztex->repr, i);
usleep(500000);
- i = libztex_sendHashData(ztex->root, sendbuf);
+ i = libztex_sendHashData(ztex, sendbuf);
if (i < 0) {
// And there's nothing we can do about it
ztex_disable(thr);
@@ -249,12 +249,12 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work,
break;
}
ztex_selectFpga(ztex);
- i = libztex_readHashData(ztex->root, &hdata[0]);
+ i = libztex_readHashData(ztex, &hdata[0]);
if (i < 0) {
// Something wrong happened in read
applog(LOG_ERR, "%s: Failed to read hash data with err %d, retrying", ztex->repr, i);
usleep(500000);
- i = libztex_readHashData(ztex->root, &hdata[0]);
+ i = libztex_readHashData(ztex, &hdata[0]);
if (i < 0) {
// And there's nothing we can do about it
ztex_disable(thr);
@@ -363,7 +363,7 @@ static bool ztex_prepare(struct thr_info *thr)
get_datestamp(cgpu->init, &now);
ztex_selectFpga(ztex);
- if (libztex_configureFpga(ztex->root) != 0)
+ if (libztex_configureFpga(ztex) != 0)
return false;
ztex_releaseFpga(ztex);
ztex->freqM = -1;