mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-25 22:14:36 +00:00
usb_ftdi_set_latency LOG_ERRs if called incorrectly
This commit is contained in:
parent
f366d53f3c
commit
58bb4d486d
12
usbutils.c
12
usbutils.c
@ -2493,6 +2493,18 @@ int usb_ftdi_set_latency(struct cgpu_info *cgpu)
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (cgpu->usbdev->usb_type != USB_TYPE_FTDI) {
|
||||||
|
applog(LOG_ERR, "%s: cgid %d latency request on non-FTDI device",
|
||||||
|
cgpu->drv->name, cgpu->cgminer_id);
|
||||||
|
return LIBUSB_ERROR_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cgpu->usbdev->found->latency == LATENCY_UNUSED) {
|
||||||
|
applog(LOG_ERR, "%s: cgid %d invalid latency (UNUSED)",
|
||||||
|
cgpu->drv->name, cgpu->cgminer_id);
|
||||||
|
return LIBUSB_ERROR_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
err = usb_transfer_data(cgpu, FTDI_TYPE_OUT, FTDI_REQUEST_LATENCY,
|
err = usb_transfer_data(cgpu, FTDI_TYPE_OUT, FTDI_REQUEST_LATENCY,
|
||||||
cgpu->usbdev->found->latency,
|
cgpu->usbdev->found->latency,
|
||||||
cgpu->usbdev->found->interface, NULL, 0, C_LATENCY);
|
cgpu->usbdev->found->interface, NULL, 0, C_LATENCY);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user