Merge branch 'master' into 'master'

sanei_usb: allow non-configured devices on macOS for libusb-1.x

See merge request sane-project/backends!358
merge-requests/418/head
Oliver Schwartz 2020-04-23 14:13:27 +00:00
commit 867aeb7d09
2 zmienionych plików z 19 dodań i 0 usunięć

Wyświetl plik

@ -109,6 +109,13 @@
#ifndef SSIZE_MAX
# define SSIZE_MAX LONG_MAX
#endif
#ifndef HOST_NAME_MAX
# ifdef _POSIX_HOST_NAME_MAX
# define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
# else
# define HOST_NAME_MAX 255
# endif
#endif
/* static data */
static bjnp_device_t device[BJNP_NO_DEVICES];

Wyświetl plik

@ -1859,6 +1859,11 @@ static void libusb_scan_devices(void)
continue;
}
/* macOS won't configure several USB scanners (i.e. ScanSnap 300M) because their
* descriptors are vendor specific. As a result the device will get configured
* later during sanei_usb_open making it safe to ignore the configuration check
* here on these platforms. */
#if !defined(__APPLE__)
if (config == 0)
{
DBG (1,
@ -1866,6 +1871,7 @@ static void libusb_scan_devices(void)
vid, pid, busno, address);
continue;
}
#endif
ret = libusb_get_config_descriptor (dev, 0, &config0);
if (ret < 0)
@ -2614,11 +2620,17 @@ sanei_usb_open (SANE_String_Const devname, SANE_Int * dn)
return SANE_STATUS_INVAL;
}
/* macOS won't configure several USB scanners (i.e. ScanSnap 300M) because their
* descriptors are vendor specific. As a result the device will get configured
* later during sanei_usb_open making it safe to ignore the configuration check
* here on these platforms. */
#if !defined(__APPLE__)
if (config == 0)
{
DBG (1, "sanei_usb_open: device `%s' not configured?\n", devname);
return SANE_STATUS_INVAL;
}
#endif
result = libusb_get_device_descriptor (dev, &desc);
if (result < 0)