Reinstate missing necessary init sequence for hashratio
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/driver-hashratio.c b/driver-hashratio.c
index 348335f..45325a0 100644
--- a/driver-hashratio.c
+++ b/driver-hashratio.c
@@ -513,6 +513,58 @@ static void hashratio_initialise(struct cgpu_info *hashratio)
applog(LOG_DEBUG, "%s%i: data got err %d",
hashratio->drv->name, hashratio->device_id, err);
+
+ if (hashratio->usbinfo.nodev)
+ return;
+
+ // Set the baud
+ err = usb_transfer(hashratio, FTDI_TYPE_OUT, FTDI_REQUEST_BAUD, FTDI_VALUE_BAUD_AVA,
+ (FTDI_INDEX_BAUD_AVA & 0xff00) | interface,
+ C_SETBAUD);
+
+ applog(LOG_DEBUG, "%s%i: setbaud got err %d",
+ hashratio->drv->name, hashratio->device_id, err);
+
+ if (hashratio->usbinfo.nodev)
+ return;
+
+ // Set Modem Control
+ err = usb_transfer(hashratio, FTDI_TYPE_OUT, FTDI_REQUEST_MODEM,
+ FTDI_VALUE_MODEM, interface, C_SETMODEM);
+
+ applog(LOG_DEBUG, "%s%i: setmodemctrl got err %d",
+ hashratio->drv->name, hashratio->device_id, err);
+
+ if (hashratio->usbinfo.nodev)
+ return;
+
+ // Set Flow Control
+ err = usb_transfer(hashratio, FTDI_TYPE_OUT, FTDI_REQUEST_FLOW,
+ FTDI_VALUE_FLOW, interface, C_SETFLOW);
+
+ applog(LOG_DEBUG, "%s%i: setflowctrl got err %d",
+ hashratio->drv->name, hashratio->device_id, err);
+
+ if (hashratio->usbinfo.nodev)
+ return;
+
+ /* hashratio repeats the following */
+ // Set Modem Control
+ err = usb_transfer(hashratio, FTDI_TYPE_OUT, FTDI_REQUEST_MODEM,
+ FTDI_VALUE_MODEM, interface, C_SETMODEM);
+
+ applog(LOG_DEBUG, "%s%i: setmodemctrl 2 got err %d",
+ hashratio->drv->name, hashratio->device_id, err);
+
+ if (hashratio->usbinfo.nodev)
+ return;
+
+ // Set Flow Control
+ err = usb_transfer(hashratio, FTDI_TYPE_OUT, FTDI_REQUEST_FLOW,
+ FTDI_VALUE_FLOW, interface, C_SETFLOW);
+
+ applog(LOG_DEBUG, "%s%i: setflowctrl 2 got err %d",
+ hashratio->drv->name, hashratio->device_id, err);
}
static struct cgpu_info *hashratio_detect_one(struct libusb_device *dev, struct usb_find_devices *found)