Commit 78932aa1ede6001cf038296cc10630a3d6259e50

Con Kolivas 2013-09-19T10:38:08

Provide basic structure for a hashfast driver.

diff --git a/driver-hashfast.c b/driver-hashfast.c
index 0b02396..027a131 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -9,4 +9,59 @@
  */
 
 #include "config.h"
+
+#include <stdbool.h>
+
+#include "usbutils.h"
+#include "fpgautils.h"
+
 #include "driver-hashfast.h"
+
+static hf_info_t **hashfast_infos;
+struct device_drv hashfast_drv;
+
+static void hashfast_detect(void)
+{
+}
+
+static bool hashfast_prepare(struct thr_info __maybe_unused *thr)
+{
+	return true;
+}
+
+static bool hashfast_fill(struct cgpu_info __maybe_unused *hashfast)
+{
+	return true;
+}
+
+static int64_t hashfast_scanhash(struct thr_info __maybe_unused *thr)
+{
+	return 0;
+}
+
+static struct api_data *hashfast_api_stats(struct cgpu_info __maybe_unused *cgpu)
+{
+	return NULL;
+}
+
+static void hashfast_init(struct cgpu_info __maybe_unused *hashfast)
+{
+}
+
+static void hashfast_shutdown(struct thr_info __maybe_unused *thr)
+{
+}
+
+struct device_drv hashfast_drv = {
+	.drv_id = DRIVER_HASHFAST,
+	.dname = "Hashfast",
+	.name = "HFA",
+	.drv_detect = hashfast_detect,
+	.thread_prepare = hashfast_prepare,
+	.hash_work = hash_queued_work,
+	.queue_full = hashfast_fill,
+	.scanwork = hashfast_scanhash,
+	.get_api_stats = hashfast_api_stats,
+	.reinit_device = hashfast_init,
+	.thread_shutdown = hashfast_shutdown,
+};
diff --git a/miner.h b/miner.h
index 2f5fc66..850e633 100644
--- a/miner.h
+++ b/miner.h
@@ -228,6 +228,7 @@ enum drv_driver {
 	DRIVER_ZTEX,
 	DRIVER_BFLSC,
 	DRIVER_AVALON,
+	DRIVER_HASHFAST,
 	DRIVER_MAX
 };
 
diff --git a/usbutils.c b/usbutils.c
index 9aec4d2..194220b 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -50,6 +50,10 @@
 #define DRV_AVALON 6
 #endif
 
+#ifdef USE_HASHFAST
+#define DRV_HASHFAST 7
+#endif
+
 #define DRV_LAST -1
 
 #define USB_CONFIG 1
@@ -219,6 +223,13 @@ static struct usb_find_devices find_dev[] = {
 		.epcount = ARRAY_SIZE(ava_eps),
 		.eps = ava_eps },
 #endif
+#ifdef USE_HASHFAST
+	{
+		.drv = DRV_HASHFAST,
+		.name = "HFA",
+		.ident = IDENT_HFA,
+	},
+#endif
 #ifdef USE_ICARUS
 	{
 		.drv = DRV_ICARUS,
diff --git a/usbutils.h b/usbutils.h
index 4894a9d..9124d07 100644
--- a/usbutils.h
+++ b/usbutils.h
@@ -131,6 +131,7 @@ enum sub_ident {
 	IDENT_MMQ,
 	IDENT_AVA,
 	IDENT_BTB,
+	IDENT_HFA,
 	IDENT_ICA,
 	IDENT_AMU,
 	IDENT_BLT,