diff --git a/README b/README index fbf76705..29846596 100644 --- a/README +++ b/README @@ -39,6 +39,10 @@ We include bozorth3 from the US export controlled distribution. We have determined that it is fine to ship bozorth3 in an open source project, see https://fprint.freedesktop.org/us-export-control.html +## TOD Informations + +See https://gitlab.freedesktop.org/3v1n0/libfprint/-/blob/tod/README.tod.md + ## Historical links Older versions of libfprint are available at: diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb index f3ee8fc6..42d22ca7 100644 --- a/data/autosuspend.hwdb +++ b/data/autosuspend.hwdb @@ -142,6 +142,7 @@ usb:v04F3p0C58* ID_PERSIST=0 # Supported by libfprint driver elanmoc +usb:v04F3p0C7D* usb:v04F3p0C7E* ID_AUTOSUSPEND=1 ID_PERSIST=0 @@ -158,6 +159,7 @@ usb:v27C6p60A2* usb:v27C6p639C* usb:v27C6p63AC* usb:v27C6p63BC* +usb:v27C6p63CC* usb:v27C6p6496* usb:v27C6p6584* usb:v27C6p658C* diff --git a/examples/meson.build b/examples/meson.build index 06615465..3f213470 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -21,3 +21,13 @@ executable('cpp-test', 'cpp-test.cpp', dependencies: libfprint_dep, ) + +if get_option('tod') + executable('tod-inspector', + sources: 'tod-inspector.c', + dependencies: [ + libfprint_dep, + tod_dep, + ], + ) +endif diff --git a/examples/tod-inspector.c b/examples/tod-inspector.c new file mode 100644 index 00000000..e2012fdd --- /dev/null +++ b/examples/tod-inspector.c @@ -0,0 +1,138 @@ +/* + * Shared library loader for libfprint + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include "libfprint/tod/tod-shared-loader.h" +#include "libfprint/fpi-device.h" + +static char * +id_table_to_string (FpDeviceType device_type, + const FpIdEntry *id_table) +{ + const FpIdEntry *entry; + char *str = NULL; + + if (!id_table) + return g_strdup ("INVALID: Empty ID table"); + + entry = id_table; + while (TRUE) + { + g_autofree char *value = NULL; + + if (device_type == FP_DEVICE_TYPE_VIRTUAL) + { + if (entry->virtual_envvar) + value = g_strdup (entry->virtual_envvar); + } + else if (device_type == FP_DEVICE_TYPE_USB) + { + if (entry->vid) + value = g_strdup_printf ("%04x:%04x", entry->vid, entry->pid); + } + else + { + return g_strdup ("Unsupported device type"); + } + + if (!value) + return str; + + if (!str) + { + str = g_steal_pointer (&value); + } + else + { + g_autofree char *tmp = g_steal_pointer (&str); + str = g_strconcat (tmp, ", ", value, NULL); + } + + entry++; + } + + return str; +} + +static const char * +device_type_to_string (FpDeviceType device_type) +{ + g_autoptr(GEnumClass) device_types = g_type_class_ref (fp_device_type_get_type ()); + GEnumValue *value = g_enum_get_value (device_types, device_type); + + return value->value_nick; +} + +static const char * +scan_type_to_string (FpScanType scan_type) +{ + g_autoptr(GEnumClass) scan_types = g_type_class_ref (fp_scan_type_get_type ()); + GEnumValue *value = g_enum_get_value (scan_types, scan_type); + + return value->value_nick; +} + +int +main (void) +{ + g_autoptr(GArray) shared_drivers = NULL; + guint i; + + fpi_tod_shared_drivers_register (); + + shared_drivers = fpi_tod_shared_drivers_get (); + g_print ("Found %u drivers\n", shared_drivers->len); + + for (i = 0; i < shared_drivers->len; i++) + { + GType driver = g_array_index (shared_drivers, GType, i); + g_autoptr(FpDeviceClass) cls = g_type_class_ref (driver); + g_autofree char *id_table = NULL; + g_autofree char *features = NULL; + + id_table = id_table_to_string (cls->type, cls->id_table); + features = g_flags_to_string (fp_device_feature_get_type (), cls->features); + + g_print ("ID: %s\n", cls->id); + g_print ("Full Name: %s\n", cls->full_name); + g_print ("Type: %s\n", device_type_to_string (cls->type)); + g_print ("Enroll stages: %d\n", cls->nr_enroll_stages); + g_print ("Scan type: %s\n", scan_type_to_string (cls->scan_type)); + g_print ("Supported Devices: %s\n", id_table); + g_print ("Supported features: %s\n", features); + g_print ("Implemented VFuncs:\n"); + g_print (" usb_discover: %s\n", cls->usb_discover ? "true" : "false"); + g_print (" probe: %s\n", cls->probe ? "true" : "false"); + g_print (" open: %s\n", cls->open ? "true" : "false"); + g_print (" close: %s\n", cls->close ? "true" : "false"); + g_print (" enroll: %s\n", cls->enroll ? "true" : "false"); + g_print (" verify: %s\n", cls->verify ? "true" : "false"); + g_print (" identify: %s\n", cls->identify ? "true" : "false"); + g_print (" capture: %s\n", cls->capture ? "true" : "false"); + g_print (" list: %s\n", cls->list ? "true" : "false"); + g_print (" delete: %s\n", cls->delete ? "true" : "false"); + g_print (" cancel: %s\n", cls->cancel ? "true" : "false"); + + if (i < shared_drivers->len - 1) + g_print ("------------\n"); + } + + fpi_tod_shared_drivers_unregister (); +} diff --git a/libfprint/drivers/elanmoc/elanmoc.c b/libfprint/drivers/elanmoc/elanmoc.c index aef386c1..69700a0c 100644 --- a/libfprint/drivers/elanmoc/elanmoc.c +++ b/libfprint/drivers/elanmoc/elanmoc.c @@ -25,6 +25,7 @@ G_DEFINE_TYPE (FpiDeviceElanmoc, fpi_device_elanmoc, FP_TYPE_DEVICE) static const FpIdEntry id_table[] = { + { .vid = 0x04f3, .pid = 0x0c7d, }, { .vid = 0x04f3, .pid = 0x0c7e, }, { .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */ }; diff --git a/libfprint/drivers/goodixmoc/goodix.c b/libfprint/drivers/goodixmoc/goodix.c index eb5e67a6..15a85323 100644 --- a/libfprint/drivers/goodixmoc/goodix.c +++ b/libfprint/drivers/goodixmoc/goodix.c @@ -1282,6 +1282,7 @@ gx_fp_probe (FpDevice *device) case 0x639C: case 0x63AC: case 0x63BC: + case 0x63CC: case 0x6A94: self->max_enroll_stage = 12; break; @@ -1505,6 +1506,7 @@ static const FpIdEntry id_table[] = { { .vid = 0x27c6, .pid = 0x639C, }, { .vid = 0x27c6, .pid = 0x63AC, }, { .vid = 0x27c6, .pid = 0x63BC, }, + { .vid = 0x27c6, .pid = 0x63CC, }, { .vid = 0x27c6, .pid = 0x6496, }, { .vid = 0x27c6, .pid = 0x6584, }, { .vid = 0x27c6, .pid = 0x658C, }, diff --git a/libfprint/drivers/goodixmoc/goodix_proto.h b/libfprint/drivers/goodixmoc/goodix_proto.h index bcd1cdd0..000be2fe 100644 --- a/libfprint/drivers/goodixmoc/goodix_proto.h +++ b/libfprint/drivers/goodixmoc/goodix_proto.h @@ -113,14 +113,16 @@ typedef struct _gxfp_enroll_init #pragma pack(push, 1) typedef struct _template_format { + uint8_t _0x43_byte; uint8_t type; uint8_t finger_index; + uint8_t pad0; uint8_t accountid[32]; uint8_t tid[32]; struct { - uint32_t size; - uint8_t data[56]; + uint8_t size; + uint8_t data[56]; } payload; uint8_t reserve[2]; } template_format_t, *ptemplate_format_t; diff --git a/libfprint/fp-context.c b/libfprint/fp-context.c index d706b475..a5b45e8f 100644 --- a/libfprint/fp-context.c +++ b/libfprint/fp-context.c @@ -27,15 +27,14 @@ #include -#ifdef HAVE_UDEV -#include -#endif - -#include #ifdef HAVE_LIBFPRINT_TOD #include "tod/tod-shared-loader.h" #endif +#ifdef HAVE_UDEV +#include +#endif + /** * SECTION: fp-context * @title: FpContext diff --git a/libfprint/fp-device.h b/libfprint/fp-device.h index 85be34c4..5a9dda0f 100644 --- a/libfprint/fp-device.h +++ b/libfprint/fp-device.h @@ -43,8 +43,8 @@ G_DECLARE_DERIVABLE_TYPE (FpDevice, fp_device, FP, DEVICE, GObject) */ typedef enum { FP_DEVICE_TYPE_VIRTUAL, - FP_DEVICE_TYPE_UDEV, FP_DEVICE_TYPE_USB, + FP_DEVICE_TYPE_UDEV, } FpDeviceType; /** diff --git a/libfprint/fpi-device.h b/libfprint/fpi-device.h index ba8820dd..aba30b10 100644 --- a/libfprint/fpi-device.h +++ b/libfprint/fpi-device.h @@ -53,6 +53,12 @@ struct _FpIdEntry guint vid; }; const gchar *virtual_envvar; + }; + guint64 driver_data; + + /* Elements added after TODv1 */ + union + { struct { FpiDeviceUdevSubtypeFlags udev_types; @@ -64,11 +70,10 @@ struct _FpIdEntry } hid_id; }; }; - guint64 driver_data; /*< private >*/ /* padding for future expansion */ - gpointer _padding_dummy[16]; + gpointer _padding_dummy[13]; }; /** @@ -149,16 +154,11 @@ struct _FpDeviceClass const gchar *full_name; FpDeviceType type; const FpIdEntry *id_table; - FpDeviceFeature features; /* Defaults for device properties */ gint nr_enroll_stages; FpScanType scan_type; - /* Simple device temperature model constants */ - gint32 temp_hot_seconds; - gint32 temp_cold_seconds; - /* Callbacks */ gint (*usb_discover) (GUsbDevice *usb_device); void (*probe) (FpDevice *device); @@ -170,15 +170,23 @@ struct _FpDeviceClass void (*capture) (FpDevice *device); void (*list) (FpDevice *device); void (*delete) (FpDevice * device); - void (*clear_storage) (FpDevice * device); void (*cancel) (FpDevice *device); - void (*suspend) (FpDevice *device); - void (*resume) (FpDevice *device); + + /* Class elements added after tod-v1 */ + FpDeviceFeature features; + + /* Simple device temperature model constants */ + gint32 temp_hot_seconds; + gint32 temp_cold_seconds; + + void (*clear_storage) (FpDevice * device); + void (*suspend) (FpDevice *device); + void (*resume) (FpDevice *device); /*< private >*/ /* padding for future expansion */ - gpointer _padding_dummy[32]; + gpointer _padding_dummy[27]; }; void fpi_device_class_auto_initialize_features (FpDeviceClass *device_class); diff --git a/libfprint/fpi-image.h b/libfprint/fpi-image.h index 3554bb7b..0ae19f9f 100644 --- a/libfprint/fpi-image.h +++ b/libfprint/fpi-image.h @@ -68,6 +68,8 @@ struct _FpImage GPtrArray *minutiae; guint ref_count; + + gpointer _padding_dummy[32]; }; gint fpi_std_sq_dev (const guint8 *buf, diff --git a/libfprint/fpi-spi-transfer.h b/libfprint/fpi-spi-transfer.h index 755b405f..0b75673b 100644 --- a/libfprint/fpi-spi-transfer.h +++ b/libfprint/fpi-spi-transfer.h @@ -73,6 +73,9 @@ struct _FpiSpiTransfer /* Data free function */ GDestroyNotify free_buffer_wr; GDestroyNotify free_buffer_rd; + + /* padding for future expansion */ + gpointer _padding_dummy[32]; }; GType fpi_spi_transfer_get_type (void) G_GNUC_CONST; diff --git a/libfprint/fpi-ssm.c b/libfprint/fpi-ssm.c index 8ceab674..8080f550 100644 --- a/libfprint/fpi-ssm.c +++ b/libfprint/fpi-ssm.c @@ -747,3 +747,7 @@ fpi_ssm_spi_transfer_with_weak_pointer_cb (FpiSpiTransfer *transfer, fpi_ssm_spi_transfer_cb (transfer, device, weak_ptr, error); } + +#ifdef TOD_LIBRARY +#include "tod/tod-fpi-ssm.c" +#endif diff --git a/libfprint/tod/libfprint-tod.ver b/libfprint/tod/libfprint-tod.ver deleted file mode 100644 index d18569f1..00000000 --- a/libfprint/tod/libfprint-tod.ver +++ /dev/null @@ -1,6 +0,0 @@ -LIBFPRINT_TOD_1.0.0 { -global: - fpi_*; -local: - *; -}; diff --git a/libfprint/tod/libfprint-tod.ver.in b/libfprint/tod/libfprint-tod.ver.in new file mode 100644 index 00000000..8166f164 --- /dev/null +++ b/libfprint/tod/libfprint-tod.ver.in @@ -0,0 +1,33 @@ +LIBFPRINT_TOD_@tod_soversion@.0.0 { +global: + fpi_*; + fpi_ssm_new_full; + fpi_ssm_jump_to_state_delayed; + fpi_ssm_mark_completed_delayed; + fpi_ssm_next_state_delayed; +local: + *; +}; + +LIBFPRINT_TOD_@tod_soversion@_1.92 { +global: + fpi_device_class_auto_initialize_features; + fpi_device_clear_storage_complete; + fpi_device_get_udev_data; + fpi_device_update_features; + fpi_spi_*; + fpi_ssm_get_device; + fpi_ssm_jump_to_state_delayed; + fpi_ssm_mark_completed_delayed; + fpi_ssm_new_full; + fpi_ssm_next_state_delayed; + fpi_ssm_spi_*; +} LIBFPRINT_TOD_@tod_soversion@.0.0; + +LIBFPRINT_TOD_@tod_soversion@_1.94 { +global: + fpi_device_critical_enter; + fpi_device_critical_leave; + fpi_device_resume_complete; + fpi_device_suspend_complete; +} LIBFPRINT_TOD_@tod_soversion@_1.92; diff --git a/libfprint/tod/meson.build b/libfprint/tod/meson.build index 58c48680..ba395c16 100644 --- a/libfprint/tod/meson.build +++ b/libfprint/tod/meson.build @@ -10,7 +10,11 @@ configure_file(output: 'tod-config.h', configuration: tod_conf) gmodule_dep = dependency('gmodule-2.0', version: '>=' + glib_min_version) deps += gmodule_dep -mapfile = files('libfprint-tod.ver') +mapfile = configure_file(input: 'libfprint-tod.ver.in', + output: 'libfprint-tod.ver', + configuration: { + 'tod_soversion' : tod_soversion, +}) libfprint_tod_private = static_library('fprint-tod-private', sources: [ @@ -22,19 +26,26 @@ libfprint_tod_private = static_library('fprint-tod-private', install: false, ) -tod_sources = [] +tod_sources = [ + 'tod-wrappers.c', + 'tod-symbols.h', +] foreach source: libfprint_private_sources tod_sources += '..' / source endforeach libfprint_tod = library(versioned_libname.split('lib')[1] + '-tod', + c_args: [ + '-DTOD_LIBRARY=1', + '-include', '@0@'.format(files('tod-symbols.h')[0]), + ], sources: [ tod_sources, ], soversion: tod_soversion, include_directories: include_directories('..'), link_args: [ - '-Wl,--version-script,@0@/@1@'.format(meson.source_root(), mapfile[0]), + '-Wl,--version-script,@0@'.format(mapfile), '-Wl,--unresolved-symbols=ignore-in-object-files' ], link_depends: mapfile, @@ -42,12 +53,12 @@ libfprint_tod = library(versioned_libname.split('lib')[1] + '-tod', dependencies: deps, install: true) -deps += declare_dependency( +tod_dep = declare_dependency( link_with: [ libfprint_tod, libfprint_tod_private, - ] -) + ]) +deps += tod_dep pkgconfig = import('pkgconfig') pkgconfig.generate(libfprint_tod, diff --git a/libfprint/tod/tod-fpi-ssm.c b/libfprint/tod/tod-fpi-ssm.c new file mode 100644 index 00000000..32e282f7 --- /dev/null +++ b/libfprint/tod/tod-fpi-ssm.c @@ -0,0 +1,67 @@ +/* + * Shared library loader for libfprint + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "tod-wrappers.h" +#include "fpi-ssm.h" + +static gboolean +check_delayed_cancellable (FpiSsm *machine, + GCancellable *cancellable) +{ + if (g_cancellable_is_cancelled (cancellable)) + { + fpi_ssm_mark_failed (machine, g_error_new (G_IO_ERROR, + G_IO_ERROR_CANCELLED, + "Action cancelled")); + return FALSE; + } + + if (cancellable) + fp_err ("GCancellable in SSM Delayed actions is ignored as per libfprint 1.92"); + + return TRUE; +} + +void +fpi_ssm_next_state_delayed_1_90 (FpiSsm *machine, + int delay, + GCancellable *cancellable) +{ + if (check_delayed_cancellable (machine, cancellable)) + fpi_ssm_next_state_delayed (machine, delay); +} + +void +fpi_ssm_jump_to_state_delayed_1_90 (FpiSsm *machine, + int state, + int delay, + GCancellable *cancellable) +{ + if (check_delayed_cancellable (machine, cancellable)) + fpi_ssm_jump_to_state_delayed (machine, state, delay); +} + +void +fpi_ssm_mark_completed_delayed_1_90 (FpiSsm *machine, + int delay, + GCancellable *cancellable) +{ + if (check_delayed_cancellable (machine, cancellable)) + fpi_ssm_mark_completed_delayed (machine, delay); +} diff --git a/libfprint/tod/tod-shared-loader.c b/libfprint/tod/tod-shared-loader.c index 3fb04209..d214aebb 100644 --- a/libfprint/tod/tod-shared-loader.c +++ b/libfprint/tod/tod-shared-loader.c @@ -127,6 +127,12 @@ fpi_tod_shared_drivers_register (void) fp_dbg ("Loading driver %s (%s)", cls->id, cls->full_name); g_array_append_val (shared_drivers, driver); + if (cls->features == FP_DEVICE_FEATURE_NONE) + { + g_debug ("Initializing features for driver %s", cls->id); + fpi_device_class_auto_initialize_features (cls); + } + shared_modules = g_list_prepend (shared_modules, g_steal_pointer (&module)); } diff --git a/libfprint/tod/tod-symbols.h b/libfprint/tod/tod-symbols.h new file mode 100644 index 00000000..d4f497bc --- /dev/null +++ b/libfprint/tod/tod-symbols.h @@ -0,0 +1,45 @@ +/* + * Shared library loader for libfprint + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#define TOD_1_SYMBOL_VERSION_1_90 "LIBFPRINT_TOD_1.0.0" +#define TOD_1_SYMBOL_VERSION_1_92 "LIBFPRINT_TOD_1_1.92" +#define TOD_1_SYMBOL_VERSION_1_94 "LIBFPRINT_TOD_1_1.94" +#define TOD_1_SYMBOL_VERSION(major, minor) \ + TOD_1_SYMBOL_VERSION_ ## major ## _ ## minor + +#define TOD_DEFAULT_VERSION_SYMBOL(symbol, major, minor) \ + __asm__ (".symver " # symbol "," # symbol "@@@" \ + TOD_1_SYMBOL_VERSION (major, minor)); +#define TOD_VERSIONED_SYMBOL(symbol, major, minor) \ + __asm__ (".symver " # symbol "_" # major "_" #minor "," # symbol "@" \ + TOD_1_SYMBOL_VERSION (major, minor)); + +TOD_DEFAULT_VERSION_SYMBOL (fpi_ssm_new_full, 1, 92) +TOD_VERSIONED_SYMBOL (fpi_ssm_new_full, 1, 90) + +TOD_DEFAULT_VERSION_SYMBOL (fpi_ssm_next_state_delayed, 1, 92) +TOD_VERSIONED_SYMBOL (fpi_ssm_next_state_delayed, 1, 90) + +TOD_DEFAULT_VERSION_SYMBOL (fpi_ssm_jump_to_state_delayed, 1, 92) +TOD_VERSIONED_SYMBOL (fpi_ssm_jump_to_state_delayed, 1, 90) + +TOD_DEFAULT_VERSION_SYMBOL (fpi_ssm_mark_completed_delayed, 1, 92) +TOD_VERSIONED_SYMBOL (fpi_ssm_mark_completed_delayed, 1, 90) diff --git a/libfprint/tod/tod-wrappers.c b/libfprint/tod/tod-wrappers.c new file mode 100644 index 00000000..181dbb13 --- /dev/null +++ b/libfprint/tod/tod-wrappers.c @@ -0,0 +1,31 @@ +/* + * Shared library loader for libfprint + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define FP_COMPONENT "tod" + +#include "tod-wrappers.h" + +FpiSsm * +fpi_ssm_new_full_1_90 (FpDevice *dev, + FpiSsmHandlerCallback handler, + int nr_states, + const char *machine_name) +{ + return fpi_ssm_new_full (dev, handler, nr_states, nr_states, machine_name); +} diff --git a/libfprint/tod/tod-wrappers.h b/libfprint/tod/tod-wrappers.h new file mode 100644 index 00000000..b01aad44 --- /dev/null +++ b/libfprint/tod/tod-wrappers.h @@ -0,0 +1,39 @@ +/* + * Shared library loader for libfprint + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#include "drivers_api.h" +#include "tod-symbols.h" + +extern FpiSsm *fpi_ssm_new_full_1_90 (FpDevice *dev, + FpiSsmHandlerCallback handler, + int nr_states, + const char *machine_name); + +extern void fpi_ssm_next_state_delayed_1_90 (FpiSsm *machine, + int delay, + GCancellable *cancellable); +extern void fpi_ssm_jump_to_state_delayed_1_90 (FpiSsm *machine, + int state, + int delay, + GCancellable *cancellable); +extern void fpi_ssm_mark_completed_delayed_1_90 (FpiSsm *machine, + int delay, + GCancellable *cancellable); diff --git a/meson.build b/meson.build index 492e40a8..d5c28772 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('libfprint', [ 'c', 'cpp' ], - version: '1.94.1', + version: '1.94.1+tod1', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', @@ -292,13 +292,10 @@ if get_option('gtk-examples') endif endif -<<<<<<< HEAD -libfprint_conf.set10('HAVE_LIBFPRINT_TOD', get_option('tod')) -======= # Some dependency resolving happens inside here subdir('libfprint') ->>>>>>> debian/1%1.94.1-1 +libfprint_conf.set10('HAVE_LIBFPRINT_TOD', get_option('tod')) configure_file(output: 'config.h', configuration: libfprint_conf) subdir('examples') diff --git a/tests/egis0570/device b/tests/egis0570/device index e22dcf1e..5247b785 100644 --- a/tests/egis0570/device +++ b/tests/egis0570/device @@ -25,63 +25,63 @@ E: ID_VENDOR_FROM_DATABASE=LighTuning Technology Inc. E: ID_PATH=pci-0000:00:14.0-usb-0:9 E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_9 E: LIBFPRINT_DRIVER=Hardcoded whitelist -A: authorized=1 -A: avoid_reset_quirk=0 -A: bConfigurationValue=1 -A: bDeviceClass=00 -A: bDeviceProtocol=00 -A: bDeviceSubClass=00 -A: bMaxPacketSize0=8 -A: bMaxPower=100mA -A: bNumConfigurations=1 -A: bNumInterfaces= 1 -A: bcdDevice=1041 -A: bmAttributes=a0 -A: busnum=1 -A: configuration= +A: authorized=1\n +A: avoid_reset_quirk=0\n +A: bConfigurationValue=1\n +A: bDeviceClass=00\n +A: bDeviceProtocol=00\n +A: bDeviceSubClass=00\n +A: bMaxPacketSize0=8\n +A: bMaxPower=100mA\n +A: bNumConfigurations=1\n +A: bNumInterfaces= 1\n +A: bcdDevice=1041\n +A: bmAttributes=a0\n +A: busnum=1\n +A: configuration=\n H: descriptors=12011001000000087A1C700541100102030109022000010100A0320904000002FF0000000705830240000007050402400003 -A: dev=189:4 -A: devnum=5 -A: devpath=9 +A: dev=189:4\n +A: devnum=5\n +A: devpath=9\n L: driver=../../../../../bus/usb/drivers/usb -A: idProduct=0570 -A: idVendor=1c7a -A: ltm_capable=no -A: manufacturer=EgisTec -A: maxchild=0 +A: idProduct=0570\n +A: idVendor=1c7a\n +A: ltm_capable=no\n +A: manufacturer=EgisTec\n +A: maxchild=0\n L: port=../1-0:1.0/usb1-port9 -A: power/active_duration=362352 -A: power/async=enabled -A: power/autosuspend=2 -A: power/autosuspend_delay_ms=2000 -A: power/connected_duration=5526124 -A: power/control=auto -A: power/level=auto -A: power/persist=1 -A: power/runtime_active_kids=0 -A: power/runtime_active_time=365097 -A: power/runtime_enabled=enabled -A: power/runtime_status=active -A: power/runtime_suspended_time=5160752 -A: power/runtime_usage=0 -A: power/wakeup=disabled -A: power/wakeup_abort_count= -A: power/wakeup_active= -A: power/wakeup_active_count= -A: power/wakeup_count= -A: power/wakeup_expire_count= -A: power/wakeup_last_time_ms= -A: power/wakeup_max_time_ms= -A: power/wakeup_total_time_ms= -A: product=EgisTec Touch Fingerprint Sensor -A: quirks=0x0 -A: removable=fixed -A: rx_lanes=1 -A: serial=W700B41B -A: speed=12 -A: tx_lanes=1 -A: urbnum=8040 -A: version= 1.10 +A: power/active_duration=362352\n +A: power/async=enabled\n +A: power/autosuspend=2\n +A: power/autosuspend_delay_ms=2000\n +A: power/connected_duration=5526124\n +A: power/control=auto\n +A: power/level=auto\n +A: power/persist=1\n +A: power/runtime_active_kids=0\n +A: power/runtime_active_time=365097\n +A: power/runtime_enabled=enabled\n +A: power/runtime_status=active\n +A: power/runtime_suspended_time=5160752\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=EgisTec Touch Fingerprint Sensor\n +A: quirks=0x0\n +A: removable=fixed\n +A: rx_lanes=1\n +A: serial=W700B41B\n +A: speed=12\n +A: tx_lanes=1\n +A: urbnum=8040\n +A: version= 1.10\n P: /devices/pci0000:00/0000:00:14.0/usb1 N: bus/usb/001/001=12010002090001406B1D020008050302010109021900010100E0000904000001090000000705810304000C @@ -112,63 +112,63 @@ E: ID_PATH=pci-0000:00:14.0 E: ID_PATH_TAG=pci-0000_00_14_0 E: ID_FOR_SEAT=usb-pci-0000_00_14_0 E: TAGS=:seat: -A: authorized=1 -A: authorized_default=1 -A: avoid_reset_quirk=0 -A: bConfigurationValue=1 -A: bDeviceClass=09 -A: bDeviceProtocol=01 -A: bDeviceSubClass=00 -A: bMaxPacketSize0=64 -A: bMaxPower=0mA -A: bNumConfigurations=1 -A: bNumInterfaces= 1 -A: bcdDevice=0508 -A: bmAttributes=e0 -A: busnum=1 -A: configuration= +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=0508\n +A: bmAttributes=e0\n +A: busnum=1\n +A: configuration=\n H: descriptors=12010002090001406B1D020008050302010109021900010100E0000904000001090000000705810304000C -A: dev=189:0 -A: devnum=1 -A: devpath=0 +A: dev=189:0\n +A: devnum=1\n +A: devpath=0\n L: driver=../../../../bus/usb/drivers/usb -A: idProduct=0002 -A: idVendor=1d6b -A: interface_authorized_default=1 -A: ltm_capable=no -A: manufacturer=Linux 5.8.0-59-generic xhci-hcd -A: maxchild=12 -A: power/active_duration=378024 -A: power/async=enabled -A: power/autosuspend=0 -A: power/autosuspend_delay_ms=0 -A: power/connected_duration=5527220 -A: power/control=auto -A: power/level=auto -A: power/runtime_active_kids=1 -A: power/runtime_active_time=377962 -A: power/runtime_enabled=enabled -A: power/runtime_status=active -A: power/runtime_suspended_time=5149253 -A: power/runtime_usage=0 -A: power/wakeup=disabled -A: power/wakeup_abort_count= -A: power/wakeup_active= -A: power/wakeup_active_count= -A: power/wakeup_count= -A: power/wakeup_expire_count= -A: power/wakeup_last_time_ms= -A: power/wakeup_max_time_ms= -A: power/wakeup_total_time_ms= -A: product=xHCI Host Controller -A: quirks=0x0 -A: removable=unknown -A: rx_lanes=1 -A: serial=0000:00:14.0 -A: speed=480 -A: tx_lanes=1 -A: urbnum=956 -A: version= 2.00 +A: idProduct=0002\n +A: idVendor=1d6b\n +A: interface_authorized_default=1\n +A: ltm_capable=no\n +A: manufacturer=Linux 5.8.0-59-generic xhci-hcd\n +A: maxchild=12\n +A: power/active_duration=378024\n +A: power/async=enabled\n +A: power/autosuspend=0\n +A: power/autosuspend_delay_ms=0\n +A: power/connected_duration=5527220\n +A: power/control=auto\n +A: power/level=auto\n +A: power/runtime_active_kids=1\n +A: power/runtime_active_time=377962\n +A: power/runtime_enabled=enabled\n +A: power/runtime_status=active\n +A: power/runtime_suspended_time=5149253\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=956\n +A: version= 2.00\n P: /devices/pci0000:00/0000:00:14.0 E: DRIVER=xhci_hcd @@ -183,46 +183,46 @@ E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI E: ID_VENDOR_FROM_DATABASE=Intel Corporation E: ID_MODEL_FROM_DATABASE=Sunrise Point-LP USB 3.0 xHCI Controller -A: ari_enabled=0 -A: broken_parity_status=0 -A: class=0x0c0330 +A: ari_enabled=0\n +A: broken_parity_status=0\n +A: class=0x0c0330\n H: config=86802F9D060490022130030C00008000040021A400000000000000000000000000000000000000000000000025108E11000000007000000000000000FF010000 -A: consistent_dma_mask_bits=64 -A: d3cold_allowed=1 -A: dbc=disabled -A: device=0x9d2f -A: dma_mask_bits=64 +A: consistent_dma_mask_bits=64\n +A: d3cold_allowed=1\n +A: dbc=disabled\n +A: device=0x9d2f\n +A: dma_mask_bits=64\n L: driver=../../../bus/pci/drivers/xhci_hcd -A: driver_override=(null) -A: enable=1 -A: irq=127 -A: local_cpulist=0-7 -A: local_cpus=ff -A: modalias=pci:v00008086d00009D2Fsv00001025sd0000118Ebc0Csc03i30 -A: msi_bus=1 -A: msi_irqs/127=msi -A: numa_node=-1 -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 9 10 2112 10\nxHCI ring segments 32 36 4096 36\nbuffer-2048 1 2 2048 1\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0 -A: power/async=enabled -A: power/control=on -A: power/runtime_active_kids=1 -A: power/runtime_active_time=5524703 -A: power/runtime_enabled=forbidden -A: power/runtime_status=active -A: power/runtime_suspended_time=3373 -A: power/runtime_usage=1 -A: power/wakeup=enabled -A: power/wakeup_abort_count=0 -A: power/wakeup_active=0 -A: power/wakeup_active_count=0 -A: power/wakeup_count=0 -A: power/wakeup_expire_count=0 -A: power/wakeup_last_time_ms=0 -A: power/wakeup_max_time_ms=0 -A: power/wakeup_total_time_ms=0 -A: resource=0x00000000a4210000 0x00000000a421ffff 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 -A: revision=0x21 -A: subsystem_device=0x118e -A: subsystem_vendor=0x1025 -A: vendor=0x8086 +A: driver_override=(null)\n +A: enable=1\n +A: irq=127\n +A: local_cpulist=0-7\n +A: local_cpus=ff\n +A: modalias=pci:v00008086d00009D2Fsv00001025sd0000118Ebc0Csc03i30\n +A: msi_bus=1\n +A: msi_irqs/127=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 9 10 2112 10\nxHCI ring segments 32 36 4096 36\nbuffer-2048 1 2 2048 1\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0\n +A: power/async=enabled\n +A: power/control=on\n +A: power/runtime_active_kids=1\n +A: power/runtime_active_time=5524703\n +A: power/runtime_enabled=forbidden\n +A: power/runtime_status=active\n +A: power/runtime_suspended_time=3373\n +A: power/runtime_usage=1\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: resource=0x00000000a4210000 0x00000000a421ffff 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=0x21\n +A: subsystem_device=0x118e\n +A: subsystem_vendor=0x1025\n +A: vendor=0x8086\n diff --git a/tests/elanmoc/device b/tests/elanmoc/device index 8d47c2da..ef3400dd 100644 --- a/tests/elanmoc/device +++ b/tests/elanmoc/device @@ -23,62 +23,62 @@ E: ID_USB_INTERFACES=:ff0000: E: ID_VENDOR_FROM_DATABASE=Elan Microelectronics Corp. E: ID_PATH=pci-0000:00:14.0-usb-0:1 E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_1 -A: authorized=1 -A: avoid_reset_quirk=0 -A: bConfigurationValue=1 -A: bDeviceClass=00 -A: bDeviceProtocol=00 -A: bDeviceSubClass=00 -A: bMaxPacketSize0=64 -A: bMaxPower=100mA -A: bNumConfigurations=1 -A: bNumInterfaces= 1 -A: bcdDevice=0305 -A: bmAttributes=a0 -A: busnum=1 -A: configuration=add909c9-e67e-4126-a6f7-1e31179e27d9 +A: authorized=1\n +A: avoid_reset_quirk=0\n +A: bConfigurationValue=1\n +A: bDeviceClass=00\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=0305\n +A: bmAttributes=a0\n +A: busnum=1\n +A: configuration=add909c9-e67e-4126-a6f7-1e31179e27d9\n H: descriptors=1201000200000040F3047E0C05030102000109025300010103A0320904000008FF0000000921100100012215000705810240000107050102400001070582024000010705020240000107058302400001070503024000010705840240000107050402400001 -A: dev=189:9 -A: devnum=10 -A: devpath=1 +A: dev=189:9\n +A: devnum=10\n +A: devpath=1\n L: driver=../../../../../bus/usb/drivers/usb -A: idProduct=0c7e -A: idVendor=04f3 -A: ltm_capable=no -A: manufacturer=ELAN -A: maxchild=0 +A: idProduct=0c7e\n +A: idVendor=04f3\n +A: ltm_capable=no\n +A: manufacturer=ELAN\n +A: maxchild=0\n L: port=../1-0:1.0/usb1-port1 -A: power/active_duration=94712 -A: power/async=enabled -A: power/autosuspend=2 -A: power/autosuspend_delay_ms=2000 -A: power/connected_duration=94712 -A: power/control=on -A: power/level=on -A: power/persist=1 -A: power/runtime_active_kids=0 -A: power/runtime_active_time=94436 -A: power/runtime_enabled=forbidden -A: power/runtime_status=active -A: power/runtime_suspended_time=0 -A: power/runtime_usage=1 -A: power/wakeup=disabled -A: power/wakeup_abort_count= -A: power/wakeup_active= -A: power/wakeup_active_count= -A: power/wakeup_count= -A: power/wakeup_expire_count= -A: power/wakeup_last_time_ms= -A: power/wakeup_max_time_ms= -A: power/wakeup_total_time_ms= -A: product=ELAN:ARM-M4 -A: quirks=0x0 -A: removable=removable -A: rx_lanes=1 -A: speed=12 -A: tx_lanes=1 -A: urbnum=12 -A: version= 2.00 +A: power/active_duration=94712\n +A: power/async=enabled\n +A: power/autosuspend=2\n +A: power/autosuspend_delay_ms=2000\n +A: power/connected_duration=94712\n +A: power/control=on\n +A: power/level=on\n +A: power/persist=1\n +A: power/runtime_active_kids=0\n +A: power/runtime_active_time=94436\n +A: power/runtime_enabled=forbidden\n +A: power/runtime_status=active\n +A: power/runtime_suspended_time=0\n +A: power/runtime_usage=1\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=ELAN:ARM-M4\n +A: quirks=0x0\n +A: removable=removable\n +A: rx_lanes=1\n +A: speed=12\n +A: tx_lanes=1\n +A: urbnum=12\n +A: version= 2.00\n P: /devices/pci0000:00/0000:00:14.0/usb1 N: bus/usb/001/001=12010002090001406B1D020004050302010109021900010100E0000904000001090000000705810304000C @@ -109,63 +109,63 @@ E: ID_PATH=pci-0000:00:14.0 E: ID_PATH_TAG=pci-0000_00_14_0 E: ID_FOR_SEAT=usb-pci-0000_00_14_0 E: TAGS=:seat: -A: authorized=1 -A: authorized_default=1 -A: avoid_reset_quirk=0 -A: bConfigurationValue=1 -A: bDeviceClass=09 -A: bDeviceProtocol=01 -A: bDeviceSubClass=00 -A: bMaxPacketSize0=64 -A: bMaxPower=0mA -A: bNumConfigurations=1 -A: bNumInterfaces= 1 -A: bcdDevice=0504 -A: bmAttributes=e0 -A: busnum=1 -A: configuration= +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=0504\n +A: bmAttributes=e0\n +A: busnum=1\n +A: configuration=\n H: descriptors=12010002090001406B1D020004050302010109021900010100E0000904000001090000000705810304000C -A: dev=189:0 -A: devnum=1 -A: devpath=0 +A: dev=189:0\n +A: devnum=1\n +A: devpath=0\n L: driver=../../../../bus/usb/drivers/usb -A: idProduct=0002 -A: idVendor=1d6b -A: interface_authorized_default=1 -A: ltm_capable=no -A: manufacturer=Linux 5.4.0-42-generic xhci-hcd -A: maxchild=12 -A: power/active_duration=74604360 -A: power/async=enabled -A: power/autosuspend=0 -A: power/autosuspend_delay_ms=0 -A: power/connected_duration=74606456 -A: power/control=auto -A: power/level=auto -A: power/runtime_active_kids=4 -A: power/runtime_active_time=74605838 -A: power/runtime_enabled=enabled -A: power/runtime_status=active -A: power/runtime_suspended_time=0 -A: power/runtime_usage=0 -A: power/wakeup=disabled -A: power/wakeup_abort_count= -A: power/wakeup_active= -A: power/wakeup_active_count= -A: power/wakeup_count= -A: power/wakeup_expire_count= -A: power/wakeup_last_time_ms= -A: power/wakeup_max_time_ms= -A: power/wakeup_total_time_ms= -A: product=xHCI Host Controller -A: quirks=0x0 -A: removable=unknown -A: rx_lanes=1 -A: serial=0000:00:14.0 -A: speed=480 -A: tx_lanes=1 -A: urbnum=490 -A: version= 2.00 +A: idProduct=0002\n +A: idVendor=1d6b\n +A: interface_authorized_default=1\n +A: ltm_capable=no\n +A: manufacturer=Linux 5.4.0-42-generic xhci-hcd\n +A: maxchild=12\n +A: power/active_duration=74604360\n +A: power/async=enabled\n +A: power/autosuspend=0\n +A: power/autosuspend_delay_ms=0\n +A: power/connected_duration=74606456\n +A: power/control=auto\n +A: power/level=auto\n +A: power/runtime_active_kids=4\n +A: power/runtime_active_time=74605838\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=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=490\n +A: version= 2.00\n P: /devices/pci0000:00/0000:00:14.0 E: DRIVER=xhci_hcd @@ -180,46 +180,46 @@ E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI E: ID_VENDOR_FROM_DATABASE=Intel Corporation E: ID_MODEL_FROM_DATABASE=Cannon Point-LP USB 3.1 xHCI Controller -A: ari_enabled=0 -A: broken_parity_status=0 -A: class=0x0c0330 +A: ari_enabled=0\n +A: broken_parity_status=0\n +A: class=0x0c0330\n H: config=8680ED9D060490023030030C00008000040030A10000000000000000000000000000000000000000000000003C10EF85000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F00000000181C030400000000316000000000000000000000000000000180C2C1080000000000000000000000059087007802E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000B50F300112000000 -A: consistent_dma_mask_bits=64 -A: d3cold_allowed=1 -A: dbc=disabled -A: device=0x9ded -A: dma_mask_bits=64 +A: consistent_dma_mask_bits=64\n +A: d3cold_allowed=1\n +A: dbc=disabled\n +A: device=0x9ded\n +A: dma_mask_bits=64\n L: driver=../../../bus/pci/drivers/xhci_hcd -A: driver_override=(null) -A: enable=1 -A: irq=124 -A: local_cpulist=0-3 -A: local_cpus=f -A: modalias=pci:v00008086d00009DEDsv0000103Csd000085EFbc0Csc03i30 -A: msi_bus=1 -A: msi_irqs/124=msi -A: numa_node=-1 -A: pools=poolinfo - 0.1\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 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 11 12 2112 12\nxHCI ring segments 54 54 4096 54\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 9 32 128 1\nbuffer-32 0 0 32 0 -A: power/async=enabled -A: power/control=auto -A: power/runtime_active_kids=1 -A: power/runtime_active_time=74606194 -A: power/runtime_enabled=enabled -A: power/runtime_status=active -A: power/runtime_suspended_time=0 -A: power/runtime_usage=0 -A: power/wakeup=enabled -A: power/wakeup_abort_count=0 -A: power/wakeup_active=0 -A: power/wakeup_active_count=0 -A: power/wakeup_count=0 -A: power/wakeup_expire_count=0 -A: power/wakeup_last_time_ms=0 -A: power/wakeup_max_time_ms=0 -A: power/wakeup_total_time_ms=0 -A: resource=0x00000000a1300000 0x00000000a130ffff 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 -A: revision=0x30 -A: subsystem_device=0x85ef -A: subsystem_vendor=0x103c -A: vendor=0x8086 +A: driver_override=(null)\n +A: enable=1\n +A: irq=124\n +A: local_cpulist=0-3\n +A: local_cpus=f\n +A: modalias=pci:v00008086d00009DEDsv0000103Csd000085EFbc0Csc03i30\n +A: msi_bus=1\n +A: msi_irqs/124=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 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 11 12 2112 12\nxHCI ring segments 54 54 4096 54\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 9 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=1\n +A: power/runtime_active_time=74606194\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: resource=0x00000000a1300000 0x00000000a130ffff 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=0x30\n +A: subsystem_device=0x85ef\n +A: subsystem_vendor=0x103c\n +A: vendor=0x8086\n diff --git a/tests/goodixmoc/device b/tests/goodixmoc/device index e92ffbb4..9fb39e59 100644 --- a/tests/goodixmoc/device +++ b/tests/goodixmoc/device @@ -25,60 +25,60 @@ E: ID_VENDOR_FROM_DATABASE=Shenzhen Goodix Technology Co.,Ltd. E: ID_AUTOSUSPEND=1 E: ID_PATH=pci-0000:00:14.0-usb-0:3 E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3 -A: authorized=1 -A: avoid_reset_quirk=0 -A: bConfigurationValue=1 -A: bDeviceClass=ef -A: bDeviceProtocol=00 -A: bDeviceSubClass=00 -A: bMaxPacketSize0=64 -A: bMaxPower=100mA -A: bNumConfigurations=1 -A: bNumInterfaces= 1 -A: bcdDevice=0100 -A: bmAttributes=a0 -A: busnum=1 -A: configuration=XXXX_MOC_B0 +A: authorized=1\n +A: avoid_reset_quirk=0\n +A: bConfigurationValue=1\n +A: bDeviceClass=ef\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=0100\n +A: bmAttributes=a0\n +A: busnum=1\n +A: configuration=XXXX_MOC_B0\n H: descriptors=12010002EF000040C627966400010102030109022000010103A0320904000002FF0000040705830240000007050102400000 -A: dev=189:52 -A: devnum=53 -A: devpath=3 +A: dev=189:52\n +A: devnum=53\n +A: devpath=3\n L: driver=../../../../../bus/usb/drivers/usb L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d/device:20 -A: idProduct=6496 -A: idVendor=27c6 -A: ltm_capable=no -A: manufacturer=Goodix Technology Co., Ltd. -A: maxchild=0 +A: idProduct=6496\n +A: idVendor=27c6\n +A: ltm_capable=no\n +A: manufacturer=Goodix Technology Co., Ltd.\n +A: maxchild=0\n L: port=../1-0:1.0/usb1-port3 -A: power/active_duration=29262 -A: power/autosuspend=2 -A: power/autosuspend_delay_ms=2000 -A: power/connected_duration=57399 -A: power/control=auto -A: power/level=auto -A: power/persist=1 -A: power/runtime_active_time=29308 -A: power/runtime_status=active -A: power/runtime_suspended_time=27850 -A: power/wakeup=disabled -A: power/wakeup_abort_count= -A: power/wakeup_active= -A: power/wakeup_active_count= -A: power/wakeup_count= -A: power/wakeup_expire_count= -A: power/wakeup_last_time_ms= -A: power/wakeup_max_time_ms= -A: power/wakeup_total_time_ms= -A: product=Goodix USB2.0 MISC -A: quirks=0x0 -A: removable=removable -A: rx_lanes=1 -A: serial=XXXX_MOC_B0 -A: speed=12 -A: tx_lanes=1 -A: urbnum=394 -A: version= 2.00 +A: power/active_duration=29262\n +A: power/autosuspend=2\n +A: power/autosuspend_delay_ms=2000\n +A: power/connected_duration=57399\n +A: power/control=auto\n +A: power/level=auto\n +A: power/persist=1\n +A: power/runtime_active_time=29308\n +A: power/runtime_status=active\n +A: power/runtime_suspended_time=27850\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=Goodix USB2.0 MISC\n +A: quirks=0x0\n +A: removable=removable\n +A: rx_lanes=1\n +A: serial=XXXX_MOC_B0\n +A: speed=12\n +A: tx_lanes=1\n +A: urbnum=394\n +A: version= 2.00\n P: /devices/pci0000:00/0000:00:14.0/usb1 N: bus/usb/001/001=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C @@ -111,66 +111,66 @@ E: ID_PATH_TAG=pci-0000_00_14_0 E: ID_FOR_SEAT=usb-pci-0000_00_14_0 E: TAGS=:seat: E: CURRENT_TAGS=:seat: -A: authorized=1 -A: authorized_default=1 -A: avoid_reset_quirk=0 -A: bConfigurationValue=1 -A: bDeviceClass=09 -A: bDeviceProtocol=01 -A: bDeviceSubClass=00 -A: bMaxPacketSize0=64 -A: bMaxPower=0mA -A: bNumConfigurations=1 -A: bNumInterfaces= 1 -A: bcdDevice=0513 -A: bmAttributes=e0 -A: busnum=1 -A: configuration= +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=0513\n +A: bmAttributes=e0\n +A: busnum=1\n +A: configuration=\n H: descriptors=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C -A: dev=189:0 -A: devnum=1 -A: devpath=0 +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:1c/device:1d -A: idProduct=0002 -A: idVendor=1d6b -A: interface_authorized_default=1 -A: ltm_capable=no -A: manufacturer=Linux 5.13.15-200.fc34.x86_64 xhci-hcd -A: maxchild=12 -A: power/active_duration=219578717 -A: power/autosuspend=0 -A: power/autosuspend_delay_ms=0 -A: power/connected_duration=219649620 -A: power/control=auto -A: power/level=auto -A: power/runtime_active_time=219589127 -A: power/runtime_status=active -A: power/runtime_suspended_time=0 -A: power/wakeup=disabled -A: power/wakeup_abort_count= -A: power/wakeup_active= -A: power/wakeup_active_count= -A: power/wakeup_count= -A: power/wakeup_expire_count= -A: power/wakeup_last_time_ms= -A: power/wakeup_max_time_ms= -A: power/wakeup_total_time_ms= -A: product=xHCI Host Controller -A: quirks=0x0 -A: removable=unknown -A: rx_lanes=1 -A: serial=0000:00:14.0 -A: speed=480 -A: tx_lanes=1 -A: urbnum=4325 -A: version= 2.00 +A: idProduct=0002\n +A: idVendor=1d6b\n +A: interface_authorized_default=1\n +A: ltm_capable=no\n +A: manufacturer=Linux 5.13.15-200.fc34.x86_64 xhci-hcd\n +A: maxchild=12\n +A: power/active_duration=219578717\n +A: power/autosuspend=0\n +A: power/autosuspend_delay_ms=0\n +A: power/connected_duration=219649620\n +A: power/control=auto\n +A: power/level=auto\n +A: power/runtime_active_time=219589127\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=4325\n +A: version= 2.00\n P: /devices/pci0000:00/0000:00:14.0 E: DRIVER=xhci_hcd E: PCI_CLASS=C0330 E: PCI_ID=8086:9DED -E: PCI_SUBSYS_ID=17AA:2292 +E: PCI_SUBSYS_ID=17AA:2292\n E: PCI_SLOT_NAME=0000:00:14.0 E: MODALIAS=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30 E: SUBSYSTEM=pci @@ -180,44 +180,44 @@ E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI E: ID_VENDOR_FROM_DATABASE=Intel Corporation E: ID_AUTOSUSPEND=1 E: ID_MODEL_FROM_DATABASE=Cannon Point-LP USB 3.1 xHCI Controller -A: ari_enabled=0 -A: broken_parity_status=0 -A: class=0x0c0330 +A: ari_enabled=0\n +A: broken_parity_status=0\n +A: class=0x0c0330\n H: config=8680ED9D060490021130030C00008000040022EA000000000000000000000000000000000000000000000000AA179222000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F000000004C084B0100000000316000000000000000000000000000000180C2C1080000000000000000000000059087001803E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000000000000000000008000000040000000000000000000000000000000000000000000000000000000800000004000000000000000000000000000000000000000000000000000000B50F320112000000 -A: consistent_dma_mask_bits=64 -A: d3cold_allowed=1 -A: dbc=disabled -A: device=0x9ded -A: dma_mask_bits=64 +A: consistent_dma_mask_bits=64\n +A: d3cold_allowed=1\n +A: dbc=disabled\n +A: device=0x9ded\n +A: dma_mask_bits=64\n L: driver=../../../bus/pci/drivers/xhci_hcd -A: driver_override=(null) -A: enable=1 +A: driver_override=(null)\n +A: enable=1\n L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c -A: irq=128 -A: local_cpulist=0-7 -A: local_cpus=ff -A: modalias=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30 -A: msi_bus=1 -A: msi_irqs/128=msi -A: numa_node=-1 -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 11 12 2112 12\nxHCI ring segments 46 50 4096 50\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 6 32 128 1\nbuffer-32 0 0 32 0 -A: power/control=on -A: power/runtime_active_time=219589302 -A: power/runtime_status=active -A: power/runtime_suspended_time=0 -A: power/wakeup=enabled -A: power/wakeup_abort_count=0 -A: power/wakeup_active=0 -A: power/wakeup_active_count=0 -A: power/wakeup_count=0 -A: power/wakeup_expire_count=0 -A: power/wakeup_last_time_ms=0 -A: power/wakeup_max_time_ms=0 -A: power/wakeup_total_time_ms=0 -A: power_state=D0 -A: resource=0x00000000ea220000 0x00000000ea22ffff 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 -A: revision=0x11 -A: subsystem_device=0x2292 -A: subsystem_vendor=0x17aa -A: vendor=0x8086 +A: irq=128\n +A: local_cpulist=0-7\n +A: local_cpus=ff\n +A: modalias=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30\n +A: msi_bus=1\n +A: msi_irqs/128=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 11 12 2112 12\nxHCI ring segments 46 50 4096 50\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/control=on\n +A: power/runtime_active_time=219589302\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=0x00000000ea220000 0x00000000ea22ffff 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=0x11\n +A: subsystem_device=0x2292\n +A: subsystem_vendor=0x17aa\n +A: vendor=0x8086\n diff --git a/tests/meson.build b/tests/meson.build index 85305065..e1eaedc8 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -248,15 +248,20 @@ if valgrind.found() endif if get_option('tod') + tod_test_driver_name = 'fake_test_dev_tod' + tod_ssm_test_driver_name = 'ssm_test_dev_tod' tod_envs = envs tod_envs.set('FP_TOD_KEEP_MODULES_OPEN', 'TRUE') tod_envs.set('FP_VIRTUAL_FAKE_DEVICE', 'yes') - tod_envs.set('FP_TOD_TEST_DRIVER_NAME', 'fake_test_dev_tod') + tod_envs.set('FP_TOD_TEST_DRIVER_NAME', tod_test_driver_name) tod_envs.prepend('LD_LIBRARY_PATH', meson.build_root() / 'libfprint', meson.build_root() / 'libfprint' / 'tod') + tod_subversion = meson.project_version().split('+tod')[0] tod_c_args = [ '-DTEST_TOD_DRIVER=1', + '-DTOD_CURRENT_VERSION=@0@'.format(tod_soversion), + '-DTOD_CURRENT_SUBVERSION="@0@"'.format(tod_subversion), ] fake_driver = shared_module('device-fake-tod-driver', @@ -273,35 +278,85 @@ if get_option('tod') install: false ) + fp_todv1_enums = gnome.mkenums_simple('fp-todv1-enums', + source_dir: 'tod-drivers', + sources: [ + 'tod-drivers/base-fp-device.h', + 'tod-drivers/base-fp-print.h', + 'tod-drivers/base-fpi-device.h', + 'tod-drivers/base-fpi-image.h', + 'tod-drivers/base-fpi-image-device.h', + 'tod-drivers/base-fpi-spi.h', + 'tod-drivers/base-fpi-usb.h', + ], + install_header: false) + test_utils_tod = static_library('fprint-test-utils-tod', sources: [ 'test-utils.c', 'test-utils-tod.c', + fp_todv1_enums, ], + include_directories: 'tod-drivers', dependencies: libfprint_private_dep, install: false) - tod_unit_tests = [ + tod_standalone_tests = [ + 'fp-todv1-types', + ] + + tod_drivers_tests = [ 'fp-context-tod', 'fp-device-tod', 'fpi-device', ] - tod_dirs = { - 'fake_test_dev_tod_current': meson.current_build_dir(), + tod_driver_infos = { + tod_test_driver_name + '_current': { + 'tod-driver': tod_test_driver_name, + 'tod-dir': meson.current_build_dir(), + 'supported-tests': tod_drivers_tests, + } } - machine = run_command(meson.get_compiler('c'), '-dumpmachine').stdout().strip() - if machine.startswith('x86_64-') - tod_dirs += { - 'fake_test_dev_tod_v1': meson.current_source_dir() / 'tod-drivers', - } + if host_machine.cpu_family() == 'x86_64' + tod_test_versions = [ + 'v1+1.90.1', + 'v1+1.90.2', + 'v1+1.90.3', + 'v1+1.90.5', + 'v1+1.94.0', + ] + + foreach tod_version: tod_test_versions + tod_dir = meson.current_source_dir() / 'tod-drivers' / '-'.join([ + 'tod', host_machine.cpu_family(), tod_version + ]) + tod_driver_infos += { + tod_test_driver_name + '_' + tod_version: { + 'tod-driver': tod_test_driver_name, + 'tod-dir': tod_dir, + 'supported-tests': tod_drivers_tests, + } + } + + tod_driver_infos += { + tod_ssm_test_driver_name + '_' + tod_version: { + 'tod-driver': tod_ssm_test_driver_name, + 'tod-dir': tod_dir, + 'supported-tests': [ + 'fp-context-tod', + ], + } + } + endforeach endif - foreach test_name: tod_unit_tests + foreach test_name: tod_drivers_tests + tod_standalone_tests basename = 'test-' + test_name sufix = test_name.endswith('-tod') ? '' : '-tod' - test_name = test_name + sufix + tod_test_name = test_name + sufix + tod_suites = ['unit-tests', 'tod'] test_exe = executable(basename + sufix, sources: basename + '.c', dependencies: libfprint_private_dep, @@ -312,19 +367,29 @@ if get_option('tod') link_with: test_utils_tod, ) - foreach tod_driver, tod_dir : tod_dirs + foreach tod_driver, tod_driver_info : tod_driver_infos + if test_name not in tod_driver_info.get('supported-tests') + continue + endif tod_test_envs = tod_envs tod_test_envs.prepend('FP_DRIVERS_WHITELIST', tod_driver) - tod_test_envs.set('FP_TOD_DRIVERS_DIR', tod_dir) + tod_test_envs.set('FP_TOD_DRIVERS_DIR', tod_driver_info.get('tod-dir')) tod_test_envs.set('FP_TOD_TEST_DRIVER_NAME', tod_driver) - test(test_name + '-' + tod_driver, - find_program('test-runner.sh'), - suite: ['unit-tests', 'tod', tod_driver], - args: [test_exe], + test(tod_test_name + '-' + tod_driver, + test_exe, + suite: tod_suites + [tod_driver], env: tod_test_envs, depends: fake_driver, ) endforeach + + if test_name in tod_standalone_tests + test(tod_test_name, + test_exe, + suite: tod_suites, + env: tod_envs, + ) + endif endforeach endif diff --git a/tests/test-fp-context-tod.c b/tests/test-fp-context-tod.c index f25a31dc..7137e3dd 100644 --- a/tests/test-fp-context-tod.c +++ b/tests/test-fp-context-tod.c @@ -17,6 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#define FP_COMPONENT "tod" + +#include "fpi-log.h" #include static void @@ -33,8 +36,12 @@ test_context_has_no_devices (void) GPtrArray *devices; const char *old_drivers_dir = g_getenv ("FP_TOD_DRIVERS_DIR"); + g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, + "*Impossible to load the shared drivers dir Error " + "opening directory*__HOPEFULLY_AN_INVALID_PATH*"); g_setenv ("FP_TOD_DRIVERS_DIR", "__HOPEFULLY_AN_INVALID_PATH", TRUE); context = fp_context_new (); + g_test_assert_expected_messages (); devices = fp_context_get_devices (context); g_setenv ("FP_TOD_DRIVERS_DIR", old_drivers_dir, TRUE); diff --git a/tests/test-fp-device-tod.c b/tests/test-fp-device-tod.c index d134d1e1..f3d45cb1 100644 --- a/tests/test-fp-device-tod.c +++ b/tests/test-fp-device-tod.c @@ -193,7 +193,10 @@ test_device_supports_identify (void) g_autoptr(FptContext) tctx = fpt_context_new_with_fake_dev (); fp_device_open_sync (tctx->device, NULL, NULL); - g_assert_true (fp_device_supports_identify (tctx->device)); + g_assert_true (fp_device_has_feature (tctx->device, FP_DEVICE_FEATURE_IDENTIFY)); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + g_assert_true (fp_device_supports_identify (tctx->device)); + G_GNUC_END_IGNORE_DEPRECATIONS } static void @@ -202,7 +205,10 @@ test_device_supports_capture (void) g_autoptr(FptContext) tctx = fpt_context_new_with_fake_dev (); fp_device_open_sync (tctx->device, NULL, NULL); - g_assert_true (fp_device_supports_capture (tctx->device)); + g_assert_true (fp_device_has_feature (tctx->device, FP_DEVICE_FEATURE_CAPTURE)); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + g_assert_true (fp_device_supports_capture (tctx->device)); + G_GNUC_END_IGNORE_DEPRECATIONS } static void @@ -211,7 +217,10 @@ test_device_has_storage (void) g_autoptr(FptContext) tctx = fpt_context_new_with_fake_dev (); fp_device_open_sync (tctx->device, NULL, NULL); - g_assert_true (fp_device_has_storage (tctx->device)); + g_assert_true (fp_device_has_feature (tctx->device, FP_DEVICE_FEATURE_STORAGE)); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + g_assert_true (fp_device_has_storage (tctx->device)); + G_GNUC_END_IGNORE_DEPRECATIONS } int diff --git a/tests/test-fp-todv1-types.c b/tests/test-fp-todv1-types.c new file mode 100644 index 00000000..6846faa8 --- /dev/null +++ b/tests/test-fp-todv1-types.c @@ -0,0 +1,337 @@ +/* + * FpDevice Unit tests + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include "drivers_api.h" +#include "fp-todv1-enums.h" + +#include "tod-drivers/base-fp-device.h" +#include "tod-drivers/base-fp-print.h" +#include "tod-drivers/base-fpi-device.h" +#include "tod-drivers/base-fpi-image.h" +#include "tod-drivers/base-fpi-image-device.h" +#include "tod-drivers/base-fpi-spi.h" +#include "tod-drivers/base-fpi-usb.h" + +static void +check_enum_compatibility (GType old_type, GType current_type) +{ + g_autoptr(GEnumClass) old_class = g_type_class_ref (old_type); + g_autoptr(GEnumClass) current_class = g_type_class_ref (current_type); + int i; + + g_debug ("Checking Enum %s vs %s", + g_type_name (current_type), + g_type_name (old_type)); + + g_assert_true (G_TYPE_IS_ENUM (old_type)); + g_assert_true (G_TYPE_IS_ENUM (current_type)); + g_assert_cmpuint (old_class->n_values, <=, current_class->n_values); + + for (i = old_class->minimum; i <= old_class->maximum; i++) + { + GEnumValue *old_value = g_enum_get_value (old_class, i); + GEnumValue *current_value; + + if (!old_value) + continue; + + current_value = g_enum_get_value_by_nick (current_class, + old_value->value_nick); + + g_debug (" .. %s (%d)", old_value->value_nick, old_value->value); + g_assert_nonnull (current_value); + g_assert_cmpuint (old_value->value, ==, current_value->value); + } +} + +static void +check_flags_compatibility (GType old_type, GType current_type) +{ + g_autoptr(GFlagsClass) old_class = g_type_class_ref (old_type); + g_autoptr(GFlagsClass) current_class = g_type_class_ref (current_type); + int i; + + g_debug ("Checking Flags %s vs %s", + g_type_name (current_type), + g_type_name (old_type)); + + g_assert_true (G_TYPE_IS_FLAGS (old_type)); + g_assert_true (G_TYPE_IS_FLAGS (current_type)); + g_assert_cmpuint (old_class->n_values, <=, current_class->n_values); + + for (i = 0; i < old_class->n_values; ++i) + { + GFlagsValue *old_value = &old_class->values[i]; + GFlagsValue *current_value = g_flags_get_value_by_nick (current_class, + old_value->value_nick); + + g_debug (" .. %s (%d)", old_value->value_nick, old_value->value); + g_assert_nonnull (current_value); + g_assert_cmpuint (old_value->value, ==, current_value->value); + } +} + +static void +check_compatiblity_auto (GType old_type, GType current_type) +{ + if (G_TYPE_IS_ENUM (old_type)) + return check_enum_compatibility (old_type, current_type); + + if (G_TYPE_IS_FLAGS (old_type)) + return check_flags_compatibility (old_type, current_type); + + g_assert_not_reached (); +} + +#define check_type_compatibility(type, major, minor, micro) \ + g_debug ("Checking " # type " @ " G_STRLOC); \ + check_compatiblity_auto (type ## _TOD_V ## major ## _ ## minor ## _ ## micro, type); + +#define tod_versioned_type(type, major, minor, micro) \ + type ## TODV ## major ## _ ## minor ## _ ## micro + +#define check_struct_size(type, major, minor, micro) \ + g_debug ("Checking " # type " size @ " G_STRLOC); \ + g_assert_cmpuint (sizeof (tod_versioned_type (type, major, minor, micro)), \ + ==, \ + sizeof (type)) + +#define check_struct_member(type, major, minor, micro, member) \ + g_debug ("Checking " # type "'s " # member " offset @ " G_STRLOC); \ + g_assert_cmpuint (G_STRUCT_OFFSET (tod_versioned_type (type, major, minor, micro), member), \ + ==, \ + G_STRUCT_OFFSET (type, member)) + +static void +test_device_type (void) +{ + check_struct_size (FpIdEntry, 1, 90, 1); + check_struct_size (FpIdEntry, 1, 92, 0); + check_struct_size (FpDeviceClass, 1, 90, 1); + check_struct_size (FpDeviceClass, 1, 92, 0); + check_struct_size (FpDeviceClass, 1, 94, 0); + + check_struct_member (FpIdEntry, 1, 90, 1, virtual_envvar); + check_struct_member (FpIdEntry, 1, 90, 1, driver_data); + + check_struct_member (FpDeviceClass, 1, 90, 1, id); + check_struct_member (FpDeviceClass, 1, 90, 1, full_name); + check_struct_member (FpDeviceClass, 1, 90, 1, type); + check_struct_member (FpDeviceClass, 1, 90, 1, id_table); + + check_struct_member (FpDeviceClass, 1, 90, 1, nr_enroll_stages); + check_struct_member (FpDeviceClass, 1, 90, 1, scan_type); + + check_struct_member (FpDeviceClass, 1, 90, 1, usb_discover); + check_struct_member (FpDeviceClass, 1, 90, 1, probe); + check_struct_member (FpDeviceClass, 1, 90, 1, open); + check_struct_member (FpDeviceClass, 1, 90, 1, close); + check_struct_member (FpDeviceClass, 1, 90, 1, enroll); + check_struct_member (FpDeviceClass, 1, 90, 1, verify); + check_struct_member (FpDeviceClass, 1, 90, 1, identify); + check_struct_member (FpDeviceClass, 1, 90, 1, capture); + check_struct_member (FpDeviceClass, 1, 90, 1, list); + check_struct_member (FpDeviceClass, 1, 90, 1, delete); + check_struct_member (FpDeviceClass, 1, 90, 1, cancel); + + /* Version 1.92 */ + check_struct_member (FpIdEntry, 1, 92, 0, virtual_envvar); + check_struct_member (FpIdEntry, 1, 92, 0, driver_data); + check_struct_member (FpIdEntry, 1, 92, 0, udev_types); + check_struct_member (FpIdEntry, 1, 92, 0, spi_acpi_id); + check_struct_member (FpIdEntry, 1, 92, 0, hid_id); + + check_struct_member (FpDeviceClass, 1, 92, 0, usb_discover); + check_struct_member (FpDeviceClass, 1, 92, 0, probe); + check_struct_member (FpDeviceClass, 1, 92, 0, open); + check_struct_member (FpDeviceClass, 1, 92, 0, close); + check_struct_member (FpDeviceClass, 1, 92, 0, enroll); + check_struct_member (FpDeviceClass, 1, 92, 0, verify); + check_struct_member (FpDeviceClass, 1, 92, 0, identify); + check_struct_member (FpDeviceClass, 1, 92, 0, capture); + check_struct_member (FpDeviceClass, 1, 92, 0, list); + check_struct_member (FpDeviceClass, 1, 92, 0, delete); + check_struct_member (FpDeviceClass, 1, 92, 0, cancel); + + check_struct_member (FpDeviceClass, 1, 92, 0, id); + check_struct_member (FpDeviceClass, 1, 92, 0, full_name); + check_struct_member (FpDeviceClass, 1, 92, 0, type); + check_struct_member (FpDeviceClass, 1, 92, 0, id_table); + + check_struct_member (FpDeviceClass, 1, 92, 0, nr_enroll_stages); + check_struct_member (FpDeviceClass, 1, 92, 0, scan_type); + + check_struct_member (FpDeviceClass, 1, 92, 0, features); + + /* Version 1.94 */ + check_struct_member (FpDeviceClass, 1, 94, 0, usb_discover); + check_struct_member (FpDeviceClass, 1, 94, 0, probe); + check_struct_member (FpDeviceClass, 1, 94, 0, open); + check_struct_member (FpDeviceClass, 1, 94, 0, close); + check_struct_member (FpDeviceClass, 1, 94, 0, enroll); + check_struct_member (FpDeviceClass, 1, 94, 0, verify); + check_struct_member (FpDeviceClass, 1, 94, 0, identify); + check_struct_member (FpDeviceClass, 1, 94, 0, capture); + check_struct_member (FpDeviceClass, 1, 94, 0, list); + check_struct_member (FpDeviceClass, 1, 94, 0, delete); + check_struct_member (FpDeviceClass, 1, 94, 0, cancel); + + check_struct_member (FpDeviceClass, 1, 94, 0, id); + check_struct_member (FpDeviceClass, 1, 94, 0, full_name); + check_struct_member (FpDeviceClass, 1, 94, 0, type); + check_struct_member (FpDeviceClass, 1, 94, 0, id_table); + + check_struct_member (FpDeviceClass, 1, 94, 0, nr_enroll_stages); + check_struct_member (FpDeviceClass, 1, 94, 0, scan_type); + + check_struct_member (FpDeviceClass, 1, 94, 0, features); +} + +static void +test_image_device_private (void) +{ + check_struct_size (FpImage, 1, 90, 1); + check_struct_size (FpImageDeviceClass, 1, 90, 1); + + check_struct_member (FpImageDeviceClass, 1, 90, 1, bz3_threshold); + check_struct_member (FpImageDeviceClass, 1, 90, 1, img_width); + check_struct_member (FpImageDeviceClass, 1, 90, 1, img_height); + check_struct_member (FpImageDeviceClass, 1, 90, 1, img_open); + check_struct_member (FpImageDeviceClass, 1, 90, 1, img_close); + check_struct_member (FpImageDeviceClass, 1, 90, 1, activate); + check_struct_member (FpImageDeviceClass, 1, 90, 1, change_state); + check_struct_member (FpImageDeviceClass, 1, 90, 1, deactivate); +} + +static void +test_usb_private (void) +{ + check_struct_size (FpiUsbTransfer, 1, 90, 1); + + check_struct_member (FpiUsbTransfer, 1, 90, 1, device); + check_struct_member (FpiUsbTransfer, 1, 90, 1, ssm); + check_struct_member (FpiUsbTransfer, 1, 90, 1, length); + check_struct_member (FpiUsbTransfer, 1, 90, 1, actual_length); + check_struct_member (FpiUsbTransfer, 1, 90, 1, buffer); + check_struct_member (FpiUsbTransfer, 1, 90, 1, ref_count); + check_struct_member (FpiUsbTransfer, 1, 90, 1, type); + check_struct_member (FpiUsbTransfer, 1, 90, 1, endpoint); + check_struct_member (FpiUsbTransfer, 1, 90, 1, direction); + check_struct_member (FpiUsbTransfer, 1, 90, 1, request_type); + check_struct_member (FpiUsbTransfer, 1, 90, 1, recipient); + check_struct_member (FpiUsbTransfer, 1, 90, 1, request); + check_struct_member (FpiUsbTransfer, 1, 90, 1, value); + check_struct_member (FpiUsbTransfer, 1, 90, 1, idx); + check_struct_member (FpiUsbTransfer, 1, 90, 1, short_is_error); + check_struct_member (FpiUsbTransfer, 1, 90, 1, user_data); + check_struct_member (FpiUsbTransfer, 1, 90, 1, callback); + check_struct_member (FpiUsbTransfer, 1, 90, 1, free_buffer); +} + +static void +test_spi_private (void) +{ + check_struct_size (FpiSpiTransfer, 1, 92, 0); + + check_struct_member (FpiSpiTransfer, 1, 92, 0, device); + check_struct_member (FpiSpiTransfer, 1, 92, 0, ssm); + check_struct_member (FpiSpiTransfer, 1, 92, 0, length_wr); + check_struct_member (FpiSpiTransfer, 1, 92, 0, length_rd); + check_struct_member (FpiSpiTransfer, 1, 92, 0, buffer_wr); + check_struct_member (FpiSpiTransfer, 1, 92, 0, buffer_rd); + check_struct_member (FpiSpiTransfer, 1, 92, 0, ref_count); + check_struct_member (FpiSpiTransfer, 1, 92, 0, spidev_fd); + check_struct_member (FpiSpiTransfer, 1, 92, 0, user_data); + check_struct_member (FpiSpiTransfer, 1, 92, 0, callback); + check_struct_member (FpiSpiTransfer, 1, 92, 0, free_buffer_wr); + check_struct_member (FpiSpiTransfer, 1, 92, 0, free_buffer_rd); +} + +static void +test_device_public_enums (void) +{ + check_type_compatibility (FP_TYPE_DEVICE_TYPE, 1, 90, 1); + check_type_compatibility (FP_TYPE_SCAN_TYPE, 1, 90, 1); + check_type_compatibility (FP_TYPE_DEVICE_RETRY, 1, 90, 1); + check_type_compatibility (FP_TYPE_DEVICE_ERROR, 1, 90, 1); + check_type_compatibility (FP_TYPE_DEVICE_ERROR, 1, 90, 3); + check_type_compatibility (FP_TYPE_DEVICE_ERROR, 1, 90, 4); + check_type_compatibility (FP_TYPE_DEVICE_ERROR, 1, 94, 0); + check_type_compatibility (FP_TYPE_DEVICE_FEATURE, 1, 92, 0); + check_type_compatibility (FP_TYPE_DEVICE_FEATURE, 1, 94, 0); + check_type_compatibility (FP_TYPE_TEMPERATURE, 1, 94, 0); + check_type_compatibility (FPI_TYPE_DEVICE_UDEV_SUBTYPE_FLAGS, 1, 92, 0); +} + +static void +test_device_private_enums (void) +{ + check_type_compatibility (FPI_TYPE_DEVICE_ACTION, 1, 90, 1); + check_type_compatibility (FPI_TYPE_DEVICE_ACTION, 1, 92, 0); +} + +static void +test_print_public_enums (void) +{ + check_type_compatibility (FP_TYPE_FINGER, 1, 90, 1); + check_type_compatibility (FP_TYPE_FINGER_STATUS_FLAGS, 1, 90, 4); +} + +static void +test_print_private_enums (void) +{ + check_type_compatibility (FPI_TYPE_PRINT_TYPE, 1, 90, 1); + check_type_compatibility (FPI_TYPE_MATCH_RESULT, 1, 90, 1); +} + +static void +test_image_device_enums (void) +{ + check_type_compatibility (FPI_TYPE_IMAGE_FLAGS, 1, 90, 1); + check_type_compatibility (FPI_TYPE_IMAGE_FLAGS, 1, 90, 2); + check_type_compatibility (FPI_TYPE_IMAGE_DEVICE_STATE, 1, 90, 1); + check_type_compatibility (FPI_TYPE_IMAGE_DEVICE_STATE, 1, 90, 4); +} + +static void +test_usb_enums (void) +{ + check_type_compatibility (FPI_TYPE_TRANSFER_TYPE, 1, 90, 3); +} + +int +main (int argc, char *argv[]) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/type/device/private", test_device_type); + g_test_add_func ("/type/device/enums", test_device_public_enums); + g_test_add_func ("/type/device/private/enums", test_device_private_enums); + g_test_add_func ("/type/print/enums", test_print_public_enums); + g_test_add_func ("/type/print/private/enums", test_print_private_enums); + g_test_add_func ("/type/image-device/private", test_image_device_private); + g_test_add_func ("/type/image-device/enums", test_image_device_enums); + g_test_add_func ("/type/usb/private", test_usb_private); + g_test_add_func ("/type/usb/enums", test_usb_enums); + g_test_add_func ("/type/spi/private", test_spi_private); + + return g_test_run (); +} diff --git a/tests/test-fpi-device.c b/tests/test-fpi-device.c index e3da1e97..6e2021c2 100644 --- a/tests/test-fpi-device.c +++ b/tests/test-fpi-device.c @@ -46,8 +46,102 @@ fpt_context_device_driver_get_type (void) return G_TYPE_FROM_CLASS (FP_DEVICE_GET_CLASS (tctx->device)); } +static int +tod_get_version (FpDeviceClass *device_class, + const char **sub_version) +{ + g_autofree char *tod_version = NULL; + const char *tod_version_info; + const char *tod_subversion_info; + + g_debug ("Getting TOD version for driver '%s'", device_class->id); + g_assert_true (g_str_has_prefix (device_class->id, "fake_test_dev_tod")); + + tod_version_info = device_class->id + sizeof ("fake_test_dev_tod"); + g_debug ("Tod version info is '%s'", tod_version_info); + g_assert (*tod_version_info != '\0'); + + if (sub_version) + *sub_version = NULL; + + if (g_str_equal (tod_version_info, "current")) + { + *sub_version = TOD_CURRENT_SUBVERSION; + return TOD_CURRENT_VERSION; + } + + g_assert_true (g_str_has_prefix (device_class->id, "fake_test_dev_tod_v")); + + tod_version_info = device_class->id + sizeof ("fake_test_dev_tod_v") - 1; + tod_subversion_info = strchr (tod_version_info, '+'); + g_assert_nonnull (tod_subversion_info); + g_assert (*tod_subversion_info != '\0'); + + tod_version = g_strndup (tod_version_info, + tod_subversion_info - tod_version_info); + tod_subversion_info += 1; + + g_debug ("Tod version is '%s', subversion '%s'", + tod_version, tod_subversion_info); + + g_assert_nonnull (tod_version); + g_assert (*tod_version != '\0'); + g_assert (*tod_subversion_info != '\0'); + + if (sub_version) + *sub_version = tod_subversion_info; + + return atoi (tod_version); +} + #endif +static gboolean +tod_check_version (FpDeviceClass *device_class, + int tod_version, + const char *tod_subversion) +{ +#ifdef TEST_TOD_DRIVER + g_auto(GStrv) versions = NULL; + g_auto(GStrv) wanted_versions = NULL; + int version; + const char *sub_version; + + version = tod_get_version (device_class, &sub_version); + + if (version != tod_version) + return FALSE; + + if (!tod_subversion) + return TRUE; + + versions = g_strsplit (sub_version, ".", -1); + g_assert_cmpuint (g_strv_length (versions), ==, 3); + + wanted_versions = g_strsplit (tod_subversion, ".", -1); + g_assert_cmpuint (g_strv_length (wanted_versions), ==, 3); + + if (atoi (versions[0]) >= atoi (wanted_versions[0]) && + atoi (versions[1]) > atoi (wanted_versions[1])) + return TRUE; + + return atoi (versions[0]) == atoi (wanted_versions[0]) && + atoi (versions[1]) == atoi (wanted_versions[1]) && + atoi (versions[2]) >= atoi (wanted_versions[2]); +#endif + return TRUE; +} + +static gboolean +tod_check_device_version (FpDevice *device_class, + int tod_version, + const char *tod_subversion) +{ + return tod_check_version (FP_DEVICE_GET_CLASS (device_class), + tod_version, + tod_subversion); +} + /* Utility functions */ typedef FpDevice FpAutoCloseDevice; @@ -539,6 +633,12 @@ test_driver_features_probe_updates (void) FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device); FpiDeviceFake *fake_dev; + if (!tod_check_device_version (device, 1, "1.92.0")) + { + g_test_skip ("Feature not supported by TODv1 versions before 1.92.0"); + return; + } + g_assert_cmpuint (dev_class->features, !=, FP_DEVICE_FEATURE_NONE); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_CAPTURE); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_IDENTIFY); @@ -592,7 +692,10 @@ test_driver_initial_features (void) g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_LIST); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_DELETE); - g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + if (tod_check_device_version (device, 1, "1.92.0")) + g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + else + g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); g_async_initable_init_async (G_ASYNC_INITABLE (device), G_PRIORITY_DEFAULT, NULL, NULL, NULL); @@ -606,7 +709,10 @@ test_driver_initial_features (void) g_assert_true (fp_device_has_feature (device, FP_DEVICE_FEATURE_STORAGE)); g_assert_true (fp_device_has_feature (device, FP_DEVICE_FEATURE_STORAGE_LIST)); g_assert_true (fp_device_has_feature (device, FP_DEVICE_FEATURE_STORAGE_DELETE)); - g_assert_true (fp_device_has_feature (device, FP_DEVICE_FEATURE_STORAGE_CLEAR)); + if (tod_check_device_version (device, 1, "1.92.0")) + g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + else + g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); g_assert_cmpuint (fp_device_get_features (device), ==, @@ -616,7 +722,8 @@ test_driver_initial_features (void) FP_DEVICE_FEATURE_STORAGE | FP_DEVICE_FEATURE_STORAGE_LIST | FP_DEVICE_FEATURE_STORAGE_DELETE | - FP_DEVICE_FEATURE_STORAGE_CLEAR); + (tod_check_device_version (device, 1, "1.92.0") ? + FP_DEVICE_FEATURE_STORAGE_CLEAR : 0)); } static void @@ -663,7 +770,10 @@ test_driver_initial_features_no_capture (void) g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_LIST); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_DELETE); - g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + if (tod_check_version (dev_class, 1, "1.92.0")) + g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + else + g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); } static void @@ -684,7 +794,10 @@ test_driver_initial_features_no_verify (void) g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_LIST); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_DELETE); - g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + if (tod_check_version (dev_class, 1, "1.92.0")) + g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + else + g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); } static void @@ -705,7 +818,10 @@ test_driver_initial_features_no_identify (void) g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_LIST); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_DELETE); - g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + if (tod_check_version (dev_class, 1, "1.92.0")) + g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + else + g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); } static void @@ -726,7 +842,10 @@ test_driver_initial_features_no_storage (void) g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_LIST); g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_DELETE); - g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + if (tod_check_version (dev_class, 1, "1.92.0")) + g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + else + g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); } static void @@ -744,10 +863,16 @@ test_driver_initial_features_no_list (void) g_assert_true (dev_class->features & FP_DEVICE_FEATURE_IDENTIFY); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_VERIFY); g_assert_false (dev_class->features & FP_DEVICE_FEATURE_DUPLICATES_CHECK); - g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE); + if (tod_check_version (dev_class, 1, "1.92.0")) + g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE); + else + g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE); g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_LIST); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_DELETE); - g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + if (tod_check_version (dev_class, 1, "1.92.0")) + g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + else + g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); } static void @@ -768,7 +893,10 @@ test_driver_initial_features_no_delete (void) g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_LIST); g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_DELETE); - g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + if (tod_check_version (dev_class, 1, "1.92.0")) + g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); + else + g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); } static void @@ -2005,6 +2133,12 @@ test_driver_identify_suspend_continues (void) FpiDeviceFake *fake_dev; FpPrint *expected_matched; + if (!tod_check_version (dev_class, 1, "1.94.0")) + { + g_test_skip ("Feature not supported by TODv1 versions before 1.94.0"); + return; + } + device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL); fake_dev = FPI_DEVICE_FAKE (device); orig_identify = dev_class->identify; @@ -2071,6 +2205,12 @@ test_driver_identify_suspend_succeeds (void) FpiDeviceFake *fake_dev; FpPrint *expected_matched; + if (!tod_check_version (dev_class, 1, "1.94.0")) + { + g_test_skip ("Feature not supported by TODv1 versions before 1.94.0"); + return; + } + device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL); fake_dev = FPI_DEVICE_FAKE (device); orig_identify = dev_class->identify; @@ -2133,6 +2273,12 @@ test_driver_identify_suspend_busy_error (void) FpiDeviceFake *fake_dev; FpPrint *expected_matched; + if (!tod_check_version (dev_class, 1, "1.94.0")) + { + g_test_skip ("Feature not supported by TODv1 versions before 1.94.0"); + return; + } + device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL); fake_dev = FPI_DEVICE_FAKE (device); orig_identify = dev_class->identify; @@ -2190,6 +2336,12 @@ test_driver_identify_suspend_while_idle (void) g_autoptr(GError) error = NULL; FpiDeviceFake *fake_dev; + if (!tod_check_version (dev_class, 1, "1.94.0")) + { + g_test_skip ("Feature not supported by TODv1 versions before 1.94.0"); + return; + } + device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL); fake_dev = FPI_DEVICE_FAKE (device); @@ -2234,6 +2386,12 @@ test_driver_identify_warmup_cooldown (void) FpiDeviceFake *fake_dev; gint64 start_time; + if (!tod_check_version (dev_class, 1, "1.94.0")) + { + g_test_skip ("Feature not supported by TODv1 versions before 1.94.0"); + return; + } + dev_class->temp_hot_seconds = 2; dev_class->temp_cold_seconds = 5; @@ -2532,6 +2690,12 @@ test_driver_clear_storage (void) FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device); gboolean ret; + if (!tod_check_device_version (device, 1, "1.92.0")) + { + g_test_skip ("Feature not supported by TODv1 versions before 1.92.0"); + return; + } + ret = fp_device_clear_storage_sync (device, NULL, &error); g_assert (fake_dev->last_called_function == dev_class->clear_storage); g_assert_no_error (error); @@ -2547,6 +2711,12 @@ test_driver_clear_storage_error (void) FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device); gboolean ret; + if (!tod_check_device_version (device, 1, "1.92.0")) + { + g_test_skip ("Feature not supported by TODv1 versions before 1.92.0"); + return; + } + fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_GENERAL); ret = fp_device_clear_storage_sync (device, NULL, &error); g_assert (fake_dev->last_called_function == dev_class->clear_storage); @@ -2653,6 +2823,12 @@ test_driver_critical (void) void (*orig_verify) (FpDevice *device) = dev_class->verify; FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device); + if (!tod_check_device_version (device, 1, "1.94.0")) + { + g_test_skip ("Feature not supported by TODv1 versions before 1.94.0"); + return; + } + fake_dev->last_called_function = NULL; dev_class->verify = fake_device_stub_verify; @@ -2861,6 +3037,12 @@ test_driver_action_is_cancelled_open (void) g_autoptr(GError) error = NULL; FpiDeviceFake *fake_dev; + if (!tod_check_version (dev_class, 1, "1.94.0")) + { + g_test_skip ("Feature not supported by TODv1 versions before 1.94.0"); + return; + } + dev_class->open = test_driver_action_is_cancelled_open_vfunc; device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL); fake_dev = FPI_DEVICE_FAKE (device); @@ -2881,6 +3063,12 @@ test_driver_action_internally_cancelled_open (void) g_autoptr(GError) error = NULL; FpiDeviceFake *fake_dev; + if (!tod_check_version (dev_class, 1, "1.94.0")) + { + g_test_skip ("Feature not supported by TODv1 versions before 1.94.0"); + return; + } + dev_class->open = test_driver_action_is_cancelled_open_vfunc; device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL); fake_dev = FPI_DEVICE_FAKE (device); @@ -3030,11 +3218,20 @@ test_driver_action_error_all (void) g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_INVALID); g_clear_error (&error); - fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID); - g_assert_false (fp_device_clear_storage_sync (device, NULL, &error)); - g_assert_true (fake_dev->last_called_function == dev_class->clear_storage); - g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_INVALID); - g_clear_error (&error); + if (tod_check_device_version (device, 1, "1.92.0")) + { + fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID); + g_assert_false (fp_device_clear_storage_sync (device, NULL, &error)); + g_assert_true (fake_dev->last_called_function == dev_class->clear_storage); + g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_INVALID); + g_clear_error (&error); + } + else + { + g_assert_false (fp_device_clear_storage_sync (device, NULL, &error)); + g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_NOT_SUPPORTED); + g_clear_error (&error); + } /* Test close last, as we can't operate on a closed device. */ fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID); @@ -3135,15 +3332,18 @@ test_driver_action_error_fallback_all (void) g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL); g_clear_error (&error); - g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, - "*Device failed to pass an error to generic action " - "error function*"); + if (tod_check_device_version (device, 1, "1.92.0")) + { + g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, + "*Device failed to pass an error to generic action " + "error function*"); - g_assert_false (fp_device_clear_storage_sync (device, NULL, &error)); - g_test_assert_expected_messages (); - g_assert_true (fake_dev->last_called_function == dev_class->clear_storage); - g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL); - g_clear_error (&error); + g_assert_false (fp_device_clear_storage_sync (device, NULL, &error)); + g_test_assert_expected_messages (); + g_assert_true (fake_dev->last_called_function == dev_class->clear_storage); + g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL); + g_clear_error (&error); + } /* Test close last, as we can't operate on a closed device. */ g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, diff --git a/tests/tod-drivers/README.md b/tests/tod-drivers/README.md index 3afec6dd..a1b27de9 100644 --- a/tests/tod-drivers/README.md +++ b/tests/tod-drivers/README.md @@ -7,3 +7,7 @@ test-device-fake) built using the minimum libfprint TOD we want to support. In this way the library is loaded during tests and tested for all the upstream tests and particularly test-fpi-device. + +Such binaries are compiled (for each platform) using the [libfprint TOD test +drivers](https://gitlab.freedesktop.org/3v1n0/libfprint-tod-test-drivers) +project, per each supported version. diff --git a/tests/tod-drivers/base-fp-device.h b/tests/tod-drivers/base-fp-device.h new file mode 100644 index 00000000..600bdf9f --- /dev/null +++ b/tests/tod-drivers/base-fp-device.h @@ -0,0 +1,107 @@ +/* + * FpDevice - A fingerprint reader device + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +typedef struct _FpDevice FpDevice; + +typedef enum { + FP_DEVICE_TYPE_TODV1_90_1_VIRTUAL, + FP_DEVICE_TYPE_TODV1_90_1_USB, +} FpDeviceTypeTODV1_90_1; + +typedef enum { + FP_DEVICE_TYPE_TODV1_92_0_VIRTUAL, + FP_DEVICE_TYPE_TODV1_92_0_USB, + FP_DEVICE_TYPE_TODV1_92_0_UDEV, +} FpDeviceTypeTODV1_92_0; + +typedef enum { + FP_SCAN_TYPE_TODV1_90_1_SWIPE, + FP_SCAN_TYPE_TODV1_90_1_PRESS, +} FpScanTypeTODV1_90_1; + +typedef enum { + FP_DEVICE_RETRY_TODV1_90_1_GENERAL, + FP_DEVICE_RETRY_TODV1_90_1_TOO_SHORT, + FP_DEVICE_RETRY_TODV1_90_1_CENTER_FINGER, + FP_DEVICE_RETRY_TODV1_90_1_REMOVE_FINGER, +} FpDeviceRetryTODV1_90_1; + +typedef enum { + FP_DEVICE_ERROR_TODV1_90_1_GENERAL, + FP_DEVICE_ERROR_TODV1_90_1_NOT_SUPPORTED, + FP_DEVICE_ERROR_TODV1_90_1_NOT_OPEN, + FP_DEVICE_ERROR_TODV1_90_1_ALREADY_OPEN, + FP_DEVICE_ERROR_TODV1_90_1_BUSY, + FP_DEVICE_ERROR_TODV1_90_1_PROTO, + FP_DEVICE_ERROR_TODV1_90_1_DATA_INVALID, + FP_DEVICE_ERROR_TODV1_90_1_DATA_NOT_FOUND, + FP_DEVICE_ERROR_TODV1_90_1_DATA_FULL, +} FpDeviceErrorTODV1_90_1; + +typedef enum { + FP_DEVICE_ERROR_TODV1_90_3_GENERAL, + FP_DEVICE_ERROR_TODV1_90_3_NOT_SUPPORTED, + FP_DEVICE_ERROR_TODV1_90_3_NOT_OPEN, + FP_DEVICE_ERROR_TODV1_90_3_ALREADY_OPEN, + FP_DEVICE_ERROR_TODV1_90_3_BUSY, + FP_DEVICE_ERROR_TODV1_90_3_PROTO, + FP_DEVICE_ERROR_TODV1_90_3_DATA_INVALID, + FP_DEVICE_ERROR_TODV1_90_3_DATA_NOT_FOUND, + FP_DEVICE_ERROR_TODV1_90_3_DATA_FULL, + FP_DEVICE_ERROR_TODV1_90_3_DATA_DUPLICATE, +} FpDeviceErrorTODV1_90_3; + +typedef enum { + FP_DEVICE_ERROR_TODV1_90_4_GENERAL, + FP_DEVICE_ERROR_TODV1_90_4_NOT_SUPPORTED, + FP_DEVICE_ERROR_TODV1_90_4_NOT_OPEN, + FP_DEVICE_ERROR_TODV1_90_4_ALREADY_OPEN, + FP_DEVICE_ERROR_TODV1_90_4_BUSY, + FP_DEVICE_ERROR_TODV1_90_4_PROTO, + FP_DEVICE_ERROR_TODV1_90_4_DATA_INVALID, + FP_DEVICE_ERROR_TODV1_90_4_DATA_NOT_FOUND, + FP_DEVICE_ERROR_TODV1_90_4_DATA_FULL, + FP_DEVICE_ERROR_TODV1_90_4_DATA_DUPLICATE, + /* Leave some room to add more DATA related errors */ + FP_DEVICE_ERROR_TODV1_90_4_REMOVED = 0x100, +} FpDeviceErrorTODV1_90_4; + +typedef enum { + FP_DEVICE_ERROR_TODV1_94_0_GENERAL, + FP_DEVICE_ERROR_TODV1_94_0_NOT_SUPPORTED, + FP_DEVICE_ERROR_TODV1_94_0_NOT_OPEN, + FP_DEVICE_ERROR_TODV1_94_0_ALREADY_OPEN, + FP_DEVICE_ERROR_TODV1_94_0_BUSY, + FP_DEVICE_ERROR_TODV1_94_0_PROTO, + FP_DEVICE_ERROR_TODV1_94_0_DATA_INVALID, + FP_DEVICE_ERROR_TODV1_94_0_DATA_NOT_FOUND, + FP_DEVICE_ERROR_TODV1_94_0_DATA_FULL, + FP_DEVICE_ERROR_TODV1_94_0_DATA_DUPLICATE, + /* Leave some room to add more DATA related errors */ + FP_DEVICE_ERROR_TODV1_94_0_REMOVED = 0x100, + FP_DEVICE_ERROR_TODV1_94_0_TOO_HOT, +} FpDeviceErrorTODV1_94_0; + +typedef enum { + FP_TEMPERATURE_TODV1_94_0_COLD, + FP_TEMPERATURE_TODV1_94_0_WARM, + FP_TEMPERATURE_TODV1_94_0_HOT, +} FpTemperatureTODV1_94_0; diff --git a/tests/tod-drivers/base-fp-print.h b/tests/tod-drivers/base-fp-print.h new file mode 100644 index 00000000..403631ae --- /dev/null +++ b/tests/tod-drivers/base-fp-print.h @@ -0,0 +1,57 @@ +/* + * FpDevice - A fingerprint reader device + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +typedef enum { + FP_FINGER_TODV1_90_1_UNKNOWN = 0, + FP_FINGER_TODV1_90_1_LEFT_THUMB, + FP_FINGER_TODV1_90_1_LEFT_INDEX, + FP_FINGER_TODV1_90_1_LEFT_MIDDLE, + FP_FINGER_TODV1_90_1_LEFT_RING, + FP_FINGER_TODV1_90_1_LEFT_LITTLE, + FP_FINGER_TODV1_90_1_RIGHT_THUMB, + FP_FINGER_TODV1_90_1_RIGHT_INDEX, + FP_FINGER_TODV1_90_1_RIGHT_MIDDLE, + FP_FINGER_TODV1_90_1_RIGHT_RING, + FP_FINGER_TODV1_90_1_RIGHT_LITTLE, + + FP_FINGER_TODV1_90_1_FIRST = FP_FINGER_TODV1_90_1_LEFT_THUMB, + FP_FINGER_TODV1_90_1_LAST = FP_FINGER_TODV1_90_1_RIGHT_LITTLE, +} FpFingerTODV1_90_1; + +typedef enum { + FP_FINGER_STATUS_TODV1_90_4_NONE = 0, + FP_FINGER_STATUS_TODV1_90_4_NEEDED = 1 << 0, + FP_FINGER_STATUS_TODV1_90_4_PRESENT = 1 << 1, +} FpFingerStatusFlagsTODV1_90_4; + +/* Private flags */ + +typedef enum { + FPI_PRINT_TODV1_90_1_UNDEFINED = 0, + FPI_PRINT_TODV1_90_1_RAW, + FPI_PRINT_TODV1_90_1_NBIS, +} FpiPrintTypeTODV1_90_1; + +typedef enum { + FPI_MATCH_TODV1_90_1_ERROR = -1, + FPI_MATCH_TODV1_90_1_FAIL, + FPI_MATCH_TODV1_90_1_SUCCESS, +} FpiMatchResultTODV1_90_1; diff --git a/tests/tod-drivers/base-fpi-device.h b/tests/tod-drivers/base-fpi-device.h new file mode 100644 index 00000000..fe68e5bc --- /dev/null +++ b/tests/tod-drivers/base-fpi-device.h @@ -0,0 +1,266 @@ +/* + * FpDevice - A fingerprint reader device + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#include +#include + +#include "base-fp-device.h" + +typedef struct _GUsbDevice GUsbDevice; + +typedef struct _FpIdEntryTODV1_90_1 FpIdEntryTODV1_90_1; + +struct _FpIdEntryTODV1_90_1 +{ + union + { + struct + { + guint pid; + guint vid; + }; + const gchar *virtual_envvar; + }; + guint64 driver_data; + + /*< private >*/ + /* padding for future expansion */ + gpointer _padding_dummy[16]; +}; + +struct _FpDeviceClassTODV1_90_1 +{ + /*< private >*/ + GObjectClass parent_class; + + /*< public >*/ + /* Static information about the driver. */ + const gchar *id; + const gchar *full_name; + FpDeviceTypeTODV1_90_1 type; + const FpIdEntryTODV1_90_1 *id_table; + + /* Defaults for device properties */ + gint nr_enroll_stages; + FpScanTypeTODV1_90_1 scan_type; + + /* Callbacks */ + gint (*usb_discover) (GUsbDevice *usb_device); + void (*probe) (FpDevice *device); + void (*open) (FpDevice *device); + void (*close) (FpDevice *device); + void (*enroll) (FpDevice *device); + void (*verify) (FpDevice *device); + void (*identify) (FpDevice *device); + void (*capture) (FpDevice *device); + void (*list) (FpDevice *device); + void (*delete) (FpDevice * device); + + void (*cancel) (FpDevice *device); + + /*< private >*/ + /* padding for future expansion */ + gpointer _padding_dummy[32]; +}; + +typedef struct _FpDeviceClassTODV1_90_1 FpDeviceClassTODV1_90_1; + +typedef enum { + FPI_DEVICE_ACTION_TODV1_90_1_NONE = 0, + FPI_DEVICE_ACTION_TODV1_90_1_PROBE, + FPI_DEVICE_ACTION_TODV1_90_1_OPEN, + FPI_DEVICE_ACTION_TODV1_90_1_CLOSE, + FPI_DEVICE_ACTION_TODV1_90_1_ENROLL, + FPI_DEVICE_ACTION_TODV1_90_1_VERIFY, + FPI_DEVICE_ACTION_TODV1_90_1_IDENTIFY, + FPI_DEVICE_ACTION_TODV1_90_1_CAPTURE, + FPI_DEVICE_ACTION_TODV1_90_1_LIST, + FPI_DEVICE_ACTION_TODV1_90_1_DELETE, +} FpiDeviceActionTODV1_90_1; + +typedef enum { + FPI_DEVICE_ACTION_TODV1_92_0_NONE = 0, + FPI_DEVICE_ACTION_TODV1_92_0_PROBE, + FPI_DEVICE_ACTION_TODV1_92_0_OPEN, + FPI_DEVICE_ACTION_TODV1_92_0_CLOSE, + FPI_DEVICE_ACTION_TODV1_92_0_ENROLL, + FPI_DEVICE_ACTION_TODV1_92_0_VERIFY, + FPI_DEVICE_ACTION_TODV1_92_0_IDENTIFY, + FPI_DEVICE_ACTION_TODV1_92_0_CAPTURE, + FPI_DEVICE_ACTION_TODV1_92_0_LIST, + FPI_DEVICE_ACTION_TODV1_92_0_DELETE, + FPI_DEVICE_ACTION_TODV1_92_0_CLEAR_STORAGE +} FpiDeviceActionTODV1_92_0; + +typedef enum /*< flags >*/ { + FP_DEVICE_FEATURE_TODV1_92_0_NONE = 0, + FP_DEVICE_FEATURE_TODV1_92_0_CAPTURE = 1 << 0, + FP_DEVICE_FEATURE_TODV1_92_0_IDENTIFY = 1 << 1, + FP_DEVICE_FEATURE_TODV1_92_0_VERIFY = 1 << 2, + FP_DEVICE_FEATURE_TODV1_92_0_STORAGE = 1 << 3, + FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_LIST = 1 << 4, + FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_DELETE = 1 << 5, + FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_CLEAR = 1 << 6, + FP_DEVICE_FEATURE_TODV1_92_0_DUPLICATES_CHECK = 1 << 7, +} FpDeviceFeatureTODV1_92_0; + +typedef enum /*< flags >*/ { + FP_DEVICE_FEATURE_TODV1_94_0_NONE = 0, + FP_DEVICE_FEATURE_TODV1_94_0_CAPTURE = 1 << 0, + FP_DEVICE_FEATURE_TODV1_94_0_IDENTIFY = 1 << 1, + FP_DEVICE_FEATURE_TODV1_94_0_VERIFY = 1 << 2, + FP_DEVICE_FEATURE_TODV1_94_0_STORAGE = 1 << 3, + FP_DEVICE_FEATURE_TODV1_94_0_STORAGE_LIST = 1 << 4, + FP_DEVICE_FEATURE_TODV1_94_0_STORAGE_DELETE = 1 << 5, + FP_DEVICE_FEATURE_TODV1_94_0_STORAGE_CLEAR = 1 << 6, + FP_DEVICE_FEATURE_TODV1_94_0_DUPLICATES_CHECK = 1 << 7, + FP_DEVICE_FEATURE_TODV1_94_0_ALWAYS_ON = 1 << 8, +} FpDeviceFeatureTODV1_94_0; + +typedef enum { + FPI_DEVICE_UDEV_SUBTYPE_TODV1_92_0_SPIDEV = 1 << 0, + FPI_DEVICE_UDEV_SUBTYPE_TODV1_92_0_HIDRAW = 1 << 1, +} FpiDeviceUdevSubtypeFlagsTODV1_92_0; + +typedef struct _FpIdEntryTODV1_92_0 FpIdEntryTODV1_92_0; + +struct _FpIdEntryTODV1_92_0 +{ + union + { + struct + { + guint pid; + guint vid; + }; + const gchar *virtual_envvar; + }; + guint64 driver_data; + + /* Elements added after TODv1 */ + union + { + struct + { + FpiDeviceUdevSubtypeFlagsTODV1_92_0 udev_types; + const gchar *spi_acpi_id; + struct + { + guint pid; + guint vid; + } hid_id; + }; + }; + + /*< private >*/ + /* padding for future expansion */ + gpointer _padding_dummy[13]; +}; + +typedef struct _FpIdEntryTODV1_92_0 FpIdEntryTODV1_92_0; + +struct _FpDeviceClassTODV1_92_0 +{ + /*< private >*/ + GObjectClass parent_class; + + /*< public >*/ + /* Static information about the driver. */ + const gchar *id; + const gchar *full_name; + FpDeviceTypeTODV1_92_0 type; + const FpIdEntryTODV1_92_0 *id_table; + + /* Defaults for device properties */ + gint nr_enroll_stages; + FpScanTypeTODV1_90_1 scan_type; + + /* Callbacks */ + gint (*usb_discover) (GUsbDevice *usb_device); + void (*probe) (FpDevice *device); + void (*open) (FpDevice *device); + void (*close) (FpDevice *device); + void (*enroll) (FpDevice *device); + void (*verify) (FpDevice *device); + void (*identify) (FpDevice *device); + void (*capture) (FpDevice *device); + void (*list) (FpDevice *device); + void (*delete) (FpDevice * device); + + void (*cancel) (FpDevice *device); + + FpDeviceFeatureTODV1_92_0 features; + + /*< private >*/ + /* padding for future expansion */ + gpointer _padding_dummy[31]; +}; + +typedef struct _FpDeviceClassTODV1_92_0 FpDeviceClassTODV1_92_0; + + +struct _FpDeviceClassTODV1_94_0 +{ + /*< private >*/ + GObjectClass parent_class; + + /*< public >*/ + /* Static information about the driver. */ + const gchar *id; + const gchar *full_name; + FpDeviceTypeTODV1_92_0 type; + const FpIdEntryTODV1_92_0 *id_table; + + /* Defaults for device properties */ + gint nr_enroll_stages; + FpScanTypeTODV1_90_1 scan_type; + + /* Callbacks */ + gint (*usb_discover) (GUsbDevice *usb_device); + void (*probe) (FpDevice *device); + void (*open) (FpDevice *device); + void (*close) (FpDevice *device); + void (*enroll) (FpDevice *device); + void (*verify) (FpDevice *device); + void (*identify) (FpDevice *device); + void (*capture) (FpDevice *device); + void (*list) (FpDevice *device); + void (*delete) (FpDevice * device); + + void (*cancel) (FpDevice *device); + + /* Class elements added after tod-v1 */ + FpDeviceFeatureTODV1_94_0 features; + + /* Simple device temperature model constants */ + gint32 temp_hot_seconds; + gint32 temp_cold_seconds; + + void (*clear_storage) (FpDevice * device); + void (*suspend) (FpDevice *device); + void (*resume) (FpDevice *device); + + /*< private >*/ + /* padding for future expansion */ + gpointer _padding_dummy[27]; +}; + +typedef struct _FpDeviceClassTODV1_94_0 FpDeviceClassTODV1_94_0; diff --git a/tests/tod-drivers/base-fpi-image-device.h b/tests/tod-drivers/base-fpi-image-device.h new file mode 100644 index 00000000..5d83d1e0 --- /dev/null +++ b/tests/tod-drivers/base-fpi-image-device.h @@ -0,0 +1,61 @@ +/* + * FpImageDevice - An image based fingerprint reader device + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#include "base-fpi-device.h" + +typedef struct _FpImageDevice FpImageDevice; + +typedef enum { + FPI_IMAGE_DEVICE_STATE_TODV1_90_1_INACTIVE, + FPI_IMAGE_DEVICE_STATE_TODV1_90_1_AWAIT_FINGER_ON, + FPI_IMAGE_DEVICE_STATE_TODV1_90_1_CAPTURE, + FPI_IMAGE_DEVICE_STATE_TODV1_90_1_AWAIT_FINGER_OFF, +} FpiImageDeviceStateTODV1_90_1; + +typedef enum { + FPI_IMAGE_DEVICE_STATE_TODV1_92_0_INACTIVE, + FPI_IMAGE_DEVICE_STATE_TODV1_92_0_AWAIT_FINGER_ON, + FPI_IMAGE_DEVICE_STATE_TODV1_92_0_CAPTURE, + FPI_IMAGE_DEVICE_STATE_TODV1_92_0_AWAIT_FINGER_OFF, + FPI_IMAGE_DEVICE_STATE_TODV1_92_0_ACTIVATING, + FPI_IMAGE_DEVICE_STATE_TODV1_92_0_DEACTIVATING, + FPI_IMAGE_DEVICE_STATE_TODV1_92_0_IDLE, +} FpiImageDeviceStateTODV1_90_4; + +typedef struct _FpImageDeviceClassTODV1_90_1 +{ + FpDeviceClassTODV1_90_1 parent_class; + + gint bz3_threshold; + gint img_width; + gint img_height; + + void (*img_open)(FpImageDevice *dev); + void (*img_close)(FpImageDevice *dev); + void (*activate)(FpImageDevice *dev); + void (*change_state)(FpImageDevice *dev, + FpiImageDeviceStateTODV1_90_1 state); + void (*deactivate)(FpImageDevice *dev); + + /*< private >*/ + /* padding for future expansion */ + gpointer _padding_dummy[32]; +} FpImageDeviceClassTODV1_90_1; diff --git a/tests/tod-drivers/base-fpi-image.h b/tests/tod-drivers/base-fpi-image.h new file mode 100644 index 00000000..22d0c779 --- /dev/null +++ b/tests/tod-drivers/base-fpi-image.h @@ -0,0 +1,62 @@ +/* + * FpImageDevice - An image based fingerprint reader device + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#include +#include + +typedef struct _FpImage FpImage; +typedef struct _FpImageTODV1_90_1 FpImageTODV1_90_1; + +typedef enum { + FPI_IMAGE_TODV1_90_1_V_FLIPPED = 1 << 0, + FPI_IMAGE_TODV1_90_1_H_FLIPPED = 1 << 1, + FPI_IMAGE_TODV1_90_1_COLORS_INVERTED = 1 << 2, +} FpiImageFlagsTODV1_90_1; + +typedef enum { + FPI_IMAGE_TODV1_90_2_V_FLIPPED = 1 << 0, + FPI_IMAGE_TODV1_90_2_H_FLIPPED = 1 << 1, + FPI_IMAGE_TODV1_90_2_COLORS_INVERTED = 1 << 2, + FPI_IMAGE_TODV1_90_2_PARTIAL = 1 << 3, +} FpiImageFlagsTODV1_90_2; + +struct _FpImageTODV1_90_1 +{ + /*< private >*/ + GObject parent; + + /*< public >*/ + guint width; + guint height; + + gdouble ppmm; + + FpiImageFlagsTODV1_90_1 flags; + + /*< private >*/ + guint8 *data; + guint8 *binarized; + + GPtrArray *minutiae; + guint ref_count; + + gpointer _padding_dummy[32]; +}; diff --git a/tests/tod-drivers/base-fpi-spi.h b/tests/tod-drivers/base-fpi-spi.h new file mode 100644 index 00000000..73aa293f --- /dev/null +++ b/tests/tod-drivers/base-fpi-spi.h @@ -0,0 +1,60 @@ +/* + * FpDevice - A fingerprint reader device + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#include "base-fpi-device.h" + +typedef struct _FpiSpiTransferTODV1_92_0 FpiSpiTransferTODV1_92_0; +typedef struct _FpiSsm FpiSsm; + +typedef void (*FpiSpiTransferCallbackTODV1_92_0)(FpiSpiTransferTODV1_92_0 *transfer, + FpDevice *dev, + gpointer user_data, + GError *error); + +struct _FpiSpiTransferTODV1_92_0 +{ + /*< public >*/ + FpDevice *device; + + FpiSsm *ssm; + + gssize length_wr; + gssize length_rd; + + guchar *buffer_wr; + guchar *buffer_rd; + + /*< private >*/ + guint ref_count; + + int spidev_fd; + + /* Callbacks */ + gpointer user_data; + FpiSpiTransferCallbackTODV1_92_0 callback; + + /* Data free function */ + GDestroyNotify free_buffer_wr; + GDestroyNotify free_buffer_rd; + + /* padding for future expansion */ + gpointer _padding_dummy[32]; +}; diff --git a/tests/tod-drivers/base-fpi-usb.h b/tests/tod-drivers/base-fpi-usb.h new file mode 100644 index 00000000..5542a102 --- /dev/null +++ b/tests/tod-drivers/base-fpi-usb.h @@ -0,0 +1,81 @@ +/* + * FpDevice - A fingerprint reader device + * Copyright (C) 2021 Marco Trevisan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#include + +#include "base-fpi-device.h" + +typedef struct _FpiUsbTransferTODV1_90_1 FpiUsbTransferTODV1_90_1; +typedef struct _FpiSsm FpiSsm; + +typedef void (*FpiUsbTransferCallbackTODV1_90_1)(FpiUsbTransferTODV1_90_1 *transfer, + FpDevice *dev, + gpointer user_data, + GError *error); + +typedef enum { + FP_TRANSFER_TODV1_90_1_NONE = -1, + FP_TRANSFER_TODV1_90_1_CONTROL = 0, + FP_TRANSFER_TODV1_90_1_BULK = 2, + FP_TRANSFER_TODV1_90_1_INTERRUPT = 3, +} FpiTransferTypeTODV1_90_3; + +struct _FpiUsbTransferTODV1_90_1 +{ + /*< public >*/ + FpDevice *device; + + FpiSsm *ssm; + + gssize length; + gssize actual_length; + + guchar *buffer; + + /*< private >*/ + guint ref_count; + + /* USB Transfer information */ + FpiTransferTypeTODV1_90_3 type; + guint8 endpoint; + + /* Control Transfer options */ + GUsbDeviceDirection direction; + GUsbDeviceRequestType request_type; + GUsbDeviceRecipient recipient; + guint8 request; + guint16 value; + guint16 idx; + + /* Flags */ + gboolean short_is_error; + + /* Callbacks */ + gpointer user_data; + FpiUsbTransferCallbackTODV1_90_1 callback; + + /* Data free function */ + GDestroyNotify free_buffer; + + /*< private >*/ + /* padding for future expansion */ + gpointer _padding_dummy[32]; +}; diff --git a/tests/tod-drivers/libdevice-fake-tod-driver-x86_64.so b/tests/tod-drivers/libdevice-fake-tod-driver-x86_64.so deleted file mode 100755 index 822f417c..00000000 Binary files a/tests/tod-drivers/libdevice-fake-tod-driver-x86_64.so and /dev/null differ diff --git a/tests/tod-drivers/tod-x86_64-v1+1.90.1/libdevice-fake-tod-ssm-test-v1+1.90.1-x86_64.so b/tests/tod-drivers/tod-x86_64-v1+1.90.1/libdevice-fake-tod-ssm-test-v1+1.90.1-x86_64.so new file mode 100755 index 00000000..094bb567 Binary files /dev/null and b/tests/tod-drivers/tod-x86_64-v1+1.90.1/libdevice-fake-tod-ssm-test-v1+1.90.1-x86_64.so differ diff --git a/tests/tod-drivers/tod-x86_64-v1+1.90.1/libdevice-fake-tod-test-driver-v1+1.90.1-x86_64.so b/tests/tod-drivers/tod-x86_64-v1+1.90.1/libdevice-fake-tod-test-driver-v1+1.90.1-x86_64.so new file mode 100755 index 00000000..05c265b0 Binary files /dev/null and b/tests/tod-drivers/tod-x86_64-v1+1.90.1/libdevice-fake-tod-test-driver-v1+1.90.1-x86_64.so differ diff --git a/tests/tod-drivers/tod-x86_64-v1+1.90.2/libdevice-fake-tod-ssm-test-v1+1.90.2-x86_64.so b/tests/tod-drivers/tod-x86_64-v1+1.90.2/libdevice-fake-tod-ssm-test-v1+1.90.2-x86_64.so new file mode 100755 index 00000000..79dd1073 Binary files /dev/null and b/tests/tod-drivers/tod-x86_64-v1+1.90.2/libdevice-fake-tod-ssm-test-v1+1.90.2-x86_64.so differ diff --git a/tests/tod-drivers/tod-x86_64-v1+1.90.2/libdevice-fake-tod-test-driver-v1+1.90.2-x86_64.so b/tests/tod-drivers/tod-x86_64-v1+1.90.2/libdevice-fake-tod-test-driver-v1+1.90.2-x86_64.so new file mode 100755 index 00000000..ead8c975 Binary files /dev/null and b/tests/tod-drivers/tod-x86_64-v1+1.90.2/libdevice-fake-tod-test-driver-v1+1.90.2-x86_64.so differ diff --git a/tests/tod-drivers/tod-x86_64-v1+1.90.3/libdevice-fake-tod-ssm-test-v1+1.90.3-x86_64.so b/tests/tod-drivers/tod-x86_64-v1+1.90.3/libdevice-fake-tod-ssm-test-v1+1.90.3-x86_64.so new file mode 100755 index 00000000..336ced53 Binary files /dev/null and b/tests/tod-drivers/tod-x86_64-v1+1.90.3/libdevice-fake-tod-ssm-test-v1+1.90.3-x86_64.so differ diff --git a/tests/tod-drivers/tod-x86_64-v1+1.90.3/libdevice-fake-tod-test-driver-v1+1.90.3-x86_64.so b/tests/tod-drivers/tod-x86_64-v1+1.90.3/libdevice-fake-tod-test-driver-v1+1.90.3-x86_64.so new file mode 100755 index 00000000..281bb096 Binary files /dev/null and b/tests/tod-drivers/tod-x86_64-v1+1.90.3/libdevice-fake-tod-test-driver-v1+1.90.3-x86_64.so differ diff --git a/tests/tod-drivers/tod-x86_64-v1+1.90.5/libdevice-fake-tod-ssm-test-v1+1.90.5-x86_64.so b/tests/tod-drivers/tod-x86_64-v1+1.90.5/libdevice-fake-tod-ssm-test-v1+1.90.5-x86_64.so new file mode 100755 index 00000000..0001228a Binary files /dev/null and b/tests/tod-drivers/tod-x86_64-v1+1.90.5/libdevice-fake-tod-ssm-test-v1+1.90.5-x86_64.so differ diff --git a/tests/tod-drivers/tod-x86_64-v1+1.90.5/libdevice-fake-tod-test-driver-v1+1.90.5-x86_64.so b/tests/tod-drivers/tod-x86_64-v1+1.90.5/libdevice-fake-tod-test-driver-v1+1.90.5-x86_64.so new file mode 100755 index 00000000..d8634c42 Binary files /dev/null and b/tests/tod-drivers/tod-x86_64-v1+1.90.5/libdevice-fake-tod-test-driver-v1+1.90.5-x86_64.so differ diff --git a/tests/tod-drivers/tod-x86_64-v1+1.94.0/libdevice-fake-tod-ssm-test-v1+1.94.0-x86_64.so b/tests/tod-drivers/tod-x86_64-v1+1.94.0/libdevice-fake-tod-ssm-test-v1+1.94.0-x86_64.so new file mode 100755 index 00000000..49e3104a Binary files /dev/null and b/tests/tod-drivers/tod-x86_64-v1+1.94.0/libdevice-fake-tod-ssm-test-v1+1.94.0-x86_64.so differ diff --git a/tests/tod-drivers/tod-x86_64-v1+1.94.0/libdevice-fake-tod-test-driver-v1+1.94.0-x86_64.so b/tests/tod-drivers/tod-x86_64-v1+1.94.0/libdevice-fake-tod-test-driver-v1+1.94.0-x86_64.so new file mode 100755 index 00000000..8c64885e Binary files /dev/null and b/tests/tod-drivers/tod-x86_64-v1+1.94.0/libdevice-fake-tod-test-driver-v1+1.94.0-x86_64.so differ