Browse Source

Merge commit '454197a' into littlefury

Conflicts:
	driver-bitfury.c
	libbitfury.c
	libbitfury.h
Luke Dashjr 12 years ago
parent
commit
9f634077e2
4 changed files with 8 additions and 8 deletions
  1. 1 4
      driver-bitfury.c
  2. 1 1
      driver-littlefury.c
  3. 4 2
      libbitfury.c
  4. 2 1
      libbitfury.h

+ 1 - 4
driver-bitfury.c

@@ -169,7 +169,6 @@ static int64_t bitfury_scanHash(struct thr_info *thr)
 	int long_stat = 1800;
 	static time_t long_out_t;
 	static int first = 0; //TODO Move to detect()
-	static bool second_run = false;
 	int i;
 
 	devices = thr->cgpu->devices;
@@ -197,7 +196,7 @@ static int64_t bitfury_scanHash(struct thr_info *thr)
 		}
 		
 		payload_to_atrvec(devices[chip].atrvec, &devices[chip].payload);
-		libbitfury_sendHashData1(chip, &devices[chip], second_run);
+		libbitfury_sendHashData1(chip, &devices[chip]);
 	}
 
 	cgsleep_ms(5);
@@ -329,8 +328,6 @@ static int64_t bitfury_scanHash(struct thr_info *thr)
 		long_out_t = now.tv_sec;
 	}
 
-	second_run = true;
-	
 	return hashes;
 }
 

+ 1 - 1
driver-littlefury.c

@@ -361,7 +361,7 @@ bool littlefury_do_io(struct thr_info *thr)
 	struct cgpu_info * const proc = thr->cgpu;
 	struct bitfury_device * const bitfury = proc->device_data;
 	bitfury->results_n = 0;
-	libbitfury_sendHashData1(proc->proc_id, bitfury, thr->work);
+	libbitfury_sendHashData1(proc->proc_id, bitfury);
 	if (bitfury->job_switched && thr->next_work)
 	{
 		mt_job_transition(thr);

+ 4 - 2
libbitfury.c

@@ -388,7 +388,7 @@ void payload_to_atrvec(uint32_t *atrvec, struct bitfury_payload *p)
 	ms3_compute(atrvec);
 }
 
-void libbitfury_sendHashData1(int chip_id, struct bitfury_device *d, bool second_run)
+void libbitfury_sendHashData1(int chip_id, struct bitfury_device *d)
 {
 	struct spi_port *port = d->spi;
 	unsigned *newbuf = d->newbuf;
@@ -403,7 +403,7 @@ void libbitfury_sendHashData1(int chip_id, struct bitfury_device *d, bool second
 
 	clock_gettime(CLOCK_REALTIME, &(time));
 
-	if (!second_run) {
+	if (!d->second_run) {
 		d->predict2 = d->predict1 = time;
 		d->counter1 = d->counter2 = 0;
 		d->req2_done = 0;
@@ -600,6 +600,8 @@ void libbitfury_sendHashData1(int chip_id, struct bitfury_device *d, bool second
 			d->req2_done = 1;
 		}
 	}
+	
+	d->second_run = true;
 }
 
 int libbitfury_readHashData(unsigned int *res) {

+ 2 - 1
libbitfury.h

@@ -50,10 +50,11 @@ struct bitfury_device {
 	double ns;
 	unsigned slot;
 	unsigned fasync;
+	bool second_run;
 };
 
 int libbitfury_readHashData(unsigned int *res);
-extern void libbitfury_sendHashData1(int chip_id, struct bitfury_device *d, bool second_run);
+extern void libbitfury_sendHashData1(int chip_id, struct bitfury_device *d);
 void work_to_payload(struct bitfury_payload *p, struct work *w);
 extern void payload_to_atrvec(uint32_t *atrvec, struct bitfury_payload *);
 struct timespec t_diff(struct timespec start, struct timespec end);