Browse Source

Bugfix: dualminer: Set min_nonce_diff before getting work

Luke Dashjr 12 years ago
parent
commit
a5e5be01b3
3 changed files with 14 additions and 4 deletions
  1. 12 3
      driver-dualminer.c
  2. 1 1
      driver-icarus.c
  3. 1 0
      icarus-common.h

+ 12 - 3
driver-dualminer.c

@@ -104,6 +104,17 @@ void dualminer_teardown_device(int fd)
 	gc3355_set_rts_status(fd, RTS_LOW);
 }
 
+static
+bool dualminer_init(struct thr_info * const thr)
+{
+	struct cgpu_info * const cgpu = thr->cgpu;
+	
+	if (opt_scrypt)
+		cgpu->min_nonce_diff = 1./0x10000;
+	
+	return icarus_init(thr);
+}
+
 static
 void dualminer_init_firstrun(struct cgpu_info *icarus)
 {
@@ -125,9 +136,6 @@ void dualminer_init_firstrun(struct cgpu_info *icarus)
 			info->Hs = DUALMINER_SCRYPT_DM_HASH_TIME;
 	}
 
-	if (opt_scrypt)
-		icarus->min_nonce_diff = 1./0x10000;
-
 	applog(LOG_DEBUG, "%"PRIpreprv": dualminer: Init: pll=%d, sha2num=%d", icarus->proc_repr, opt_pll_freq, opt_sha2_number);
 }
 
@@ -313,6 +321,7 @@ void dualminer_drv_init()
 	dualminer_drv.dname = "dualminer";
 	dualminer_drv.name = "DMU";
 	dualminer_drv.lowl_probe = dualminer_lowl_probe;
+	dualminer_drv.thread_init = dualminer_init;
 	dualminer_drv.thread_shutdown = dualminer_thread_shutdown;
 	dualminer_drv.job_prepare = dualminer_job_prepare;
 	dualminer_drv.set_device = dualminer_set_device;

+ 1 - 1
driver-icarus.c

@@ -660,7 +660,7 @@ static bool icarus_prepare(struct thr_info *thr)
 	return true;
 }
 
-static bool icarus_init(struct thr_info *thr)
+bool icarus_init(struct thr_info *thr)
 {
 	struct cgpu_info *icarus = thr->cgpu;
 	struct ICARUS_INFO *info = icarus->device_data;

+ 1 - 0
icarus-common.h

@@ -135,6 +135,7 @@ struct icarus_state {
 bool icarus_detect_custom(const char *devpath, struct device_drv *, struct ICARUS_INFO *);
 extern int icarus_gets(unsigned char *, int fd, struct timeval *tv_finish, struct thr_info *, int read_count, int read_size);
 extern int icarus_write(int fd, const void *buf, size_t bufLen);
+extern bool icarus_init(struct thr_info *);
 extern void do_icarus_close(struct thr_info *thr);
 extern bool icarus_job_start(struct thr_info *);