|
|
@@ -26,6 +26,8 @@
|
|
|
|
|
|
#include <unistd.h>
|
|
|
#include <sha2.h>
|
|
|
+
|
|
|
+#include "fpgautils.h"
|
|
|
#include "miner.h"
|
|
|
#include "libztex.h"
|
|
|
|
|
|
@@ -54,11 +56,12 @@ static void ztex_releaseFpga(struct libztex_device* ztex)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static void ztex_detect(void)
|
|
|
+static int ztex_autodetect(void)
|
|
|
{
|
|
|
int cnt;
|
|
|
int i,j;
|
|
|
int fpgacount;
|
|
|
+ int totaldevs = 0;
|
|
|
struct libztex_dev_list **ztex_devices;
|
|
|
struct libztex_device *ztex_slave;
|
|
|
struct cgpu_info *ztex;
|
|
|
@@ -79,6 +82,7 @@ static void ztex_detect(void)
|
|
|
applog(LOG_INFO, "%s %u: Found Ztex (ZTEX %s-%u)", ztex->api->name, ztex->device_id, ztex->device_ztex->snString, 1);
|
|
|
|
|
|
fpgacount = libztex_numberOfFpgas(ztex->device_ztex);
|
|
|
+ totaldevs += fpgacount;
|
|
|
|
|
|
if (fpgacount > 1)
|
|
|
pthread_mutex_init(&ztex->device_ztex->mutex, NULL);
|
|
|
@@ -100,6 +104,14 @@ static void ztex_detect(void)
|
|
|
|
|
|
if (cnt > 0)
|
|
|
libztex_freeDevList(ztex_devices);
|
|
|
+
|
|
|
+ return totaldevs;
|
|
|
+}
|
|
|
+
|
|
|
+static void ztex_detect()
|
|
|
+{
|
|
|
+ // This wrapper ensures users can specify -S ztex:noauto to disable it
|
|
|
+ noserial_detect(ztex_api.dname, ztex_autodetect);
|
|
|
}
|
|
|
|
|
|
static bool ztex_updateFreq(struct libztex_device* ztex)
|