Skip to content

Commit

Permalink
Reinstate work utility based hashmeter for knc.
Browse files Browse the repository at this point in the history
  • Loading branch information
ckolivas committed Dec 23, 2013
1 parent 227d57b commit 2d44807
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions driver-knc-spi-fpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ static int64_t knc_process_response(struct thr_info *thr, struct cgpu_info *cgpu
struct spi_rx_t *rxbuf)
{
struct knc_state *knc = cgpu->device_data;
int submitted, completed, i, num_sent;
int submitted, successful, i, num_sent;
int next_read_q, next_read_a;
struct timeval now;
struct timespec ts_now;
Expand Down Expand Up @@ -561,7 +561,7 @@ static int64_t knc_process_response(struct thr_info *thr, struct cgpu_info *cgpu

/* check for completed works and calculated nonces */
gettimeofday(&now, NULL);
completed = 0;
successful = 0;

for (i = 0; i < (int)MAX_RESPONSES_IN_BATCH; ++i) {
if ((rxbuf->responses[i].type != RESPONSE_TYPE_NONCE_FOUND) &&
Expand Down Expand Up @@ -625,6 +625,7 @@ static int64_t knc_process_response(struct thr_info *thr, struct cgpu_info *cgpu
knc->disa_cnt[cidx] = 0;
knc->hwerr_work_id[cidx] = 0xFFFFFFFF;
}
successful++;
} else {
stats_bad_share(knc, rxbuf->responses[i].asic, rxbuf->responses[i].core, &ts_now);
bool process_hwerr = (cidx < (int)sizeof(knc->hwerrs));
Expand Down Expand Up @@ -667,10 +668,9 @@ static int64_t knc_process_response(struct thr_info *thr, struct cgpu_info *cgpu
sizeof(struct active_work));
}
knc->active_fifo[knc->read_a].work = NULL;
++completed;
}

return ((uint64_t)completed) * 0x100000000UL;
return ((uint64_t)successful) * 0x100000000UL;
}

/* Send flush command via SPI */
Expand Down

0 comments on commit 2d44807

Please sign in to comment.