mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
add usb_ftdi_set_latency
This commit is contained in:
parent
4368a04fce
commit
f366d53f3c
15
usbutils.c
15
usbutils.c
@ -2489,6 +2489,21 @@ int usb_ftdi_cts(struct cgpu_info *cgpu)
|
||||
return (ret & FTDI_RS0_CTS);
|
||||
}
|
||||
|
||||
int usb_ftdi_set_latency(struct cgpu_info *cgpu)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = usb_transfer_data(cgpu, FTDI_TYPE_OUT, FTDI_REQUEST_LATENCY,
|
||||
cgpu->usbdev->found->latency,
|
||||
cgpu->usbdev->found->interface, NULL, 0, C_LATENCY);
|
||||
|
||||
applog(LOG_DEBUG, "%s: cgid %d %s got err %d",
|
||||
cgpu->drv->name, cgpu->cgminer_id,
|
||||
usb_cmdname(C_LATENCY), err);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
void usb_buffer_enable(struct cgpu_info *cgpu)
|
||||
{
|
||||
struct cg_usb_device *cgusb = cgpu->usbdev;
|
||||
|
@ -256,11 +256,11 @@ void usb_detect(struct device_drv *drv, bool (*device_detect)(struct libusb_devi
|
||||
struct api_data *api_usb_stats(int *count);
|
||||
void update_usb_stats(struct cgpu_info *cgpu);
|
||||
int _usb_read(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *processed, unsigned int timeout, const char *end, enum usb_cmds cmd, bool readonce);
|
||||
int usb_ftdi_cts(struct cgpu_info *cgpu);
|
||||
int usb_ftdi_ctw(struct cgpu_info *cgpu);
|
||||
int _usb_write(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *processed, unsigned 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_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_set_latency(struct cgpu_info *cgpu);
|
||||
void usb_buffer_enable(struct cgpu_info *cgpu);
|
||||
void usb_buffer_disable(struct cgpu_info *cgpu);
|
||||
void usb_buffer_clear(struct cgpu_info *cgpu);
|
||||
|
Loading…
Reference in New Issue
Block a user