Add API support for Avalon.
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
diff --git a/api.c b/api.c
index a2c7058..24dcb58 100644
--- a/api.c
+++ b/api.c
@@ -29,7 +29,7 @@
#include "util.h"
#include "driver-cpu.h" /* for algo_names[], TODO: re-factor dependency */
-#if defined(USE_BFLSC)
+#if defined(USE_BFLSC) || defined(USE_AVALON)
#define HAVE_AN_ASIC 1
#endif
@@ -179,6 +179,9 @@ static const char *DEVICECODE = ""
#ifdef USE_ICARUS
"ICA "
#endif
+#ifdef USE_AVALON
+ "AVA "
+#endif
#ifdef USE_ZTEX
"ZTX "
#endif
@@ -605,9 +608,6 @@ struct CODES {
static int my_thr_id = 0;
static bool bye;
-#if defined(HAVE_OPENCL) || defined (HAVE_AN_ASIC) || defined(HAVE_AN_FPGA)
-static bool ping = true;
-#endif
// Used to control quit restart access to shutdown variables
static pthread_mutex_t quit_restart_lock;
@@ -1178,6 +1178,10 @@ static int numascs()
rd_lock(&devices_lock);
for (i = 0; i < total_devices; i++) {
+#ifdef USE_AVALON
+ if (devices[i]->drv->drv_id == DRIVER_AVALON)
+ count++;
+#endif
#ifdef USE_BFLSC
if (devices[i]->drv->drv_id == DRIVER_BFLSC)
count++;
@@ -1194,6 +1198,10 @@ static int ascdevice(int ascid)
rd_lock(&devices_lock);
for (i = 0; i < total_devices; i++) {
+#ifdef USE_AVALON
+ if (devices[i]->drv->drv_id == DRIVER_AVALON)
+ count++;
+#endif
#ifdef USE_BFLSC
if (devices[i]->drv->drv_id == DRIVER_BFLSC)
count++;
diff --git a/miner.h b/miner.h
index 7f56582..9aa8741 100644
--- a/miner.h
+++ b/miner.h
@@ -805,6 +805,7 @@ extern bool opt_usb_list_all;
#ifdef USE_BITFORCE
extern bool opt_bfl_noncerange;
#endif
+extern bool ping;
extern int swork_id;
extern pthread_rwlock_t netacc_lock;