From 4fb802fc58debc5e1c8ead2b2a9700b1723a8716 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 24 Sep 2013 23:30:01 +1000 Subject: [PATCH] Provide a bitfury identify function for bf1. --- driver-bitfury.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/driver-bitfury.c b/driver-bitfury.c index 81c3ef0a..c039e7a1 100644 --- a/driver-bitfury.c +++ b/driver-bitfury.c @@ -36,6 +36,13 @@ static void bitfury_empty_buffer(struct cgpu_info *bitfury) } while (amount); } +static void bitfury_identify(struct cgpu_info *bitfury) +{ + int amount; + + usb_write(bitfury, "L", 1, &amount, C_PING); +} + static bool bitfury_detect_one(struct libusb_device *dev, struct usb_find_devices *found) { struct cgpu_info *bitfury; @@ -91,6 +98,8 @@ static bool bitfury_detect_one(struct libusb_device *dev, struct usb_find_device bitfury->device_id, buf); bitfury_empty_buffer(bitfury); + bitfury_identify(bitfury); + bitfury_empty_buffer(bitfury); //return true; out_close: bitfury_close(bitfury); @@ -157,5 +166,6 @@ struct device_drv bitfury_drv = { .get_api_stats = bitfury_api_stats, .get_statline_before = get_bitfury_statline_before, .reinit_device = bitfury_init, - .thread_shutdown = bitfury_shutdown + .thread_shutdown = bitfury_shutdown, + .identify_device = bitfury_identify };