Browse Source

Only count successful nonces as hashrate in the knc driver.

Con Kolivas 12 years ago
parent
commit
32ec362821
1 changed files with 4 additions and 4 deletions
  1. 4 4
      driver-knc-spi-fpga.c

+ 4 - 4
driver-knc-spi-fpga.c

@@ -368,7 +368,7 @@ static int64_t knc_process_response(struct thr_info *thr, struct cgpu_info *cgpu
 	struct knc_state *knc = cgpu->knc_state;
 	struct knc_state *knc = cgpu->knc_state;
 	struct work *work;
 	struct work *work;
 	int64_t us;
 	int64_t us;
-	int submitted, completed, i, num_sent;
+	int submitted, successful, i, num_sent;
 	int next_read_q, next_read_a;
 	int next_read_q, next_read_a;
 	struct timeval now;
 	struct timeval now;
 
 
@@ -411,7 +411,7 @@ static int64_t knc_process_response(struct thr_info *thr, struct cgpu_info *cgpu
 
 
 	/* check for completed works and calculated nonces */
 	/* check for completed works and calculated nonces */
 	gettimeofday(&now, NULL);
 	gettimeofday(&now, NULL);
-	completed = 0;
+	successful = 0;
 	for (i = 0; i < (int)MAX_RESPONSES_IN_BATCH; ++i)
 	for (i = 0; i < (int)MAX_RESPONSES_IN_BATCH; ++i)
 	{
 	{
 		if ( (rxbuf->responses[i].type != RESPONSE_TYPE_NONCE_FOUND) &&
 		if ( (rxbuf->responses[i].type != RESPONSE_TYPE_NONCE_FOUND) &&
@@ -470,6 +470,7 @@ static int64_t knc_process_response(struct thr_info *thr, struct cgpu_info *cgpu
 						knc->disa_cnt[cidx] = 0;
 						knc->disa_cnt[cidx] = 0;
 						knc->hwerr_work_id[cidx] = 0xFFFFFFFF;
 						knc->hwerr_work_id[cidx] = 0xFFFFFFFF;
 					}
 					}
+					successful++;
 				} else  {
 				} else  {
 					if ((cidx < (int)sizeof(knc->hwerrs)) &&
 					if ((cidx < (int)sizeof(knc->hwerrs)) &&
 					    (knc->hwerr_work_id[cidx] != rxbuf->responses[i].work_id)) {
 					    (knc->hwerr_work_id[cidx] != rxbuf->responses[i].work_id)) {
@@ -505,10 +506,9 @@ static int64_t knc_process_response(struct thr_info *thr, struct cgpu_info *cgpu
 			       &(knc->active_fifo[knc->read_a]),
 			       &(knc->active_fifo[knc->read_a]),
 			       sizeof(struct active_work));
 			       sizeof(struct active_work));
 		knc->active_fifo[knc->read_a].work = NULL;
 		knc->active_fifo[knc->read_a].work = NULL;
-		++completed;
 	}
 	}
 
 
-	return ((uint64_t)completed) * 0x100000000UL;
+	return ((uint64_t)successful) * 0x100000000UL;
 }
 }
 
 
 /* Send flush command via SPI */
 /* Send flush command via SPI */