Commit 1d0d9fbacc74f787e977315876c4d7fe1b453d9e

Con Kolivas 2013-11-14T11:11:01

Separate out the bf1 reset from bitfury reset.

diff --git a/driver-bitfury.c b/driver-bitfury.c
index 221f8ae..b38d47e 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -97,7 +97,7 @@ static bool bitfury_getinfo(struct cgpu_info *bitfury, struct bitfury_info *info
 	return true;
 }
 
-static bool bitfury_reset(struct cgpu_info *bitfury)
+static bool bf1_reset(struct cgpu_info *bitfury)
 {
 	int amount, err;
 	char buf[16];
@@ -126,6 +126,20 @@ static bool bitfury_reset(struct cgpu_info *bitfury)
 	return true;
 }
 
+static bool bitfury_reset(struct cgpu_info *bitfury)
+{
+	struct bitfury_info *info = bitfury->device_data;
+
+	switch(info->ident) {
+		case IDENT_BF1:
+			return bf1_reset(bitfury);
+			break;
+		case IDENT_BXF:
+		default:
+			return true;
+	}
+}
+
 static bool bxf_detect_one(struct cgpu_info *bitfury, struct bitfury_info *info)
 {
 	return false;
@@ -141,7 +155,7 @@ static bool bf1_detect_one(struct cgpu_info *bitfury, struct bitfury_info *info)
 		goto out_close;
 
 	/* Send reset request */
-	if (!bitfury_reset(bitfury))
+	if (!bf1_reset(bitfury))
 		goto out_close;
 
 	bitfury_identify(bitfury);