diff --git a/usbutils.c b/usbutils.c index 3c697110..13941477 100644 --- a/usbutils.c +++ b/usbutils.c @@ -752,6 +752,13 @@ static void cgusb_check_init() mutex_unlock(&cgusb_lock); } +const char *usb_cmdname(enum usb_cmds cmd) +{ + cgusb_check_init(); + + return usb_commands[cmd]; +} + #ifndef WIN32 #include #include diff --git a/usbutils.h b/usbutils.h index 1454faae..7cacc43a 100644 --- a/usbutils.h +++ b/usbutils.h @@ -132,6 +132,7 @@ struct device_drv; struct cgpu_info; void usb_all(int level); +const char *usb_cmdname(enum usb_cmds cmd); void usb_uninit(struct cgpu_info *cgpu); bool usb_init(struct cgpu_info *cgpu, struct libusb_device *dev, struct usb_find_devices *found); void usb_detect(struct device_drv *drv, bool (*device_detect)(struct libusb_device *, struct usb_find_devices *));