Skip to content

Commit

Permalink
Add basic definitions for hashfast device recognition.
Browse files Browse the repository at this point in the history
  • Loading branch information
ckolivas committed Oct 13, 2013
1 parent df6873e commit 176cae2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions 01-cgminer.rules
Expand Up @@ -27,3 +27,6 @@ ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204b", SUBSYSTEMS=="usb", ACTION=="a

#Klondike
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f60a", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

#HashFast
ATTRS{idVendor}=="297c", ATTRS{idProduct}=="0001", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev", ENV{ID_MM_DEVICE_IGNORE}="1"
31 changes: 30 additions & 1 deletion usbutils.c
Expand Up @@ -67,6 +67,7 @@
#define AVALON_TIMEOUT_MS 999
#define KLONDIKE_TIMEOUT_MS 999
#define ICARUS_TIMEOUT_MS 999
#define HASHFAST_TIMEOUT_MS 999
#else
#define BFLSC_TIMEOUT_MS 300
#define BITFORCE_TIMEOUT_MS 200
Expand All @@ -75,6 +76,7 @@
#define AVALON_TIMEOUT_MS 200
#define KLONDIKE_TIMEOUT_MS 200
#define ICARUS_TIMEOUT_MS 200
#define HASHFAST_TIMEOUT_MS 200
#endif

#define USB_READ_MINPOLL 40
Expand Down Expand Up @@ -134,6 +136,25 @@ static struct usb_intinfo bfu_ints[] = {
};
#endif

#ifdef USE_HASHFAST
#include "driver-hashfast.h"

static struct usb_epinfo hfa0_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_INTERRUPT, 8, EPI(3), 0, 0, 0 }
};

static struct usb_epinfo hfa1_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 }
};

/* Default to interface 1 */
static struct usb_intinfo hfa_ints[] = {
USB_EPS(1, hfa1_epinfos),
USB_EPS(0, hfa0_epinfos)
};
#endif

#ifdef USE_MODMINER
static struct usb_epinfo mmq_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0, 0 },
Expand Down Expand Up @@ -325,7 +346,14 @@ static struct usb_find_devices find_dev[] = {
.drv = DRIVER_hashfast,
.name = "HFA",
.ident = IDENT_HFA,
},
.idVendor = HF_USB_VENDOR_ID,
.idProduct = HF_USB_PRODUCT_ID_G1,
.iManufacturer = "HashFast LLC",
.iProduct = "M1 Module",
.config = 1,
.timeout = HASHFAST_TIMEOUT_MS,
.latency = LATENCY_UNUSED,
INTINFO(hfa_ints) },
#endif
#ifdef USE_KLONDIKE
{
Expand Down Expand Up @@ -3191,6 +3219,7 @@ void usb_cleanup(void)
case DRIVER_icarus:
case DRIVER_avalon:
case DRIVER_klondike:
case DRIVER_hashfast:
DEVWLOCK(cgpu, pstate);
release_cgpu(cgpu);
DEVWUNLOCK(cgpu, pstate);
Expand Down

0 comments on commit 176cae2

Please sign in to comment.