1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-02 18:14:20 +00:00

usbutils - usb_nodev() allow a driver to drop a device

This commit is contained in:
Kano 2013-10-28 07:41:15 +11:00
parent 50c8377305
commit 5bd1b560ac
2 changed files with 16 additions and 1 deletions

@ -1355,6 +1355,20 @@ static void release_cgpu(struct cgpu_info *cgpu)
cgminer_usb_unlock_bd(cgpu->drv, cgpu->usbinfo.bus_number, cgpu->usbinfo.device_address);
}
/*
* Force a NODEV on a device so it goes back to hotplug
*/
void usb_nodev(struct cgpu_info *cgpu)
{
int pstate;
DEVWLOCK(cgpu, pstate);
release_cgpu(cgpu);
DEVWUNLOCK(cgpu, pstate);
}
/*
* Use the same usbdev thus locking is across all related devices
*/

@ -358,7 +358,8 @@ bool async_usb_transfers(void);
void cancel_usb_transfers(void);
void usb_all(int level);
const char *usb_cmdname(enum usb_cmds cmd);
void usb_applog(struct cgpu_info *bflsc, enum usb_cmds cmd, char *msg, int amount, int err);
void usb_applog(struct cgpu_info *cgpu, enum usb_cmds cmd, char *msg, int amount, int err);
void usb_nodev(struct cgpu_info *cgpu);
struct cgpu_info *usb_copy_cgpu(struct cgpu_info *orig);
struct cgpu_info *usb_alloc_cgpu(struct device_drv *drv, int threads);
struct cgpu_info *usb_free_cgpu(struct cgpu_info *cgpu);