Remove the buffer from bitfury info since it is only used on one pass in the bf1 device.
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 69 70 71 72 73
diff --git a/driver-bitfury.c b/driver-bitfury.c
index 9d77ded..993ec7d 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -276,11 +276,11 @@ static int64_t bf1_scan(struct thr_info *thr, struct cgpu_info *bitfury,
struct bitfury_info *info)
{
int amount, i, aged = 0, total = 0, ms_diff;
+ char readbuf[512], buf[45];
struct work *work, *tmp;
struct timeval tv_now;
double nonce_rate;
int64_t ret = 0;
- char buf[45];
work = get_queue_work(thr, bitfury, thr->id);
if (unlikely(thr->work_restart)) {
@@ -298,7 +298,7 @@ static int64_t bf1_scan(struct thr_info *thr, struct cgpu_info *bitfury,
cgtime(&tv_now);
ms_diff = 600 - ms_tdiff(&tv_now, &info->tv_start);
if (ms_diff > 0) {
- usb_read_timeout_cancellable(bitfury, info->buf, 512, &amount, ms_diff,
+ usb_read_timeout_cancellable(bitfury, readbuf, 512, &amount, ms_diff,
C_BF1_GETRES);
total += amount;
}
@@ -310,11 +310,11 @@ static int64_t bf1_scan(struct thr_info *thr, struct cgpu_info *bitfury,
/* If a work restart was sent, just empty the buffer. */
if (unlikely(ms_diff < 10 || thr->work_restart))
ms_diff = 10;
- usb_read_once_timeout_cancellable(bitfury, info->buf + total, BF1MSGSIZE,
+ usb_read_once_timeout_cancellable(bitfury, readbuf + total, BF1MSGSIZE,
&amount, ms_diff, C_BF1_GETRES);
total += amount;
while (amount) {
- usb_read_once_timeout(bitfury, info->buf + total, 512, &amount, 10,
+ usb_read_once_timeout(bitfury, readbuf + total, 512, &amount, 10,
C_BF1_GETRES);
total += amount;
};
@@ -339,7 +339,7 @@ out:
uint32_t nonce;
/* Ignore state & switched data in results for now. */
- memcpy(&nonce, info->buf + i + 3, 4);
+ memcpy(&nonce, readbuf + i + 3, 4);
nonce = decnonce(nonce);
rd_lock(&bitfury->qlock);
diff --git a/driver-bitfury.h b/driver-bitfury.h
index 7ab6908..dc16e50 100644
--- a/driver-bitfury.h
+++ b/driver-bitfury.h
@@ -16,14 +16,15 @@
struct bitfury_info {
struct cgpu_info *base_cgpu;
enum sub_ident ident;
- uint8_t version;
- char product[8];
- uint32_t serial;
- char buf[512];
int nonces;
int total_nonces;
double saved_nonces;
int cycles;
+
+ /* BF1 specific data */
+ uint8_t version;
+ char product[8];
+ uint32_t serial;
struct timeval tv_start;
};