Provide basic structure for a hashfast driver.
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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
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,