|
|
@ -220,18 +220,24 @@ static bool bitfury_checkresults(struct thr_info *thr, struct work *work, uint32 |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int64_t bitfury_scanhash(struct thr_info *thr, struct work *work, |
|
|
|
static int64_t bitfury_scanwork(struct thr_info *thr) |
|
|
|
int64_t __maybe_unused max_nonce) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
struct cgpu_info *bitfury = thr->cgpu; |
|
|
|
struct cgpu_info *bitfury = thr->cgpu; |
|
|
|
struct bitfury_info *info = bitfury->device_data; |
|
|
|
struct bitfury_info *info = bitfury->device_data; |
|
|
|
struct timeval tv_now; |
|
|
|
struct timeval tv_now; |
|
|
|
|
|
|
|
struct work *work; |
|
|
|
double nonce_rate; |
|
|
|
double nonce_rate; |
|
|
|
int64_t ret = 0; |
|
|
|
int64_t ret = 0; |
|
|
|
int amount, i; |
|
|
|
int amount, i; |
|
|
|
char buf[45]; |
|
|
|
char buf[45]; |
|
|
|
int ms_diff; |
|
|
|
int ms_diff; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
work = get_work(thr, thr->id); |
|
|
|
|
|
|
|
if (unlikely(thr->work_restart)) { |
|
|
|
|
|
|
|
free_work(work); |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
buf[0] = 'W'; |
|
|
|
buf[0] = 'W'; |
|
|
|
memcpy(buf + 1, work->midstate, 32); |
|
|
|
memcpy(buf + 1, work->midstate, 32); |
|
|
|
memcpy(buf + 33, work->data + 64, 12); |
|
|
|
memcpy(buf + 33, work->data + 64, 12); |
|
|
@ -298,8 +304,7 @@ static int64_t bitfury_scanhash(struct thr_info *thr, struct work *work, |
|
|
|
cascade: |
|
|
|
cascade: |
|
|
|
for (i = BF1ARRAY_SIZE; i > 0; i--) |
|
|
|
for (i = BF1ARRAY_SIZE; i > 0; i--) |
|
|
|
info->prevwork[i] = info->prevwork[i - 1]; |
|
|
|
info->prevwork[i] = info->prevwork[i - 1]; |
|
|
|
info->prevwork[0] = copy_work(work); |
|
|
|
info->prevwork[0] = work; |
|
|
|
work->blk.nonce = 0xffffffff; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info->cycles++; |
|
|
|
info->cycles++; |
|
|
|
info->total_nonces += info->nonces; |
|
|
|
info->total_nonces += info->nonces; |
|
|
@ -358,7 +363,8 @@ struct device_drv bitfury_drv = { |
|
|
|
.dname = "bitfury", |
|
|
|
.dname = "bitfury", |
|
|
|
.name = "BF1", |
|
|
|
.name = "BF1", |
|
|
|
.drv_detect = bitfury_detect, |
|
|
|
.drv_detect = bitfury_detect, |
|
|
|
.scanhash = bitfury_scanhash, |
|
|
|
.hash_work = &hash_driver_work, |
|
|
|
|
|
|
|
.scanwork = bitfury_scanwork, |
|
|
|
.get_api_stats = bitfury_api_stats, |
|
|
|
.get_api_stats = bitfury_api_stats, |
|
|
|
.reinit_device = bitfury_init, |
|
|
|
.reinit_device = bitfury_init, |
|
|
|
.thread_shutdown = bitfury_shutdown, |
|
|
|
.thread_shutdown = bitfury_shutdown, |
|
|
|