kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'master' into 'master'
sanei_usb: allow non-configured devices on macOS for libusb-1.x See merge request sane-project/backends!358merge-requests/418/head
commit
867aeb7d09
|
@ -109,6 +109,13 @@
|
||||||
#ifndef SSIZE_MAX
|
#ifndef SSIZE_MAX
|
||||||
# define SSIZE_MAX LONG_MAX
|
# define SSIZE_MAX LONG_MAX
|
||||||
#endif
|
#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 data */
|
||||||
static bjnp_device_t device[BJNP_NO_DEVICES];
|
static bjnp_device_t device[BJNP_NO_DEVICES];
|
||||||
|
|
|
@ -1859,6 +1859,11 @@ static void libusb_scan_devices(void)
|
||||||
continue;
|
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)
|
if (config == 0)
|
||||||
{
|
{
|
||||||
DBG (1,
|
DBG (1,
|
||||||
|
@ -1866,6 +1871,7 @@ static void libusb_scan_devices(void)
|
||||||
vid, pid, busno, address);
|
vid, pid, busno, address);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = libusb_get_config_descriptor (dev, 0, &config0);
|
ret = libusb_get_config_descriptor (dev, 0, &config0);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
@ -2614,11 +2620,17 @@ sanei_usb_open (SANE_String_Const devname, SANE_Int * dn)
|
||||||
return SANE_STATUS_INVAL;
|
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)
|
if (config == 0)
|
||||||
{
|
{
|
||||||
DBG (1, "sanei_usb_open: device `%s' not configured?\n", devname);
|
DBG (1, "sanei_usb_open: device `%s' not configured?\n", devname);
|
||||||
return SANE_STATUS_INVAL;
|
return SANE_STATUS_INVAL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
result = libusb_get_device_descriptor (dev, &desc);
|
result = libusb_get_device_descriptor (dev, &desc);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
|
|
Ładowanie…
Reference in New Issue