Browse Source

Merge commit '2ce7f28' into bfgminer

Conflicts:
	driver-bitforce.c
	driver-icarus.c
	miner.c
	miner.h
	sha256_via.c
Luke Dashjr 13 years ago
parent
commit
3543f598c7
2 changed files with 9 additions and 13 deletions
  1. 2 1
      driver-icarus.c
  2. 7 12
      miner.c

+ 2 - 1
driver-icarus.c

@@ -206,7 +206,7 @@ static void rev(unsigned char *s, size_t l)
 #define icarus_open2(devpath, purge)  serial_open(devpath, 115200, ICARUS_READ_FAULT_DECISECONDS, purge)
 #define icarus_open2(devpath, purge)  serial_open(devpath, 115200, ICARUS_READ_FAULT_DECISECONDS, purge)
 #define icarus_open(devpath)  icarus_open2(devpath, false)
 #define icarus_open(devpath)  icarus_open2(devpath, false)
 
 
-static int icarus_gets(unsigned char *buf, int fd, struct timeval *tv_finish, struct thr_info*thr, int read_count)
+static int icarus_gets(unsigned char *buf, int fd, struct timeval *tv_finish, struct thr_info *thr, int read_count)
 {
 {
 	ssize_t ret = 0;
 	ssize_t ret = 0;
 	int rc = 0;
 	int rc = 0;
@@ -444,6 +444,7 @@ static bool icarus_detect_one(const char *devpath)
 
 
 	memset(nonce_bin, 0, sizeof(nonce_bin));
 	memset(nonce_bin, 0, sizeof(nonce_bin));
 	struct thr_info dummy = {
 	struct thr_info dummy = {
+		.work_restart = false,
 		.work_restart_fd = -1,
 		.work_restart_fd = -1,
 	};
 	};
 	icarus_gets(nonce_bin, fd, &tv_finish, &dummy, 1);
 	icarus_gets(nonce_bin, fd, &tv_finish, &dummy, 1);

+ 7 - 12
miner.c

@@ -2537,8 +2537,7 @@ int restart_wait(unsigned int mstime)
 	
 	
 static void restart_threads(void)
 static void restart_threads(void)
 {
 {
-	int i, j, fd;
-	struct cgpu_info *cgpu;
+	int i, fd;
 	struct thr_info *thr;
 	struct thr_info *thr;
 
 
 	/* Discard staged work that is now stale */
 	/* Discard staged work that is now stale */
@@ -2546,17 +2545,13 @@ static void restart_threads(void)
 
 
 	queue_request(NULL, true);
 	queue_request(NULL, true);
 
 
-	for (i = 0; i < total_devices; ++i)
+	for (i = 0; i < mining_threads; i++)
 	{
 	{
-		cgpu = devices[i];
-		for (j = 0; j < cgpu->threads; ++j)
-		{
-			thr = cgpu->thr[j];
-			fd = thr->_work_restart_fd_w;
-			thr->work_restart = true;
-			if (fd != -1)
-				write(fd, "\0", 1);
-		}
+		thr = &thr_info[i];
+		fd = thr->_work_restart_fd_w;
+		thr->work_restart = true;
+		if (fd != -1)
+			write(fd, "\0", 1);
 	}
 	}
 
 
 	mutex_lock(&restart_lock);
 	mutex_lock(&restart_lock);