New upstream version 1.94.2+tod1

This commit is contained in:
Marco Trevisan (Treviño)
2021-12-14 19:46:02 +01:00
22 changed files with 149 additions and 25 deletions
+7
View File
@@ -1,6 +1,13 @@
This file lists notable changes in each release. For the full history of all This file lists notable changes in each release. For the full history of all
changes, see ChangeLog. changes, see ChangeLog.
2021-11-02: v1.94.2 release
Highlights:
* goodixmoc: Fix protocol error with certain username lengths
* elanmoc: New PID 0x0c7d
* goodixmoc: New PID 0x63cc
2021-09-24: v1.94.1 release 2021-09-24: v1.94.1 release
Highlights: Highlights:
+1
View File
@@ -286,6 +286,7 @@ usb:v0A5Cp5842*
usb:v0A5Cp5843* usb:v0A5Cp5843*
usb:v0A5Cp5844* usb:v0A5Cp5844*
usb:v0A5Cp5845* usb:v0A5Cp5845*
usb:v0BDAp5812*
usb:v10A5p0007* usb:v10A5p0007*
usb:v1188p9545* usb:v1188p9545*
usb:v138Ap0007* usb:v138Ap0007*
+21
View File
@@ -179,6 +179,7 @@ fpi_device_enroll_complete
fpi_device_verify_complete fpi_device_verify_complete
fpi_device_identify_complete fpi_device_identify_complete
fpi_device_capture_complete fpi_device_capture_complete
fpi_device_clear_storage_complete
fpi_device_delete_complete fpi_device_delete_complete
fpi_device_list_complete fpi_device_list_complete
fpi_device_suspend_complete fpi_device_suspend_complete
@@ -259,7 +260,10 @@ fpi_ssm_get_device
fpi_ssm_get_error fpi_ssm_get_error
fpi_ssm_dup_error fpi_ssm_dup_error
fpi_ssm_get_cur_state fpi_ssm_get_cur_state
fpi_ssm_spi_transfer_cb
fpi_ssm_spi_transfer_with_weak_pointer_cb
fpi_ssm_usb_transfer_cb fpi_ssm_usb_transfer_cb
fpi_ssm_usb_transfer_with_weak_pointer_cb
FpiSsm FpiSsm
</SECTION> </SECTION>
@@ -286,3 +290,20 @@ FPI_TYPE_USB_TRANSFER
fpi_usb_transfer_get_type fpi_usb_transfer_get_type
</SECTION> </SECTION>
<SECTION>
<FILE>fpi-spi-transfer</FILE>
FpiSpiTransferCallback
FpiSpiTransfer
fpi_spi_transfer_new
fpi_spi_transfer_ref
fpi_spi_transfer_unref
fpi_spi_transfer_write
fpi_spi_transfer_write_full
fpi_spi_transfer_read
fpi_spi_transfer_read_full
fpi_spi_transfer_submit
fpi_spi_transfer_submit_sync
<SUBSECTION Standard>
FPI_TYPE_SPI_TRANSFER
fpi_spi_transfer_get_type
</SECTION>
+2 -1
View File
@@ -41,7 +41,8 @@
</chapter> </chapter>
<chapter id="driver-helpers"> <chapter id="driver-helpers">
<title>USB and State Machine helpers</title> <title>USB, SPI and State Machine helpers</title>
<xi:include href="xml/fpi-spi-transfer.xml"/>
<xi:include href="xml/fpi-usb-transfer.xml"/> <xi:include href="xml/fpi-usb-transfer.xml"/>
<xi:include href="xml/fpi-ssm.xml"/> <xi:include href="xml/fpi-ssm.xml"/>
<xi:include href="xml/fpi-log.xml"/> <xi:include href="xml/fpi-log.xml"/>
+23
View File
@@ -47,6 +47,24 @@ id_table_to_string (FpDeviceType device_type,
if (entry->vid) if (entry->vid)
value = g_strdup_printf ("%04x:%04x", entry->vid, entry->pid); value = g_strdup_printf ("%04x:%04x", entry->vid, entry->pid);
} }
else if (device_type == FP_DEVICE_TYPE_UDEV)
{
if (entry->hid_id.vid)
{
g_autofree gchar *udev_flags = NULL;
udev_flags = g_flags_to_string (fpi_device_udev_subtype_flags_get_type (),
entry->udev_types);
value = g_strdup_printf ("%s (%04x:%04x) [%s]",
entry->spi_acpi_id,
entry->hid_id.vid, entry->hid_id.pid,
udev_flags);
}
else
{
value = g_strdup (entry->spi_acpi_id);
}
}
else else
{ {
return g_strdup ("Unsupported device type"); return g_strdup ("Unsupported device type");
@@ -115,6 +133,8 @@ main (void)
g_print ("Type: %s\n", device_type_to_string (cls->type)); g_print ("Type: %s\n", device_type_to_string (cls->type));
g_print ("Enroll stages: %d\n", cls->nr_enroll_stages); 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 ("Scan type: %s\n", scan_type_to_string (cls->scan_type));
g_print ("Seconds to get Hot: %d\n", cls->temp_hot_seconds);
g_print ("Seconds to get Cold: %d\n", cls->temp_cold_seconds);
g_print ("Supported Devices: %s\n", id_table); g_print ("Supported Devices: %s\n", id_table);
g_print ("Supported features: %s\n", features); g_print ("Supported features: %s\n", features);
g_print ("Implemented VFuncs:\n"); g_print ("Implemented VFuncs:\n");
@@ -122,12 +142,15 @@ main (void)
g_print (" probe: %s\n", cls->probe ? "true" : "false"); g_print (" probe: %s\n", cls->probe ? "true" : "false");
g_print (" open: %s\n", cls->open ? "true" : "false"); g_print (" open: %s\n", cls->open ? "true" : "false");
g_print (" close: %s\n", cls->close ? "true" : "false"); g_print (" close: %s\n", cls->close ? "true" : "false");
g_print (" suspend: %s\n", cls->suspend ? "true" : "false");
g_print (" resume: %s\n", cls->resume ? "true" : "false");
g_print (" enroll: %s\n", cls->enroll ? "true" : "false"); g_print (" enroll: %s\n", cls->enroll ? "true" : "false");
g_print (" verify: %s\n", cls->verify ? "true" : "false"); g_print (" verify: %s\n", cls->verify ? "true" : "false");
g_print (" identify: %s\n", cls->identify ? "true" : "false"); g_print (" identify: %s\n", cls->identify ? "true" : "false");
g_print (" capture: %s\n", cls->capture ? "true" : "false"); g_print (" capture: %s\n", cls->capture ? "true" : "false");
g_print (" list: %s\n", cls->list ? "true" : "false"); g_print (" list: %s\n", cls->list ? "true" : "false");
g_print (" delete: %s\n", cls->delete ? "true" : "false"); g_print (" delete: %s\n", cls->delete ? "true" : "false");
g_print (" clear_storage: %s\n", cls->clear_storage ? "true" : "false");
g_print (" cancel: %s\n", cls->cancel ? "true" : "false"); g_print (" cancel: %s\n", cls->cancel ? "true" : "false");
if (i < shared_drivers->len - 1) if (i < shared_drivers->len - 1)
+14 -2
View File
@@ -437,6 +437,7 @@ void
fp_context_enumerate (FpContext *context) fp_context_enumerate (FpContext *context)
{ {
FpContextPrivate *priv = fp_context_get_instance_private (context); FpContextPrivate *priv = fp_context_get_instance_private (context);
gboolean dispatched;
gint i; gint i;
g_return_if_fail (FP_IS_CONTEXT (context)); g_return_if_fail (FP_IS_CONTEXT (context));
@@ -575,8 +576,19 @@ fp_context_enumerate (FpContext *context)
} }
#endif #endif
while (priv->pending_devices) /* Iterate until 1. we have no pending devices, and 2. the mainloop is idle
g_main_context_iteration (NULL, TRUE); * This takes care of processing hotplug events that happened during
* enumeration.
* This is important due to USB `persist` being turned off. At resume time,
* devices will disappear and immediately re-appear. In this situation,
* enumerate could first see the old state with a removed device resulting
* in it to not be discovered.
* As a hotplug event is seemingly emitted by the kernel immediately, we can
* simply make sure to process all events before returning from enumerate.
*/
dispatched = TRUE;
while (priv->pending_devices || dispatched)
dispatched = g_main_context_iteration (NULL, !!priv->pending_devices);
} }
/** /**
+4 -1
View File
@@ -20,6 +20,7 @@
#pragma once #pragma once
#include "fp-image.h" #include "fp-image.h"
#include "tod/tod-macros.h"
/** /**
* fpi_frame: * fpi_frame:
@@ -110,7 +111,9 @@ struct fpi_line_asmbl_ctx
unsigned char (*get_pixel)(struct fpi_line_asmbl_ctx *ctx, unsigned char (*get_pixel)(struct fpi_line_asmbl_ctx *ctx,
GSList *line, GSList *line,
unsigned int x); unsigned int x);
gpointer _padding_dummy[32];
/*< private >*/
TOD_PADDING (32, 0);
}; };
FpImage *fpi_assemble_lines (struct fpi_line_asmbl_ctx *ctx, FpImage *fpi_assemble_lines (struct fpi_line_asmbl_ctx *ctx,
+12 -3
View File
@@ -23,11 +23,14 @@
#include "fp-device.h" #include "fp-device.h"
#include "fp-image.h" #include "fp-image.h"
#include "fpi-print.h" #include "fpi-print.h"
#include "tod/tod-macros.h"
/** /**
* FpiDeviceUdevSubtype: * FpiDeviceUdevSubtypeFlags:
* @FPI_DEVICE_UDEV_SUBTYPE_SPIDEV: The device requires an spidev node * @FPI_DEVICE_UDEV_SUBTYPE_SPIDEV: The device requires an spidev node
* @FPI_DEVICE_UDEV_SUBTYPE_HIDRAW: The device requires a hidraw node * @FPI_DEVICE_UDEV_SUBTYPE_HIDRAW: The device requires a hidraw node
*
* Bitfield of required hardware resources for a udev-backed device.
*/ */
typedef enum { typedef enum {
FPI_DEVICE_UDEV_SUBTYPE_SPIDEV = 1 << 0, FPI_DEVICE_UDEV_SUBTYPE_SPIDEV = 1 << 0,
@@ -73,7 +76,10 @@ struct _FpIdEntry
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[13]; TOD_PADDING_ALIGNED (16,
sizeof (guint) * 2 +
sizeof (FpiDeviceUdevSubtypeFlags) +
sizeof (gpointer));
}; };
/** /**
@@ -186,7 +192,10 @@ struct _FpDeviceClass
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[27]; TOD_PADDING_ALIGNED8 (32,
sizeof (FpDeviceFeature) +
sizeof (gint32) * 2 +
sizeof (gpointer) * 3);
}; };
void fpi_device_class_auto_initialize_features (FpDeviceClass *device_class); void fpi_device_class_auto_initialize_features (FpDeviceClass *device_class);
+1 -1
View File
@@ -117,7 +117,7 @@ struct _FpImageDeviceClass
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[32]; TOD_PADDING (32, 0);
}; };
void fpi_image_device_set_bz3_threshold (FpImageDevice *self, void fpi_image_device_set_bz3_threshold (FpImageDevice *self,
+2 -1
View File
@@ -21,6 +21,7 @@
#pragma once #pragma once
#include "fp-image.h" #include "fp-image.h"
#include "tod/tod-macros.h"
/** /**
* FpiImageFlags: * FpiImageFlags:
@@ -69,7 +70,7 @@ struct _FpImage
GPtrArray *minutiae; GPtrArray *minutiae;
guint ref_count; guint ref_count;
gpointer _padding_dummy[32]; TOD_PADDING (32, 0);
}; };
gint fpi_std_sq_dev (const guint8 *buf, gint fpi_std_sq_dev (const guint8 *buf,
+1 -1
View File
@@ -75,7 +75,7 @@ struct _FpiSpiTransfer
GDestroyNotify free_buffer_rd; GDestroyNotify free_buffer_rd;
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[32]; TOD_PADDING (32, 0);
}; };
GType fpi_spi_transfer_get_type (void) G_GNUC_CONST; GType fpi_spi_transfer_get_type (void) G_GNUC_CONST;
+1 -2
View File
@@ -103,9 +103,8 @@ struct _FpiUsbTransfer
/* Data free function */ /* Data free function */
GDestroyNotify free_buffer; GDestroyNotify free_buffer;
/*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[32]; TOD_PADDING (32, 0);
}; };
GType fpi_usb_transfer_get_type (void) G_GNUC_CONST; GType fpi_usb_transfer_get_type (void) G_GNUC_CONST;
+1
View File
@@ -60,6 +60,7 @@ static const FpIdEntry whitelist_id_table[] = {
{ .vid = 0x0a5c, .pid = 0x5843 }, { .vid = 0x0a5c, .pid = 0x5843 },
{ .vid = 0x0a5c, .pid = 0x5844 }, { .vid = 0x0a5c, .pid = 0x5844 },
{ .vid = 0x0a5c, .pid = 0x5845 }, { .vid = 0x0a5c, .pid = 0x5845 },
{ .vid = 0x0bda, .pid = 0x5812 },
{ .vid = 0x10a5, .pid = 0x0007 }, { .vid = 0x10a5, .pid = 0x0007 },
{ .vid = 0x1188, .pid = 0x9545 }, { .vid = 0x1188, .pid = 0x9545 },
{ .vid = 0x138a, .pid = 0x0007 }, { .vid = 0x138a, .pid = 0x0007 },
+32
View File
@@ -0,0 +1,32 @@
/*
* 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_PADDING(original, wasted) \
char _tod_expansion_padding[(GLIB_SIZEOF_VOID_P * (original)) - (wasted)];
#define TOD_PADDING_ALIGNED(original, wasted) \
TOD_PADDING (original, (wasted) + GLIB_SIZEOF_VOID_P)
#define TOD_PADDING_ALIGNED4(original, wasted) \
TOD_PADDING (original, (wasted) + (GLIB_SIZEOF_VOID_P == 4 ? GLIB_SIZEOF_VOID_P : 0))
#define TOD_PADDING_ALIGNED8(original, wasted) \
TOD_PADDING (original, (wasted) + (GLIB_SIZEOF_VOID_P == 8 ? GLIB_SIZEOF_VOID_P : 0))
+1 -1
View File
@@ -1,5 +1,5 @@
project('libfprint', [ 'c', 'cpp' ], project('libfprint', [ 'c', 'cpp' ],
version: '1.94.1+tod1', version: '1.94.2+tod1',
license: 'LGPLv2.1+', license: 'LGPLv2.1+',
default_options: [ default_options: [
'buildtype=debugoptimized', 'buildtype=debugoptimized',
+8 -2
View File
@@ -109,13 +109,13 @@ check_compatiblity_auto (GType old_type, GType current_type)
type ## TODV ## major ## _ ## minor ## _ ## micro type ## TODV ## major ## _ ## minor ## _ ## micro
#define check_struct_size(type, major, minor, micro) \ #define check_struct_size(type, major, minor, micro) \
g_debug ("Checking " # type " size @ " G_STRLOC); \ g_debug ("Checking " # type " v" #major "." #minor "." #micro " size @ " G_STRLOC); \
g_assert_cmpuint (sizeof (tod_versioned_type (type, major, minor, micro)), \ g_assert_cmpuint (sizeof (tod_versioned_type (type, major, minor, micro)), \
==, \ ==, \
sizeof (type)) sizeof (type))
#define check_struct_member(type, major, minor, micro, member) \ #define check_struct_member(type, major, minor, micro, member) \
g_debug ("Checking " # type "'s " # member " offset @ " G_STRLOC); \ g_debug ("Checking " # type " v" #major "." #minor "." #micro "'s " # member " offset @ " G_STRLOC); \
g_assert_cmpuint (G_STRUCT_OFFSET (tod_versioned_type (type, major, minor, micro), member), \ g_assert_cmpuint (G_STRUCT_OFFSET (tod_versioned_type (type, major, minor, micro), member), \
==, \ ==, \
G_STRUCT_OFFSET (type, member)) G_STRUCT_OFFSET (type, member))
@@ -193,6 +193,9 @@ test_device_type (void)
check_struct_member (FpDeviceClass, 1, 94, 0, list); check_struct_member (FpDeviceClass, 1, 94, 0, list);
check_struct_member (FpDeviceClass, 1, 94, 0, delete); check_struct_member (FpDeviceClass, 1, 94, 0, delete);
check_struct_member (FpDeviceClass, 1, 94, 0, cancel); check_struct_member (FpDeviceClass, 1, 94, 0, cancel);
check_struct_member (FpDeviceClass, 1, 94, 0, clear_storage);
check_struct_member (FpDeviceClass, 1, 94, 0, suspend);
check_struct_member (FpDeviceClass, 1, 94, 0, resume);
check_struct_member (FpDeviceClass, 1, 94, 0, id); check_struct_member (FpDeviceClass, 1, 94, 0, id);
check_struct_member (FpDeviceClass, 1, 94, 0, full_name); check_struct_member (FpDeviceClass, 1, 94, 0, full_name);
@@ -203,6 +206,9 @@ test_device_type (void)
check_struct_member (FpDeviceClass, 1, 94, 0, scan_type); check_struct_member (FpDeviceClass, 1, 94, 0, scan_type);
check_struct_member (FpDeviceClass, 1, 94, 0, features); check_struct_member (FpDeviceClass, 1, 94, 0, features);
check_struct_member (FpDeviceClass, 1, 94, 0, temp_hot_seconds);
check_struct_member (FpDeviceClass, 1, 94, 0, temp_cold_seconds);
} }
static void static void
+2
View File
@@ -19,6 +19,8 @@
#pragma once #pragma once
#include "tod/tod-macros.h"
typedef struct _FpDevice FpDevice; typedef struct _FpDevice FpDevice;
typedef enum { typedef enum {
+10 -5
View File
@@ -43,7 +43,7 @@ struct _FpIdEntryTODV1_90_1
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[16]; TOD_PADDING (16, 0);
}; };
struct _FpDeviceClassTODV1_90_1 struct _FpDeviceClassTODV1_90_1
@@ -78,7 +78,7 @@ struct _FpDeviceClassTODV1_90_1
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[32]; TOD_PADDING (32, 0);
}; };
typedef struct _FpDeviceClassTODV1_90_1 FpDeviceClassTODV1_90_1; typedef struct _FpDeviceClassTODV1_90_1 FpDeviceClassTODV1_90_1;
@@ -172,7 +172,9 @@ struct _FpIdEntryTODV1_92_0
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[13]; TOD_PADDING_ALIGNED (16, sizeof (guint) * 2 +
sizeof (FpiDeviceUdevSubtypeFlagsTODV1_92_0) +
sizeof (gpointer));
}; };
typedef struct _FpIdEntryTODV1_92_0 FpIdEntryTODV1_92_0; typedef struct _FpIdEntryTODV1_92_0 FpIdEntryTODV1_92_0;
@@ -211,7 +213,7 @@ struct _FpDeviceClassTODV1_92_0
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[31]; TOD_PADDING (32, sizeof (FpDeviceFeatureTODV1_92_0));
}; };
typedef struct _FpDeviceClassTODV1_92_0 FpDeviceClassTODV1_92_0; typedef struct _FpDeviceClassTODV1_92_0 FpDeviceClassTODV1_92_0;
@@ -260,7 +262,10 @@ struct _FpDeviceClassTODV1_94_0
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[27]; TOD_PADDING_ALIGNED8 (32,
sizeof (FpDeviceFeatureTODV1_94_0) +
sizeof (gint32) * 2 +
sizeof (gpointer) * 3)
}; };
typedef struct _FpDeviceClassTODV1_94_0 FpDeviceClassTODV1_94_0; typedef struct _FpDeviceClassTODV1_94_0 FpDeviceClassTODV1_94_0;
+1 -1
View File
@@ -57,5 +57,5 @@ typedef struct _FpImageDeviceClassTODV1_90_1
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[32]; TOD_PADDING (32, 0);
} FpImageDeviceClassTODV1_90_1; } FpImageDeviceClassTODV1_90_1;
+3 -1
View File
@@ -22,6 +22,8 @@
#include <glib.h> #include <glib.h>
#include <glib-object.h> #include <glib-object.h>
#include "tod/tod-macros.h"
typedef struct _FpImage FpImage; typedef struct _FpImage FpImage;
typedef struct _FpImageTODV1_90_1 FpImageTODV1_90_1; typedef struct _FpImageTODV1_90_1 FpImageTODV1_90_1;
@@ -58,5 +60,5 @@ struct _FpImageTODV1_90_1
GPtrArray *minutiae; GPtrArray *minutiae;
guint ref_count; guint ref_count;
gpointer _padding_dummy[32]; TOD_PADDING (32, 0);
}; };
+1 -1
View File
@@ -56,5 +56,5 @@ struct _FpiSpiTransferTODV1_92_0
GDestroyNotify free_buffer_rd; GDestroyNotify free_buffer_rd;
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[32]; TOD_PADDING (32, 0);
}; };
+1 -2
View File
@@ -75,7 +75,6 @@ struct _FpiUsbTransferTODV1_90_1
/* Data free function */ /* Data free function */
GDestroyNotify free_buffer; GDestroyNotify free_buffer;
/*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[32]; TOD_PADDING (32, 0);
}; };