Parse bxf work submits fully, submitting the results.
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
diff --git a/driver-bitfury.c b/driver-bitfury.c
index dfeee96..8e73b00 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -234,6 +234,8 @@ 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 thr_info *thr = info->thr;
uint32_t nonce, timestamp;
unsigned int workid;
@@ -242,6 +244,29 @@ static void parse_bxf_submit(struct cgpu_info *bitfury, struct bitfury_info *inf
bitfury->drv->name, bitfury->device_id);
return;
}
+
+ rd_lock(&bitfury->qlock);
+ HASH_FIND_INT(bitfury->queued_work, &workid, match_work);
+ if (match_work)
+ work = copy_work(match_work);
+ rd_unlock(&bitfury->qlock);
+
+ if (!work) {
+ applog(LOG_INFO, "%s %d: No matching work", bitfury->drv->name, bitfury->device_id);
+
+ mutex_lock(&info->lock);
+ info->no_matching_work++;
+ mutex_unlock(&info->lock);
+
+ return;
+ }
+ set_work_ntime(work, timestamp);
+ if (submit_nonce(thr, work, nonce)) {
+ mutex_lock(&info->lock);
+ info->nonces++;
+ mutex_unlock(&info->lock);
+ }
+ free_work(work);
}
static void parse_bxf_temp(struct cgpu_info *bitfury, struct bitfury_info *info, char *buf)
diff --git a/driver-bitfury.h b/driver-bitfury.h
index 27f0411..2438e28 100644
--- a/driver-bitfury.h
+++ b/driver-bitfury.h
@@ -33,6 +33,7 @@ struct bitfury_info {
pthread_t read_thr;
double temperature;
int work_id; // Current work->subid
+ int no_matching_work;
};
#endif /* BITFURY_H */