Browse Source

Merge branch 'icarushit'

nfactor-troky
Con Kolivas 11 years ago
parent
commit
38164d637d
  1. 2
      driver-avalon.c
  2. 1
      driver-avalon.h
  3. 2
      driver-bflsc.c
  4. 2
      driver-bitfury.c
  5. 2
      driver-hashfast.c
  6. 12
      driver-icarus.c
  7. 388
      usbutils.c
  8. 15
      usbutils.h

2
driver-avalon.c

@ -780,8 +780,6 @@ static bool avalon_detect_one(libusb_device *dev, struct usb_find_devices *found
/* Even though this is an FTDI type chip, we want to do the parsing /* Even though this is an FTDI type chip, we want to do the parsing
* all ourselves so set it to std usb type */ * all ourselves so set it to std usb type */
avalon->usbdev->usb_type = USB_TYPE_STD; avalon->usbdev->usb_type = USB_TYPE_STD;
usb_set_pps(avalon, AVALON_USB_PACKETSIZE);
usb_buffer_enable(avalon);
/* We have a real Avalon! */ /* We have a real Avalon! */
avalon_initialise(avalon); avalon_initialise(avalon);

1
driver-avalon.h

@ -64,7 +64,6 @@
#define AVALON_AUTO_CYCLE 1024 #define AVALON_AUTO_CYCLE 1024
#define AVALON_FTDI_READSIZE 510 #define AVALON_FTDI_READSIZE 510
#define AVALON_USB_PACKETSIZE 512
#define AVALON_READBUF_SIZE 8192 #define AVALON_READBUF_SIZE 8192
#define AVALON_RESET_TIMEOUT 100 #define AVALON_RESET_TIMEOUT 100
#define AVALON_READ_TIMEOUT 18 /* Enough to only half fill the buffer */ #define AVALON_READ_TIMEOUT 18 /* Enough to only half fill the buffer */

2
driver-bflsc.c

@ -888,8 +888,6 @@ reinit:
mutex_init(&bflsc->device_mutex); mutex_init(&bflsc->device_mutex);
rwlock_init(&sc_info->stat_lock); rwlock_init(&sc_info->stat_lock);
usb_buffer_enable(bflsc);
return true; return true;
unshin: unshin:

2
driver-bitfury.c

@ -146,8 +146,6 @@ static bool bitfury_detect_one(struct libusb_device *dev, struct usb_find_device
* hashrate to adapt quickly on starting. */ * hashrate to adapt quickly on starting. */
info->total_nonces = 1; info->total_nonces = 1;
usb_buffer_enable(bitfury);
if (!bitfury_open(bitfury)) if (!bitfury_open(bitfury))
goto out_close; goto out_close;

2
driver-hashfast.c

@ -347,7 +347,6 @@ static bool hfa_initialise(struct cgpu_info *hashfast)
if (hashfast->usbinfo.nodev) if (hashfast->usbinfo.nodev)
return false; return false;
usb_buffer_enable(hashfast);
hfa_clear_readbuf(hashfast); hfa_clear_readbuf(hashfast);
err = usb_transfer(hashfast, 0, 9, 1, 0, C_ATMEL_RESET); err = usb_transfer(hashfast, 0, 9, 1, 0, C_ATMEL_RESET);
@ -916,7 +915,6 @@ static void hfa_shutdown(struct thr_info *thr)
pthread_join(info->read_thr, NULL); pthread_join(info->read_thr, NULL);
hfa_free_all_work(info); hfa_free_all_work(info);
hfa_clear_readbuf(hashfast); hfa_clear_readbuf(hashfast);
usb_buffer_disable(hashfast);
free(info->works); free(info->works);
free(info->die_statistics); free(info->die_statistics);
free(info->die_status); free(info->die_status);

12
driver-icarus.c

@ -55,10 +55,6 @@
// The size of a successful nonce read // The size of a successful nonce read
#define ICARUS_READ_SIZE 4 #define ICARUS_READ_SIZE 4
#define AMU_PREF_PACKET 256
#define BLT_PREF_PACKET 512
#define ICA_PREF_PACKET 256
// Ensure the sizes are correct for the Serial read // Ensure the sizes are correct for the Serial read
#if (ICARUS_READ_SIZE != 4) #if (ICARUS_READ_SIZE != 4)
#error ICARUS_READ_SIZE must be 4 #error ICARUS_READ_SIZE must be 4
@ -329,8 +325,6 @@ static void icarus_initialise(struct cgpu_info *icarus, int baud)
case IDENT_LLT: case IDENT_LLT:
case IDENT_CMR1: case IDENT_CMR1:
case IDENT_CMR2: case IDENT_CMR2:
usb_set_pps(icarus, BLT_PREF_PACKET);
// Reset // Reset
transfer(icarus, FTDI_TYPE_OUT, FTDI_REQUEST_RESET, FTDI_VALUE_RESET, transfer(icarus, FTDI_TYPE_OUT, FTDI_REQUEST_RESET, FTDI_VALUE_RESET,
interface, C_RESET); interface, C_RESET);
@ -404,8 +398,6 @@ static void icarus_initialise(struct cgpu_info *icarus, int baud)
interface, C_PURGERX); interface, C_PURGERX);
break; break;
case IDENT_ICA: case IDENT_ICA:
usb_set_pps(icarus, ICA_PREF_PACKET);
// Set Data Control // Set Data Control
transfer(icarus, PL2303_CTRL_OUT, PL2303_REQUEST_CTRL, PL2303_VALUE_CTRL, transfer(icarus, PL2303_CTRL_OUT, PL2303_REQUEST_CTRL, PL2303_VALUE_CTRL,
interface, C_SETDATA); interface, C_SETDATA);
@ -426,8 +418,6 @@ static void icarus_initialise(struct cgpu_info *icarus, int baud)
interface, C_VENDOR); interface, C_VENDOR);
break; break;
case IDENT_AMU: case IDENT_AMU:
usb_set_pps(icarus, AMU_PREF_PACKET);
// Enable the UART // Enable the UART
transfer(icarus, CP210X_TYPE_OUT, CP210X_REQUEST_IFC_ENABLE, transfer(icarus, CP210X_TYPE_OUT, CP210X_REQUEST_IFC_ENABLE,
CP210X_VALUE_UART_ENABLE, CP210X_VALUE_UART_ENABLE,
@ -832,8 +822,6 @@ static bool icarus_detect_one(struct libusb_device *dev, struct usb_find_devices
if (!usb_init(icarus, dev, found)) if (!usb_init(icarus, dev, found))
goto shin; goto shin;
usb_buffer_enable(icarus);
get_options(this_option_offset, icarus, &baud, &work_division, &fpga_count); get_options(this_option_offset, icarus, &baud, &work_division, &fpga_count);
hex2bin((void *)(&workdata), golden_ob, sizeof(workdata)); hex2bin((void *)(&workdata), golden_ob, sizeof(workdata));

388
usbutils.c

@ -103,8 +103,8 @@ static struct list_head ut_list;
#ifdef USE_BFLSC #ifdef USE_BFLSC
// N.B. transfer size is 512 with USB2.0, but only 64 with USB1.1 // N.B. transfer size is 512 with USB2.0, but only 64 with USB1.1
static struct usb_epinfo bas_epinfos[] = { static struct usb_epinfo bas_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
}; };
static struct usb_intinfo bas_ints[] = { static struct usb_intinfo bas_ints[] = {
@ -115,8 +115,8 @@ static struct usb_intinfo bas_ints[] = {
#ifdef USE_BITFORCE #ifdef USE_BITFORCE
// N.B. transfer size is 512 with USB2.0, but only 64 with USB1.1 // N.B. transfer size is 512 with USB2.0, but only 64 with USB1.1
static struct usb_epinfo bfl_epinfos[] = { static struct usb_epinfo bfl_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
}; };
static struct usb_intinfo bfl_ints[] = { static struct usb_intinfo bfl_ints[] = {
@ -126,12 +126,12 @@ static struct usb_intinfo bfl_ints[] = {
#ifdef USE_BITFURY #ifdef USE_BITFURY
static struct usb_epinfo bfu0_epinfos[] = { static struct usb_epinfo bfu0_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_INTERRUPT, 8, EPI(2), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_INTERRUPT, 8, EPI(2), 0, 0 }
}; };
static struct usb_epinfo bfu1_epinfos[] = { static struct usb_epinfo bfu1_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 16, EPI(3), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 16, EPI(3), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 16, EPO(4), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 16, EPO(4), 0, 0 }
}; };
/* Default to interface 1 */ /* Default to interface 1 */
@ -145,12 +145,12 @@ static struct usb_intinfo bfu_ints[] = {
#include "driver-hashfast.h" #include "driver-hashfast.h"
static struct usb_epinfo hfa0_epinfos[] = { static struct usb_epinfo hfa0_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_INTERRUPT, 8, EPI(3), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_INTERRUPT, 8, EPI(3), 0, 0 }
}; };
static struct usb_epinfo hfa1_epinfos[] = { static struct usb_epinfo hfa1_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
}; };
/* Default to interface 1 */ /* Default to interface 1 */
@ -162,8 +162,8 @@ static struct usb_intinfo hfa_ints[] = {
#ifdef USE_MODMINER #ifdef USE_MODMINER
static struct usb_epinfo mmq_epinfos[] = { static struct usb_epinfo mmq_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(3), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(3), 0, 0 }
}; };
static struct usb_intinfo mmq_ints[] = { static struct usb_intinfo mmq_ints[] = {
@ -173,8 +173,8 @@ static struct usb_intinfo mmq_ints[] = {
#ifdef USE_AVALON #ifdef USE_AVALON
static struct usb_epinfo ava_epinfos[] = { static struct usb_epinfo ava_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
}; };
static struct usb_intinfo ava_ints[] = { static struct usb_intinfo ava_ints[] = {
@ -184,8 +184,8 @@ static struct usb_intinfo ava_ints[] = {
#ifdef USE_KLONDIKE #ifdef USE_KLONDIKE
static struct usb_epinfo kln_epinfos[] = { static struct usb_epinfo kln_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(1), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(1), 0, 0 }
}; };
static struct usb_intinfo kln_ints[] = { static struct usb_intinfo kln_ints[] = {
@ -195,8 +195,8 @@ static struct usb_intinfo kln_ints[] = {
#ifdef USE_ICARUS #ifdef USE_ICARUS
static struct usb_epinfo ica_epinfos[] = { static struct usb_epinfo ica_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
}; };
static struct usb_intinfo ica_ints[] = { static struct usb_intinfo ica_ints[] = {
@ -204,8 +204,8 @@ static struct usb_intinfo ica_ints[] = {
}; };
static struct usb_epinfo amu_epinfos[] = { static struct usb_epinfo amu_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(1), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(1), 0, 0 }
}; };
static struct usb_intinfo amu_ints[] = { static struct usb_intinfo amu_ints[] = {
@ -213,8 +213,8 @@ static struct usb_intinfo amu_ints[] = {
}; };
static struct usb_epinfo llt_epinfos[] = { static struct usb_epinfo llt_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
}; };
static struct usb_intinfo llt_ints[] = { static struct usb_intinfo llt_ints[] = {
@ -222,8 +222,8 @@ static struct usb_intinfo llt_ints[] = {
}; };
static struct usb_epinfo cmr1_epinfos[] = { static struct usb_epinfo cmr1_epinfos[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
}; };
static struct usb_intinfo cmr1_ints[] = { static struct usb_intinfo cmr1_ints[] = {
@ -231,20 +231,20 @@ static struct usb_intinfo cmr1_ints[] = {
}; };
static struct usb_epinfo cmr2_epinfos0[] = { static struct usb_epinfo cmr2_epinfos0[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
}; };
static struct usb_epinfo cmr2_epinfos1[] = { static struct usb_epinfo cmr2_epinfos1[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(4), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(4), 0, 0 },
}; };
static struct usb_epinfo cmr2_epinfos2[] = { static struct usb_epinfo cmr2_epinfos2[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(5), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(5), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(6), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(6), 0, 0 },
}; };
static struct usb_epinfo cmr2_epinfos3[] = { static struct usb_epinfo cmr2_epinfos3[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(7), 0, 0, 0 }, { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(7), 0, 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(8), 0, 0, 0 } { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(8), 0, 0 }
}; };
static struct usb_intinfo cmr2_ints[] = { static struct usb_intinfo cmr2_ints[] = {
@ -466,6 +466,15 @@ static const char *nodatareturned = "no data returned ";
cgpu->usbinfo.continuous_ioerr_count = 0; \ cgpu->usbinfo.continuous_ioerr_count = 0; \
} }
/* Timeout errors on writes are unusual and should be treated as IO errors. */
#define WRITEIOERR_CHECK(cgpu, err) \
if (err == LIBUSB_ERROR_IO || err == LIBUSB_ERROR_TIMEOUT) { \
cgpu->usbinfo.ioerr_count++; \
cgpu->usbinfo.continuous_ioerr_count++; \
} else { \
cgpu->usbinfo.continuous_ioerr_count = 0; \
}
#if 0 // enable USBDEBUG - only during development testing #if 0 // enable USBDEBUG - only during development testing
static const char *debug_true_str = "true"; static const char *debug_true_str = "true";
static const char *debug_false_str = "false"; static const char *debug_false_str = "false";
@ -1300,9 +1309,6 @@ static struct cg_usb_device *free_cgusb(struct cg_usb_device *cgusb)
free(cgusb->found); free(cgusb->found);
if (cgusb->buffer)
free(cgusb->buffer);
free(cgusb); free(cgusb);
return NULL; return NULL;
@ -2332,6 +2338,9 @@ static void LIBUSB_CALL transfer_callback(struct libusb_transfer *transfer)
static int usb_transfer_toerr(int ret) static int usb_transfer_toerr(int ret)
{ {
if (ret <= 0)
return ret;
switch (ret) { switch (ret) {
default: default:
case LIBUSB_TRANSFER_COMPLETED: case LIBUSB_TRANSFER_COMPLETED:
@ -2405,15 +2414,24 @@ usb_bulk_transfer(struct libusb_device_handle *dev_handle, int intinfo,
struct cgpu_info *cgpu, __maybe_unused int mode, struct cgpu_info *cgpu, __maybe_unused int mode,
enum usb_cmds cmd, __maybe_unused int seq, bool cancellable) enum usb_cmds cmd, __maybe_unused int seq, bool cancellable)
{ {
int bulk_timeout, callback_timeout = timeout;
struct usb_epinfo *usb_epinfo; struct usb_epinfo *usb_epinfo;
struct usb_transfer ut; struct usb_transfer ut;
unsigned char endpoint; unsigned char endpoint;
uint16_t MaxPacketSize;
int err, errn; int err, errn;
#if DO_USB_STATS #if DO_USB_STATS
struct timeval tv_start, tv_finish; struct timeval tv_start, tv_finish;
#endif #endif
unsigned char buf[512]; unsigned char buf[512];
#ifdef WIN32
/* On windows the callback_timeout is a safety mechanism only. */
bulk_timeout = timeout;
callback_timeout += timeout + cgpu->usbdev->found->timeout;
#else
/* We give the transfer no timeout since we manage timeouts ourself on
* non windows. */
bulk_timeout = 0;
#endif
usb_epinfo = &(cgpu->usbdev->found->intinfos[intinfo].epinfos[epinfo]); usb_epinfo = &(cgpu->usbdev->found->intinfos[intinfo].epinfos[epinfo]);
endpoint = usb_epinfo->ep; endpoint = usb_epinfo->ep;
@ -2423,37 +2441,33 @@ usb_bulk_transfer(struct libusb_device_handle *dev_handle, int intinfo,
if (unlikely(cgpu->shutdown)) if (unlikely(cgpu->shutdown))
return libusb_bulk_transfer(dev_handle, endpoint, data, length, transferred, timeout); return libusb_bulk_transfer(dev_handle, endpoint, data, length, transferred, timeout);
/* Limit length of transfer to the largest this descriptor supports if (length > usb_epinfo->wMaxPacketSize)
* and leave the higher level functions to transfer more if needed. */ length = usb_epinfo->wMaxPacketSize;
if (usb_epinfo->PrefPacketSize)
MaxPacketSize = usb_epinfo->PrefPacketSize;
else
MaxPacketSize = usb_epinfo->wMaxPacketSize;
if (length > MaxPacketSize)
length = MaxPacketSize;
if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT) if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT)
memcpy(buf, data, length); memcpy(buf, data, length);
USBDEBUG("USB debug: @usb_bulk_transfer(%s (nodev=%s),intinfo=%d,epinfo=%d,data=%p,length=%d,timeout=%u,mode=%d,cmd=%s,seq=%d) endpoint=%d", cgpu->drv->name, bool_str(cgpu->usbinfo.nodev), intinfo, epinfo, data, length, timeout, mode, usb_cmdname(cmd), seq, (int)endpoint); USBDEBUG("USB debug: @usb_bulk_transfer(%s (nodev=%s),intinfo=%d,epinfo=%d,data=%p,length=%d,timeout=%u,mode=%d,cmd=%s,seq=%d) endpoint=%d", cgpu->drv->name, bool_str(cgpu->usbinfo.nodev), intinfo, epinfo, data, length, timeout, mode, usb_cmdname(cmd), seq, (int)endpoint);
init_usb_transfer(&ut); init_usb_transfer(&ut);
/* We give the transfer no timeout since we manage timeouts ourself */
libusb_fill_bulk_transfer(ut.transfer, dev_handle, endpoint, buf, length, libusb_fill_bulk_transfer(ut.transfer, dev_handle, endpoint, buf, length,
transfer_callback, &ut, 0); transfer_callback, &ut, bulk_timeout);
STATS_TIMEVAL(&tv_start); STATS_TIMEVAL(&tv_start);
err = usb_submit_transfer(&ut, ut.transfer, cancellable); err = usb_submit_transfer(&ut, ut.transfer, cancellable);
errn = errno; errn = errno;
if (!err) if (!err)
err = callback_wait(&ut, transferred, timeout); err = callback_wait(&ut, transferred, callback_timeout);
else
err = usb_transfer_toerr(err);
complete_usb_transfer(&ut); complete_usb_transfer(&ut);
STATS_TIMEVAL(&tv_finish); STATS_TIMEVAL(&tv_finish);
USB_STATS(cgpu, &tv_start, &tv_finish, err, mode, cmd, seq, timeout); USB_STATS(cgpu, &tv_start, &tv_finish, err, mode, cmd, seq, timeout);
if (err < 0) if (err < 0) {
applog(LOG_DEBUG, "%s%i: %s (amt=%d err=%d ern=%d)", applog(LOG_DEBUG, "%s%i: %s (amt=%d err=%d ern=%d)",
cgpu->drv->name, cgpu->device_id, cgpu->drv->name, cgpu->device_id,
usb_cmdname(cmd), *transferred, err, errn); usb_cmdname(cmd), *transferred, err, errn);
}
if (err == LIBUSB_ERROR_PIPE) { if (err == LIBUSB_ERROR_PIPE) {
int retries = 0; int retries = 0;
@ -2472,12 +2486,12 @@ usb_bulk_transfer(struct libusb_device_handle *dev_handle, int intinfo,
} while (err && ++retries < USB_RETRY_MAX); } while (err && ++retries < USB_RETRY_MAX);
} }
if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN) if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)
memcpy(data, buf, length); memcpy(data, buf, *transferred);
return err; return err;
} }
int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t bufsiz, int *processed, unsigned int timeout, const char *end, enum usb_cmds cmd, bool readonce, bool cancellable) int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t bufsiz, int *processed, int timeout, const char *end, enum usb_cmds cmd, bool readonce, bool cancellable)
{ {
struct cg_usb_device *usbdev; struct cg_usb_device *usbdev;
bool ftdi; bool ftdi;
@ -2486,10 +2500,11 @@ int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t
double max, done; double max, done;
int bufleft, err, got, tot, pstate; int bufleft, err, got, tot, pstate;
bool first = true; bool first = true;
bool dobuffer;
char *search; char *search;
int endlen; int endlen;
unsigned char *ptr, *usbbuf = cgpu->usbinfo.bulkbuf; unsigned char *ptr, *usbbuf = cgpu->usbinfo.bulkbuf;
size_t usbbufread; const size_t usbbufread = 512; /* Always read full size */
DEVRLOCK(cgpu, pstate); DEVRLOCK(cgpu, pstate);
@ -2514,50 +2529,20 @@ int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t
timeout = usbdev->found->timeout; timeout = usbdev->found->timeout;
if (end == NULL) { if (end == NULL) {
if (usbdev->buffer && usbdev->bufamt) { tot = usbdev->bufamt;
tot = usbdev->bufamt; bufleft = bufsiz - tot;
bufleft = bufsiz - tot; if (tot)
memcpy(usbbuf, usbdev->buffer, tot); memcpy(usbbuf, usbdev->buffer, tot);
ptr = usbbuf + tot; ptr = usbbuf + tot;
usbdev->bufamt = 0; usbdev->bufamt = 0;
} else {
tot = 0;
bufleft = bufsiz;
ptr = usbbuf;
}
err = LIBUSB_SUCCESS; err = LIBUSB_SUCCESS;
initial_timeout = timeout; initial_timeout = timeout;
max = ((double)timeout) / 1000.0; max = ((double)timeout) / 1000.0;
cgtime(&read_start); cgtime(&read_start);
while (bufleft > 0) { while (bufleft > 0) {
// TODO: use (USB_MAX_READ - tot) always?
if (usbdev->buffer)
usbbufread = USB_MAX_READ - tot;
else {
if (ftdi)
usbbufread = bufleft + 2;
else
usbbufread = bufleft;
}
got = 0; got = 0;
if (first && usbdev->usecps && usbdev->last_write_siz) {
cgtimer_t now, already_done;
double sleep_estimate;
double write_time = (double)(usbdev->last_write_siz) /
(double)(usbdev->cps) * 1000;
cgtimer_time(&now);
cgtimer_sub(&now, &usbdev->cgt_last_write, &already_done);
sleep_estimate = write_time - cgtimer_to_ms(&already_done);
if (sleep_estimate > 0.0) {
cgsleep_ms_r(&usbdev->cgt_last_write, write_time);
cgpu->usbinfo.read_delay_count++;
cgpu->usbinfo.total_read_delay += sleep_estimate;
}
}
err = usb_bulk_transfer(usbdev->handle, intinfo, epinfo, err = usb_bulk_transfer(usbdev->handle, intinfo, epinfo,
ptr, usbbufread, &got, timeout, ptr, usbbufread, &got, timeout,
cgpu, MODE_BULK_READ, cmd, first ? SEQ0 : SEQ1, cgpu, MODE_BULK_READ, cmd, first ? SEQ0 : SEQ1,
@ -2595,12 +2580,12 @@ int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t
if (unlikely(done >= max)) if (unlikely(done >= max))
break; break;
timeout = initial_timeout - (done * 1000); timeout = initial_timeout - (done * 1000);
if (!timeout) if (timeout <= 0)
break; break;
} }
// N.B. usbdev->buffer was emptied before the while() loop // N.B. usbdev->buffer was emptied before the while() loop
if (usbdev->buffer && tot > (int)bufsiz) { if (tot > (int)bufsiz) {
usbdev->bufamt = tot - bufsiz; usbdev->bufamt = tot - bufsiz;
memcpy(usbdev->buffer, usbbuf + bufsiz, usbdev->bufamt); memcpy(usbdev->buffer, usbbuf + bufsiz, usbdev->bufamt);
tot -= usbdev->bufamt; tot -= usbdev->bufamt;
@ -2615,50 +2600,21 @@ int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t
goto out_unlock; goto out_unlock;
} }
if (usbdev->buffer && usbdev->bufamt) { tot = usbdev->bufamt;
tot = usbdev->bufamt; bufleft = bufsiz - tot;
bufleft = bufsiz - tot; if (tot)
memcpy(usbbuf, usbdev->buffer, tot); memcpy(usbbuf, usbdev->buffer, tot);
ptr = usbbuf + tot; ptr = usbbuf + tot;
usbdev->bufamt = 0; usbdev->bufamt = 0;
} else {
tot = 0;
bufleft = bufsiz;
ptr = usbbuf;
}
endlen = strlen(end); endlen = strlen(end);
err = LIBUSB_SUCCESS; err = LIBUSB_SUCCESS;
initial_timeout = timeout; initial_timeout = timeout;
max = ((double)timeout) / 1000.0; max = ((double)timeout) / 1000.0;
cgtime(&read_start); cgtime(&read_start);
while (bufleft > 0) { while (bufleft > 0) {
// TODO: use (USB_MAX_READ - tot) always?
if (usbdev->buffer)
usbbufread = USB_MAX_READ - tot;
else {
if (ftdi)
usbbufread = bufleft + 2;
else
usbbufread = bufleft;
}
got = 0; got = 0;
if (first && usbdev->usecps && usbdev->last_write_siz) {
cgtimer_t now, already_done;
double sleep_estimate;
double write_time = (double)(usbdev->last_write_siz) /
(double)(usbdev->cps) * 1000;
cgtimer_time(&now);
cgtimer_sub(&now, &usbdev->cgt_last_write, &already_done);
sleep_estimate = write_time - cgtimer_to_ms(&already_done);
if (sleep_estimate > 0.0) {
cgsleep_ms_r(&usbdev->cgt_last_write, write_time);
cgpu->usbinfo.read_delay_count++;
cgpu->usbinfo.total_read_delay += sleep_estimate;
}
}
err = usb_bulk_transfer(usbdev->handle, intinfo, epinfo, err = usb_bulk_transfer(usbdev->handle, intinfo, epinfo,
ptr, usbbufread, &got, timeout, ptr, usbbufread, &got, timeout,
cgpu, MODE_BULK_READ, cmd, first ? SEQ0 : SEQ1, cgpu, MODE_BULK_READ, cmd, first ? SEQ0 : SEQ1,
@ -2699,42 +2655,40 @@ int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t
if (unlikely(done >= max)) if (unlikely(done >= max))
break; break;
timeout = initial_timeout - (done * 1000); timeout = initial_timeout - (done * 1000);
if (!timeout) if (timeout <= 0)
break; break;
} }
if (usbdev->buffer) { dobuffer = false;
bool dobuffer = false;
if ((search = find_end(usbbuf, usbbuf, tot, tot, (char *)end, endlen, true))) { if ((search = find_end(usbbuf, usbbuf, tot, tot, (char *)end, endlen, true))) {
// end finishes after bufsiz // end finishes after bufsiz
if ((search + endlen - (char *)usbbuf) > (int)bufsiz) { if ((search + endlen - (char *)usbbuf) > (int)bufsiz) {
usbdev->bufamt = tot - bufsiz; usbdev->bufamt = tot - bufsiz;
dobuffer = true; dobuffer = true;
} else {
// extra data after end
if (*(search + endlen)) {
usbdev->bufamt = tot - (search + endlen - (char *)usbbuf);
dobuffer = true;
}
}
} else { } else {
// no end, but still bigger than bufsiz // extra data after end
if (tot > (int)bufsiz) { if (*(search + endlen)) {
usbdev->bufamt = tot - bufsiz; usbdev->bufamt = tot - (search + endlen - (char *)usbbuf);
dobuffer = true; dobuffer = true;
} }
} }
} else {
if (dobuffer) { // no end, but still bigger than bufsiz
tot -= usbdev->bufamt; if (tot > (int)bufsiz) {
memcpy(usbdev->buffer, usbbuf + tot, usbdev->bufamt); usbdev->bufamt = tot - bufsiz;
usbbuf[tot] = '\0'; dobuffer = true;
applog(LOG_DEBUG, "USB: %s%i read2 buffering %d extra bytes",
cgpu->drv->name, cgpu->device_id, usbdev->bufamt);
} }
} }
if (dobuffer) {
tot -= usbdev->bufamt;
memcpy(usbdev->buffer, usbbuf + tot, usbdev->bufamt);
usbbuf[tot] = '\0';
applog(LOG_DEBUG, "USB: %s%i read2 buffering %d extra bytes",
cgpu->drv->name, cgpu->device_id, usbdev->bufamt);
}
*processed = tot; *processed = tot;
memcpy((char *)buf, (const char *)usbbuf, (tot < (int)bufsiz) ? tot + 1 : (int)bufsiz); memcpy((char *)buf, (const char *)usbbuf, (tot < (int)bufsiz) ? tot + 1 : (int)bufsiz);
@ -2756,7 +2710,7 @@ out_noerrmsg:
return err; return err;
} }
int _usb_write(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t bufsiz, int *processed, unsigned int timeout, enum usb_cmds cmd) int _usb_write(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t bufsiz, int *processed, int timeout, enum usb_cmds cmd)
{ {
struct cg_usb_device *usbdev; struct cg_usb_device *usbdev;
struct timeval read_start, tv_finish; struct timeval read_start, tv_finish;
@ -2788,29 +2742,15 @@ int _usb_write(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_
max = ((double)timeout) / 1000.0; max = ((double)timeout) / 1000.0;
cgtime(&read_start); cgtime(&read_start);
while (bufsiz > 0) { while (bufsiz > 0) {
sent = 0; int tosend = bufsiz;
if (usbdev->usecps) { if (usbdev->usecps) {
if (usbdev->last_write_siz) { int cpms = usbdev->cps / 1000 ? : 1;
cgtimer_t now, already_done; if (tosend > cpms)
double sleep_estimate; tosend = cpms;
double write_time = (double)(usbdev->last_write_siz) /
(double)(usbdev->cps) * 1000;
cgtimer_time(&now);
cgtimer_sub(&now, &usbdev->cgt_last_write, &already_done);
sleep_estimate = write_time - cgtimer_to_ms(&already_done);
if (sleep_estimate > 0.0) {
cgsleep_ms_r(&usbdev->cgt_last_write, write_time);
cgpu->usbinfo.write_delay_count++;
cgpu->usbinfo.total_write_delay += sleep_estimate;
}
}
cgsleep_prepare_r(&usbdev->cgt_last_write);
usbdev->last_write_siz = bufsiz;
} }
err = usb_bulk_transfer(usbdev->handle, intinfo, epinfo, err = usb_bulk_transfer(usbdev->handle, intinfo, epinfo,
(unsigned char *)buf, bufsiz, &sent, timeout, (unsigned char *)buf, tosend, &sent, timeout,
cgpu, MODE_BULK_WRITE, cmd, first ? SEQ0 : SEQ1, cgpu, MODE_BULK_WRITE, cmd, first ? SEQ0 : SEQ1,
false); false);
cgtime(&tv_finish); cgtime(&tv_finish);
@ -2834,7 +2774,7 @@ int _usb_write(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_
if (unlikely(done >= max)) if (unlikely(done >= max))
break; break;
timeout = initial_timeout - (done * 1000); timeout = initial_timeout - (done * 1000);
if (!timeout) if (timeout <= 0)
break; break;
} }
@ -2928,26 +2868,6 @@ int __usb_transfer(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bReques
USBDEBUG("USB debug: @_usb_transfer() buf=%s", bin2hex(buf, (size_t)siz)); USBDEBUG("USB debug: @_usb_transfer() buf=%s", bin2hex(buf, (size_t)siz));
if (usbdev->usecps) {
if (usbdev->last_write_siz) {
cgtimer_t now, already_done;
double sleep_estimate;
double write_time = (double)(usbdev->last_write_siz) /
(double)(usbdev->cps) * 1000;
cgtimer_time(&now);
cgtimer_sub(&now, &usbdev->cgt_last_write, &already_done);
sleep_estimate = write_time - cgtimer_to_ms(&already_done);
if (sleep_estimate > 0.0) {
cgsleep_ms_r(&usbdev->cgt_last_write, write_time);
cgpu->usbinfo.write_delay_count++;
cgpu->usbinfo.total_write_delay += sleep_estimate;
}
}
cgsleep_prepare_r(&usbdev->cgt_last_write);
usbdev->last_write_siz = siz;
}
STATS_TIMEVAL(&tv_start); STATS_TIMEVAL(&tv_start);
err = usb_control_transfer(cgpu, usbdev->handle, request_type, bRequest, err = usb_control_transfer(cgpu, usbdev->handle, request_type, bRequest,
wValue, wIndex, buf, (uint16_t)siz, timeout); wValue, wIndex, buf, (uint16_t)siz, timeout);
@ -3011,22 +2931,6 @@ int _usb_transfer_read(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bRe
*amount = 0; *amount = 0;
if (usbdev->usecps && usbdev->last_write_siz) {
cgtimer_t now, already_done;
double sleep_estimate;
double write_time = (double)(usbdev->last_write_siz) /
(double)(usbdev->cps) * 1000;
cgtimer_time(&now);
cgtimer_sub(&now, &usbdev->cgt_last_write, &already_done);
sleep_estimate = write_time - cgtimer_to_ms(&already_done);
if (sleep_estimate > 0.0) {
cgsleep_ms_r(&usbdev->cgt_last_write, write_time);
cgpu->usbinfo.read_delay_count++;
cgpu->usbinfo.total_read_delay += sleep_estimate;
}
}
memset(tbuf, 0, 64); memset(tbuf, 0, 64);
STATS_TIMEVAL(&tv_start); STATS_TIMEVAL(&tv_start);
err = usb_control_transfer(cgpu, usbdev->handle, request_type, bRequest, err = usb_control_transfer(cgpu, usbdev->handle, request_type, bRequest,
@ -3114,44 +3018,6 @@ int _usb_ftdi_set_latency(struct cgpu_info *cgpu, int intinfo)
return err; return err;
} }
void usb_buffer_enable(struct cgpu_info *cgpu)
{
struct cg_usb_device *cgusb;
int pstate;
DEVWLOCK(cgpu, pstate);
cgusb = cgpu->usbdev;
if (cgusb && !cgusb->buffer) {
cgusb->bufamt = 0;
cgusb->buffer = malloc(USB_MAX_READ+1);
if (!cgusb->buffer)
quit(1, "Failed to malloc buffer for USB %s%i",
cgpu->drv->name, cgpu->device_id);
cgusb->bufsiz = USB_MAX_READ;
}
DEVWUNLOCK(cgpu, pstate);
}
void usb_buffer_disable(struct cgpu_info *cgpu)
{
struct cg_usb_device *cgusb;
int pstate;
DEVWLOCK(cgpu, pstate);
cgusb = cgpu->usbdev;
if (cgusb && cgusb->buffer) {
cgusb->bufamt = 0;
cgusb->bufsiz = 0;
free(cgusb->buffer);
cgusb->buffer = NULL;
}
DEVWUNLOCK(cgpu, pstate);
}
void usb_buffer_clear(struct cgpu_info *cgpu) void usb_buffer_clear(struct cgpu_info *cgpu)
{ {
int pstate; int pstate;
@ -3252,40 +3118,6 @@ enum sub_ident usb_ident(struct cgpu_info *cgpu)
return ident; return ident;
} }
/*
* If you pass both intinfo and epinfo as <0 then it will set all
* endpoints to PrefPacketSize
* If intinfo >=0 but epinfo <0 then it will set all endpoints
* for the given one intinfo to PrefPacketSize
* If both are >=0 then it will set only the specified single
* endpoint (intinfo,epinfo) to PrefPacketSize
*/
void _usb_set_pps(struct cgpu_info *cgpu, int intinfo, int epinfo, uint16_t PrefPacketSize)
{
struct usb_find_devices *found;
int pstate;
DEVWLOCK(cgpu, pstate);
if (cgpu->usbdev) {
found = cgpu->usbdev->found;
if (intinfo >= 0 && epinfo >= 0)
found->intinfos[intinfo].epinfos[epinfo].PrefPacketSize = PrefPacketSize;
else {
if (intinfo >= 0) {
for (epinfo = 0; epinfo < found->intinfos[intinfo].epinfo_count; epinfo++)
found->intinfos[intinfo].epinfos[epinfo].PrefPacketSize = PrefPacketSize;
} else {
for (intinfo = 0; intinfo < found->intinfo_count ; intinfo++)
for (epinfo = 0; epinfo < found->intinfos[intinfo].epinfo_count; epinfo++)
found->intinfos[intinfo].epinfos[epinfo].PrefPacketSize = PrefPacketSize;
}
}
}
DEVWUNLOCK(cgpu, pstate);
}
// Need to set all devices with matching usbdev // Need to set all devices with matching usbdev
void usb_set_dev_start(struct cgpu_info *cgpu) void usb_set_dev_start(struct cgpu_info *cgpu)
{ {

15
usbutils.h

@ -122,7 +122,6 @@ struct usb_epinfo {
uint16_t size; uint16_t size;
unsigned char ep; unsigned char ep;
uint16_t wMaxPacketSize; uint16_t wMaxPacketSize;
uint16_t PrefPacketSize;
bool found; bool found;
}; };
@ -182,6 +181,8 @@ enum usb_types {
USB_TYPE_FTDI USB_TYPE_FTDI
}; };
#define USB_MAX_READ 8192
struct cg_usb_device { struct cg_usb_device {
struct usb_find_devices *found; struct usb_find_devices *found;
libusb_device_handle *handle; libusb_device_handle *handle;
@ -197,7 +198,7 @@ struct cg_usb_device {
char *serial_string; char *serial_string;
unsigned char fwVersion; // ?? unsigned char fwVersion; // ??
unsigned char interfaceVersion; // ?? unsigned char interfaceVersion; // ??
char *buffer; char buffer[USB_MAX_READ];
uint32_t bufsiz; uint32_t bufsiz;
uint32_t bufamt; uint32_t bufamt;
cgtimer_t cgt_last_write; cgtimer_t cgt_last_write;
@ -206,8 +207,6 @@ struct cg_usb_device {
#define USB_NOSTAT 0 #define USB_NOSTAT 0
#define USB_MAX_READ 8192
#define USB_TMO_0 50 #define USB_TMO_0 50
#define USB_TMO_1 100 #define USB_TMO_1 100
#define USB_TMO_2 500 #define USB_TMO_2 500
@ -388,15 +387,13 @@ bool usb_init(struct cgpu_info *cgpu, struct libusb_device *dev, struct usb_find
void usb_detect(struct device_drv *drv, bool (*device_detect)(struct libusb_device *, struct usb_find_devices *)); void usb_detect(struct device_drv *drv, bool (*device_detect)(struct libusb_device *, struct usb_find_devices *));
struct api_data *api_usb_stats(int *count); struct api_data *api_usb_stats(int *count);
void update_usb_stats(struct cgpu_info *cgpu); void update_usb_stats(struct cgpu_info *cgpu);
int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t bufsiz, int *processed, unsigned int timeout, const char *end, enum usb_cmds cmd, bool readonce, bool cancellable); int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t bufsiz, int *processed, int timeout, const char *end, enum usb_cmds cmd, bool readonce, bool cancellable);
int _usb_write(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t bufsiz, int *processed, unsigned int timeout, enum usb_cmds); int _usb_write(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t bufsiz, int *processed, int timeout, enum usb_cmds);
int _usb_transfer(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint32_t *data, int siz, unsigned int timeout, enum usb_cmds cmd); int _usb_transfer(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint32_t *data, int siz, unsigned int timeout, enum usb_cmds cmd);
int _usb_transfer_read(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, char *buf, int bufsiz, int *amount, unsigned int timeout, enum usb_cmds cmd); int _usb_transfer_read(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, char *buf, int bufsiz, int *amount, unsigned int timeout, enum usb_cmds cmd);
int usb_ftdi_cts(struct cgpu_info *cgpu); int usb_ftdi_cts(struct cgpu_info *cgpu);
int _usb_ftdi_set_latency(struct cgpu_info *cgpu, int intinfo); int _usb_ftdi_set_latency(struct cgpu_info *cgpu, int intinfo);
#define usb_ftdi_set_latency(_cgpu) _usb_ftdi_set_latency(_cgpu, DEFAULT_INTINFO) #define usb_ftdi_set_latency(_cgpu) _usb_ftdi_set_latency(_cgpu, DEFAULT_INTINFO)
void usb_buffer_enable(struct cgpu_info *cgpu);
void usb_buffer_disable(struct cgpu_info *cgpu);
void usb_buffer_clear(struct cgpu_info *cgpu); void usb_buffer_clear(struct cgpu_info *cgpu);
uint32_t usb_buffer_size(struct cgpu_info *cgpu); uint32_t usb_buffer_size(struct cgpu_info *cgpu);
void usb_set_cps(struct cgpu_info *cgpu, int cps); void usb_set_cps(struct cgpu_info *cgpu, int cps);
@ -405,8 +402,6 @@ void usb_disable_cps(struct cgpu_info *cgpu);
int _usb_interface(struct cgpu_info *cgpu, int intinfo); int _usb_interface(struct cgpu_info *cgpu, int intinfo);
#define usb_interface(_cgpu) _usb_interface(_cgpu, DEFAULT_INTINFO) #define usb_interface(_cgpu) _usb_interface(_cgpu, DEFAULT_INTINFO)
enum sub_ident usb_ident(struct cgpu_info *cgpu); enum sub_ident usb_ident(struct cgpu_info *cgpu);
void _usb_set_pps(struct cgpu_info *cgpu, int intinfo, int epinfo, uint16_t PrefPacketSize);
#define usb_set_pps(_cgpu, _pps) _usb_set_pps(_cgpu, -1, -1, _pps)
void usb_set_dev_start(struct cgpu_info *cgpu); void usb_set_dev_start(struct cgpu_info *cgpu);
void usb_cleanup(); void usb_cleanup();
void usb_initialise(); void usb_initialise();

Loading…
Cancel
Save