diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-12-03 20:38:41 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-12-03 20:38:41 +0100 |
commit | ba627dd9ecb578e9852c7b9cce67ec63199d1acf (patch) | |
tree | 27c4258311ca8c8ed7ff67a8a0bc7280e8fcae79 /spectro/usbio_ox.c | |
parent | 69aec3b712232e93600ecd741269fed1f90b412a (diff) | |
parent | 3abb40d43649adb3807180692d8579c405524675 (diff) |
Merge branch 'release/2.0.0+repack-1'2.0.0+repack-1
Diffstat (limited to 'spectro/usbio_ox.c')
-rwxr-xr-x[-rw-r--r--] | spectro/usbio_ox.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spectro/usbio_ox.c b/spectro/usbio_ox.c index 2b09955..3923d6d 100644..100755 --- a/spectro/usbio_ox.c +++ b/spectro/usbio_ox.c @@ -457,12 +457,20 @@ char **pnames /* List of process names to try and kill before opening */ (*pluginref)->Stop(pluginref); IODestroyPlugInInterface(pluginref); // this stops IOServices though ?? + /* This can fail if the device has multiple interfaces, and */ + /* one of them is grabbed by a system interface (i.e. debug serial port) */ + /* So soft fail, and rely on ep use to fail for invalid interface */ if ((rv = (*(p->usbd->interfaces[i]))->USBInterfaceOpen( p->usbd->interfaces[i])) != kIOReturnSuccess) { - a1loge(p->log, rv, "usb_open_port: USBInterfaceOpen failed with 0x%x\n",rv); +#ifdef NEVER + a1loge(p->log, rv, "usb_open_port: USBInterfaceOpen %d failed with 0x%x\n",i, rv); IOObjectRelease(ioit); cleanup_device(p); return ICOM_SYS; +#else + a1logw(p->log, "usb_open_port: USBInterfaceOpen %d failed with 0x%x\n",i,rv); + continue; +#endif } /* Get the end point details, and set reference to pipe no and interfece ix */ @@ -580,6 +588,9 @@ static int icoms_usb_transaction( a1logd(p->log, 8, "icoms_usb_transaction: req type 0x%x ep 0x%x size %d\n",ttype,endpoint,length); + if (transferred != NULL) + *transferred = 0; + if (ttype != icom_usb_trantype_interrutpt && ttype != icom_usb_trantype_bulk) { /* We only handle interrupt & bulk, not control */ |