Commit 27f64f31c9fbe58b20956776a9cdfed583ad3308

Con Kolivas 2014-01-09T14:34:56

Pass extra parameters for later use in libbitfury_sendHashData

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 */