From d8eb9844f52b72cbb7ffed51d8c1dc49f68356c6 Mon Sep 17 00:00:00 2001 From: Tamer Hassan Date: Sat, 9 Mar 2024 12:20:15 +0400 Subject: [PATCH 1/2] egismoc: add 0587 support (also supports 0586 but missing device file) --- data/autosuspend.hwdb | 1 + libfprint/drivers/egismoc/egismoc.c | 80 ++++++++- libfprint/drivers/egismoc/egismoc.h | 7 +- tests/egismoc-0587/custom.pcapng | Bin 0 -> 92988 bytes tests/egismoc-0587/custom.py | 156 ++++++++++++++++ tests/egismoc-0587/device | 270 ++++++++++++++++++++++++++++ tests/meson.build | 1 + 7 files changed, 508 insertions(+), 7 deletions(-) create mode 100644 tests/egismoc-0587/custom.pcapng create mode 100755 tests/egismoc-0587/custom.py create mode 100644 tests/egismoc-0587/device diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb index 8e0e6eab..f9842ae4 100644 --- a/data/autosuspend.hwdb +++ b/data/autosuspend.hwdb @@ -79,6 +79,7 @@ usb:v1C7Ap0571* # Supported by libfprint driver egismoc usb:v1C7Ap0582* +usb:v1C7Ap0587* usb:v1C7Ap05A1* ID_AUTOSUSPEND=1 ID_PERSIST=0 diff --git a/libfprint/drivers/egismoc/egismoc.c b/libfprint/drivers/egismoc/egismoc.c index 336ea53c..97997a2d 100644 --- a/libfprint/drivers/egismoc/egismoc.c +++ b/libfprint/drivers/egismoc/egismoc.c @@ -43,14 +43,20 @@ struct _FpiDeviceEgisMoc FpiSsm *cmd_ssm; FpiUsbTransfer *cmd_transfer; GCancellable *interrupt_cancellable; - GPtrArray *enrolled_ids; + gint max_enroll_stages; }; G_DEFINE_TYPE (FpiDeviceEgisMoc, fpi_device_egismoc, FP_TYPE_DEVICE); static const FpIdEntry egismoc_id_table[] = { { .vid = 0x1c7a, .pid = 0x0582, .driver_data = EGISMOC_DRIVER_CHECK_PREFIX_TYPE1 }, + /* + * 0x0586 is supported in the same way as 0587 per user report, but missing submission of device file to be included + * + * { .vid = 0x1c7a, .pid = 0x0586, .driver_data = EGISMOC_DRIVER_CHECK_PREFIX_TYPE1 | EGISMOC_DRIVER_MAX_ENROLL_STAGES_20 }, + */ + { .vid = 0x1c7a, .pid = 0x0587, .driver_data = EGISMOC_DRIVER_CHECK_PREFIX_TYPE1 | EGISMOC_DRIVER_MAX_ENROLL_STAGES_20 }, { .vid = 0x1c7a, .pid = 0x05a1, .driver_data = EGISMOC_DRIVER_CHECK_PREFIX_TYPE2 }, { .vid = 0, .pid = 0, .driver_data = 0 } }; @@ -769,7 +775,7 @@ egismoc_enroll_status_report (FpDevice *device, enroll_print->stage++; fp_info ("Partial capture successful. Please touch the sensor again (%d/%d)", enroll_print->stage, - EGISMOC_MAX_ENROLL_NUM); + self->max_enroll_stages); fpi_device_enroll_progress (device, enroll_print->stage, enroll_print->print, NULL); break; @@ -849,7 +855,7 @@ egismoc_read_capture_cb (FpDevice *device, egismoc_enroll_status_report (device, enroll_print, ENROLL_STATUS_RETRY, error); } - if (enroll_print->stage == EGISMOC_ENROLL_TIMES) + if (enroll_print->stage == self->max_enroll_stages) fpi_ssm_next_state (self->task_ssm); else fpi_ssm_jump_to_state (self->task_ssm, ENROLL_CAPTURE_SENSOR_RESET); @@ -1460,6 +1466,71 @@ egismoc_dev_init_handler (FpiSsm *ssm, NULL); } +static void +egismoc_probe (FpDevice *device) +{ + GUsbDevice *usb_dev; + GError *error = NULL; + g_autofree gchar *serial = NULL; + FpiDeviceEgisMoc *self = FPI_DEVICE_EGISMOC (device); + + fp_dbg ("%s enter --> ", G_STRFUNC); + + /* Claim usb interface */ + usb_dev = fpi_device_get_usb_device (device); + if (!g_usb_device_open (usb_dev, &error)) + { + fp_dbg ("%s g_usb_device_open failed %s", G_STRFUNC, error->message); + fpi_device_probe_complete (device, NULL, NULL, error); + return; + } + + if (!g_usb_device_reset (usb_dev, &error)) + { + fp_dbg ("%s g_usb_device_reset failed %s", G_STRFUNC, error->message); + g_usb_device_close (usb_dev, NULL); + fpi_device_probe_complete (device, NULL, NULL, error); + return; + } + + if (!g_usb_device_claim_interface (usb_dev, 0, 0, &error)) + { + fp_dbg ("%s g_usb_device_claim_interface failed %s", G_STRFUNC, error->message); + g_usb_device_close (usb_dev, NULL); + fpi_device_probe_complete (device, NULL, NULL, error); + return; + } + + if (g_strcmp0 (g_getenv ("FP_DEVICE_EMULATION"), "1") == 0) + serial = g_strdup ("emulated-device"); + else + serial = g_usb_device_get_string_descriptor (usb_dev, + g_usb_device_get_serial_number_index (usb_dev), + &error); + + if (error) + { + fp_dbg ("%s g_usb_device_get_string_descriptor failed %s", G_STRFUNC, error->message); + g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (device)), + 0, 0, NULL); + g_usb_device_close (usb_dev, NULL); + fpi_device_probe_complete (device, NULL, NULL, error); + return; + } + + if (fpi_device_get_driver_data (device) & EGISMOC_DRIVER_MAX_ENROLL_STAGES_20) + self->max_enroll_stages = 20; + else + self->max_enroll_stages = EGISMOC_MAX_ENROLL_STAGES_DEFAULT; + + fpi_device_set_nr_enroll_stages (device, self->max_enroll_stages); + + g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (device)), 0, 0, NULL); + g_usb_device_close (usb_dev, NULL); + + fpi_device_probe_complete (device, serial, NULL, error); +} + static void egismoc_open (FpDevice *device) { @@ -1540,10 +1611,11 @@ fpi_device_egismoc_class_init (FpiDeviceEgisMocClass *klass) dev_class->type = FP_DEVICE_TYPE_USB; dev_class->scan_type = FP_SCAN_TYPE_PRESS; dev_class->id_table = egismoc_id_table; - dev_class->nr_enroll_stages = EGISMOC_ENROLL_TIMES; + dev_class->nr_enroll_stages = EGISMOC_MAX_ENROLL_STAGES_DEFAULT; /* device should be "always off" unless being used */ dev_class->temp_hot_seconds = 0; + dev_class->probe = egismoc_probe; dev_class->open = egismoc_open; dev_class->cancel = egismoc_cancel; dev_class->suspend = egismoc_suspend; diff --git a/libfprint/drivers/egismoc/egismoc.h b/libfprint/drivers/egismoc/egismoc.h index f027ea23..ef31d2cd 100644 --- a/libfprint/drivers/egismoc/egismoc.h +++ b/libfprint/drivers/egismoc/egismoc.h @@ -36,6 +36,7 @@ G_DECLARE_FINAL_TYPE (FpiDeviceEgisMoc, fpi_device_egismoc, FPI, DEVICE_EGISMOC, #define EGISMOC_DRIVER_CHECK_PREFIX_TYPE1 (1 << 0) #define EGISMOC_DRIVER_CHECK_PREFIX_TYPE2 (1 << 1) +#define EGISMOC_DRIVER_MAX_ENROLL_STAGES_20 (1 << 2) #define EGISMOC_EP_CMD_OUT (0x02 | FPI_USB_ENDPOINT_OUT) #define EGISMOC_EP_CMD_IN (0x81 | FPI_USB_ENDPOINT_IN) @@ -49,7 +50,7 @@ G_DECLARE_FINAL_TYPE (FpiDeviceEgisMoc, fpi_device_egismoc, FPI, DEVICE_EGISMOC, #define EGISMOC_USB_IN_RECV_LENGTH 4096 #define EGISMOC_USB_INTERRUPT_IN_RECV_LENGTH 64 -#define EGISMOC_ENROLL_TIMES 10 +#define EGISMOC_MAX_ENROLL_STAGES_DEFAULT 10 #define EGISMOC_MAX_ENROLL_NUM 10 #define EGISMOC_FINGERPRINT_DATA_SIZE 32 #define EGISMOC_LIST_RESPONSE_PREFIX_SIZE 14 @@ -100,11 +101,11 @@ static guchar cmd_read_capture[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x02, 0x static gsize cmd_read_capture_len = sizeof (cmd_read_capture) / sizeof (cmd_read_capture[0]); static guchar rsp_read_success_prefix[] = {0x00, 0x00, 0x00, 0x04}; static gsize rsp_read_success_prefix_len = sizeof (rsp_read_success_prefix) / sizeof (rsp_read_success_prefix[0]); -static guchar rsp_read_success_suffix[] = {0x0a, 0x90, 0x00}; +static guchar rsp_read_success_suffix[] = {0x90, 0x00}; static gsize rsp_read_success_suffix_len = sizeof (rsp_read_success_suffix) / sizeof (rsp_read_success_suffix[0]); static guchar rsp_read_offcenter_prefix[] = {0x00, 0x00, 0x00, 0x04}; static gsize rsp_read_offcenter_prefix_len = sizeof (rsp_read_offcenter_prefix) / sizeof (rsp_read_offcenter_prefix[0]); -static guchar rsp_read_offcenter_suffix[] = {0x0a, 0x64, 0x91}; +static guchar rsp_read_offcenter_suffix[] = {0x64, 0x91}; static gsize rsp_read_offcenter_suffix_len = sizeof (rsp_read_offcenter_suffix) / sizeof (rsp_read_offcenter_suffix[0]); static guchar rsp_read_dirty_prefix[] = {0x00, 0x00, 0x00, 0x02, 0x64}; static gsize rsp_read_dirty_prefix_len = sizeof (rsp_read_dirty_prefix) / sizeof (rsp_read_dirty_prefix[0]); diff --git a/tests/egismoc-0587/custom.pcapng b/tests/egismoc-0587/custom.pcapng new file mode 100644 index 0000000000000000000000000000000000000000..c721929c2e46976dceaf808a77f9e30df486a586 GIT binary patch literal 92988 zcmd5_2bdJa*6j`CC>co$C^_d$69hq!Rm23mHwp+yT2U19AecaL5s|2(pd#`s7*JGj z5J55`Nuq%y3Wy*m=bdh!-1koP0Yvbwjb zd1VqjUzR1=YGBoGc;BG3&I5+0bs2u&fT7iHte)0k#K-~FZt7k=ZE*A2^&2*?SMS=i zY7Y#CPxb71O`|#us#{iyRl@2vc=)K%X-(=hsZ+0Z{YJG14j4XQxHm?iE{W*9UAY z*j8-kwNUp!wL>XZvX#pkb?=?SMhtIg<$`u%f!A0g#q`XNA|^yMP$ddH zN&Gy?Rjs5XYjy*83psc!_W+j-?_(t{uFoI9g|SqH&tMU;&?|U@#qx~vDWQMsC+74X z2(PgcKG$dIPa+mXG*Bf9Jn>laq{5&8rL0^z#w5emTse}()7TW-%3&ctkF)ZWMJmqV zKzAOVl6lzggS@`;u-40qR2~vO#Yy->Kg{dIl&C!X7C3D{#7dl`9dQ=^NW?__>P5TD zQx_@i2%pE)_G1y#zp35p(_+W@6SMY1TZ?GJF#QBuS(Y@0b^}Zcm zV~rGNxlcr#SHfqoW+@W?%9Q$6bE}!v2)w?jm2P#gdcmuP@Y=GFljr5xS>a-{&>t<* zu<2(aHpQ6--8yRtz*`)@*Q;6aJ0v51?KXrz<#Q2RRz&wZ;qZsf&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ziIZ#8>=pkSz1LFX2cM>x+!_sk)xSm;XK0NGpKJ8R-`+He=J};x(eZ?ylJUs39rFC0 zmqk2IpJKnt63;w8?^PX@=Mz48enGjmGrnW?t?fKkrK9rv&{)z_1OP^G^jk>ai{HDNhOi-q-b-M_50M zW1esRcJY748CofSbZfP5t~aeNb^-x%rI)~Owx>ZwKJLrk1FsG5V+~1OuGOt?`qyf} zQ(5t89gh0);9K6bGS?0ssoY8VzHYyh3l`yD?BMOXkZpsZGmw6CE@1k{-Ud6}U zU8&xV2cqr22OjF8#yEL59amG{9M0+Om@U>EYa4Ld(6?BLlWWu~m;Yn7D~@P<+P`v* zCgt&e%=Q%Er$gJZ5ayM|R9Z{q!C1V)3K%F9i&Ic5F)cgX;L#xknYPGe0&Z{7rCw zOf1=@Gw!RfU|ue+)>Z90`5FYZw~71>!^ZG8SR)l0&z)w$C#t5G!f$)J_nl$V6F!6O z;p4GNb*&S%i;wrWpj}v^wF$QepmO}5Y8d#m_9X8iKylx3owq#5Kr$%UuPbtPSH7&) zp5(o&3BN;CZ}+<3`%ZJb_R8B`jo090nt!|JK-+3~`wmz)ai>--TR_$SP7r+KU*~y?XL%)!J4HoU+(rIe4XS9QYhQgO{CLdKO~f0oueOWmt6_HQpi?+s{S(?{!#1bNcJc9g zAG8aLA76d8w#E0g!O0%lSJgd{ z+`d|?sQ8{4j*DnxgZ7W{`07dEwE+*SzE_gN+lI#DNZ`d1jT5&Apz{6SV}Ba>>i$*k m`R=7+{=W}+0r1m-7puNkm3s}~;o{zOx;z5Fk_TMEeE5F>3ZJ_G literal 0 HcmV?d00001 diff --git a/tests/egismoc-0587/custom.py b/tests/egismoc-0587/custom.py new file mode 100755 index 00000000..3a662380 --- /dev/null +++ b/tests/egismoc-0587/custom.py @@ -0,0 +1,156 @@ +#!/usr/bin/python3 + +import traceback +import sys +import time +import gi + +gi.require_version('FPrint', '2.0') +from gi.repository import FPrint, GLib + +# Exit with error on any exception, included those happening in async callbacks +sys.excepthook = lambda *args: (traceback.print_exception(*args), sys.exit(1)) + +ctx = GLib.main_context_default() + +c = FPrint.Context() +c.enumerate() +devices = c.get_devices() + +d = devices[0] +del devices + +d.open_sync() + +assert d.get_driver() == "egismoc" +assert not d.has_feature(FPrint.DeviceFeature.CAPTURE) +assert d.has_feature(FPrint.DeviceFeature.IDENTIFY) +assert d.has_feature(FPrint.DeviceFeature.VERIFY) +assert d.has_feature(FPrint.DeviceFeature.DUPLICATES_CHECK) +assert d.has_feature(FPrint.DeviceFeature.STORAGE) +assert d.has_feature(FPrint.DeviceFeature.STORAGE_LIST) +assert d.has_feature(FPrint.DeviceFeature.STORAGE_DELETE) +assert d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR) + +def enroll_progress(*args): + print("finger status: ", d.get_finger_status()) + print('enroll progress: ' + str(args)) + +def identify_done(dev, res): + global identified + identified = True + identify_match, identify_print = dev.identify_finish(res) + print('indentification_done: ', identify_match, identify_print) + assert identify_match.equal(identify_print) + +# Beginning with list and clear assumes you begin with >0 prints enrolled before capturing + +print("listing - device should have prints") +stored = d.list_prints_sync() +assert len(stored) > 0 +del stored + +print("clear device storage") +d.clear_storage_sync() +print("clear done") + +print("listing - device should be empty") +stored = d.list_prints_sync() +assert len(stored) == 0 +del stored + +print("enrolling") +template = FPrint.Print.new(d) +template.set_finger(FPrint.Finger.LEFT_INDEX) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +p1 = d.enroll_sync(template, None, enroll_progress, None) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +print("enroll done") +del template + +print("listing - device should have 1 print") +stored = d.list_prints_sync() +assert len(stored) == 1 +assert stored[0].equal(p1) + +print("verifying") +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +verify_res, verify_print = d.verify_sync(p1) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +print("verify done") +assert verify_res == True + +identified = False +deserialized_prints = [] +for p in stored: + deserialized_prints.append(FPrint.Print.deserialize(p.serialize())) + assert deserialized_prints[-1].equal(p) +del stored + +print('async identifying') +d.identify(deserialized_prints, callback=identify_done) +del deserialized_prints + +while not identified: + ctx.iteration(True) + +print("try to enroll duplicate") +template = FPrint.Print.new(d) +template.set_finger(FPrint.Finger.RIGHT_INDEX) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +try: + d.enroll_sync(template, None, enroll_progress, None) +except GLib.Error as error: + assert error.matches(FPrint.DeviceError.quark(), + FPrint.DeviceError.DATA_DUPLICATE) +except Exception as exc: + raise +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +print("duplicate enroll attempt done") + +print("listing - device should still only have 1 print") +stored = d.list_prints_sync() +assert len(stored) == 1 +assert stored[0].equal(p1) +del stored + +print("enroll new finger") +template = FPrint.Print.new(d) +template.set_finger(FPrint.Finger.RIGHT_INDEX) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +p2 = d.enroll_sync(template, None, enroll_progress, None) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +print("enroll new finger done") +del template + +print("listing - device should have 2 prints") +stored = d.list_prints_sync() +assert len(stored) == 2 +assert (stored[0].equal(p1) and stored[1].equal(p2)) or (stored[0].equal(p2) and stored[1].equal(p1)) +del stored + +print("deleting first print") +d.delete_print_sync(p1) +print("delete done") +del p1 + +print("listing - device should only have second print") +stored = d.list_prints_sync() +assert len(stored) == 1 +assert stored[0].equal(p2) +del stored +del p2 + +print("clear device storage") +d.clear_storage_sync() +print("clear done") + +print("listing - device should be empty") +stored = d.list_prints_sync() +assert len(stored) == 0 +del stored + +d.close_sync() + +del d +del c diff --git a/tests/egismoc-0587/device b/tests/egismoc-0587/device new file mode 100644 index 00000000..91744df1 --- /dev/null +++ b/tests/egismoc-0587/device @@ -0,0 +1,270 @@ +P: /devices/pci0000:00/0000:00:14.0/usb3/3-5 +N: bus/usb/003/009=12010002FF0000407A1C870567640102030109022700010100A0320904000003FF000000070581020002000705020200020007058303400005 +E: BUSNUM=003 +E: DEVNAME=/dev/bus/usb/003/009 +E: DEVNUM=009 +E: DEVTYPE=usb_device +E: DRIVER=usb +E: ID_AUTOSUSPEND=1 +E: ID_BUS=usb +E: ID_MODEL=ETU905A88-E +E: ID_MODEL_ENC=ETU905A88-E +E: ID_MODEL_ID=0587 +E: ID_PATH=pci-0000:00:14.0-usb-0:5 +E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_5 +E: ID_PATH_WITH_USB_REVISION=pci-0000:00:14.0-usbv2-0:5 +E: ID_PERSIST=0 +E: ID_REVISION=6467 +E: ID_SERIAL=EGIS_ETU905A88-E_198427PCU834 +E: ID_SERIAL_SHORT=198427PCU834 +E: ID_USB_INTERFACES=:ff0000: +E: ID_USB_MODEL=ETU905A88-E +E: ID_USB_MODEL_ENC=ETU905A88-E +E: ID_USB_MODEL_ID=0587 +E: ID_USB_REVISION=6467 +E: ID_USB_SERIAL=EGIS_ETU905A88-E_198427PCU834 +E: ID_USB_SERIAL_SHORT=198427PCU834 +E: ID_USB_VENDOR=EGIS +E: ID_USB_VENDOR_ENC=EGIS +E: ID_USB_VENDOR_ID=1c7a +E: ID_VENDOR=EGIS +E: ID_VENDOR_ENC=EGIS +E: ID_VENDOR_FROM_DATABASE=LighTuning Technology Inc. +E: ID_VENDOR_ID=1c7a +E: MAJOR=189 +E: MINOR=264 +E: PRODUCT=1c7a/587/6467 +E: SUBSYSTEM=usb +E: TYPE=255/0/0 +A: authorized=1\n +A: avoid_reset_quirk=0\n +A: bConfigurationValue=1\n +A: bDeviceClass=ff\n +A: bDeviceProtocol=00\n +A: bDeviceSubClass=00\n +A: bMaxPacketSize0=64\n +A: bMaxPower=100mA\n +A: bNumConfigurations=1\n +A: bNumInterfaces= 1\n +A: bcdDevice=6467\n +A: bmAttributes=a0\n +A: busnum=3\n +A: configuration= +H: descriptors=12010002FF0000407A1C870567640102030109022700010100A0320904000003FF000000070581020002000705020200020007058303400005 +A: dev=189:264\n +A: devnum=9\n +A: devpath=5\n +L: driver=../../../../../bus/usb/drivers/usb +L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4e/device:4f/device:54 +A: idProduct=0587\n +A: idVendor=1c7a\n +A: ltm_capable=no\n +A: manufacturer=EGIS\n +A: maxchild=0\n +A: physical_location/dock=no\n +A: physical_location/horizontal_position=left\n +A: physical_location/lid=no\n +A: physical_location/panel=top\n +A: physical_location/vertical_position=upper\n +L: port=../3-0:1.0/usb3-port5 +A: power/active_duration=58096\n +A: power/async=enabled\n +A: power/autosuspend=2\n +A: power/autosuspend_delay_ms=2000\n +A: power/connected_duration=183928\n +A: power/control=auto\n +A: power/level=auto\n +A: power/persist=0\n +A: power/runtime_active_kids=0\n +A: power/runtime_active_time=58510\n +A: power/runtime_enabled=enabled\n +A: power/runtime_status=active\n +A: power/runtime_suspended_time=125136\n +A: power/runtime_usage=0\n +A: power/wakeup=disabled\n +A: power/wakeup_abort_count=\n +A: power/wakeup_active=\n +A: power/wakeup_active_count=\n +A: power/wakeup_count=\n +A: power/wakeup_expire_count=\n +A: power/wakeup_last_time_ms=\n +A: power/wakeup_max_time_ms=\n +A: power/wakeup_total_time_ms=\n +A: product=ETU905A88-E\n +A: quirks=0x0\n +A: removable=fixed\n +A: rx_lanes=1\n +A: serial=198427PCU834\n +A: speed=480\n +A: tx_lanes=1\n +A: urbnum=547\n +A: version= 2.00\n + +P: /devices/pci0000:00/0000:00:14.0/usb3 +N: bus/usb/003/001=12010002090001406B1D020006060302010109021900010100E0000904000001090000000705810304000C +E: BUSNUM=003 +E: CURRENT_TAGS=:seat: +E: DEVNAME=/dev/bus/usb/003/001 +E: DEVNUM=001 +E: DEVTYPE=usb_device +E: DRIVER=usb +E: ID_AUTOSUSPEND=1 +E: ID_BUS=usb +E: ID_FOR_SEAT=usb-pci-0000_00_14_0 +E: ID_MODEL=xHCI_Host_Controller +E: ID_MODEL_ENC=xHCI\x20Host\x20Controller +E: ID_MODEL_FROM_DATABASE=2.0 root hub +E: ID_MODEL_ID=0002 +E: ID_PATH=pci-0000:00:14.0 +E: ID_PATH_TAG=pci-0000_00_14_0 +E: ID_REVISION=0606 +E: ID_SERIAL=Linux_6.6.0-14-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0 +E: ID_SERIAL_SHORT=0000:00:14.0 +E: ID_USB_INTERFACES=:090000: +E: ID_USB_MODEL=xHCI_Host_Controller +E: ID_USB_MODEL_ENC=xHCI\x20Host\x20Controller +E: ID_USB_MODEL_ID=0002 +E: ID_USB_REVISION=0606 +E: ID_USB_SERIAL=Linux_6.6.0-14-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0 +E: ID_USB_SERIAL_SHORT=0000:00:14.0 +E: ID_USB_VENDOR=Linux_6.6.0-14-generic_xhci-hcd +E: ID_USB_VENDOR_ENC=Linux\x206.6.0-14-generic\x20xhci-hcd +E: ID_USB_VENDOR_ID=1d6b +E: ID_VENDOR=Linux_6.6.0-14-generic_xhci-hcd +E: ID_VENDOR_ENC=Linux\x206.6.0-14-generic\x20xhci-hcd +E: ID_VENDOR_FROM_DATABASE=Linux Foundation +E: ID_VENDOR_ID=1d6b +E: MAJOR=189 +E: MINOR=256 +E: PRODUCT=1d6b/2/606 +E: SUBSYSTEM=usb +E: TAGS=:seat: +E: TYPE=9/0/1 +A: authorized=1\n +A: authorized_default=1\n +A: avoid_reset_quirk=0\n +A: bConfigurationValue=1\n +A: bDeviceClass=09\n +A: bDeviceProtocol=01\n +A: bDeviceSubClass=00\n +A: bMaxPacketSize0=64\n +A: bMaxPower=0mA\n +A: bNumConfigurations=1\n +A: bNumInterfaces= 1\n +A: bcdDevice=0606\n +A: bmAttributes=e0\n +A: busnum=3\n +A: configuration= +H: descriptors=12010002090001406B1D020006060302010109021900010100E0000904000001090000000705810304000C +A: dev=189:256\n +A: devnum=1\n +A: devpath=0\n +L: driver=../../../../bus/usb/drivers/usb +L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4e/device:4f +A: idProduct=0002\n +A: idVendor=1d6b\n +A: interface_authorized_default=1\n +A: ltm_capable=no\n +A: manufacturer=Linux 6.6.0-14-generic xhci-hcd\n +A: maxchild=12\n +A: power/active_duration=5145268\n +A: power/async=enabled\n +A: power/autosuspend=0\n +A: power/autosuspend_delay_ms=0\n +A: power/connected_duration=5191200\n +A: power/control=auto\n +A: power/level=auto\n +A: power/runtime_active_kids=2\n +A: power/runtime_active_time=5145262\n +A: power/runtime_enabled=enabled\n +A: power/runtime_status=active\n +A: power/runtime_suspended_time=45937\n +A: power/runtime_usage=0\n +A: power/wakeup=disabled\n +A: power/wakeup_abort_count=\n +A: power/wakeup_active=\n +A: power/wakeup_active_count=\n +A: power/wakeup_count=\n +A: power/wakeup_expire_count=\n +A: power/wakeup_last_time_ms=\n +A: power/wakeup_max_time_ms=\n +A: power/wakeup_total_time_ms=\n +A: product=xHCI Host Controller\n +A: quirks=0x0\n +A: removable=unknown\n +A: rx_lanes=1\n +A: serial=0000:00:14.0\n +A: speed=480\n +A: tx_lanes=1\n +A: urbnum=637\n +A: version= 2.00\n + +P: /devices/pci0000:00/0000:00:14.0 +E: DRIVER=xhci_hcd +E: ID_AUTOSUSPEND=1 +E: ID_MODEL_FROM_DATABASE=Alder Lake PCH USB 3.2 xHCI Host Controller +E: ID_PATH=pci-0000:00:14.0 +E: ID_PATH_TAG=pci-0000_00_14_0 +E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller +E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI +E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller +E: ID_VENDOR_FROM_DATABASE=Intel Corporation +E: MODALIAS=pci:v00008086d000051EDsv00001043sd0000201Fbc0Csc03i30 +E: PCI_CLASS=C0330 +E: PCI_ID=8086:51ED +E: PCI_SLOT_NAME=0000:00:14.0 +E: PCI_SUBSYS_ID=1043:201F +E: SUBSYSTEM=pci +A: ari_enabled=0\n +A: broken_parity_status=0\n +A: class=0x0c0330\n +H: config=8680ED51060490020130030C000080000400262F62000000000000000000000000000000000000000000000043101F20000000007000000000000000FF010000FD0134A089C27F8000000000000000003F6DD80F000000000000000000000000316000000000000000000000000000000180C2C1080000000000000000000000059087001805E0FE000000000000000009B014F01000400100000000C10A080000080E00001800008F50020000010000090000018680C00009001014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B50F110112000000 +A: consistent_dma_mask_bits=64\n +A: d3cold_allowed=1\n +A: dbc=disabled\n +A: dbc_bInterfaceProtocol=01\n +A: dbc_bcdDevice=0010\n +A: dbc_idProduct=0010\n +A: dbc_idVendor=1d6b\n +A: device=0x51ed\n +A: dma_mask_bits=64\n +L: driver=../../../bus/pci/drivers/xhci_hcd +A: driver_override=(null)\n +A: enable=1\n +L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4e +A: index=10\n +L: iommu=../../virtual/iommu/dmar1 +L: iommu_group=../../../kernel/iommu_groups/11 +A: irq=145\n +A: label=Onboard - Other\n +A: local_cpulist=0-19\n +A: local_cpus=fffff\n +A: modalias=pci:v00008086d000051EDsv00001043sd0000201Fbc0Csc03i30\n +A: msi_bus=1\n +A: msi_irqs/145=msi\n +A: numa_node=-1\n +A: pools=poolinfo - 0.1\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 1 32 128 1\nbuffer-32 0 0 32 0\nxHCI 1KB stream ctx arrays 0 0 1024 0\nxHCI 256 byte stream ctx arrays 0 0 256 0\nxHCI input/output contexts 10 11 2112 11\nxHCI ring segments 38 38 4096 38\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 6 32 128 1\nbuffer-32 0 0 32 0\n +A: power/async=enabled\n +A: power/control=auto\n +A: power/runtime_active_kids=2\n +A: power/runtime_active_time=5192072\n +A: power/runtime_enabled=enabled\n +A: power/runtime_status=active\n +A: power/runtime_suspended_time=0\n +A: power/runtime_usage=0\n +A: power/wakeup=enabled\n +A: power/wakeup_abort_count=0\n +A: power/wakeup_active=0\n +A: power/wakeup_active_count=0\n +A: power/wakeup_count=0\n +A: power/wakeup_expire_count=0\n +A: power/wakeup_last_time_ms=0\n +A: power/wakeup_max_time_ms=0\n +A: power/wakeup_total_time_ms=0\n +A: power_state=D0\n +A: resource=0x000000622f260000 0x000000622f26ffff 0x0000000000140204\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n +A: revision=0x01\n +A: subsystem_device=0x201f\n +A: subsystem_vendor=0x1043\n +A: vendor=0x8086\n + diff --git a/tests/meson.build b/tests/meson.build index dc3b70e2..7a7afc03 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -53,6 +53,7 @@ drivers_tests = [ 'egis0570', 'egismoc', 'egismoc-05a1', + 'egismoc-0587', 'fpcmoc', 'realtek', 'focaltech_moc', -- GitLab From 4c50d9b6a0cb45681e1cd08411df477772f6821c Mon Sep 17 00:00:00 2001 From: Tamer Hassan Date: Wed, 17 Apr 2024 16:09:36 +0400 Subject: [PATCH 2/2] egismoc: add 0586 support --- data/autosuspend.hwdb | 1 + libfprint/drivers/egismoc/egismoc.c | 6 +- tests/egismoc-0586/custom.pcapng | Bin 0 -> 92980 bytes tests/egismoc-0586/custom.py | 156 +++++++++++++++++ tests/egismoc-0586/device | 255 ++++++++++++++++++++++++++++ tests/meson.build | 1 + 6 files changed, 414 insertions(+), 5 deletions(-) create mode 100644 tests/egismoc-0586/custom.pcapng create mode 100755 tests/egismoc-0586/custom.py create mode 100644 tests/egismoc-0586/device diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb index f9842ae4..0e4c30ef 100644 --- a/data/autosuspend.hwdb +++ b/data/autosuspend.hwdb @@ -79,6 +79,7 @@ usb:v1C7Ap0571* # Supported by libfprint driver egismoc usb:v1C7Ap0582* +usb:v1C7Ap0586* usb:v1C7Ap0587* usb:v1C7Ap05A1* ID_AUTOSUSPEND=1 diff --git a/libfprint/drivers/egismoc/egismoc.c b/libfprint/drivers/egismoc/egismoc.c index 97997a2d..de5ec765 100644 --- a/libfprint/drivers/egismoc/egismoc.c +++ b/libfprint/drivers/egismoc/egismoc.c @@ -51,11 +51,7 @@ G_DEFINE_TYPE (FpiDeviceEgisMoc, fpi_device_egismoc, FP_TYPE_DEVICE); static const FpIdEntry egismoc_id_table[] = { { .vid = 0x1c7a, .pid = 0x0582, .driver_data = EGISMOC_DRIVER_CHECK_PREFIX_TYPE1 }, - /* - * 0x0586 is supported in the same way as 0587 per user report, but missing submission of device file to be included - * - * { .vid = 0x1c7a, .pid = 0x0586, .driver_data = EGISMOC_DRIVER_CHECK_PREFIX_TYPE1 | EGISMOC_DRIVER_MAX_ENROLL_STAGES_20 }, - */ + { .vid = 0x1c7a, .pid = 0x0586, .driver_data = EGISMOC_DRIVER_CHECK_PREFIX_TYPE1 | EGISMOC_DRIVER_MAX_ENROLL_STAGES_20 }, { .vid = 0x1c7a, .pid = 0x0587, .driver_data = EGISMOC_DRIVER_CHECK_PREFIX_TYPE1 | EGISMOC_DRIVER_MAX_ENROLL_STAGES_20 }, { .vid = 0x1c7a, .pid = 0x05a1, .driver_data = EGISMOC_DRIVER_CHECK_PREFIX_TYPE2 }, { .vid = 0, .pid = 0, .driver_data = 0 } diff --git a/tests/egismoc-0586/custom.pcapng b/tests/egismoc-0586/custom.pcapng new file mode 100644 index 0000000000000000000000000000000000000000..f43dc6f4d1c06801e083c37eaab5e45729444ebe GIT binary patch literal 92980 zcmd6Q2bdK__Whe73?NYi)KwT=6j%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!yv5`M!k+hC$Q9!TBnsxd!B!sa2@iRD{!Tjv?E+DVKjf-#UA_OzU<(2we~C3 zIQ8cF-#@U*jBVV5TE=OksjB^P$F`0etmh}w{8~gGj$mJo zrCP1jxxG|5N~HPaud@E&*bjL=IO^J3ox^n8Ub7FWX#P8AJZv-{_NC@${Y#ynC<)E4 z{pW{`=Hs4rQbz_IQRg#QdlTs|a>rEet9d@*a(}uN_Z!vs=taL@PqTf{JKQf~@rsS&mrRp3-TukmTD&Q(v zoNsU?7zKy@wJikwFu=6fn&A{li@k~>I-Whnk>gs-KWBH^yPVvSdPs4 zVeGt|eM0)~pMTl;kJ$dgye#tkyDNsjfBs8TpS7BgdqXSxkyUza=cTf&SS9nHDW6^Y ztkHbr2#8U%@3Sm*-9$Py|6hdbkk4F!i#P@DzX+F07|mZj&DuvEjyQ$=)#ZX+58}=9 z-`w)7)qL}xFDg!9|II5^`{U|w3YzczzxswBSgwlR$2khMZUD@NLxXYkM`!9_`oDV4 zqOz&_{a<}Q!gXjHSKvyn`VlUdFkCI);jwRi7pQa}ek~ssj4QA1FUfh{Xo~&)Uo2Nk zUJrI%$c|CuY-T}e#$nIzqRNGj?Vo7+{Maefa<{{zjaDa&gf2>syqehQ!vaK*U?shNd@%OwoYi+-{8oy%j-Z6J;o%?r=-+$t{{o?&0|Ja6)6YZ7bIk!;tM+^E6*LVfvx${40k9xT$^Ga9j-02gZv=6sOj>py1E{8sMtL90@ z!D?z3mqcyi?NO@I{!=Gf`-n3+-k-WRSRCXr7!~fT`{9@33HIOU j6aGHleaL<;VRMCj$y1HKs{N_*bbLG+%N%|zkDmS?t0mXh literal 0 HcmV?d00001 diff --git a/tests/egismoc-0586/custom.py b/tests/egismoc-0586/custom.py new file mode 100755 index 00000000..3a662380 --- /dev/null +++ b/tests/egismoc-0586/custom.py @@ -0,0 +1,156 @@ +#!/usr/bin/python3 + +import traceback +import sys +import time +import gi + +gi.require_version('FPrint', '2.0') +from gi.repository import FPrint, GLib + +# Exit with error on any exception, included those happening in async callbacks +sys.excepthook = lambda *args: (traceback.print_exception(*args), sys.exit(1)) + +ctx = GLib.main_context_default() + +c = FPrint.Context() +c.enumerate() +devices = c.get_devices() + +d = devices[0] +del devices + +d.open_sync() + +assert d.get_driver() == "egismoc" +assert not d.has_feature(FPrint.DeviceFeature.CAPTURE) +assert d.has_feature(FPrint.DeviceFeature.IDENTIFY) +assert d.has_feature(FPrint.DeviceFeature.VERIFY) +assert d.has_feature(FPrint.DeviceFeature.DUPLICATES_CHECK) +assert d.has_feature(FPrint.DeviceFeature.STORAGE) +assert d.has_feature(FPrint.DeviceFeature.STORAGE_LIST) +assert d.has_feature(FPrint.DeviceFeature.STORAGE_DELETE) +assert d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR) + +def enroll_progress(*args): + print("finger status: ", d.get_finger_status()) + print('enroll progress: ' + str(args)) + +def identify_done(dev, res): + global identified + identified = True + identify_match, identify_print = dev.identify_finish(res) + print('indentification_done: ', identify_match, identify_print) + assert identify_match.equal(identify_print) + +# Beginning with list and clear assumes you begin with >0 prints enrolled before capturing + +print("listing - device should have prints") +stored = d.list_prints_sync() +assert len(stored) > 0 +del stored + +print("clear device storage") +d.clear_storage_sync() +print("clear done") + +print("listing - device should be empty") +stored = d.list_prints_sync() +assert len(stored) == 0 +del stored + +print("enrolling") +template = FPrint.Print.new(d) +template.set_finger(FPrint.Finger.LEFT_INDEX) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +p1 = d.enroll_sync(template, None, enroll_progress, None) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +print("enroll done") +del template + +print("listing - device should have 1 print") +stored = d.list_prints_sync() +assert len(stored) == 1 +assert stored[0].equal(p1) + +print("verifying") +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +verify_res, verify_print = d.verify_sync(p1) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +print("verify done") +assert verify_res == True + +identified = False +deserialized_prints = [] +for p in stored: + deserialized_prints.append(FPrint.Print.deserialize(p.serialize())) + assert deserialized_prints[-1].equal(p) +del stored + +print('async identifying') +d.identify(deserialized_prints, callback=identify_done) +del deserialized_prints + +while not identified: + ctx.iteration(True) + +print("try to enroll duplicate") +template = FPrint.Print.new(d) +template.set_finger(FPrint.Finger.RIGHT_INDEX) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +try: + d.enroll_sync(template, None, enroll_progress, None) +except GLib.Error as error: + assert error.matches(FPrint.DeviceError.quark(), + FPrint.DeviceError.DATA_DUPLICATE) +except Exception as exc: + raise +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +print("duplicate enroll attempt done") + +print("listing - device should still only have 1 print") +stored = d.list_prints_sync() +assert len(stored) == 1 +assert stored[0].equal(p1) +del stored + +print("enroll new finger") +template = FPrint.Print.new(d) +template.set_finger(FPrint.Finger.RIGHT_INDEX) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +p2 = d.enroll_sync(template, None, enroll_progress, None) +assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE +print("enroll new finger done") +del template + +print("listing - device should have 2 prints") +stored = d.list_prints_sync() +assert len(stored) == 2 +assert (stored[0].equal(p1) and stored[1].equal(p2)) or (stored[0].equal(p2) and stored[1].equal(p1)) +del stored + +print("deleting first print") +d.delete_print_sync(p1) +print("delete done") +del p1 + +print("listing - device should only have second print") +stored = d.list_prints_sync() +assert len(stored) == 1 +assert stored[0].equal(p2) +del stored +del p2 + +print("clear device storage") +d.clear_storage_sync() +print("clear done") + +print("listing - device should be empty") +stored = d.list_prints_sync() +assert len(stored) == 0 +del stored + +d.close_sync() + +del d +del c diff --git a/tests/egismoc-0586/device b/tests/egismoc-0586/device new file mode 100644 index 00000000..fb41aeea --- /dev/null +++ b/tests/egismoc-0586/device @@ -0,0 +1,255 @@ +P: /devices/pci0000:00/0000:00:14.0/usb1/1-7 +N: bus/usb/001/021=12010002FF0000407A1C860556620102030109022700010100A0320904000003FF000000070581020002000705020200020007058303400005 +E: BUSNUM=001 +E: DEVNAME=/dev/bus/usb/001/021 +E: DEVNUM=021 +E: DEVTYPE=usb_device +E: DRIVER=usb +E: ID_AUTOSUSPEND=1 +E: ID_BUS=usb +E: ID_MODEL=ETU905A88-E +E: ID_MODEL_ENC=ETU905A88-E +E: ID_MODEL_ID=0586 +E: ID_PATH=pci-0000:00:14.0-usb-0:7 +E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_7 +E: ID_PATH_WITH_USB_REVISION=pci-0000:00:14.0-usbv2-0:7 +E: ID_PERSIST=0 +E: ID_REVISION=6256 +E: ID_SERIAL=EGIS_ETU905A88-E_0A5743PCU834 +E: ID_SERIAL_SHORT=0A5743PCU834 +E: ID_USB_INTERFACES=:ff0000: +E: ID_USB_MODEL=ETU905A88-E +E: ID_USB_MODEL_ENC=ETU905A88-E +E: ID_USB_MODEL_ID=0586 +E: ID_USB_REVISION=6256 +E: ID_USB_SERIAL=EGIS_ETU905A88-E_0A5743PCU834 +E: ID_USB_SERIAL_SHORT=0A5743PCU834 +E: ID_USB_VENDOR=EGIS +E: ID_USB_VENDOR_ENC=EGIS +E: ID_USB_VENDOR_ID=1c7a +E: ID_VENDOR=EGIS +E: ID_VENDOR_ENC=EGIS +E: ID_VENDOR_FROM_DATABASE=LighTuning Technology Inc. +E: ID_VENDOR_ID=1c7a +E: MAJOR=189 +E: MINOR=20 +E: PRODUCT=1c7a/586/6256 +E: SUBSYSTEM=usb +E: TYPE=255/0/0 +A: authorized=1\n +A: avoid_reset_quirk=0\n +A: bConfigurationValue=1\n +A: bDeviceClass=ff\n +A: bDeviceProtocol=00\n +A: bDeviceSubClass=00\n +A: bMaxPacketSize0=64\n +A: bMaxPower=100mA\n +A: bNumConfigurations=1\n +A: bNumInterfaces= 1\n +A: bcdDevice=6256\n +A: bmAttributes=a0\n +A: busnum=1\n +A: configuration= +H: descriptors=12010002FF0000407A1C860556620102030109022700010100A0320904000003FF000000070581020002000705020200020007058303400005 +A: dev=189:20\n +A: devnum=21\n +A: devpath=7\n +L: driver=../../../../../bus/usb/drivers/usb +L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4e/device:4f/device:56 +A: idProduct=0586\n +A: idVendor=1c7a\n +A: ltm_capable=no\n +A: manufacturer=EGIS\n +A: maxchild=0\n +A: physical_location/dock=no\n +A: physical_location/horizontal_position=center\n +A: physical_location/lid=no\n +A: physical_location/panel=front\n +A: physical_location/vertical_position=center\n +L: port=../1-0:1.0/usb1-port7 +A: power/active_duration=12644\n +A: power/autosuspend=2\n +A: power/autosuspend_delay_ms=2000\n +A: power/connected_duration=230907\n +A: power/control=auto\n +A: power/level=auto\n +A: power/persist=0\n +A: power/runtime_active_time=12929\n +A: power/runtime_status=active\n +A: power/runtime_suspended_time=217715\n +A: power/wakeup=disabled\n +A: power/wakeup_abort_count=\n +A: power/wakeup_active=\n +A: power/wakeup_active_count=\n +A: power/wakeup_count=\n +A: power/wakeup_expire_count=\n +A: power/wakeup_last_time_ms=\n +A: power/wakeup_max_time_ms=\n +A: power/wakeup_total_time_ms=\n +A: product=ETU905A88-E\n +A: quirks=0x0\n +A: removable=fixed\n +A: rx_lanes=1\n +A: serial=0A5743PCU834\n +A: speed=480\n +A: tx_lanes=1\n +A: urbnum=18\n +A: version= 2.00\n + +P: /devices/pci0000:00/0000:00:14.0/usb1 +N: bus/usb/001/001=12010002090001406B1D020008060302010109021900010100E0000904000001090000000705810304000C +E: BUSNUM=001 +E: CURRENT_TAGS=:seat: +E: DEVNAME=/dev/bus/usb/001/001 +E: DEVNUM=001 +E: DEVTYPE=usb_device +E: DRIVER=usb +E: ID_AUTOSUSPEND=1 +E: ID_BUS=usb +E: ID_FOR_SEAT=usb-pci-0000_00_14_0 +E: ID_MODEL=xHCI_Host_Controller +E: ID_MODEL_ENC=xHCI\x20Host\x20Controller +E: ID_MODEL_FROM_DATABASE=2.0 root hub +E: ID_MODEL_ID=0002 +E: ID_PATH=pci-0000:00:14.0 +E: ID_PATH_TAG=pci-0000_00_14_0 +E: ID_REVISION=0608 +E: ID_SERIAL=Linux_6.8.5-arch1-1_xhci-hcd_xHCI_Host_Controller_0000:00:14.0 +E: ID_SERIAL_SHORT=0000:00:14.0 +E: ID_USB_INTERFACES=:090000: +E: ID_USB_MODEL=xHCI_Host_Controller +E: ID_USB_MODEL_ENC=xHCI\x20Host\x20Controller +E: ID_USB_MODEL_ID=0002 +E: ID_USB_REVISION=0608 +E: ID_USB_SERIAL=Linux_6.8.5-arch1-1_xhci-hcd_xHCI_Host_Controller_0000:00:14.0 +E: ID_USB_SERIAL_SHORT=0000:00:14.0 +E: ID_USB_VENDOR=Linux_6.8.5-arch1-1_xhci-hcd +E: ID_USB_VENDOR_ENC=Linux\x206.8.5-arch1-1\x20xhci-hcd +E: ID_USB_VENDOR_ID=1d6b +E: ID_VENDOR=Linux_6.8.5-arch1-1_xhci-hcd +E: ID_VENDOR_ENC=Linux\x206.8.5-arch1-1\x20xhci-hcd +E: ID_VENDOR_FROM_DATABASE=Linux Foundation +E: ID_VENDOR_ID=1d6b +E: MAJOR=189 +E: MINOR=0 +E: PRODUCT=1d6b/2/608 +E: SUBSYSTEM=usb +E: TAGS=:seat: +E: TYPE=9/0/1 +A: authorized=1\n +A: authorized_default=1\n +A: avoid_reset_quirk=0\n +A: bConfigurationValue=1\n +A: bDeviceClass=09\n +A: bDeviceProtocol=01\n +A: bDeviceSubClass=00\n +A: bMaxPacketSize0=64\n +A: bMaxPower=0mA\n +A: bNumConfigurations=1\n +A: bNumInterfaces= 1\n +A: bcdDevice=0608\n +A: bmAttributes=e0\n +A: busnum=1\n +A: configuration= +H: descriptors=12010002090001406B1D020008060302010109021900010100E0000904000001090000000705810304000C +A: dev=189:0\n +A: devnum=1\n +A: devpath=0\n +L: driver=../../../../bus/usb/drivers/usb +L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4e/device:4f +A: idProduct=0002\n +A: idVendor=1d6b\n +A: interface_authorized_default=1\n +A: ltm_capable=no\n +A: manufacturer=Linux 6.8.5-arch1-1 xhci-hcd\n +A: maxchild=12\n +A: power/active_duration=73066477\n +A: power/autosuspend=0\n +A: power/autosuspend_delay_ms=0\n +A: power/connected_duration=73071614\n +A: power/control=auto\n +A: power/level=auto\n +A: power/runtime_active_time=73070027\n +A: power/runtime_status=active\n +A: power/runtime_suspended_time=0\n +A: power/wakeup=disabled\n +A: power/wakeup_abort_count=\n +A: power/wakeup_active=\n +A: power/wakeup_active_count=\n +A: power/wakeup_count=\n +A: power/wakeup_expire_count=\n +A: power/wakeup_last_time_ms=\n +A: power/wakeup_max_time_ms=\n +A: power/wakeup_total_time_ms=\n +A: product=xHCI Host Controller\n +A: quirks=0x0\n +A: removable=unknown\n +A: rx_lanes=1\n +A: serial=0000:00:14.0\n +A: speed=480\n +A: tx_lanes=1\n +A: urbnum=1111\n +A: version= 2.00\n + +P: /devices/pci0000:00/0000:00:14.0 +E: DRIVER=xhci_hcd +E: ID_AUTOSUSPEND=1 +E: ID_MODEL_FROM_DATABASE=Alder Lake PCH USB 3.2 xHCI Host Controller +E: ID_PATH=pci-0000:00:14.0 +E: ID_PATH_TAG=pci-0000_00_14_0 +E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller +E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI +E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller +E: ID_VENDOR_FROM_DATABASE=Intel Corporation +E: MODALIAS=pci:v00008086d000051EDsv00001043sd0000201Fbc0Csc03i30 +E: PCI_CLASS=C0330 +E: PCI_ID=8086:51ED +E: PCI_SLOT_NAME=0000:00:14.0 +E: PCI_SUBSYS_ID=1043:201F +E: SUBSYSTEM=pci +A: ari_enabled=0\n +A: broken_parity_status=0\n +A: class=0x0c0330\n +H: config=8680ED51060490020130030C000080000400220560000000000000000000000000000000000000000000000043101F20000000007000000000000000FF010000FD0134A089C27F8000000000000000003F6DD80F000000000000000000000000316000000000000000000000000000000180C2C10800000000000000000000000590B7001805E0FE000000000000000009B014F01000400100000000C10A080000080E00001800008F50020000010000090000018680C00009001014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B50F110112000000 +A: consistent_dma_mask_bits=64\n +A: d3cold_allowed=1\n +A: device=0x51ed\n +A: dma_mask_bits=64\n +L: driver=../../../bus/pci/drivers/xhci_hcd +A: driver_override=(null)\n +A: enable=1\n +L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4e +A: irq=143\n +A: local_cpulist=0-15\n +A: local_cpus=ffff\n +A: modalias=pci:v00008086d000051EDsv00001043sd0000201Fbc0Csc03i30\n +A: msi_bus=1\n +A: msi_irqs/143=msi\n +A: msi_irqs/144=msi\n +A: msi_irqs/145=msi\n +A: msi_irqs/146=msi\n +A: msi_irqs/147=msi\n +A: msi_irqs/148=msi\n +A: msi_irqs/149=msi\n +A: msi_irqs/150=msi\n +A: numa_node=-1\n +A: pools=poolinfo - 0.1\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0\nxHCI 1KB stream ctx arrays 0 0 1024 0\nxHCI 256 byte stream ctx arrays 0 0 256 0\nxHCI input/output contexts 8 9 2112 9\nxHCI ring segments 43 53 4096 53\nbuffer-2048 0 16 2048 8\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 128 32 1\n +A: power/control=auto\n +A: power/runtime_active_time=73070690\n +A: power/runtime_status=active\n +A: power/runtime_suspended_time=0\n +A: power/wakeup=enabled\n +A: power/wakeup_abort_count=0\n +A: power/wakeup_active=0\n +A: power/wakeup_active_count=0\n +A: power/wakeup_count=0\n +A: power/wakeup_expire_count=0\n +A: power/wakeup_last_time_ms=0\n +A: power/wakeup_max_time_ms=0\n +A: power/wakeup_total_time_ms=0\n +A: power_state=D0\n +A: resource=0x0000006005220000 0x000000600522ffff 0x0000000000140204\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n +A: revision=0x01\n +A: subsystem_device=0x201f\n +A: subsystem_vendor=0x1043\n +A: vendor=0x8086\n diff --git a/tests/meson.build b/tests/meson.build index 7a7afc03..2b9691ee 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -53,6 +53,7 @@ drivers_tests = [ 'egis0570', 'egismoc', 'egismoc-05a1', + 'egismoc-0586', 'egismoc-0587', 'fpcmoc', 'realtek', -- GitLab