Browse Source

dualminer: Simplify teardown

Nate Woolls 12 years ago
parent
commit
432c0f9313
3 changed files with 2 additions and 97 deletions
  1. 2 5
      driver-dualminer.c
  2. 0 86
      gc3355.c
  3. 0 6
      gc3355.h

+ 2 - 5
driver-dualminer.c

@@ -93,11 +93,8 @@ void dualminer_bootstrap_device(int fd)
 static
 void dualminer_teardown_device(int fd)
 {
-	if (opt_scrypt)
-		gc3355_open_scrypt_unit(fd, SCRYPT_UNIT_CLOSE);
-	else
-		gc3355_open_sha2_unit(fd, "0");
-
+	// set data terminal ready (DTR) status
+	set_serial_dtr(fd, BGV_HIGH);
 	// set request to send (RTS) status
 	set_serial_rts(fd, BGV_LOW);
 }

+ 0 - 86
gc3355.c

@@ -369,61 +369,6 @@ void gc3355_set_pll_freq(int fd, int pll_freq)
 	gc3355_write(fd, buf, sizeof(buf));
 }
 
-
-void gc3355_open_sha2_unit(int fd, char *opt_sha2_gating)
-{
-	unsigned char ob_bin[8];
-	int i;
-
-	//---sha2 unit---
-	char sha2_gating[5][17] =
-	{
-		"55AAEF0200000000",
-		"55AAEF0300000000",
-		"55AAEF0400000000",
-		"55AAEF0500000000",
-		"55AAEF0600000000",
-	};
-	union
-	{
-	    unsigned int i32[5];
-	    unsigned char c8[20] ;
-	}sha2_group;
-
-	int sha2_number=0;
-	if (opt_sha2_gating== NULL)
-	    sha2_number = 70;
-	else
-	{
-	    if (atoi(opt_sha2_gating) <= 160 && atoi(opt_sha2_gating) >= 0)
-			sha2_number = atoi(opt_sha2_gating);
-		else
-			sha2_number = 70;
-	}
-
-	for(i = 0; i < 5; i++)
-		sha2_group.i32[i] = 0;
-
-	for(i = 0; i < sha2_number; i++)
-		sha2_group.i32[i / 32] += 1 << ( i % 32);
-
-	for(i = 0; i < 20; i++)
-		sprintf(&sha2_gating[i / 4][8 + (i % 4) * 2], "%02x", sha2_group.c8[i]);
-	//---sha2 unit end---
-
-	for(i = 0; i < 5; i++)
-	{
-		if (sha2_gating[i][0] == '\0')
-			break;
-
-		hex2bin(ob_bin, sha2_gating[i], sizeof(ob_bin));
-		icarus_write(fd, ob_bin, 8);
-		cgsleep_ms(GC3355_COMMAND_DELAY_MS);
-	}
-
-	opt_sha2_number = sha2_number;
-}
-
 static
 void gc3355_open_sha2_units(int fd, int sha2_units)
 {
@@ -455,37 +400,6 @@ void gc3355_opt_scrypt_only_init(int fd)
 	gc3355_set_pll_freq(fd, opt_pll_freq);
 }
 
-
-void gc3355_open_scrypt_unit(int fd, int status)
-{
-	const char *scrypt_only_ob[] =
-	{
-		"55AA1F2810000000",
-		NULL
-	};
-
-	const char *scrypt_ob[] =
-	{
-		"55AA1F2814000000",
-		NULL
-	};
-
-	if (status == SCRYPT_UNIT_OPEN)
-	{
-		if (opt_dual_mode)
-			gc3355_scrypt_only_reset(fd);
-		else
-			gc3355_opt_scrypt_only_init(fd);
-	}
-	else
-	{
-		if (opt_dual_mode)
-			gc3355_send_cmds(fd, scrypt_ob);
-		else
-			gc3355_send_cmds(fd, scrypt_only_ob);
-	}
-}
-
 void gc3355_dualminer_init(int fd)
 {
 

+ 0 - 6
gc3355.h

@@ -56,12 +56,6 @@ void gc3355_scrypt_only_reset(int fd);
 extern
 void gc3355_init(int fd, int sha2_units, bool is_scrypt_only);
 
-extern
-void gc3355_open_sha2_unit(int fd, char *opt_sha2_gating);
-
-extern
-void gc3355_open_scrypt_unit(int fd, int status);
-
 extern void gc3355_scrypt_prepare_work(unsigned char cmd[156], struct work *);
 extern void gc3355_sha2_prepare_work(unsigned char cmd[52], struct work *, bool simple);