Browse Source

Provide basic structure for a hashfast driver.

nfactor-troky
Con Kolivas 11 years ago
parent
commit
78932aa1ed
  1. 55
      driver-hashfast.c
  2. 1
      miner.h
  3. 11
      usbutils.c
  4. 1
      usbutils.h

55
driver-hashfast.c

@ -9,4 +9,59 @@ @@ -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,
};

1
miner.h

@ -228,6 +228,7 @@ enum drv_driver { @@ -228,6 +228,7 @@ enum drv_driver {
DRIVER_ZTEX,
DRIVER_BFLSC,
DRIVER_AVALON,
DRIVER_HASHFAST,
DRIVER_MAX
};

11
usbutils.c

@ -50,6 +50,10 @@ @@ -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[] = { @@ -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,

1
usbutils.h

@ -131,6 +131,7 @@ enum sub_ident { @@ -131,6 +131,7 @@ enum sub_ident {
IDENT_MMQ,
IDENT_AVA,
IDENT_BTB,
IDENT_HFA,
IDENT_ICA,
IDENT_AMU,
IDENT_BLT,

Loading…
Cancel
Save