mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Add BF1 detection code to bitfury driver.
This commit is contained in:
parent
68a7e21022
commit
2ab023f300
16
cgminer.c
16
cgminer.c
@ -1563,6 +1563,9 @@ static char *opt_verusage_and_exit(const char *extra)
|
|||||||
#ifdef USE_BITFORCE
|
#ifdef USE_BITFORCE
|
||||||
"bitforce "
|
"bitforce "
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_BITFURY
|
||||||
|
"bitfury "
|
||||||
|
#endif
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
"GPU "
|
"GPU "
|
||||||
#endif
|
#endif
|
||||||
@ -7352,6 +7355,10 @@ extern struct device_drv bflsc_drv;
|
|||||||
extern struct device_drv bitforce_drv;
|
extern struct device_drv bitforce_drv;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_BITFURY
|
||||||
|
extern struct device_drv bitfury_drv;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_ICARUS
|
#ifdef USE_ICARUS
|
||||||
extern struct device_drv icarus_drv;
|
extern struct device_drv icarus_drv;
|
||||||
#endif
|
#endif
|
||||||
@ -7650,6 +7657,10 @@ static void *hotplug_thread(void __maybe_unused *userdata)
|
|||||||
bitforce_drv.drv_detect();
|
bitforce_drv.drv_detect();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_BITFURY
|
||||||
|
bitfury_drv.drv_detect();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_MODMINER
|
#ifdef USE_MODMINER
|
||||||
modminer_drv.drv_detect();
|
modminer_drv.drv_detect();
|
||||||
#endif
|
#endif
|
||||||
@ -7883,6 +7894,11 @@ int main(int argc, char *argv[])
|
|||||||
bitforce_drv.drv_detect();
|
bitforce_drv.drv_detect();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_BITFURY
|
||||||
|
if (!opt_scrypt)
|
||||||
|
bitfury_drv.drv_detect();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_MODMINER
|
#ifdef USE_MODMINER
|
||||||
if (!opt_scrypt)
|
if (!opt_scrypt)
|
||||||
modminer_drv.drv_detect();
|
modminer_drv.drv_detect();
|
||||||
|
@ -14,8 +14,24 @@
|
|||||||
|
|
||||||
struct device_drv bitfury_drv;
|
struct device_drv bitfury_drv;
|
||||||
|
|
||||||
|
static bool bitfury_detect_one(struct libusb_device *dev, struct usb_find_devices *found)
|
||||||
|
{
|
||||||
|
struct cgpu_info *bitfury;
|
||||||
|
|
||||||
|
bitfury = usb_alloc_cgpu(&bitfury_drv, 1);
|
||||||
|
|
||||||
|
if (!usb_init(bitfury, dev, found)) {
|
||||||
|
bitfury = usb_free_cgpu(bitfury);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
applog(LOG_WARNING, "%s%d: Found at %s", bitfury->drv->name,
|
||||||
|
bitfury->device_id, bitfury->device_path);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static void bitfury_detect(void)
|
static void bitfury_detect(void)
|
||||||
{
|
{
|
||||||
|
usb_detect(&bitfury_drv, bitfury_detect_one);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool bitfury_prepare(struct thr_info __maybe_unused *thr)
|
static bool bitfury_prepare(struct thr_info __maybe_unused *thr)
|
||||||
|
20
usbutils.c
20
usbutils.c
@ -124,8 +124,8 @@ static struct usb_intinfo bfl_ints[] = {
|
|||||||
|
|
||||||
#ifdef USE_BITFURY
|
#ifdef USE_BITFURY
|
||||||
static struct usb_epinfo bfu_epinfos[] = {
|
static struct usb_epinfo bfu_epinfos[] = {
|
||||||
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0 },
|
{ LIBUSB_TRANSFER_TYPE_BULK, 16, EPI(3), 0 },
|
||||||
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(4), 0 }
|
{ LIBUSB_TRANSFER_TYPE_BULK, 16, EPO(4), 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct usb_intinfo bfu_ints[] = {
|
static struct usb_intinfo bfu_ints[] = {
|
||||||
@ -407,6 +407,10 @@ extern struct device_drv bflsc_drv;
|
|||||||
extern struct device_drv bitforce_drv;
|
extern struct device_drv bitforce_drv;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_BITFURY
|
||||||
|
extern struct device_drv bitfury_drv;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_MODMINER
|
#ifdef USE_MODMINER
|
||||||
extern struct device_drv modminer_drv;
|
extern struct device_drv modminer_drv;
|
||||||
#endif
|
#endif
|
||||||
@ -2092,6 +2096,11 @@ static struct usb_find_devices *usb_check(__maybe_unused struct device_drv *drv,
|
|||||||
return usb_check_each(DRV_BITFORCE, drv, dev);
|
return usb_check_each(DRV_BITFORCE, drv, dev);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_BITFURY
|
||||||
|
if (drv->drv_id == DRIVER_BITFURY)
|
||||||
|
return usb_check_each(DRV_BITFURY, drv, dev);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_MODMINER
|
#ifdef USE_MODMINER
|
||||||
if (drv->drv_id == DRIVER_MODMINER)
|
if (drv->drv_id == DRIVER_MODMINER)
|
||||||
return usb_check_each(DRV_MODMINER, drv, dev);
|
return usb_check_each(DRV_MODMINER, drv, dev);
|
||||||
@ -3304,6 +3313,7 @@ void usb_cleanup()
|
|||||||
switch (cgpu->drv->drv_id) {
|
switch (cgpu->drv->drv_id) {
|
||||||
case DRIVER_BFLSC:
|
case DRIVER_BFLSC:
|
||||||
case DRIVER_BITFORCE:
|
case DRIVER_BITFORCE:
|
||||||
|
case DRIVER_BITFURY:
|
||||||
case DRIVER_MODMINER:
|
case DRIVER_MODMINER:
|
||||||
case DRIVER_ICARUS:
|
case DRIVER_ICARUS:
|
||||||
case DRIVER_AVALON:
|
case DRIVER_AVALON:
|
||||||
@ -3443,6 +3453,12 @@ void usb_initialise()
|
|||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_BITFURY
|
||||||
|
if (!found && strcasecmp(ptr, bitfury_drv.name) == 0) {
|
||||||
|
drv_count[bitfury_drv.drv_id].limit = lim;
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#ifdef USE_MODMINER
|
#ifdef USE_MODMINER
|
||||||
if (!found && strcasecmp(ptr, modminer_drv.name) == 0) {
|
if (!found && strcasecmp(ptr, modminer_drv.name) == 0) {
|
||||||
drv_count[modminer_drv.drv_id].limit = lim;
|
drv_count[modminer_drv.drv_id].limit = lim;
|
||||||
|
Loading…
Reference in New Issue
Block a user