Separate out the bf1 reset from bitfury reset.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
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);