|
@@ -279,7 +279,7 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work,
|
|
|
char *ob_hex, *nonce_hex;
|
|
char *ob_hex, *nonce_hex;
|
|
|
uint32_t nonce;
|
|
uint32_t nonce;
|
|
|
uint32_t hash_count;
|
|
uint32_t hash_count;
|
|
|
- struct timeval tv_start, tv_end, diff;
|
|
|
|
|
|
|
+ struct timeval tv_start, tv_end, elapsed;
|
|
|
|
|
|
|
|
icarus = thr->cgpu;
|
|
icarus = thr->cgpu;
|
|
|
|
|
|
|
@@ -319,12 +319,12 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work,
|
|
|
ret = icarus_gets(nonce_bin, sizeof(nonce_bin), fd, wr);
|
|
ret = icarus_gets(nonce_bin, sizeof(nonce_bin), fd, wr);
|
|
|
|
|
|
|
|
gettimeofday(&tv_end, NULL);
|
|
gettimeofday(&tv_end, NULL);
|
|
|
- timeval_subtract(&diff, &tv_end, &tv_start);
|
|
|
|
|
|
|
+ timeval_subtract(&elapsed, &tv_end, &tv_start);
|
|
|
|
|
|
|
|
nonce_hex = bin2hex(nonce_bin, sizeof(nonce_bin));
|
|
nonce_hex = bin2hex(nonce_bin, sizeof(nonce_bin));
|
|
|
if (nonce_hex) {
|
|
if (nonce_hex) {
|
|
|
applog(LOG_DEBUG, "Icarus %d returned (in %d.%06d seconds): %s",
|
|
applog(LOG_DEBUG, "Icarus %d returned (in %d.%06d seconds): %s",
|
|
|
- icarus->device_id, diff.tv_sec, diff.tv_usec, nonce_hex);
|
|
|
|
|
|
|
+ icarus->device_id, elapsed.tv_sec, elapsed.tv_usec, nonce_hex);
|
|
|
free(nonce_hex);
|
|
free(nonce_hex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -334,12 +334,12 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work,
|
|
|
icarus_close(fd);
|
|
icarus_close(fd);
|
|
|
|
|
|
|
|
if (nonce == 0 && ret) {
|
|
if (nonce == 0 && ret) {
|
|
|
- if (unlikely(diff.tv_sec > 12 || (diff.tv_sec == 11 && diff.tv_usec > 300067)))
|
|
|
|
|
|
|
+ if (unlikely(elapsed.tv_sec > 12 || (elapsed.tv_sec == 11 && elapsed.tv_usec > 300067)))
|
|
|
return 0xffffffff;
|
|
return 0xffffffff;
|
|
|
// Approximately how much of the nonce Icarus scans in 1 second...
|
|
// Approximately how much of the nonce Icarus scans in 1 second...
|
|
|
// 0x16a7a561 would be if it was exactly 380 MH/s
|
|
// 0x16a7a561 would be if it was exactly 380 MH/s
|
|
|
// 0x168b7b4b was the average over a 201-sample period based on time to find actual shares
|
|
// 0x168b7b4b was the average over a 201-sample period based on time to find actual shares
|
|
|
- return (0x168b7b4b * diff.tv_sec) + (0x17a * diff.tv_usec);
|
|
|
|
|
|
|
+ return (0x168b7b4b * elapsed.tv_sec) + (0x17a * elapsed.tv_usec);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#ifndef __BIG_ENDIAN__
|
|
#ifndef __BIG_ENDIAN__
|
|
@@ -357,7 +357,7 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work,
|
|
|
hash_count <<= 1;
|
|
hash_count <<= 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- applog(LOG_DEBUG, "0x%x hashes in %d.%06d seconds", hash_count, diff.tv_sec, diff.tv_usec);
|
|
|
|
|
|
|
+ applog(LOG_DEBUG, "0x%x hashes in %d.%06d seconds", hash_count, elapsed.tv_sec, elapsed.tv_usec);
|
|
|
|
|
|
|
|
return hash_count;
|
|
return hash_count;
|
|
|
}
|
|
}
|