Pass extra parameters for later use in libbitfury_sendHashData
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
diff --git a/driver-bitfury.c b/driver-bitfury.c
index e9db659..8809e85 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -932,7 +932,7 @@ static int64_t nf1_scan(struct thr_info *thr, struct cgpu_info *bitfury,
}
bitfury_work_to_payload(&info->payload, info->work);
}
- if (!libbitfury_sendHashData(bitfury))
+ if (!libbitfury_sendHashData(thr, bitfury, info))
return -1;
if (info->job_switched) {
diff --git a/libbitfury.c b/libbitfury.c
index 78f45a6..88beb45 100644
--- a/libbitfury.c
+++ b/libbitfury.c
@@ -316,9 +316,9 @@ bool spi_txrx(struct cgpu_info *bitfury, struct bitfury_info *info)
return true;
}
-bool libbitfury_sendHashData(struct cgpu_info *bf)
+bool libbitfury_sendHashData(struct thr_info *thr, struct cgpu_info *bitfury,
+ struct bitfury_info *info)
{
- struct bitfury_info *info = bf->device_data;
static unsigned second_run;
unsigned *newbuf = info->newbuf;
unsigned *oldbuf = info->oldbuf;
@@ -333,7 +333,7 @@ bool libbitfury_sendHashData(struct cgpu_info *bf)
spi_clear_buf(info);
spi_add_break(info);
spi_add_data(info, 0x3000, (void*)localvec, 19 * 4);
- if (!spi_txrx(bf, info))
+ if (!spi_txrx(bitfury, info))
return false;
memcpy(newbuf, info->spibuf + 4, 17 * 4);
diff --git a/libbitfury.h b/libbitfury.h
index 3ac1fff..639a29e 100644
--- a/libbitfury.h
+++ b/libbitfury.h
@@ -25,6 +25,7 @@ void spi_add_data(struct bitfury_info *info, uint16_t addr, const void *buf, int
bool spi_detect_bitfury(struct cgpu_info *bitfury, struct bitfury_info *info);
bool spi_reset(struct cgpu_info *bitfury, struct bitfury_info *info);
bool spi_txrx(struct cgpu_info *bitfury, struct bitfury_info *info);
-bool libbitfury_sendHashData(struct cgpu_info *bf);
+bool libbitfury_sendHashData(struct thr_info *thr, struct cgpu_info *bitfury,
+ struct bitfury_info *info);
#endif /* LIBBITFURY_H */