Update upstream source from tag 'upstream/1.94.1+tod1'

Update to upstream version '1.94.1+tod1'
with Debian dir 7437b3331b
This commit is contained in:
Marco Trevisan (Treviño)
2021-10-28 19:24:16 +02:00
49 changed files with 2229 additions and 515 deletions
+4
View File
@@ -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, determined that it is fine to ship bozorth3 in an open source project,
see https://fprint.freedesktop.org/us-export-control.html 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 ## Historical links
Older versions of libfprint are available at: Older versions of libfprint are available at:
+2
View File
@@ -142,6 +142,7 @@ usb:v04F3p0C58*
ID_PERSIST=0 ID_PERSIST=0
# Supported by libfprint driver elanmoc # Supported by libfprint driver elanmoc
usb:v04F3p0C7D*
usb:v04F3p0C7E* usb:v04F3p0C7E*
ID_AUTOSUSPEND=1 ID_AUTOSUSPEND=1
ID_PERSIST=0 ID_PERSIST=0
@@ -158,6 +159,7 @@ usb:v27C6p60A2*
usb:v27C6p639C* usb:v27C6p639C*
usb:v27C6p63AC* usb:v27C6p63AC*
usb:v27C6p63BC* usb:v27C6p63BC*
usb:v27C6p63CC*
usb:v27C6p6496* usb:v27C6p6496*
usb:v27C6p6584* usb:v27C6p6584*
usb:v27C6p658C* usb:v27C6p658C*
+10
View File
@@ -21,3 +21,13 @@ executable('cpp-test',
'cpp-test.cpp', 'cpp-test.cpp',
dependencies: libfprint_dep, dependencies: libfprint_dep,
) )
if get_option('tod')
executable('tod-inspector',
sources: 'tod-inspector.c',
dependencies: [
libfprint_dep,
tod_dep,
],
)
endif
+138
View File
@@ -0,0 +1,138 @@
/*
* Shared library loader for libfprint
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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 <libfprint/fprint.h>
#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 ();
}
+1
View File
@@ -25,6 +25,7 @@
G_DEFINE_TYPE (FpiDeviceElanmoc, fpi_device_elanmoc, FP_TYPE_DEVICE) G_DEFINE_TYPE (FpiDeviceElanmoc, fpi_device_elanmoc, FP_TYPE_DEVICE)
static const FpIdEntry id_table[] = { static const FpIdEntry id_table[] = {
{ .vid = 0x04f3, .pid = 0x0c7d, },
{ .vid = 0x04f3, .pid = 0x0c7e, }, { .vid = 0x04f3, .pid = 0x0c7e, },
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */ { .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
}; };
+2
View File
@@ -1282,6 +1282,7 @@ gx_fp_probe (FpDevice *device)
case 0x639C: case 0x639C:
case 0x63AC: case 0x63AC:
case 0x63BC: case 0x63BC:
case 0x63CC:
case 0x6A94: case 0x6A94:
self->max_enroll_stage = 12; self->max_enroll_stage = 12;
break; break;
@@ -1505,6 +1506,7 @@ static const FpIdEntry id_table[] = {
{ .vid = 0x27c6, .pid = 0x639C, }, { .vid = 0x27c6, .pid = 0x639C, },
{ .vid = 0x27c6, .pid = 0x63AC, }, { .vid = 0x27c6, .pid = 0x63AC, },
{ .vid = 0x27c6, .pid = 0x63BC, }, { .vid = 0x27c6, .pid = 0x63BC, },
{ .vid = 0x27c6, .pid = 0x63CC, },
{ .vid = 0x27c6, .pid = 0x6496, }, { .vid = 0x27c6, .pid = 0x6496, },
{ .vid = 0x27c6, .pid = 0x6584, }, { .vid = 0x27c6, .pid = 0x6584, },
{ .vid = 0x27c6, .pid = 0x658C, }, { .vid = 0x27c6, .pid = 0x658C, },
+3 -1
View File
@@ -113,13 +113,15 @@ typedef struct _gxfp_enroll_init
#pragma pack(push, 1) #pragma pack(push, 1)
typedef struct _template_format typedef struct _template_format
{ {
uint8_t _0x43_byte;
uint8_t type; uint8_t type;
uint8_t finger_index; uint8_t finger_index;
uint8_t pad0;
uint8_t accountid[32]; uint8_t accountid[32];
uint8_t tid[32]; uint8_t tid[32];
struct struct
{ {
uint32_t size; uint8_t size;
uint8_t data[56]; uint8_t data[56];
} payload; } payload;
uint8_t reserve[2]; uint8_t reserve[2];
+4 -5
View File
@@ -27,15 +27,14 @@
#include <config.h> #include <config.h>
#ifdef HAVE_UDEV
#include <gudev/gudev.h>
#endif
#include <config.h>
#ifdef HAVE_LIBFPRINT_TOD #ifdef HAVE_LIBFPRINT_TOD
#include "tod/tod-shared-loader.h" #include "tod/tod-shared-loader.h"
#endif #endif
#ifdef HAVE_UDEV
#include <gudev/gudev.h>
#endif
/** /**
* SECTION: fp-context * SECTION: fp-context
* @title: FpContext * @title: FpContext
+1 -1
View File
@@ -43,8 +43,8 @@ G_DECLARE_DERIVABLE_TYPE (FpDevice, fp_device, FP, DEVICE, GObject)
*/ */
typedef enum { typedef enum {
FP_DEVICE_TYPE_VIRTUAL, FP_DEVICE_TYPE_VIRTUAL,
FP_DEVICE_TYPE_UDEV,
FP_DEVICE_TYPE_USB, FP_DEVICE_TYPE_USB,
FP_DEVICE_TYPE_UDEV,
} FpDeviceType; } FpDeviceType;
/** /**
+17 -9
View File
@@ -53,6 +53,12 @@ struct _FpIdEntry
guint vid; guint vid;
}; };
const gchar *virtual_envvar; const gchar *virtual_envvar;
};
guint64 driver_data;
/* Elements added after TODv1 */
union
{
struct struct
{ {
FpiDeviceUdevSubtypeFlags udev_types; FpiDeviceUdevSubtypeFlags udev_types;
@@ -64,11 +70,10 @@ struct _FpIdEntry
} hid_id; } hid_id;
}; };
}; };
guint64 driver_data;
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[16]; gpointer _padding_dummy[13];
}; };
/** /**
@@ -149,16 +154,11 @@ struct _FpDeviceClass
const gchar *full_name; const gchar *full_name;
FpDeviceType type; FpDeviceType type;
const FpIdEntry *id_table; const FpIdEntry *id_table;
FpDeviceFeature features;
/* Defaults for device properties */ /* Defaults for device properties */
gint nr_enroll_stages; gint nr_enroll_stages;
FpScanType scan_type; FpScanType scan_type;
/* Simple device temperature model constants */
gint32 temp_hot_seconds;
gint32 temp_cold_seconds;
/* Callbacks */ /* Callbacks */
gint (*usb_discover) (GUsbDevice *usb_device); gint (*usb_discover) (GUsbDevice *usb_device);
void (*probe) (FpDevice *device); void (*probe) (FpDevice *device);
@@ -170,15 +170,23 @@ struct _FpDeviceClass
void (*capture) (FpDevice *device); void (*capture) (FpDevice *device);
void (*list) (FpDevice *device); void (*list) (FpDevice *device);
void (*delete) (FpDevice * device); void (*delete) (FpDevice * device);
void (*clear_storage) (FpDevice * device);
void (*cancel) (FpDevice *device); void (*cancel) (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 (*suspend) (FpDevice *device);
void (*resume) (FpDevice *device); void (*resume) (FpDevice *device);
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[32]; gpointer _padding_dummy[27];
}; };
void fpi_device_class_auto_initialize_features (FpDeviceClass *device_class); void fpi_device_class_auto_initialize_features (FpDeviceClass *device_class);
+2
View File
@@ -68,6 +68,8 @@ struct _FpImage
GPtrArray *minutiae; GPtrArray *minutiae;
guint ref_count; guint ref_count;
gpointer _padding_dummy[32];
}; };
gint fpi_std_sq_dev (const guint8 *buf, gint fpi_std_sq_dev (const guint8 *buf,
+3
View File
@@ -73,6 +73,9 @@ struct _FpiSpiTransfer
/* Data free function */ /* Data free function */
GDestroyNotify free_buffer_wr; GDestroyNotify free_buffer_wr;
GDestroyNotify free_buffer_rd; GDestroyNotify free_buffer_rd;
/* padding for future expansion */
gpointer _padding_dummy[32];
}; };
GType fpi_spi_transfer_get_type (void) G_GNUC_CONST; GType fpi_spi_transfer_get_type (void) G_GNUC_CONST;
+4
View File
@@ -747,3 +747,7 @@ fpi_ssm_spi_transfer_with_weak_pointer_cb (FpiSpiTransfer *transfer,
fpi_ssm_spi_transfer_cb (transfer, device, weak_ptr, error); fpi_ssm_spi_transfer_cb (transfer, device, weak_ptr, error);
} }
#ifdef TOD_LIBRARY
#include "tod/tod-fpi-ssm.c"
#endif
-6
View File
@@ -1,6 +0,0 @@
LIBFPRINT_TOD_1.0.0 {
global:
fpi_*;
local:
*;
};
+33
View File
@@ -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;
+17 -6
View File
@@ -10,7 +10,11 @@ configure_file(output: 'tod-config.h', configuration: tod_conf)
gmodule_dep = dependency('gmodule-2.0', version: '>=' + glib_min_version) gmodule_dep = dependency('gmodule-2.0', version: '>=' + glib_min_version)
deps += gmodule_dep 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', libfprint_tod_private = static_library('fprint-tod-private',
sources: [ sources: [
@@ -22,19 +26,26 @@ libfprint_tod_private = static_library('fprint-tod-private',
install: false, install: false,
) )
tod_sources = [] tod_sources = [
'tod-wrappers.c',
'tod-symbols.h',
]
foreach source: libfprint_private_sources foreach source: libfprint_private_sources
tod_sources += '..' / source tod_sources += '..' / source
endforeach endforeach
libfprint_tod = library(versioned_libname.split('lib')[1] + '-tod', libfprint_tod = library(versioned_libname.split('lib')[1] + '-tod',
c_args: [
'-DTOD_LIBRARY=1',
'-include', '@0@'.format(files('tod-symbols.h')[0]),
],
sources: [ sources: [
tod_sources, tod_sources,
], ],
soversion: tod_soversion, soversion: tod_soversion,
include_directories: include_directories('..'), include_directories: include_directories('..'),
link_args: [ 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' '-Wl,--unresolved-symbols=ignore-in-object-files'
], ],
link_depends: mapfile, link_depends: mapfile,
@@ -42,12 +53,12 @@ libfprint_tod = library(versioned_libname.split('lib')[1] + '-tod',
dependencies: deps, dependencies: deps,
install: true) install: true)
deps += declare_dependency( tod_dep = declare_dependency(
link_with: [ link_with: [
libfprint_tod, libfprint_tod,
libfprint_tod_private, libfprint_tod_private,
] ])
) deps += tod_dep
pkgconfig = import('pkgconfig') pkgconfig = import('pkgconfig')
pkgconfig.generate(libfprint_tod, pkgconfig.generate(libfprint_tod,
+67
View File
@@ -0,0 +1,67 @@
/*
* Shared library loader for libfprint
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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);
}
+6
View File
@@ -127,6 +127,12 @@ fpi_tod_shared_drivers_register (void)
fp_dbg ("Loading driver %s (%s)", cls->id, cls->full_name); fp_dbg ("Loading driver %s (%s)", cls->id, cls->full_name);
g_array_append_val (shared_drivers, driver); 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, shared_modules = g_list_prepend (shared_modules,
g_steal_pointer (&module)); g_steal_pointer (&module));
} }
+45
View File
@@ -0,0 +1,45 @@
/*
* Shared library loader for libfprint
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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)
+31
View File
@@ -0,0 +1,31 @@
/*
* Shared library loader for libfprint
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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);
}
+39
View File
@@ -0,0 +1,39 @@
/*
* Shared library loader for libfprint
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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);
+2 -5
View File
@@ -1,5 +1,5 @@
project('libfprint', [ 'c', 'cpp' ], project('libfprint', [ 'c', 'cpp' ],
version: '1.94.1', version: '1.94.1+tod1',
license: 'LGPLv2.1+', license: 'LGPLv2.1+',
default_options: [ default_options: [
'buildtype=debugoptimized', 'buildtype=debugoptimized',
@@ -292,13 +292,10 @@ if get_option('gtk-examples')
endif endif
endif endif
<<<<<<< HEAD
libfprint_conf.set10('HAVE_LIBFPRINT_TOD', get_option('tod'))
=======
# Some dependency resolving happens inside here # Some dependency resolving happens inside here
subdir('libfprint') 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) configure_file(output: 'config.h', configuration: libfprint_conf)
subdir('examples') subdir('examples')
+149 -149
View File
@@ -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=pci-0000:00:14.0-usb-0:9
E: ID_PATH_TAG=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 E: LIBFPRINT_DRIVER=Hardcoded whitelist
A: authorized=1 A: authorized=1\n
A: avoid_reset_quirk=0 A: avoid_reset_quirk=0\n
A: bConfigurationValue=1 A: bConfigurationValue=1\n
A: bDeviceClass=00 A: bDeviceClass=00\n
A: bDeviceProtocol=00 A: bDeviceProtocol=00\n
A: bDeviceSubClass=00 A: bDeviceSubClass=00\n
A: bMaxPacketSize0=8 A: bMaxPacketSize0=8\n
A: bMaxPower=100mA A: bMaxPower=100mA\n
A: bNumConfigurations=1 A: bNumConfigurations=1\n
A: bNumInterfaces= 1 A: bNumInterfaces= 1\n
A: bcdDevice=1041 A: bcdDevice=1041\n
A: bmAttributes=a0 A: bmAttributes=a0\n
A: busnum=1 A: busnum=1\n
A: configuration= A: configuration=\n
H: descriptors=12011001000000087A1C700541100102030109022000010100A0320904000002FF0000000705830240000007050402400003 H: descriptors=12011001000000087A1C700541100102030109022000010100A0320904000002FF0000000705830240000007050402400003
A: dev=189:4 A: dev=189:4\n
A: devnum=5 A: devnum=5\n
A: devpath=9 A: devpath=9\n
L: driver=../../../../../bus/usb/drivers/usb L: driver=../../../../../bus/usb/drivers/usb
A: idProduct=0570 A: idProduct=0570\n
A: idVendor=1c7a A: idVendor=1c7a\n
A: ltm_capable=no A: ltm_capable=no\n
A: manufacturer=EgisTec A: manufacturer=EgisTec\n
A: maxchild=0 A: maxchild=0\n
L: port=../1-0:1.0/usb1-port9 L: port=../1-0:1.0/usb1-port9
A: power/active_duration=362352 A: power/active_duration=362352\n
A: power/async=enabled A: power/async=enabled\n
A: power/autosuspend=2 A: power/autosuspend=2\n
A: power/autosuspend_delay_ms=2000 A: power/autosuspend_delay_ms=2000\n
A: power/connected_duration=5526124 A: power/connected_duration=5526124\n
A: power/control=auto A: power/control=auto\n
A: power/level=auto A: power/level=auto\n
A: power/persist=1 A: power/persist=1\n
A: power/runtime_active_kids=0 A: power/runtime_active_kids=0\n
A: power/runtime_active_time=365097 A: power/runtime_active_time=365097\n
A: power/runtime_enabled=enabled A: power/runtime_enabled=enabled\n
A: power/runtime_status=active A: power/runtime_status=active\n
A: power/runtime_suspended_time=5160752 A: power/runtime_suspended_time=5160752\n
A: power/runtime_usage=0 A: power/runtime_usage=0\n
A: power/wakeup=disabled A: power/wakeup=disabled\n
A: power/wakeup_abort_count= A: power/wakeup_abort_count=\n
A: power/wakeup_active= A: power/wakeup_active=\n
A: power/wakeup_active_count= A: power/wakeup_active_count=\n
A: power/wakeup_count= A: power/wakeup_count=\n
A: power/wakeup_expire_count= A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms= A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms= A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms= A: power/wakeup_total_time_ms=\n
A: product=EgisTec Touch Fingerprint Sensor A: product=EgisTec Touch Fingerprint Sensor\n
A: quirks=0x0 A: quirks=0x0\n
A: removable=fixed A: removable=fixed\n
A: rx_lanes=1 A: rx_lanes=1\n
A: serial=W700B41B A: serial=W700B41B\n
A: speed=12 A: speed=12\n
A: tx_lanes=1 A: tx_lanes=1\n
A: urbnum=8040 A: urbnum=8040\n
A: version= 1.10 A: version= 1.10\n
P: /devices/pci0000:00/0000:00:14.0/usb1 P: /devices/pci0000:00/0000:00:14.0/usb1
N: bus/usb/001/001=12010002090001406B1D020008050302010109021900010100E0000904000001090000000705810304000C 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_PATH_TAG=pci-0000_00_14_0
E: ID_FOR_SEAT=usb-pci-0000_00_14_0 E: ID_FOR_SEAT=usb-pci-0000_00_14_0
E: TAGS=:seat: E: TAGS=:seat:
A: authorized=1 A: authorized=1\n
A: authorized_default=1 A: authorized_default=1\n
A: avoid_reset_quirk=0 A: avoid_reset_quirk=0\n
A: bConfigurationValue=1 A: bConfigurationValue=1\n
A: bDeviceClass=09 A: bDeviceClass=09\n
A: bDeviceProtocol=01 A: bDeviceProtocol=01\n
A: bDeviceSubClass=00 A: bDeviceSubClass=00\n
A: bMaxPacketSize0=64 A: bMaxPacketSize0=64\n
A: bMaxPower=0mA A: bMaxPower=0mA\n
A: bNumConfigurations=1 A: bNumConfigurations=1\n
A: bNumInterfaces= 1 A: bNumInterfaces= 1\n
A: bcdDevice=0508 A: bcdDevice=0508\n
A: bmAttributes=e0 A: bmAttributes=e0\n
A: busnum=1 A: busnum=1\n
A: configuration= A: configuration=\n
H: descriptors=12010002090001406B1D020008050302010109021900010100E0000904000001090000000705810304000C H: descriptors=12010002090001406B1D020008050302010109021900010100E0000904000001090000000705810304000C
A: dev=189:0 A: dev=189:0\n
A: devnum=1 A: devnum=1\n
A: devpath=0 A: devpath=0\n
L: driver=../../../../bus/usb/drivers/usb L: driver=../../../../bus/usb/drivers/usb
A: idProduct=0002 A: idProduct=0002\n
A: idVendor=1d6b A: idVendor=1d6b\n
A: interface_authorized_default=1 A: interface_authorized_default=1\n
A: ltm_capable=no A: ltm_capable=no\n
A: manufacturer=Linux 5.8.0-59-generic xhci-hcd A: manufacturer=Linux 5.8.0-59-generic xhci-hcd\n
A: maxchild=12 A: maxchild=12\n
A: power/active_duration=378024 A: power/active_duration=378024\n
A: power/async=enabled A: power/async=enabled\n
A: power/autosuspend=0 A: power/autosuspend=0\n
A: power/autosuspend_delay_ms=0 A: power/autosuspend_delay_ms=0\n
A: power/connected_duration=5527220 A: power/connected_duration=5527220\n
A: power/control=auto A: power/control=auto\n
A: power/level=auto A: power/level=auto\n
A: power/runtime_active_kids=1 A: power/runtime_active_kids=1\n
A: power/runtime_active_time=377962 A: power/runtime_active_time=377962\n
A: power/runtime_enabled=enabled A: power/runtime_enabled=enabled\n
A: power/runtime_status=active A: power/runtime_status=active\n
A: power/runtime_suspended_time=5149253 A: power/runtime_suspended_time=5149253\n
A: power/runtime_usage=0 A: power/runtime_usage=0\n
A: power/wakeup=disabled A: power/wakeup=disabled\n
A: power/wakeup_abort_count= A: power/wakeup_abort_count=\n
A: power/wakeup_active= A: power/wakeup_active=\n
A: power/wakeup_active_count= A: power/wakeup_active_count=\n
A: power/wakeup_count= A: power/wakeup_count=\n
A: power/wakeup_expire_count= A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms= A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms= A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms= A: power/wakeup_total_time_ms=\n
A: product=xHCI Host Controller A: product=xHCI Host Controller\n
A: quirks=0x0 A: quirks=0x0\n
A: removable=unknown A: removable=unknown\n
A: rx_lanes=1 A: rx_lanes=1\n
A: serial=0000:00:14.0 A: serial=0000:00:14.0\n
A: speed=480 A: speed=480\n
A: tx_lanes=1 A: tx_lanes=1\n
A: urbnum=956 A: urbnum=956\n
A: version= 2.00 A: version= 2.00\n
P: /devices/pci0000:00/0000:00:14.0 P: /devices/pci0000:00/0000:00:14.0
E: DRIVER=xhci_hcd 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_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_VENDOR_FROM_DATABASE=Intel Corporation E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_MODEL_FROM_DATABASE=Sunrise Point-LP USB 3.0 xHCI Controller E: ID_MODEL_FROM_DATABASE=Sunrise Point-LP USB 3.0 xHCI Controller
A: ari_enabled=0 A: ari_enabled=0\n
A: broken_parity_status=0 A: broken_parity_status=0\n
A: class=0x0c0330 A: class=0x0c0330\n
H: config=86802F9D060490022130030C00008000040021A400000000000000000000000000000000000000000000000025108E11000000007000000000000000FF010000 H: config=86802F9D060490022130030C00008000040021A400000000000000000000000000000000000000000000000025108E11000000007000000000000000FF010000
A: consistent_dma_mask_bits=64 A: consistent_dma_mask_bits=64\n
A: d3cold_allowed=1 A: d3cold_allowed=1\n
A: dbc=disabled A: dbc=disabled\n
A: device=0x9d2f A: device=0x9d2f\n
A: dma_mask_bits=64 A: dma_mask_bits=64\n
L: driver=../../../bus/pci/drivers/xhci_hcd L: driver=../../../bus/pci/drivers/xhci_hcd
A: driver_override=(null) A: driver_override=(null)\n
A: enable=1 A: enable=1\n
A: irq=127 A: irq=127\n
A: local_cpulist=0-7 A: local_cpulist=0-7\n
A: local_cpus=ff A: local_cpus=ff\n
A: modalias=pci:v00008086d00009D2Fsv00001025sd0000118Ebc0Csc03i30 A: modalias=pci:v00008086d00009D2Fsv00001025sd0000118Ebc0Csc03i30\n
A: msi_bus=1 A: msi_bus=1\n
A: msi_irqs/127=msi A: msi_irqs/127=msi\n
A: numa_node=-1 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 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 A: power/async=enabled\n
A: power/control=on A: power/control=on\n
A: power/runtime_active_kids=1 A: power/runtime_active_kids=1\n
A: power/runtime_active_time=5524703 A: power/runtime_active_time=5524703\n
A: power/runtime_enabled=forbidden A: power/runtime_enabled=forbidden\n
A: power/runtime_status=active A: power/runtime_status=active\n
A: power/runtime_suspended_time=3373 A: power/runtime_suspended_time=3373\n
A: power/runtime_usage=1 A: power/runtime_usage=1\n
A: power/wakeup=enabled A: power/wakeup=enabled\n
A: power/wakeup_abort_count=0 A: power/wakeup_abort_count=0\n
A: power/wakeup_active=0 A: power/wakeup_active=0\n
A: power/wakeup_active_count=0 A: power/wakeup_active_count=0\n
A: power/wakeup_count=0 A: power/wakeup_count=0\n
A: power/wakeup_expire_count=0 A: power/wakeup_expire_count=0\n
A: power/wakeup_last_time_ms=0 A: power/wakeup_last_time_ms=0\n
A: power/wakeup_max_time_ms=0 A: power/wakeup_max_time_ms=0\n
A: power/wakeup_total_time_ms=0 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 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 A: revision=0x21\n
A: subsystem_device=0x118e A: subsystem_device=0x118e\n
A: subsystem_vendor=0x1025 A: subsystem_vendor=0x1025\n
A: vendor=0x8086 A: vendor=0x8086\n
+148 -148
View File
@@ -23,62 +23,62 @@ E: ID_USB_INTERFACES=:ff0000:
E: ID_VENDOR_FROM_DATABASE=Elan Microelectronics Corp. E: ID_VENDOR_FROM_DATABASE=Elan Microelectronics Corp.
E: ID_PATH=pci-0000:00:14.0-usb-0:1 E: ID_PATH=pci-0000:00:14.0-usb-0:1
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_1 E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_1
A: authorized=1 A: authorized=1\n
A: avoid_reset_quirk=0 A: avoid_reset_quirk=0\n
A: bConfigurationValue=1 A: bConfigurationValue=1\n
A: bDeviceClass=00 A: bDeviceClass=00\n
A: bDeviceProtocol=00 A: bDeviceProtocol=00\n
A: bDeviceSubClass=00 A: bDeviceSubClass=00\n
A: bMaxPacketSize0=64 A: bMaxPacketSize0=64\n
A: bMaxPower=100mA A: bMaxPower=100mA\n
A: bNumConfigurations=1 A: bNumConfigurations=1\n
A: bNumInterfaces= 1 A: bNumInterfaces= 1\n
A: bcdDevice=0305 A: bcdDevice=0305\n
A: bmAttributes=a0 A: bmAttributes=a0\n
A: busnum=1 A: busnum=1\n
A: configuration=add909c9-e67e-4126-a6f7-1e31179e27d9 A: configuration=add909c9-e67e-4126-a6f7-1e31179e27d9\n
H: descriptors=1201000200000040F3047E0C05030102000109025300010103A0320904000008FF0000000921100100012215000705810240000107050102400001070582024000010705020240000107058302400001070503024000010705840240000107050402400001 H: descriptors=1201000200000040F3047E0C05030102000109025300010103A0320904000008FF0000000921100100012215000705810240000107050102400001070582024000010705020240000107058302400001070503024000010705840240000107050402400001
A: dev=189:9 A: dev=189:9\n
A: devnum=10 A: devnum=10\n
A: devpath=1 A: devpath=1\n
L: driver=../../../../../bus/usb/drivers/usb L: driver=../../../../../bus/usb/drivers/usb
A: idProduct=0c7e A: idProduct=0c7e\n
A: idVendor=04f3 A: idVendor=04f3\n
A: ltm_capable=no A: ltm_capable=no\n
A: manufacturer=ELAN A: manufacturer=ELAN\n
A: maxchild=0 A: maxchild=0\n
L: port=../1-0:1.0/usb1-port1 L: port=../1-0:1.0/usb1-port1
A: power/active_duration=94712 A: power/active_duration=94712\n
A: power/async=enabled A: power/async=enabled\n
A: power/autosuspend=2 A: power/autosuspend=2\n
A: power/autosuspend_delay_ms=2000 A: power/autosuspend_delay_ms=2000\n
A: power/connected_duration=94712 A: power/connected_duration=94712\n
A: power/control=on A: power/control=on\n
A: power/level=on A: power/level=on\n
A: power/persist=1 A: power/persist=1\n
A: power/runtime_active_kids=0 A: power/runtime_active_kids=0\n
A: power/runtime_active_time=94436 A: power/runtime_active_time=94436\n
A: power/runtime_enabled=forbidden A: power/runtime_enabled=forbidden\n
A: power/runtime_status=active A: power/runtime_status=active\n
A: power/runtime_suspended_time=0 A: power/runtime_suspended_time=0\n
A: power/runtime_usage=1 A: power/runtime_usage=1\n
A: power/wakeup=disabled A: power/wakeup=disabled\n
A: power/wakeup_abort_count= A: power/wakeup_abort_count=\n
A: power/wakeup_active= A: power/wakeup_active=\n
A: power/wakeup_active_count= A: power/wakeup_active_count=\n
A: power/wakeup_count= A: power/wakeup_count=\n
A: power/wakeup_expire_count= A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms= A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms= A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms= A: power/wakeup_total_time_ms=\n
A: product=ELAN:ARM-M4 A: product=ELAN:ARM-M4\n
A: quirks=0x0 A: quirks=0x0\n
A: removable=removable A: removable=removable\n
A: rx_lanes=1 A: rx_lanes=1\n
A: speed=12 A: speed=12\n
A: tx_lanes=1 A: tx_lanes=1\n
A: urbnum=12 A: urbnum=12\n
A: version= 2.00 A: version= 2.00\n
P: /devices/pci0000:00/0000:00:14.0/usb1 P: /devices/pci0000:00/0000:00:14.0/usb1
N: bus/usb/001/001=12010002090001406B1D020004050302010109021900010100E0000904000001090000000705810304000C 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_PATH_TAG=pci-0000_00_14_0
E: ID_FOR_SEAT=usb-pci-0000_00_14_0 E: ID_FOR_SEAT=usb-pci-0000_00_14_0
E: TAGS=:seat: E: TAGS=:seat:
A: authorized=1 A: authorized=1\n
A: authorized_default=1 A: authorized_default=1\n
A: avoid_reset_quirk=0 A: avoid_reset_quirk=0\n
A: bConfigurationValue=1 A: bConfigurationValue=1\n
A: bDeviceClass=09 A: bDeviceClass=09\n
A: bDeviceProtocol=01 A: bDeviceProtocol=01\n
A: bDeviceSubClass=00 A: bDeviceSubClass=00\n
A: bMaxPacketSize0=64 A: bMaxPacketSize0=64\n
A: bMaxPower=0mA A: bMaxPower=0mA\n
A: bNumConfigurations=1 A: bNumConfigurations=1\n
A: bNumInterfaces= 1 A: bNumInterfaces= 1\n
A: bcdDevice=0504 A: bcdDevice=0504\n
A: bmAttributes=e0 A: bmAttributes=e0\n
A: busnum=1 A: busnum=1\n
A: configuration= A: configuration=\n
H: descriptors=12010002090001406B1D020004050302010109021900010100E0000904000001090000000705810304000C H: descriptors=12010002090001406B1D020004050302010109021900010100E0000904000001090000000705810304000C
A: dev=189:0 A: dev=189:0\n
A: devnum=1 A: devnum=1\n
A: devpath=0 A: devpath=0\n
L: driver=../../../../bus/usb/drivers/usb L: driver=../../../../bus/usb/drivers/usb
A: idProduct=0002 A: idProduct=0002\n
A: idVendor=1d6b A: idVendor=1d6b\n
A: interface_authorized_default=1 A: interface_authorized_default=1\n
A: ltm_capable=no A: ltm_capable=no\n
A: manufacturer=Linux 5.4.0-42-generic xhci-hcd A: manufacturer=Linux 5.4.0-42-generic xhci-hcd\n
A: maxchild=12 A: maxchild=12\n
A: power/active_duration=74604360 A: power/active_duration=74604360\n
A: power/async=enabled A: power/async=enabled\n
A: power/autosuspend=0 A: power/autosuspend=0\n
A: power/autosuspend_delay_ms=0 A: power/autosuspend_delay_ms=0\n
A: power/connected_duration=74606456 A: power/connected_duration=74606456\n
A: power/control=auto A: power/control=auto\n
A: power/level=auto A: power/level=auto\n
A: power/runtime_active_kids=4 A: power/runtime_active_kids=4\n
A: power/runtime_active_time=74605838 A: power/runtime_active_time=74605838\n
A: power/runtime_enabled=enabled A: power/runtime_enabled=enabled\n
A: power/runtime_status=active A: power/runtime_status=active\n
A: power/runtime_suspended_time=0 A: power/runtime_suspended_time=0\n
A: power/runtime_usage=0 A: power/runtime_usage=0\n
A: power/wakeup=disabled A: power/wakeup=disabled\n
A: power/wakeup_abort_count= A: power/wakeup_abort_count=\n
A: power/wakeup_active= A: power/wakeup_active=\n
A: power/wakeup_active_count= A: power/wakeup_active_count=\n
A: power/wakeup_count= A: power/wakeup_count=\n
A: power/wakeup_expire_count= A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms= A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms= A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms= A: power/wakeup_total_time_ms=\n
A: product=xHCI Host Controller A: product=xHCI Host Controller\n
A: quirks=0x0 A: quirks=0x0\n
A: removable=unknown A: removable=unknown\n
A: rx_lanes=1 A: rx_lanes=1\n
A: serial=0000:00:14.0 A: serial=0000:00:14.0\n
A: speed=480 A: speed=480\n
A: tx_lanes=1 A: tx_lanes=1\n
A: urbnum=490 A: urbnum=490\n
A: version= 2.00 A: version= 2.00\n
P: /devices/pci0000:00/0000:00:14.0 P: /devices/pci0000:00/0000:00:14.0
E: DRIVER=xhci_hcd 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_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_VENDOR_FROM_DATABASE=Intel Corporation E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_MODEL_FROM_DATABASE=Cannon Point-LP USB 3.1 xHCI Controller E: ID_MODEL_FROM_DATABASE=Cannon Point-LP USB 3.1 xHCI Controller
A: ari_enabled=0 A: ari_enabled=0\n
A: broken_parity_status=0 A: broken_parity_status=0\n
A: class=0x0c0330 A: class=0x0c0330\n
H: config=8680ED9D060490023030030C00008000040030A10000000000000000000000000000000000000000000000003C10EF85000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F00000000181C030400000000316000000000000000000000000000000180C2C1080000000000000000000000059087007802E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000B50F300112000000 H: config=8680ED9D060490023030030C00008000040030A10000000000000000000000000000000000000000000000003C10EF85000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F00000000181C030400000000316000000000000000000000000000000180C2C1080000000000000000000000059087007802E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000B50F300112000000
A: consistent_dma_mask_bits=64 A: consistent_dma_mask_bits=64\n
A: d3cold_allowed=1 A: d3cold_allowed=1\n
A: dbc=disabled A: dbc=disabled\n
A: device=0x9ded A: device=0x9ded\n
A: dma_mask_bits=64 A: dma_mask_bits=64\n
L: driver=../../../bus/pci/drivers/xhci_hcd L: driver=../../../bus/pci/drivers/xhci_hcd
A: driver_override=(null) A: driver_override=(null)\n
A: enable=1 A: enable=1\n
A: irq=124 A: irq=124\n
A: local_cpulist=0-3 A: local_cpulist=0-3\n
A: local_cpus=f A: local_cpus=f\n
A: modalias=pci:v00008086d00009DEDsv0000103Csd000085EFbc0Csc03i30 A: modalias=pci:v00008086d00009DEDsv0000103Csd000085EFbc0Csc03i30\n
A: msi_bus=1 A: msi_bus=1\n
A: msi_irqs/124=msi A: msi_irqs/124=msi\n
A: numa_node=-1 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 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 A: power/async=enabled\n
A: power/control=auto A: power/control=auto\n
A: power/runtime_active_kids=1 A: power/runtime_active_kids=1\n
A: power/runtime_active_time=74606194 A: power/runtime_active_time=74606194\n
A: power/runtime_enabled=enabled A: power/runtime_enabled=enabled\n
A: power/runtime_status=active A: power/runtime_status=active\n
A: power/runtime_suspended_time=0 A: power/runtime_suspended_time=0\n
A: power/runtime_usage=0 A: power/runtime_usage=0\n
A: power/wakeup=enabled A: power/wakeup=enabled\n
A: power/wakeup_abort_count=0 A: power/wakeup_abort_count=0\n
A: power/wakeup_active=0 A: power/wakeup_active=0\n
A: power/wakeup_active_count=0 A: power/wakeup_active_count=0\n
A: power/wakeup_count=0 A: power/wakeup_count=0\n
A: power/wakeup_expire_count=0 A: power/wakeup_expire_count=0\n
A: power/wakeup_last_time_ms=0 A: power/wakeup_last_time_ms=0\n
A: power/wakeup_max_time_ms=0 A: power/wakeup_max_time_ms=0\n
A: power/wakeup_total_time_ms=0 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 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 A: revision=0x30\n
A: subsystem_device=0x85ef A: subsystem_device=0x85ef\n
A: subsystem_vendor=0x103c A: subsystem_vendor=0x103c\n
A: vendor=0x8086 A: vendor=0x8086\n
+139 -139
View File
@@ -25,60 +25,60 @@ E: ID_VENDOR_FROM_DATABASE=Shenzhen Goodix Technology Co.,Ltd.
E: ID_AUTOSUSPEND=1 E: ID_AUTOSUSPEND=1
E: ID_PATH=pci-0000:00:14.0-usb-0:3 E: ID_PATH=pci-0000:00:14.0-usb-0:3
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3 E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3
A: authorized=1 A: authorized=1\n
A: avoid_reset_quirk=0 A: avoid_reset_quirk=0\n
A: bConfigurationValue=1 A: bConfigurationValue=1\n
A: bDeviceClass=ef A: bDeviceClass=ef\n
A: bDeviceProtocol=00 A: bDeviceProtocol=00\n
A: bDeviceSubClass=00 A: bDeviceSubClass=00\n
A: bMaxPacketSize0=64 A: bMaxPacketSize0=64\n
A: bMaxPower=100mA A: bMaxPower=100mA\n
A: bNumConfigurations=1 A: bNumConfigurations=1\n
A: bNumInterfaces= 1 A: bNumInterfaces= 1\n
A: bcdDevice=0100 A: bcdDevice=0100\n
A: bmAttributes=a0 A: bmAttributes=a0\n
A: busnum=1 A: busnum=1\n
A: configuration=XXXX_MOC_B0 A: configuration=XXXX_MOC_B0\n
H: descriptors=12010002EF000040C627966400010102030109022000010103A0320904000002FF0000040705830240000007050102400000 H: descriptors=12010002EF000040C627966400010102030109022000010103A0320904000002FF0000040705830240000007050102400000
A: dev=189:52 A: dev=189:52\n
A: devnum=53 A: devnum=53\n
A: devpath=3 A: devpath=3\n
L: driver=../../../../../bus/usb/drivers/usb L: driver=../../../../../bus/usb/drivers/usb
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d/device:20 L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d/device:20
A: idProduct=6496 A: idProduct=6496\n
A: idVendor=27c6 A: idVendor=27c6\n
A: ltm_capable=no A: ltm_capable=no\n
A: manufacturer=Goodix Technology Co., Ltd. A: manufacturer=Goodix Technology Co., Ltd.\n
A: maxchild=0 A: maxchild=0\n
L: port=../1-0:1.0/usb1-port3 L: port=../1-0:1.0/usb1-port3
A: power/active_duration=29262 A: power/active_duration=29262\n
A: power/autosuspend=2 A: power/autosuspend=2\n
A: power/autosuspend_delay_ms=2000 A: power/autosuspend_delay_ms=2000\n
A: power/connected_duration=57399 A: power/connected_duration=57399\n
A: power/control=auto A: power/control=auto\n
A: power/level=auto A: power/level=auto\n
A: power/persist=1 A: power/persist=1\n
A: power/runtime_active_time=29308 A: power/runtime_active_time=29308\n
A: power/runtime_status=active A: power/runtime_status=active\n
A: power/runtime_suspended_time=27850 A: power/runtime_suspended_time=27850\n
A: power/wakeup=disabled A: power/wakeup=disabled\n
A: power/wakeup_abort_count= A: power/wakeup_abort_count=\n
A: power/wakeup_active= A: power/wakeup_active=\n
A: power/wakeup_active_count= A: power/wakeup_active_count=\n
A: power/wakeup_count= A: power/wakeup_count=\n
A: power/wakeup_expire_count= A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms= A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms= A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms= A: power/wakeup_total_time_ms=\n
A: product=Goodix USB2.0 MISC A: product=Goodix USB2.0 MISC\n
A: quirks=0x0 A: quirks=0x0\n
A: removable=removable A: removable=removable\n
A: rx_lanes=1 A: rx_lanes=1\n
A: serial=XXXX_MOC_B0 A: serial=XXXX_MOC_B0\n
A: speed=12 A: speed=12\n
A: tx_lanes=1 A: tx_lanes=1\n
A: urbnum=394 A: urbnum=394\n
A: version= 2.00 A: version= 2.00\n
P: /devices/pci0000:00/0000:00:14.0/usb1 P: /devices/pci0000:00/0000:00:14.0/usb1
N: bus/usb/001/001=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C 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: ID_FOR_SEAT=usb-pci-0000_00_14_0
E: TAGS=:seat: E: TAGS=:seat:
E: CURRENT_TAGS=:seat: E: CURRENT_TAGS=:seat:
A: authorized=1 A: authorized=1\n
A: authorized_default=1 A: authorized_default=1\n
A: avoid_reset_quirk=0 A: avoid_reset_quirk=0\n
A: bConfigurationValue=1 A: bConfigurationValue=1\n
A: bDeviceClass=09 A: bDeviceClass=09\n
A: bDeviceProtocol=01 A: bDeviceProtocol=01\n
A: bDeviceSubClass=00 A: bDeviceSubClass=00\n
A: bMaxPacketSize0=64 A: bMaxPacketSize0=64\n
A: bMaxPower=0mA A: bMaxPower=0mA\n
A: bNumConfigurations=1 A: bNumConfigurations=1\n
A: bNumInterfaces= 1 A: bNumInterfaces= 1\n
A: bcdDevice=0513 A: bcdDevice=0513\n
A: bmAttributes=e0 A: bmAttributes=e0\n
A: busnum=1 A: busnum=1\n
A: configuration= A: configuration=\n
H: descriptors=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C H: descriptors=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
A: dev=189:0 A: dev=189:0\n
A: devnum=1 A: devnum=1\n
A: devpath=0 A: devpath=0\n
L: driver=../../../../bus/usb/drivers/usb L: driver=../../../../bus/usb/drivers/usb
L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d
A: idProduct=0002 A: idProduct=0002\n
A: idVendor=1d6b A: idVendor=1d6b\n
A: interface_authorized_default=1 A: interface_authorized_default=1\n
A: ltm_capable=no A: ltm_capable=no\n
A: manufacturer=Linux 5.13.15-200.fc34.x86_64 xhci-hcd A: manufacturer=Linux 5.13.15-200.fc34.x86_64 xhci-hcd\n
A: maxchild=12 A: maxchild=12\n
A: power/active_duration=219578717 A: power/active_duration=219578717\n
A: power/autosuspend=0 A: power/autosuspend=0\n
A: power/autosuspend_delay_ms=0 A: power/autosuspend_delay_ms=0\n
A: power/connected_duration=219649620 A: power/connected_duration=219649620\n
A: power/control=auto A: power/control=auto\n
A: power/level=auto A: power/level=auto\n
A: power/runtime_active_time=219589127 A: power/runtime_active_time=219589127\n
A: power/runtime_status=active A: power/runtime_status=active\n
A: power/runtime_suspended_time=0 A: power/runtime_suspended_time=0\n
A: power/wakeup=disabled A: power/wakeup=disabled\n
A: power/wakeup_abort_count= A: power/wakeup_abort_count=\n
A: power/wakeup_active= A: power/wakeup_active=\n
A: power/wakeup_active_count= A: power/wakeup_active_count=\n
A: power/wakeup_count= A: power/wakeup_count=\n
A: power/wakeup_expire_count= A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms= A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms= A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms= A: power/wakeup_total_time_ms=\n
A: product=xHCI Host Controller A: product=xHCI Host Controller\n
A: quirks=0x0 A: quirks=0x0\n
A: removable=unknown A: removable=unknown\n
A: rx_lanes=1 A: rx_lanes=1\n
A: serial=0000:00:14.0 A: serial=0000:00:14.0\n
A: speed=480 A: speed=480\n
A: tx_lanes=1 A: tx_lanes=1\n
A: urbnum=4325 A: urbnum=4325\n
A: version= 2.00 A: version= 2.00\n
P: /devices/pci0000:00/0000:00:14.0 P: /devices/pci0000:00/0000:00:14.0
E: DRIVER=xhci_hcd E: DRIVER=xhci_hcd
E: PCI_CLASS=C0330 E: PCI_CLASS=C0330
E: PCI_ID=8086:9DED 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: PCI_SLOT_NAME=0000:00:14.0
E: MODALIAS=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30 E: MODALIAS=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30
E: SUBSYSTEM=pci E: SUBSYSTEM=pci
@@ -180,44 +180,44 @@ E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_VENDOR_FROM_DATABASE=Intel Corporation E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_AUTOSUSPEND=1 E: ID_AUTOSUSPEND=1
E: ID_MODEL_FROM_DATABASE=Cannon Point-LP USB 3.1 xHCI Controller E: ID_MODEL_FROM_DATABASE=Cannon Point-LP USB 3.1 xHCI Controller
A: ari_enabled=0 A: ari_enabled=0\n
A: broken_parity_status=0 A: broken_parity_status=0\n
A: class=0x0c0330 A: class=0x0c0330\n
H: config=8680ED9D060490021130030C00008000040022EA000000000000000000000000000000000000000000000000AA179222000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F000000004C084B0100000000316000000000000000000000000000000180C2C1080000000000000000000000059087001803E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000000000000000000008000000040000000000000000000000000000000000000000000000000000000800000004000000000000000000000000000000000000000000000000000000B50F320112000000 H: config=8680ED9D060490021130030C00008000040022EA000000000000000000000000000000000000000000000000AA179222000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F000000004C084B0100000000316000000000000000000000000000000180C2C1080000000000000000000000059087001803E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000000000000000000008000000040000000000000000000000000000000000000000000000000000000800000004000000000000000000000000000000000000000000000000000000B50F320112000000
A: consistent_dma_mask_bits=64 A: consistent_dma_mask_bits=64\n
A: d3cold_allowed=1 A: d3cold_allowed=1\n
A: dbc=disabled A: dbc=disabled\n
A: device=0x9ded A: device=0x9ded\n
A: dma_mask_bits=64 A: dma_mask_bits=64\n
L: driver=../../../bus/pci/drivers/xhci_hcd L: driver=../../../bus/pci/drivers/xhci_hcd
A: driver_override=(null) A: driver_override=(null)\n
A: enable=1 A: enable=1\n
L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c
A: irq=128 A: irq=128\n
A: local_cpulist=0-7 A: local_cpulist=0-7\n
A: local_cpus=ff A: local_cpus=ff\n
A: modalias=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30 A: modalias=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30\n
A: msi_bus=1 A: msi_bus=1\n
A: msi_irqs/128=msi A: msi_irqs/128=msi\n
A: numa_node=-1 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 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 A: power/control=on\n
A: power/runtime_active_time=219589302 A: power/runtime_active_time=219589302\n
A: power/runtime_status=active A: power/runtime_status=active\n
A: power/runtime_suspended_time=0 A: power/runtime_suspended_time=0\n
A: power/wakeup=enabled A: power/wakeup=enabled\n
A: power/wakeup_abort_count=0 A: power/wakeup_abort_count=0\n
A: power/wakeup_active=0 A: power/wakeup_active=0\n
A: power/wakeup_active_count=0 A: power/wakeup_active_count=0\n
A: power/wakeup_count=0 A: power/wakeup_count=0\n
A: power/wakeup_expire_count=0 A: power/wakeup_expire_count=0\n
A: power/wakeup_last_time_ms=0 A: power/wakeup_last_time_ms=0\n
A: power/wakeup_max_time_ms=0 A: power/wakeup_max_time_ms=0\n
A: power/wakeup_total_time_ms=0 A: power/wakeup_total_time_ms=0\n
A: power_state=D0 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 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 A: revision=0x11\n
A: subsystem_device=0x2292 A: subsystem_device=0x2292\n
A: subsystem_vendor=0x17aa A: subsystem_vendor=0x17aa\n
A: vendor=0x8086 A: vendor=0x8086\n
+81 -16
View File
@@ -248,15 +248,20 @@ if valgrind.found()
endif endif
if get_option('tod') 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 = envs
tod_envs.set('FP_TOD_KEEP_MODULES_OPEN', 'TRUE') tod_envs.set('FP_TOD_KEEP_MODULES_OPEN', 'TRUE')
tod_envs.set('FP_VIRTUAL_FAKE_DEVICE', 'yes') 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', tod_envs.prepend('LD_LIBRARY_PATH',
meson.build_root() / 'libfprint', meson.build_root() / 'libfprint',
meson.build_root() / 'libfprint' / 'tod') meson.build_root() / 'libfprint' / 'tod')
tod_subversion = meson.project_version().split('+tod')[0]
tod_c_args = [ tod_c_args = [
'-DTEST_TOD_DRIVER=1', '-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', fake_driver = shared_module('device-fake-tod-driver',
@@ -273,35 +278,85 @@ if get_option('tod')
install: false 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', test_utils_tod = static_library('fprint-test-utils-tod',
sources: [ sources: [
'test-utils.c', 'test-utils.c',
'test-utils-tod.c', 'test-utils-tod.c',
fp_todv1_enums,
], ],
include_directories: 'tod-drivers',
dependencies: libfprint_private_dep, dependencies: libfprint_private_dep,
install: false) install: false)
tod_unit_tests = [ tod_standalone_tests = [
'fp-todv1-types',
]
tod_drivers_tests = [
'fp-context-tod', 'fp-context-tod',
'fp-device-tod', 'fp-device-tod',
'fpi-device', 'fpi-device',
] ]
tod_dirs = { tod_driver_infos = {
'fake_test_dev_tod_current': meson.current_build_dir(), 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 host_machine.cpu_family() == 'x86_64'
if machine.startswith('x86_64-') tod_test_versions = [
tod_dirs += { 'v1+1.90.1',
'fake_test_dev_tod_v1': meson.current_source_dir() / 'tod-drivers', '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 endif
foreach test_name: tod_unit_tests foreach test_name: tod_drivers_tests + tod_standalone_tests
basename = 'test-' + test_name basename = 'test-' + test_name
sufix = test_name.endswith('-tod') ? '' : '-tod' 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, test_exe = executable(basename + sufix,
sources: basename + '.c', sources: basename + '.c',
dependencies: libfprint_private_dep, dependencies: libfprint_private_dep,
@@ -312,19 +367,29 @@ if get_option('tod')
link_with: test_utils_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 = tod_envs
tod_test_envs.prepend('FP_DRIVERS_WHITELIST', tod_driver) 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) tod_test_envs.set('FP_TOD_TEST_DRIVER_NAME', tod_driver)
test(test_name + '-' + tod_driver, test(tod_test_name + '-' + tod_driver,
find_program('test-runner.sh'), test_exe,
suite: ['unit-tests', 'tod', tod_driver], suite: tod_suites + [tod_driver],
args: [test_exe],
env: tod_test_envs, env: tod_test_envs,
depends: fake_driver, depends: fake_driver,
) )
endforeach endforeach
if test_name in tod_standalone_tests
test(tod_test_name,
test_exe,
suite: tod_suites,
env: tod_envs,
)
endif
endforeach endforeach
endif endif
+7
View File
@@ -17,6 +17,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#define FP_COMPONENT "tod"
#include "fpi-log.h"
#include <libfprint/fprint.h> #include <libfprint/fprint.h>
static void static void
@@ -33,8 +36,12 @@ test_context_has_no_devices (void)
GPtrArray *devices; GPtrArray *devices;
const char *old_drivers_dir = g_getenv ("FP_TOD_DRIVERS_DIR"); 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); g_setenv ("FP_TOD_DRIVERS_DIR", "__HOPEFULLY_AN_INVALID_PATH", TRUE);
context = fp_context_new (); context = fp_context_new ();
g_test_assert_expected_messages ();
devices = fp_context_get_devices (context); devices = fp_context_get_devices (context);
g_setenv ("FP_TOD_DRIVERS_DIR", old_drivers_dir, TRUE); g_setenv ("FP_TOD_DRIVERS_DIR", old_drivers_dir, TRUE);
+9
View File
@@ -193,7 +193,10 @@ test_device_supports_identify (void)
g_autoptr(FptContext) tctx = fpt_context_new_with_fake_dev (); g_autoptr(FptContext) tctx = fpt_context_new_with_fake_dev ();
fp_device_open_sync (tctx->device, NULL, NULL); fp_device_open_sync (tctx->device, NULL, NULL);
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_assert_true (fp_device_supports_identify (tctx->device));
G_GNUC_END_IGNORE_DEPRECATIONS
} }
static void static void
@@ -202,7 +205,10 @@ test_device_supports_capture (void)
g_autoptr(FptContext) tctx = fpt_context_new_with_fake_dev (); g_autoptr(FptContext) tctx = fpt_context_new_with_fake_dev ();
fp_device_open_sync (tctx->device, NULL, NULL); fp_device_open_sync (tctx->device, NULL, NULL);
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_assert_true (fp_device_supports_capture (tctx->device));
G_GNUC_END_IGNORE_DEPRECATIONS
} }
static void static void
@@ -211,7 +217,10 @@ test_device_has_storage (void)
g_autoptr(FptContext) tctx = fpt_context_new_with_fake_dev (); g_autoptr(FptContext) tctx = fpt_context_new_with_fake_dev ();
fp_device_open_sync (tctx->device, NULL, NULL); fp_device_open_sync (tctx->device, NULL, NULL);
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_assert_true (fp_device_has_storage (tctx->device));
G_GNUC_END_IGNORE_DEPRECATIONS
} }
int int
+337
View File
@@ -0,0 +1,337 @@
/*
* FpDevice Unit tests
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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 <libfprint/fprint.h>
#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 ();
}
+202 -2
View File
@@ -46,8 +46,102 @@ fpt_context_device_driver_get_type (void)
return G_TYPE_FROM_CLASS (FP_DEVICE_GET_CLASS (tctx->device)); 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 #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 */ /* Utility functions */
typedef FpDevice FpAutoCloseDevice; typedef FpDevice FpAutoCloseDevice;
@@ -539,6 +633,12 @@ test_driver_features_probe_updates (void)
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device); FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
FpiDeviceFake *fake_dev; 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_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_CAPTURE);
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_IDENTIFY); 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);
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_LIST); 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_DELETE);
if (tod_check_device_version (device, 1, "1.92.0"))
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); 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_async_initable_init_async (G_ASYNC_INITABLE (device),
G_PRIORITY_DEFAULT, NULL, NULL, NULL); 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));
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_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_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), 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 |
FP_DEVICE_FEATURE_STORAGE_LIST | FP_DEVICE_FEATURE_STORAGE_LIST |
FP_DEVICE_FEATURE_STORAGE_DELETE | 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 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);
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_LIST); 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_DELETE);
if (tod_check_version (dev_class, 1, "1.92.0"))
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); 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 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);
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_LIST); 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_DELETE);
if (tod_check_version (dev_class, 1, "1.92.0"))
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); 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 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);
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_LIST); 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_DELETE);
if (tod_check_version (dev_class, 1, "1.92.0"))
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); 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 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_false (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_LIST);
g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_DELETE); g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_DELETE);
if (tod_check_version (dev_class, 1, "1.92.0"))
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); 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 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_IDENTIFY);
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_VERIFY); g_assert_true (dev_class->features & FP_DEVICE_FEATURE_VERIFY);
g_assert_false (dev_class->features & FP_DEVICE_FEATURE_DUPLICATES_CHECK); g_assert_false (dev_class->features & FP_DEVICE_FEATURE_DUPLICATES_CHECK);
if (tod_check_version (dev_class, 1, "1.92.0"))
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE); 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_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_DELETE);
if (tod_check_version (dev_class, 1, "1.92.0"))
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); 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 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_false (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_LIST);
g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_DELETE); g_assert_false (dev_class->features & FP_DEVICE_FEATURE_STORAGE_DELETE);
if (tod_check_version (dev_class, 1, "1.92.0"))
g_assert_true (dev_class->features & FP_DEVICE_FEATURE_STORAGE_CLEAR); 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 static void
@@ -2005,6 +2133,12 @@ test_driver_identify_suspend_continues (void)
FpiDeviceFake *fake_dev; FpiDeviceFake *fake_dev;
FpPrint *expected_matched; 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); device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
fake_dev = FPI_DEVICE_FAKE (device); fake_dev = FPI_DEVICE_FAKE (device);
orig_identify = dev_class->identify; orig_identify = dev_class->identify;
@@ -2071,6 +2205,12 @@ test_driver_identify_suspend_succeeds (void)
FpiDeviceFake *fake_dev; FpiDeviceFake *fake_dev;
FpPrint *expected_matched; 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); device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
fake_dev = FPI_DEVICE_FAKE (device); fake_dev = FPI_DEVICE_FAKE (device);
orig_identify = dev_class->identify; orig_identify = dev_class->identify;
@@ -2133,6 +2273,12 @@ test_driver_identify_suspend_busy_error (void)
FpiDeviceFake *fake_dev; FpiDeviceFake *fake_dev;
FpPrint *expected_matched; 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); device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
fake_dev = FPI_DEVICE_FAKE (device); fake_dev = FPI_DEVICE_FAKE (device);
orig_identify = dev_class->identify; orig_identify = dev_class->identify;
@@ -2190,6 +2336,12 @@ test_driver_identify_suspend_while_idle (void)
g_autoptr(GError) error = NULL; g_autoptr(GError) error = NULL;
FpiDeviceFake *fake_dev; 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); device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
fake_dev = FPI_DEVICE_FAKE (device); fake_dev = FPI_DEVICE_FAKE (device);
@@ -2234,6 +2386,12 @@ test_driver_identify_warmup_cooldown (void)
FpiDeviceFake *fake_dev; FpiDeviceFake *fake_dev;
gint64 start_time; 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_hot_seconds = 2;
dev_class->temp_cold_seconds = 5; dev_class->temp_cold_seconds = 5;
@@ -2532,6 +2690,12 @@ test_driver_clear_storage (void)
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device); FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
gboolean ret; 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); ret = fp_device_clear_storage_sync (device, NULL, &error);
g_assert (fake_dev->last_called_function == dev_class->clear_storage); g_assert (fake_dev->last_called_function == dev_class->clear_storage);
g_assert_no_error (error); g_assert_no_error (error);
@@ -2547,6 +2711,12 @@ test_driver_clear_storage_error (void)
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device); FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
gboolean ret; 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); fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_GENERAL);
ret = fp_device_clear_storage_sync (device, NULL, &error); ret = fp_device_clear_storage_sync (device, NULL, &error);
g_assert (fake_dev->last_called_function == dev_class->clear_storage); 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; void (*orig_verify) (FpDevice *device) = dev_class->verify;
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device); 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; fake_dev->last_called_function = NULL;
dev_class->verify = fake_device_stub_verify; dev_class->verify = fake_device_stub_verify;
@@ -2861,6 +3037,12 @@ test_driver_action_is_cancelled_open (void)
g_autoptr(GError) error = NULL; g_autoptr(GError) error = NULL;
FpiDeviceFake *fake_dev; 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; dev_class->open = test_driver_action_is_cancelled_open_vfunc;
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL); device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
fake_dev = FPI_DEVICE_FAKE (device); fake_dev = FPI_DEVICE_FAKE (device);
@@ -2881,6 +3063,12 @@ test_driver_action_internally_cancelled_open (void)
g_autoptr(GError) error = NULL; g_autoptr(GError) error = NULL;
FpiDeviceFake *fake_dev; 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; dev_class->open = test_driver_action_is_cancelled_open_vfunc;
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL); device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
fake_dev = FPI_DEVICE_FAKE (device); 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_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_INVALID);
g_clear_error (&error); 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); 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_false (fp_device_clear_storage_sync (device, NULL, &error));
g_assert_true (fake_dev->last_called_function == dev_class->clear_storage); 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_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_INVALID);
g_clear_error (&error); 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. */ /* 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); fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID);
@@ -3135,6 +3332,8 @@ test_driver_action_error_fallback_all (void)
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL); g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL);
g_clear_error (&error); g_clear_error (&error);
if (tod_check_device_version (device, 1, "1.92.0"))
{
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
"*Device failed to pass an error to generic action " "*Device failed to pass an error to generic action "
"error function*"); "error function*");
@@ -3144,6 +3343,7 @@ test_driver_action_error_fallback_all (void)
g_assert_true (fake_dev->last_called_function == dev_class->clear_storage); g_assert_true (fake_dev->last_called_function == dev_class->clear_storage);
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL); g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL);
g_clear_error (&error); g_clear_error (&error);
}
/* Test close last, as we can't operate on a closed device. */ /* Test close last, as we can't operate on a closed device. */
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
+4
View File
@@ -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 In this way the library is loaded during tests and tested for all the upstream
tests and particularly test-fpi-device. 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.
+107
View File
@@ -0,0 +1,107 @@
/*
* FpDevice - A fingerprint reader device
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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;
+57
View File
@@ -0,0 +1,57 @@
/*
* FpDevice - A fingerprint reader device
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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;
+266
View File
@@ -0,0 +1,266 @@
/*
* FpDevice - A fingerprint reader device
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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 <glib.h>
#include <glib-object.h>
#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;
+61
View File
@@ -0,0 +1,61 @@
/*
* FpImageDevice - An image based fingerprint reader device
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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;
+62
View File
@@ -0,0 +1,62 @@
/*
* FpImageDevice - An image based fingerprint reader device
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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 <glib.h>
#include <glib-object.h>
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];
};
+60
View File
@@ -0,0 +1,60 @@
/*
* FpDevice - A fingerprint reader device
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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];
};
+81
View File
@@ -0,0 +1,81 @@
/*
* FpDevice - A fingerprint reader device
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* 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 <gusb.h>
#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];
};