1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

scd: Let the CCID module auto detach the kernel driver.

* scd/ccid-driver.c (ccid_open_usb_reader): Call
libusb_set_auto_detach_kernel_driver.

* scd/scdaemon.c (oCompatibilityFlags): New.
(opts): Add option "compatibility-flags".
(compatibility_flags): New.
(main): Parse flags.
* scd/scdaemon.h (opt): Add field compat_flags.
(COMPAT_CCID_NO_AUTO_DETACH): New.
This commit is contained in:
Werner Koch 2024-03-06 11:54:33 +01:00
parent 00b877ecda
commit a1ea3b13e0
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 41 additions and 0 deletions

View file

@ -1779,6 +1779,20 @@ ccid_open_usb_reader (const char *spec_reader_name,
#ifdef USE_NPTH
npth_unprotect ();
#endif
if (!(opt.compat_flags & COMPAT_CCID_NO_AUTO_DETACH))
{
rc = libusb_set_auto_detach_kernel_driver (idev, 1);
if (rc)
{
#ifdef USE_NPTH
npth_protect ();
#endif
DEBUGOUT_1 ("note: set_auto_detach_kernel_driver failed: %d\n", rc);
#ifdef USE_NPTH
npth_unprotect ();
#endif
}
}
rc = libusb_claim_interface (idev, ifc_no);
if (rc)
{