Rename bitfury_getinfo to bf1_getinfo since it's unique to bf1 devices.
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57
diff --git a/driver-bitfury.c b/driver-bitfury.c
index b38d47e..64e42b7 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -65,7 +65,7 @@ static void bitfury_identify(struct cgpu_info *bitfury)
usb_write(bitfury, "L", 1, &amount, C_BF1_IDENTIFY);
}
-static bool bitfury_getinfo(struct cgpu_info *bitfury, struct bitfury_info *info)
+static bool bf1_getinfo(struct cgpu_info *bitfury, struct bitfury_info *info)
{
int amount, err;
char buf[16];
@@ -151,7 +151,7 @@ static bool bf1_detect_one(struct cgpu_info *bitfury, struct bitfury_info *info)
goto out_close;
/* Send getinfo request */
- if (!bitfury_getinfo(bitfury, info))
+ if (!bf1_getinfo(bitfury, info))
goto out_close;
/* Send reset request */
@@ -264,10 +264,9 @@ static bool bitfury_checkresults(struct thr_info *thr, struct work *work, uint32
return false;
}
-static int64_t bitfury_scanwork(struct thr_info *thr)
+static int64_t bf1_scan(struct thr_info *thr, struct cgpu_info *bitfury,
+ struct bitfury_info *info)
{
- struct cgpu_info *bitfury = thr->cgpu;
- struct bitfury_info *info = bitfury->device_data;
int amount, i, aged = 0, total = 0, ms_diff;
struct work *work, *tmp;
struct timeval tv_now;
@@ -386,6 +385,21 @@ out:
return ret;
}
+static int64_t bitfury_scanwork(struct thr_info *thr)
+{
+ struct cgpu_info *bitfury = thr->cgpu;
+ struct bitfury_info *info = bitfury->device_data;
+
+ switch(info->ident) {
+ case IDENT_BF1:
+ return bf1_scan(thr, bitfury, info);
+ break;
+ case IDENT_BXF:
+ default:
+ return 0;
+ }
+}
+
static struct api_data *bitfury_api_stats(struct cgpu_info *cgpu)
{
struct bitfury_info *info = cgpu->device_data;