Look up work results in bxf driver from correct variable.
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
diff --git a/driver-bitfury.c b/driver-bitfury.c
index 26eb4e5..1cabca3 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -237,10 +237,10 @@ static void bitfury_detect(bool __maybe_unused hotplug)
static void parse_bxf_submit(struct cgpu_info *bitfury, struct bitfury_info *info, char *buf)
{
- struct work *match_work = NULL, *work = NULL;
+ struct work *match_work, *tmp, *work = NULL;
struct thr_info *thr = info->thr;
uint32_t nonce, timestamp;
- unsigned int workid;
+ int workid;
if (!sscanf(&buf[7], "%x %x %x", &nonce, &workid, ×tamp)) {
applog(LOG_WARNING, "%s %d: Failed to parse submit response",
@@ -248,13 +248,16 @@ static void parse_bxf_submit(struct cgpu_info *bitfury, struct bitfury_info *inf
return;
}
- applog(LOG_DEBUG, "%s %d: Parsed nonce %u workid %u timestamp %u",
+ applog(LOG_DEBUG, "%s %d: Parsed nonce %u workid %d timestamp %u",
bitfury->drv->name, bitfury->device_id, nonce, workid, timestamp);
rd_lock(&bitfury->qlock);
- HASH_FIND_INT(bitfury->queued_work, &workid, match_work);
- if (match_work)
- work = copy_work(match_work);
+ HASH_ITER(hh, bitfury->queued_work, match_work, tmp) {
+ if (match_work->subid == workid) {
+ work = copy_work(match_work);
+ break;
+ }
+ }
rd_unlock(&bitfury->qlock);
if (!work) {