|
|
@ -2228,6 +2228,7 @@ int _usb_read(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *pro |
|
|
|
#define FTDI_RS0_RI (1 << 6) |
|
|
|
#define FTDI_RS0_RI (1 << 6) |
|
|
|
#define FTDI_RS0_RLSD (1 << 7) |
|
|
|
#define FTDI_RS0_RLSD (1 << 7) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Clear to send for FTDI */ |
|
|
|
int usb_ftdi_cts(struct cgpu_info *cgpu) |
|
|
|
int usb_ftdi_cts(struct cgpu_info *cgpu) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct cg_usb_device *usbdev = cgpu->usbdev; |
|
|
|
struct cg_usb_device *usbdev = cgpu->usbdev; |
|
|
@ -2240,26 +2241,6 @@ int usb_ftdi_cts(struct cgpu_info *cgpu) |
|
|
|
return (ret & FTDI_RS0_CTS); |
|
|
|
return (ret & FTDI_RS0_CTS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#define FTDI_RS_DR 1 |
|
|
|
|
|
|
|
#define FTDI_RS_OE (1<<1) |
|
|
|
|
|
|
|
#define FTDI_RS_PE (1<<2) |
|
|
|
|
|
|
|
#define FTDI_RS_FE (1<<3) |
|
|
|
|
|
|
|
#define FTDI_RS_BI (1<<4) |
|
|
|
|
|
|
|
#define FTDI_RS_THRE (1<<5) |
|
|
|
|
|
|
|
#define FTDI_RS_TEMT (1<<6) |
|
|
|
|
|
|
|
#define FTDI_RS_FIFO (1<<7) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int usb_ftdi_ctw(struct cgpu_info *cgpu) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
struct cg_usb_device *usbdev = cgpu->usbdev; |
|
|
|
|
|
|
|
unsigned char buf[2]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
libusb_control_transfer(usbdev->handle, (uint8_t)FTDI_TYPE_IN, |
|
|
|
|
|
|
|
(uint8_t)5, (uint16_t)0, (uint16_t)0, |
|
|
|
|
|
|
|
buf, 2, DEVTIMEOUT); |
|
|
|
|
|
|
|
return ((buf[1] & FTDI_RS_THRE) && (buf[1] & FTDI_RS_TEMT)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int _usb_write(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *processed, unsigned int timeout, __maybe_unused enum usb_cmds cmd) |
|
|
|
int _usb_write(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *processed, unsigned int timeout, __maybe_unused enum usb_cmds cmd) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct cg_usb_device *usbdev = cgpu->usbdev; |
|
|
|
struct cg_usb_device *usbdev = cgpu->usbdev; |
|
|
|