1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 20:44:19 +00:00

usb add a numeric sub-indentity for each name

This commit is contained in:
Kano 2013-05-16 22:16:15 +10:00
parent 2631b55ee2
commit e89c921ab0
3 changed files with 35 additions and 2 deletions

View File

@ -897,17 +897,20 @@ reinit:
sc_info->scan_sleep_time = BAM_SCAN_TIME; sc_info->scan_sleep_time = BAM_SCAN_TIME;
sc_info->results_sleep_time = BAM_RES_TIME; sc_info->results_sleep_time = BAM_RES_TIME;
sc_info->default_ms_work = BAM_WORK_TIME; sc_info->default_ms_work = BAM_WORK_TIME;
bflsc->usbdev->ident = IDENT_BAM;
} else { } else {
if (sc_info->sc_devs[0].engines < 34) { // 16 * 2 + 2 if (sc_info->sc_devs[0].engines < 34) { // 16 * 2 + 2
newname = BFLSC_JALAPENO; newname = BFLSC_JALAPENO;
sc_info->scan_sleep_time = BAJ_SCAN_TIME; sc_info->scan_sleep_time = BAJ_SCAN_TIME;
sc_info->results_sleep_time = BAJ_RES_TIME; sc_info->results_sleep_time = BAJ_RES_TIME;
sc_info->default_ms_work = BAJ_WORK_TIME; sc_info->default_ms_work = BAJ_WORK_TIME;
bflsc->usbdev->ident = IDENT_BAJ;
} else if (sc_info->sc_devs[0].engines < 130) { // 16 * 8 + 2 } else if (sc_info->sc_devs[0].engines < 130) { // 16 * 8 + 2
newname = BFLSC_LITTLESINGLE; newname = BFLSC_LITTLESINGLE;
sc_info->scan_sleep_time = BAL_SCAN_TIME; sc_info->scan_sleep_time = BAL_SCAN_TIME;
sc_info->results_sleep_time = BAL_RES_TIME; sc_info->results_sleep_time = BAL_RES_TIME;
sc_info->default_ms_work = BAL_WORK_TIME; sc_info->default_ms_work = BAL_WORK_TIME;
bflsc->usbdev->ident = IDENT_BAL;
} }
} }

View File

@ -123,6 +123,7 @@ static struct usb_find_devices find_dev[] = {
{ {
.drv = DRV_BFLSC, .drv = DRV_BFLSC,
.name = "BAS", .name = "BAS",
.ident = IDENT_BAS,
.idVendor = IDVENDOR_FTDI, .idVendor = IDVENDOR_FTDI,
.idProduct = 0x6014, .idProduct = 0x6014,
.iManufacturer = "Butterfly Labs", .iManufacturer = "Butterfly Labs",
@ -138,6 +139,7 @@ static struct usb_find_devices find_dev[] = {
{ {
.drv = DRV_BITFORCE, .drv = DRV_BITFORCE,
.name = "BFL", .name = "BFL",
.ident = IDENT_BFL,
.idVendor = IDVENDOR_FTDI, .idVendor = IDVENDOR_FTDI,
.idProduct = 0x6014, .idProduct = 0x6014,
.iManufacturer = "Butterfly Labs Inc.", .iManufacturer = "Butterfly Labs Inc.",
@ -153,6 +155,7 @@ static struct usb_find_devices find_dev[] = {
{ {
.drv = DRV_MODMINER, .drv = DRV_MODMINER,
.name = "MMQ", .name = "MMQ",
.ident = IDENT_MMQ,
.idVendor = 0x1fc9, .idVendor = 0x1fc9,
.idProduct = 0x0003, .idProduct = 0x0003,
.kernel = 0, .kernel = 0,
@ -166,6 +169,7 @@ static struct usb_find_devices find_dev[] = {
{ {
.drv = DRV_AVALON, .drv = DRV_AVALON,
.name = "AVA", .name = "AVA",
.ident = IDENT_AVA,
.idVendor = IDVENDOR_FTDI, .idVendor = IDVENDOR_FTDI,
.idProduct = 0x6001, .idProduct = 0x6001,
.kernel = 0, .kernel = 0,
@ -179,6 +183,7 @@ static struct usb_find_devices find_dev[] = {
{ {
.drv = DRV_ICARUS, .drv = DRV_ICARUS,
.name = "ICA", .name = "ICA",
.ident = IDENT_ICA,
.idVendor = 0x067b, .idVendor = 0x067b,
.idProduct = 0x2303, .idProduct = 0x2303,
.kernel = 0, .kernel = 0,
@ -190,6 +195,7 @@ static struct usb_find_devices find_dev[] = {
{ {
.drv = DRV_ICARUS, .drv = DRV_ICARUS,
.name = "AMU", .name = "AMU",
.ident = IDENT_AMU,
.idVendor = 0x10c4, .idVendor = 0x10c4,
.idProduct = 0xea60, .idProduct = 0xea60,
.kernel = 0, .kernel = 0,
@ -201,6 +207,7 @@ static struct usb_find_devices find_dev[] = {
{ {
.drv = DRV_ICARUS, .drv = DRV_ICARUS,
.name = "BLT", .name = "BLT",
.ident = IDENT_BLT,
.idVendor = IDVENDOR_FTDI, .idVendor = IDVENDOR_FTDI,
.idProduct = 0x6001, .idProduct = 0x6001,
.iProduct = "FT232R USB UART", .iProduct = "FT232R USB UART",
@ -214,6 +221,7 @@ static struct usb_find_devices find_dev[] = {
{ {
.drv = DRV_ICARUS, .drv = DRV_ICARUS,
.name = "LLT", .name = "LLT",
.ident = IDENT_LLT,
.idVendor = IDVENDOR_FTDI, .idVendor = IDVENDOR_FTDI,
.idProduct = 0x6001, .idProduct = 0x6001,
.kernel = 0, .kernel = 0,
@ -225,6 +233,7 @@ static struct usb_find_devices find_dev[] = {
{ {
.drv = DRV_ICARUS, .drv = DRV_ICARUS,
.name = "CMR", .name = "CMR",
.ident = IDENT_CMR,
.idVendor = 0x067b, .idVendor = 0x067b,
.idProduct = 0x0230, .idProduct = 0x0230,
.iProduct = "Cairnsmore1", .iProduct = "Cairnsmore1",
@ -241,6 +250,7 @@ static struct usb_find_devices find_dev[] = {
{ {
.drv = DRV_ZTEX, .drv = DRV_ZTEX,
.name = "ZTX", .name = "ZTX",
.ident = IDENT_ZTX,
.idVendor = 0x221a, .idVendor = 0x221a,
.idProduct = 0x0100, .idProduct = 0x0100,
.kernel = 0, .kernel = 0,
@ -250,7 +260,7 @@ static struct usb_find_devices find_dev[] = {
.epcount = 0, .epcount = 0,
.eps = NULL }, .eps = NULL },
#endif #endif
{ DRV_LAST, NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, NULL } { DRV_LAST, NULL, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, NULL }
}; };
#ifdef USE_BFLSC #ifdef USE_BFLSC
@ -1335,6 +1345,8 @@ static int _usb_init(struct cgpu_info *cgpu, struct libusb_device *dev, struct u
if (found->idVendor == IDVENDOR_FTDI) if (found->idVendor == IDVENDOR_FTDI)
cgusb->usb_type = USB_TYPE_FTDI; cgusb->usb_type = USB_TYPE_FTDI;
cgusb->ident = found->ident;
cgusb->descriptor = calloc(1, sizeof(*(cgusb->descriptor))); cgusb->descriptor = calloc(1, sizeof(*(cgusb->descriptor)));
err = libusb_get_device_descriptor(dev, cgusb->descriptor); err = libusb_get_device_descriptor(dev, cgusb->descriptor);

View File

@ -50,9 +50,26 @@ struct usb_endpoints {
bool found; bool found;
}; };
enum sub_ident {
IDENT_BAJ,
IDENT_BAL,
IDENT_BAS,
IDENT_BAM,
IDENT_BFL,
IDENT_MMQ,
IDENT_AVA,
IDENT_ICA,
IDENT_AMU,
IDENT_BLT,
IDENT_LLT,
IDENT_CMR,
IDENT_ZTX
};
struct usb_find_devices { struct usb_find_devices {
int drv; int drv;
const char *name; const char *name;
enum sub_ident ident;
uint16_t idVendor; uint16_t idVendor;
uint16_t idProduct; uint16_t idProduct;
char *iManufacturer; char *iManufacturer;
@ -75,8 +92,9 @@ struct cg_usb_device {
libusb_device_handle *handle; libusb_device_handle *handle;
pthread_mutex_t *mutex; pthread_mutex_t *mutex;
struct libusb_device_descriptor *descriptor; struct libusb_device_descriptor *descriptor;
uint16_t usbver;
enum usb_types usb_type; enum usb_types usb_type;
enum sub_ident ident;
uint16_t usbver;
int speed; int speed;
char *prod_string; char *prod_string;
char *manuf_string; char *manuf_string;