debian/patches: Drop patches applied upstream

This commit is contained in:
Marco Trevisan (Treviño)
2020-12-04 02:46:24 +01:00
parent 0849cb0476
commit 68c377ae1e
16 changed files with 3 additions and 2915 deletions
@@ -1,80 +0,0 @@
From: Benjamin Berg <bberg@redhat.com>
Date: Mon, 28 Sep 2020 19:13:32 +0200
Subject: aes3k: Fix transfer error path and cancellable lifetime
The cancellable needs to be free'ed at deactivation. Also free it if we
run into a fatal error, which then in turn indicates that the device is
deactivated already.
Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/8c4ff253c
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1897613
---
libfprint/drivers/aes3k.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/libfprint/drivers/aes3k.c b/libfprint/drivers/aes3k.c
index db0d370..be3645e 100644
--- a/libfprint/drivers/aes3k.c
+++ b/libfprint/drivers/aes3k.c
@@ -76,6 +76,7 @@ img_cb (FpiUsbTransfer *transfer, FpDevice *device,
{
FpImageDevice *dev = FP_IMAGE_DEVICE (device);
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (device);
+ FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
FpiDeviceAes3kClass *cls = FPI_DEVICE_AES3K_GET_CLASS (self);
unsigned char *ptr = transfer->buffer;
FpImage *tmp;
@@ -90,11 +91,14 @@ img_cb (FpiUsbTransfer *transfer, FpDevice *device,
{
/* Cancellation implies we are deactivating. */
g_error_free (error);
+ g_clear_object (&priv->img_trf_cancel);
fpi_image_device_deactivate_complete (dev, NULL);
return;
}
fpi_image_device_session_error (dev, error);
+ g_clear_object (&priv->img_trf_cancel);
+ return;
}
fpi_image_device_report_finger_status (dev, TRUE);
@@ -144,9 +148,14 @@ do_capture (FpImageDevice *dev)
static void
init_reqs_cb (FpImageDevice *dev, GError *result, void *user_data)
{
+ FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (FPI_DEVICE_AES3K (dev));
+
fpi_image_device_activate_complete (dev, result);
if (!result)
- do_capture (dev);
+ {
+ priv->img_trf_cancel = g_cancellable_new ();
+ do_capture (dev);
+ }
}
static void
@@ -157,7 +166,6 @@ aes3k_dev_activate (FpImageDevice *dev)
FpiDeviceAes3kClass *cls = FPI_DEVICE_AES3K_GET_CLASS (self);
g_assert (!priv->img_trf_cancel);
- priv->img_trf_cancel = g_cancellable_new ();
aes_write_regv (dev, cls->init_reqs, cls->init_reqs_len, init_reqs_cb, NULL);
}
@@ -167,8 +175,11 @@ aes3k_dev_deactivate (FpImageDevice *dev)
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
- /* Deactivation always finishes from the cancellation handler */
- g_cancellable_cancel (priv->img_trf_cancel);
+ /* Deactivation finishes from the cancellation handler */
+ if (priv->img_trf_cancel)
+ g_cancellable_cancel (priv->img_trf_cancel);
+ else
+ fpi_image_device_deactivate_complete (dev, NULL);
}
static void
@@ -1,231 +0,0 @@
From: Benjamin Berg <bberg@redhat.com>
Date: Thu, 1 Oct 2020 18:38:07 +0200
Subject: aes3k: Re-send some commands for each capture
The driver seems to have relied on the device to be fully
deactivated and activated again for each capture. This is not the case
during enroll, and as such in can cause issues.
Try fixing this by splitting out the last few commands send to the
device and assuming that this starts the capture.
Fixes: #306
Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/81e0f4dfe
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1897613
---
libfprint/drivers/aes3500.c | 4 +++
libfprint/drivers/aes3k.c | 75 ++++++++++++++++++++++++++++++++++-----------
libfprint/drivers/aes3k.h | 2 ++
libfprint/drivers/aes4000.c | 4 +++
4 files changed, 67 insertions(+), 18 deletions(-)
diff --git a/libfprint/drivers/aes3500.c b/libfprint/drivers/aes3500.c
index 3b4860b..58a9be1 100644
--- a/libfprint/drivers/aes3500.c
+++ b/libfprint/drivers/aes3500.c
@@ -106,7 +106,9 @@ static struct aes_regwrite init_reqs[] = {
{ 0x9e, 0x53 }, /* clear challenge word bits */
{ 0x9f, 0x6b }, /* set some challenge word bits */
{ 0, 0 },
+};
+static struct aes_regwrite capture_reqs[] = {
{ 0x80, 0x00 },
{ 0x81, 0x00 },
{ 0, 0 },
@@ -155,4 +157,6 @@ fpi_device_aes3500_class_init (FpiDeviceAes3500Class *klass)
aes_class->enlarge_factor = ENLARGE_FACTOR;
aes_class->init_reqs = init_reqs;
aes_class->init_reqs_len = G_N_ELEMENTS (init_reqs);
+ aes_class->capture_reqs = capture_reqs;
+ aes_class->capture_reqs_len = G_N_ELEMENTS (capture_reqs);
}
diff --git a/libfprint/drivers/aes3k.c b/libfprint/drivers/aes3k.c
index be3645e..bab6815 100644
--- a/libfprint/drivers/aes3k.c
+++ b/libfprint/drivers/aes3k.c
@@ -42,7 +42,10 @@
typedef struct
{
- GCancellable *img_trf_cancel;
+ /* This is used both as a flag that we are in a capture operation
+ * and for cancellation.
+ */
+ GCancellable *img_capture_cancel;
} FpiDeviceAes3kPrivate;
#define CTRL_TIMEOUT 1000
@@ -83,6 +86,9 @@ img_cb (FpiUsbTransfer *transfer, FpDevice *device,
FpImage *img;
int i;
+ /* Image capture operation is finished (error/completed) */
+ g_clear_object (&priv->img_capture_cancel);
+
if (error)
{
if (g_error_matches (error,
@@ -91,13 +97,11 @@ img_cb (FpiUsbTransfer *transfer, FpDevice *device,
{
/* Cancellation implies we are deactivating. */
g_error_free (error);
- g_clear_object (&priv->img_trf_cancel);
fpi_image_device_deactivate_complete (dev, NULL);
return;
}
fpi_image_device_session_error (dev, error);
- g_clear_object (&priv->img_trf_cancel);
return;
}
@@ -122,11 +126,10 @@ img_cb (FpiUsbTransfer *transfer, FpDevice *device,
fpi_image_device_image_captured (dev, img);
/* FIXME: rather than assuming finger has gone, we should poll regs until
- * it really has, then restart the capture */
+ * it really has. */
fpi_image_device_report_finger_status (dev, FALSE);
- /* Note: We always restart the transfer, it may already be cancelled though. */
- do_capture (dev);
+ /* Note: The transfer is re-started when we switch to the AWAIT_FINGER_ON state. */
}
static void
@@ -141,31 +144,51 @@ do_capture (FpImageDevice *dev)
fpi_usb_transfer_fill_bulk (img_trf, EP_IN, cls->data_buflen);
img_trf->short_is_error = TRUE;
fpi_usb_transfer_submit (g_steal_pointer (&img_trf), 0,
- priv->img_trf_cancel,
+ priv->img_capture_cancel,
img_cb, NULL);
}
static void
-init_reqs_cb (FpImageDevice *dev, GError *result, void *user_data)
+capture_reqs_cb (FpImageDevice *dev, GError *result, void *user_data)
{
- FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (FPI_DEVICE_AES3K (dev));
+ FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
+ FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
- fpi_image_device_activate_complete (dev, result);
- if (!result)
+ if (result)
{
- priv->img_trf_cancel = g_cancellable_new ();
- do_capture (dev);
+ g_clear_object (&priv->img_capture_cancel);
+ fpi_image_device_session_error (dev, result);
+ return;
}
+
+ /* FIXME: we never cancel a pending capture. So we are likely leaving the
+ * hardware in a bad state should we abort the capture operation and the
+ * user does not touch the device.
+ * But, we don't know how we might cancel, so just leave it as is. */
+ do_capture (dev);
+}
+
+static void
+do_capture_start (FpImageDevice *dev)
+{
+ FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
+ FpiDeviceAes3kClass *cls = FPI_DEVICE_AES3K_GET_CLASS (self);
+
+ aes_write_regv (dev, cls->capture_reqs, cls->capture_reqs_len, capture_reqs_cb, NULL);
+}
+
+static void
+init_reqs_cb (FpImageDevice *dev, GError *result, void *user_data)
+{
+ fpi_image_device_activate_complete (dev, result);
}
static void
aes3k_dev_activate (FpImageDevice *dev)
{
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
- FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
FpiDeviceAes3kClass *cls = FPI_DEVICE_AES3K_GET_CLASS (self);
- g_assert (!priv->img_trf_cancel);
aes_write_regv (dev, cls->init_reqs, cls->init_reqs_len, init_reqs_cb, NULL);
}
@@ -175,13 +198,28 @@ aes3k_dev_deactivate (FpImageDevice *dev)
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
- /* Deactivation finishes from the cancellation handler */
- if (priv->img_trf_cancel)
- g_cancellable_cancel (priv->img_trf_cancel);
+ /* If a capture is running, then deactivation finishes from the cancellation handler */
+ if (priv->img_capture_cancel)
+ g_cancellable_cancel (priv->img_capture_cancel);
else
fpi_image_device_deactivate_complete (dev, NULL);
}
+static void
+aes3k_dev_change_state (FpImageDevice *dev, FpiImageDeviceState state)
+{
+ FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
+ FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
+
+ if (state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON)
+ {
+ g_assert (!priv->img_capture_cancel);
+ priv->img_capture_cancel = g_cancellable_new ();
+
+ do_capture_start (dev);
+ }
+}
+
static void
fpi_device_aes3k_init (FpiDeviceAes3k *self)
{
@@ -224,6 +262,7 @@ fpi_device_aes3k_class_init (FpiDeviceAes3kClass *klass)
img_class->img_open = aes3k_dev_init;
img_class->img_close = aes3k_dev_deinit;
img_class->activate = aes3k_dev_activate;
+ img_class->change_state = aes3k_dev_change_state;
img_class->deactivate = aes3k_dev_deactivate;
/* Extremely low due to low image quality. */
diff --git a/libfprint/drivers/aes3k.h b/libfprint/drivers/aes3k.h
index 539f4e1..ae19bf1 100644
--- a/libfprint/drivers/aes3k.h
+++ b/libfprint/drivers/aes3k.h
@@ -57,4 +57,6 @@ struct _FpiDeviceAes3kClass
gsize data_buflen; /* buffer length of usb bulk transfer */
struct aes_regwrite *init_reqs; /* initial values sent to device */
gsize init_reqs_len;
+ struct aes_regwrite *capture_reqs; /* capture values sent to device */
+ gsize capture_reqs_len;
};
diff --git a/libfprint/drivers/aes4000.c b/libfprint/drivers/aes4000.c
index 0a801f6..e5770b9 100644
--- a/libfprint/drivers/aes4000.c
+++ b/libfprint/drivers/aes4000.c
@@ -103,7 +103,9 @@ static struct aes_regwrite init_reqs[] = {
{ 0x9e, 0x53 }, /* clear challenge word bits */
{ 0x9f, 0x6b }, /* set some challenge word bits */
{ 0, 0 },
+};
+static struct aes_regwrite capture_reqs[] = {
{ 0x80, 0x00 },
{ 0x81, 0x00 },
{ 0, 0 },
@@ -152,4 +154,6 @@ fpi_device_aes4000_class_init (FpiDeviceAes4000Class *klass)
aes_class->enlarge_factor = ENLARGE_FACTOR;
aes_class->init_reqs = init_reqs;
aes_class->init_reqs_len = G_N_ELEMENTS (init_reqs);
+ aes_class->capture_reqs = capture_reqs;
+ aes_class->capture_reqs_len = G_N_ELEMENTS (capture_reqs);
}
@@ -1,27 +0,0 @@
From: Benjamin Berg <bberg@redhat.com>
Date: Mon, 28 Sep 2020 19:12:28 +0200
Subject: image-device: Don't deactivate if deactivation was already started
The test only prevent deactivation after it completed. Also guard
against trying to deactivate a second time.
Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/3ce6a1554
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1897613
---
libfprint/fpi-image-device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libfprint/fpi-image-device.c b/libfprint/fpi-image-device.c
index 8fc1b92..0cef485 100644
--- a/libfprint/fpi-image-device.c
+++ b/libfprint/fpi-image-device.c
@@ -71,7 +71,7 @@ fpi_image_device_deactivate (FpImageDevice *self)
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
FpImageDeviceClass *cls = FP_IMAGE_DEVICE_GET_CLASS (device);
- if (!priv->active)
+ if (!priv->active || priv->state == FPI_IMAGE_DEVICE_STATE_INACTIVE)
{
/* XXX: We currently deactivate both from minutiae scan result
* and finger off report. */
@@ -1,27 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Mon, 30 Nov 2020 20:03:32 +0100
Subject: list-udev-rules: Remove Wrongly added well-known USB controller
vid/pid comboj
This was causing USB controllers to use power-saving mode, breaking usb
devices usage.
Related to: https://gitlab.freedesktop.org/libfprint/libfprint/-/issues/327
Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/2b7cfa75
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1906296
---
libfprint/fprint-list-udev-rules.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/libfprint/fprint-list-udev-rules.c b/libfprint/fprint-list-udev-rules.c
index aee13e4..183cfa5 100644
--- a/libfprint/fprint-list-udev-rules.c
+++ b/libfprint/fprint-list-udev-rules.c
@@ -76,7 +76,6 @@ static const FpIdEntry whitelist_id_table[] = {
{ .vid = 0x1c7a, .pid = 0x0300 },
{ .vid = 0x1c7a, .pid = 0x0570 },
{ .vid = 0x1c7a, .pid = 0x0575 },
- { .vid = 0x1d6b, .pid = 0x0002 },
{ .vid = 0x27c6, .pid = 0x5042 },
{ .vid = 0x27c6, .pid = 0x5110 },
{ .vid = 0x27c6, .pid = 0x5117 },
-14
View File
@@ -1,16 +1,2 @@
image-device-Don-t-deactivate-if-deactivation-was-already.patch
aes3k-Fix-transfer-error-path-and-cancellable-lifetime.patch
tests-Add-AES3500-test-case.patch
usb-transfer-Work-around-libgusb-cancellation-issue.patch
aes3k-Re-send-some-commands-for-each-capture.patch
synaptics-add-support-to-pid-0xF9-0xFC-0xC2.patch
synaptics-Fix-missing-reference-to-interrupt-transfer.patch
vfs301-Fix-device-pointer-handling-in-callback.patch
vfs301-Start-capture-only-on-state-change-to-AWAIT_FINGER.patch
tests-Add-a-new-test-for-vfs301.patch
udev-rules-Add-unsupported-devices-from-wiki-page-to-rule.patch
udev-rules-Regenerate-from-wiki-to-include-VFS495.patch
list-udev-rules-Remove-Wrongly-added-well-known-USB-contr.patch
synaptics-add-identify-function.patch
# Debian specifics # Debian specifics
udev-rules-creation-add-Debian-specifics.patch udev-rules-creation-add-Debian-specifics.patch
@@ -1,32 +0,0 @@
From: Benjamin Berg <bberg@redhat.com>
Date: Mon, 19 Oct 2020 16:59:28 +0200
Subject: synaptics: Fix missing reference to interrupt transfer
When resubmitting the interrupt transfer we need to add a new reference
as the submit function will steal it again.
Origin: https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/90a1abf2
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1905593
---
libfprint/drivers/synaptics/synaptics.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c
index a3d2a51..ee56271 100644
--- a/libfprint/drivers/synaptics/synaptics.c
+++ b/libfprint/drivers/synaptics/synaptics.c
@@ -202,7 +202,13 @@ cmd_interrupt_cb (FpiUsbTransfer *transfer,
if (transfer->buffer[0] & USB_ASYNC_MESSAGE_PENDING || error)
fpi_ssm_next_state (transfer->ssm);
else
- fpi_usb_transfer_submit (transfer, 1000, NULL, cmd_interrupt_cb, NULL);
+ {
+ fpi_usb_transfer_submit (fpi_usb_transfer_ref (transfer),
+ 1000,
+ NULL,
+ cmd_interrupt_cb,
+ NULL);
+ }
}
static void
-179
View File
@@ -1,179 +0,0 @@
From: Vincent Huang <vincent.huang@tw.synaptics.com>
Date: Tue, 22 Sep 2020 17:43:57 +0800
Subject: synaptics: add identify function
Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/e27b65c9
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1905600
---
libfprint/drivers/synaptics/synaptics.c | 150 ++++++++++++++++++++++++++++++++
1 file changed, 150 insertions(+)
diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c
index ee56271..7c76301 100644
--- a/libfprint/drivers/synaptics/synaptics.c
+++ b/libfprint/drivers/synaptics/synaptics.c
@@ -668,6 +668,155 @@ verify (FpDevice *device)
synaptics_sensor_cmd (self, 0, BMKT_CMD_VERIFY_USER, user_id, user_id_len, verify_msg_cb);
}
+static void
+identify_complete_after_finger_removal (FpiDeviceSynaptics *self)
+{
+ FpDevice *device = FP_DEVICE (self);
+
+ if (self->finger_on_sensor)
+ {
+ fp_dbg ("delaying identify report until after finger removal!");
+ self->cmd_complete_on_removal = TRUE;
+ }
+ else
+ {
+ fpi_device_identify_complete (device, NULL);
+ }
+}
+
+
+static void
+identify_msg_cb (FpiDeviceSynaptics *self,
+ bmkt_response_t *resp,
+ GError *error)
+{
+ FpDevice *device = FP_DEVICE (self);
+
+ if (error)
+ {
+ fpi_device_identify_complete (device, error);
+ return;
+ }
+
+ if (resp == NULL && self->cmd_complete_on_removal)
+ {
+ fpi_device_identify_complete (device, NULL);
+ return;
+ }
+
+ g_assert (resp != NULL);
+
+ switch (resp->response_id)
+ {
+ case BMKT_RSP_ID_READY:
+ fp_info ("Place Finger on the Sensor!");
+ break;
+
+ case BMKT_RSP_ID_FAIL:
+ if (resp->result == BMKT_SENSOR_STIMULUS_ERROR)
+ {
+ fp_info ("Match error occurred");
+ fpi_device_identify_report (device, NULL, NULL,
+ fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL));
+ identify_complete_after_finger_removal (self);
+ }
+ else if (resp->result == BMKT_FP_NO_MATCH)
+ {
+ fp_info ("Print didn't match");
+ fpi_device_identify_report (device, NULL, NULL, NULL);
+ identify_complete_after_finger_removal (self);
+ }
+ else if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS)
+ {
+ fp_info ("Print is not in database");
+ fpi_device_identify_complete (device,
+ fpi_device_error_new (FP_DEVICE_ERROR_DATA_NOT_FOUND));
+ }
+ else
+ {
+ fp_warn ("identify has failed: %d", resp->result);
+ fpi_device_identify_complete (device,
+ fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
+ "Unexpected result from device %d",
+ resp->result));
+ }
+ break;
+
+ case BMKT_RSP_ID_OK:
+ {
+ FpPrint *print = NULL;
+ GPtrArray *prints = NULL;
+ g_autoptr(GVariant) data = NULL;
+ guint8 finger;
+ const guint8 *user_id;
+ gsize user_id_len = 0;
+ gint cnt = 0;
+ gboolean find = FALSE;
+
+ fpi_device_get_identify_data (device, &prints);
+
+ for (cnt = 0; cnt < prints->len; cnt++)
+ {
+ print = g_ptr_array_index (prints, cnt);
+ g_object_get (print, "fpi-data", &data, NULL);
+ g_debug ("data is %p", data);
+ parse_print_data (data, &finger, &user_id, &user_id_len);
+ if (user_id)
+ {
+ if (memcmp (resp->response.id_resp.user_id, user_id, user_id_len) == 0)
+ {
+ find = TRUE;
+ break;
+ }
+ }
+ }
+ if(find)
+ {
+ fpi_device_identify_report (device, print, print, NULL);
+ fpi_device_identify_complete (device, NULL);
+ }
+ else
+ {
+ fpi_device_identify_report (device, NULL, NULL, NULL);
+ identify_complete_after_finger_removal (self);
+ }
+ }
+ }
+}
+
+static void
+identify (FpDevice *device)
+{
+ FpiDeviceSynaptics *self = FPI_DEVICE_SYNAPTICS (device);
+ FpPrint *print = NULL;
+ GPtrArray *prints = NULL;
+
+ g_autoptr(GVariant) data = NULL;
+ guint8 finger;
+ const guint8 *user_id;
+ gsize user_id_len = 0;
+ gint cnt = 0;
+
+ fpi_device_get_identify_data (device, &prints);
+
+ for (cnt = 0; cnt < prints->len; cnt++)
+ {
+ print = g_ptr_array_index (prints, cnt);
+ g_object_get (print, "fpi-data", &data, NULL);
+ g_debug ("data is %p", data);
+ if (!parse_print_data (data, &finger, &user_id, &user_id_len))
+ {
+ fpi_device_identify_complete (device,
+ fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID));
+ return;
+ }
+ }
+ G_DEBUG_HERE ();
+
+ synaptics_sensor_cmd (self, 0, BMKT_CMD_ID_USER, NULL, 0, identify_msg_cb);
+}
+
+
static void
enroll_msg_cb (FpiDeviceSynaptics *self,
bmkt_response_t *resp,
@@ -1161,6 +1310,7 @@ fpi_device_synaptics_class_init (FpiDeviceSynapticsClass *klass)
dev_class->close = dev_exit;
dev_class->probe = dev_probe;
dev_class->verify = verify;
+ dev_class->identify = identify;
dev_class->enroll = enroll;
dev_class->delete = delete_print;
dev_class->cancel = cancel;
@@ -1,25 +0,0 @@
From: Vincent Huang <vincent.huang@tw.synaptics.com>
Date: Thu, 15 Oct 2020 12:20:34 +0800
Subject: synaptics: add support to pid 0xF9, 0xFC, 0xC2
Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/31319d9c6
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1905593
---
libfprint/drivers/synaptics/synaptics.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c
index 9bbae99..a3d2a51 100644
--- a/libfprint/drivers/synaptics/synaptics.c
+++ b/libfprint/drivers/synaptics/synaptics.c
@@ -31,6 +31,9 @@ static const FpIdEntry id_table[] = {
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xBD, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xE9, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xDF, },
+ { .vid = SYNAPTICS_VENDOR_ID, .pid = 0xF9, },
+ { .vid = SYNAPTICS_VENDOR_ID, .pid = 0xFC, },
+ { .vid = SYNAPTICS_VENDOR_ID, .pid = 0xC2, },
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,101 +0,0 @@
From: Benjamin Berg <bberg@redhat.com>
Date: Wed, 18 Nov 2020 18:58:31 +0100
Subject: udev-rules: Add unsupported devices from wiki page to rules
This ensures we are putting all these devices (which are unusable) into
power save mode.
Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/2caeb8c
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1905603
---
libfprint/fprint-list-udev-rules.c | 74 ++++++++++++++++++++++++++++++++++++--
1 file changed, 71 insertions(+), 3 deletions(-)
diff --git a/libfprint/fprint-list-udev-rules.c b/libfprint/fprint-list-udev-rules.c
index 5f17b6b..bbca6ef 100644
--- a/libfprint/fprint-list-udev-rules.c
+++ b/libfprint/fprint-list-udev-rules.c
@@ -25,11 +25,79 @@
#include "fpi-device.h"
static const FpIdEntry whitelist_id_table[] = {
- /* Unsupported (for now) Validity Sensors finger print readers */
- { .vid = 0x138a, .pid = 0x0090 }, /* Found on e.g. Lenovo T460s */
+ /* Currently known and unsupported devices.
+ * You can generate this list from the wiki page using e.g.:
+ * gio cat https://gitlab.freedesktop.org/libfprint/wiki/-/wikis/Unsupported-Devices.md | sed -n 's!|.*\([0-9a-fA-F]\{4\}\):\([0-9a-fA-F]\{4\}\).*|.*! { .vid = 0x\1, .pid = 0x\2 },!p'
+ */
+ { .vid = 0x04f3, .pid = 0x036b },
+ { .vid = 0x04f3, .pid = 0x0c00 },
+ { .vid = 0x04f3, .pid = 0x0c4b },
+ { .vid = 0x04f3, .pid = 0x0c4c },
+ { .vid = 0x04f3, .pid = 0x0c4d },
+ { .vid = 0x04f3, .pid = 0x0c4f },
+ { .vid = 0x04f3, .pid = 0x0c57 },
+ { .vid = 0x04f3, .pid = 0x2706 },
+ { .vid = 0x06cb, .pid = 0x0081 },
+ { .vid = 0x06cb, .pid = 0x0088 },
+ { .vid = 0x06cb, .pid = 0x008a },
+ { .vid = 0x06cb, .pid = 0x009a },
+ { .vid = 0x06cb, .pid = 0x009b },
+ { .vid = 0x06cb, .pid = 0x00a2 },
+ { .vid = 0x06cb, .pid = 0x00b7 },
+ { .vid = 0x06cb, .pid = 0x00bb },
+ { .vid = 0x06cb, .pid = 0x00be },
+ { .vid = 0x06cb, .pid = 0x00c2 },
+ { .vid = 0x06cb, .pid = 0x00c9 },
+ { .vid = 0x06cb, .pid = 0x00cb },
+ { .vid = 0x06cb, .pid = 0x00d8 },
+ { .vid = 0x06cb, .pid = 0x00da },
+ { .vid = 0x06cb, .pid = 0x00e7 },
+ { .vid = 0x0a5c, .pid = 0x5801 },
+ { .vid = 0x0a5c, .pid = 0x5805 },
+ { .vid = 0x0a5c, .pid = 0x5834 },
+ { .vid = 0x0a5c, .pid = 0x5843 },
+ { .vid = 0x10a5, .pid = 0x0007 },
+ { .vid = 0x1188, .pid = 0x9545 },
+ { .vid = 0x138a, .pid = 0x0007 },
+ { .vid = 0x138a, .pid = 0x003c },
+ { .vid = 0x138a, .pid = 0x003d },
+ { .vid = 0x138a, .pid = 0x003f },
+ { .vid = 0x138a, .pid = 0x0090 },
{ .vid = 0x138a, .pid = 0x0091 },
+ { .vid = 0x138a, .pid = 0x0092 },
{ .vid = 0x138a, .pid = 0x0094 },
- { .vid = 0x138a, .pid = 0x0097 }, /* Found on e.g. Lenovo T470s */
+ { .vid = 0x138a, .pid = 0x0097 },
+ { .vid = 0x138a, .pid = 0x009d },
+ { .vid = 0x138a, .pid = 0x00ab },
+ { .vid = 0x147e, .pid = 0x1002 },
+ { .vid = 0x1491, .pid = 0x0088 },
+ { .vid = 0x16d1, .pid = 0x1027 },
+ { .vid = 0x1c7a, .pid = 0x0300 },
+ { .vid = 0x1c7a, .pid = 0x0570 },
+ { .vid = 0x1c7a, .pid = 0x0575 },
+ { .vid = 0x1d6b, .pid = 0x0002 },
+ { .vid = 0x27c6, .pid = 0x5042 },
+ { .vid = 0x27c6, .pid = 0x5110 },
+ { .vid = 0x27c6, .pid = 0x5117 },
+ { .vid = 0x27c6, .pid = 0x5201 },
+ { .vid = 0x27c6, .pid = 0x521d },
+ { .vid = 0x27c6, .pid = 0x5301 },
+ { .vid = 0x27c6, .pid = 0x530c },
+ { .vid = 0x27c6, .pid = 0x532d },
+ { .vid = 0x27c6, .pid = 0x533c },
+ { .vid = 0x27c6, .pid = 0x5381 },
+ { .vid = 0x27c6, .pid = 0x5385 },
+ { .vid = 0x27c6, .pid = 0x538c },
+ { .vid = 0x27c6, .pid = 0x538d },
+ { .vid = 0x27c6, .pid = 0x5395 },
+ { .vid = 0x27c6, .pid = 0x5584 },
+ { .vid = 0x27c6, .pid = 0x55a2 },
+ { .vid = 0x27c6, .pid = 0x55a4 },
+ { .vid = 0x27c6, .pid = 0x55b4 },
+ { .vid = 0x27c6, .pid = 0x5740 },
+ { .vid = 0x2808, .pid = 0x9338 },
+ { .vid = 0x298d, .pid = 0x2033 },
+ { .vid = 0x3538, .pid = 0x0930 },
{ .vid = 0 },
};
@@ -1,23 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Wed, 25 Nov 2020 18:28:41 +0100
Subject: udev-rules: Regenerate from wiki to include VFS495
Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/fa3bdb8
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1905603
---
libfprint/fprint-list-udev-rules.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libfprint/fprint-list-udev-rules.c b/libfprint/fprint-list-udev-rules.c
index bbca6ef..aee13e4 100644
--- a/libfprint/fprint-list-udev-rules.c
+++ b/libfprint/fprint-list-udev-rules.c
@@ -59,6 +59,7 @@ static const FpIdEntry whitelist_id_table[] = {
{ .vid = 0x10a5, .pid = 0x0007 },
{ .vid = 0x1188, .pid = 0x9545 },
{ .vid = 0x138a, .pid = 0x0007 },
+ { .vid = 0x138a, .pid = 0x003a },
{ .vid = 0x138a, .pid = 0x003c },
{ .vid = 0x138a, .pid = 0x003d },
{ .vid = 0x138a, .pid = 0x003f },
@@ -12,10 +12,10 @@ ones; mode and group to all.
1 file changed, 4 insertions(+), 5 deletions(-) 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/libfprint/fprint-list-udev-rules.c b/libfprint/fprint-list-udev-rules.c diff --git a/libfprint/fprint-list-udev-rules.c b/libfprint/fprint-list-udev-rules.c
index 183cfa5..ff8fd1c 100644 index d6c884c..3b6f572 100644
--- a/libfprint/fprint-list-udev-rules.c --- a/libfprint/fprint-list-udev-rules.c
+++ b/libfprint/fprint-list-udev-rules.c +++ b/libfprint/fprint-list-udev-rules.c
@@ -134,9 +134,6 @@ print_driver (const FpDeviceClass *cls) @@ -133,9 +133,6 @@ print_driver (const FpDeviceClass *cls)
if (entry->vid == bl_entry->vid && entry->pid == bl_entry->pid) if (entry->vid == bl_entry->vid && entry->pid == bl_entry->pid)
break; break;
@@ -25,7 +25,7 @@ index 183cfa5..ff8fd1c 100644
key = g_strdup_printf ("%04x:%04x", entry->vid, entry->pid); key = g_strdup_printf ("%04x:%04x", entry->vid, entry->pid);
if (g_hash_table_lookup (printed, key) != NULL) if (g_hash_table_lookup (printed, key) != NULL)
@@ -150,8 +147,10 @@ print_driver (const FpDeviceClass *cls) @@ -149,8 +146,10 @@ print_driver (const FpDeviceClass *cls)
if (num_printed == 0) if (num_printed == 0)
g_print ("# %s\n", cls->full_name); g_print ("# %s\n", cls->full_name);
@@ -1,69 +0,0 @@
From: Benjamin Berg <bberg@redhat.com>
Date: Thu, 1 Oct 2020 00:14:48 +0200
Subject: usb-transfer: Work around libgusb cancellation issue
We have plenty of code paths where a transfer may be cancelled before it
is submitted. Unfortunately, libgusb up to and including version 0.3.6
are not handling that case correctly (due to libusb ignoring
cancellation on transfers that are not yet submitted).
Work around this, but do so in a somewhat lazy fashion that is not
entirely race free.
Closes: #306
Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/c7cab77fc
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1897613
---
libfprint/fpi-usb-transfer.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/libfprint/fpi-usb-transfer.c b/libfprint/fpi-usb-transfer.c
index 37033c8..fe49168 100644
--- a/libfprint/fpi-usb-transfer.c
+++ b/libfprint/fpi-usb-transfer.c
@@ -354,6 +354,24 @@ transfer_finish_cb (GObject *source_object, GAsyncResult *res, gpointer user_dat
fpi_usb_transfer_unref (transfer);
}
+static gboolean
+transfer_cancel_cb (FpiUsbTransfer *transfer)
+{
+ GError *error;
+ FpiUsbTransferCallback callback;
+
+ error = g_error_new_literal (G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
+ "Transfer was cancelled before being started");
+ callback = transfer->callback;
+ transfer->callback = NULL;
+ transfer->actual_length = -1;
+ callback (transfer, transfer->device, transfer->user_data, error);
+
+ fpi_usb_transfer_unref (transfer);
+
+ return G_SOURCE_REMOVE;
+}
/**
* fpi_usb_transfer_submit:
@@ -387,6 +405,18 @@ fpi_usb_transfer_submit (FpiUsbTransfer *transfer,
log_transfer (transfer, TRUE, NULL);
+ /* Work around libgusb cancellation issue, see
+ * https://github.com/hughsie/libgusb/pull/42
+ * should be fixed with libgusb 0.3.7.
+ * Note that this is not race free, we rely on libfprint and API users
+ * not cancelling from a different thread here.
+ */
+ if (cancellable && g_cancellable_is_cancelled (cancellable))
+ {
+ g_idle_add ((GSourceFunc) transfer_cancel_cb, transfer);
+ return;
+ }
+
switch (transfer->type)
{
case FP_TRANSFER_BULK:
@@ -1,57 +0,0 @@
From: Benjamin Berg <bberg@redhat.com>
Date: Fri, 23 Oct 2020 18:42:55 +0200
Subject: vfs301: Fix device pointer handling in callback
When porting the driver to the new libfprint 1.90.0 a mistake was made
where the device was not passed through user_data anymore but it was
still read from there. Stop using user_data in the callback to fix this.
See: #320
Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/d3076039d
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1905597
---
libfprint/drivers/vfs301_proto.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libfprint/drivers/vfs301_proto.c b/libfprint/drivers/vfs301_proto.c
index bcd09e9..8270780 100644
--- a/libfprint/drivers/vfs301_proto.c
+++ b/libfprint/drivers/vfs301_proto.c
@@ -508,30 +508,30 @@ vfs301_proto_process_event_cb (FpiUsbTransfer *transfer,
FpDevice *device,
gpointer user_data, GError *error)
{
- FpDeviceVfs301 *dev = user_data;
+ FpDeviceVfs301 *self = FPI_DEVICE_VFS301 (device);
if (error)
{
g_warning ("Error receiving data: %s", error->message);
g_error_free (error);
- dev->recv_progress = VFS301_FAILURE;
+ self->recv_progress = VFS301_FAILURE;
return;
}
else if (transfer->actual_length < transfer->length)
{
/* TODO: process the data anyway? */
- dev->recv_progress = VFS301_ENDED;
+ self->recv_progress = VFS301_ENDED;
return;
}
else
{
FpiUsbTransfer *new;
- if (!vfs301_proto_process_data (dev,
+ if (!vfs301_proto_process_data (self,
transfer->length == VFS301_FP_RECV_LEN_1,
transfer->buffer,
transfer->actual_length))
{
- dev->recv_progress = VFS301_ENDED;
+ self->recv_progress = VFS301_ENDED;
return;
}
@@ -1,87 +0,0 @@
From: Benjamin Berg <bberg@redhat.com>
Date: Wed, 4 Nov 2020 14:08:10 +0100
Subject: vfs301: Start capture only on state change to AWAIT_FINGER_ON
Start the capture when the state changes to AWAIT_FINGER_ON instead of
assuming that the device should always be active.
Closes: #320
Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/e5fa54e8
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1905597
---
libfprint/drivers/vfs301.c | 38 ++++++++++++++------------------------
1 file changed, 14 insertions(+), 24 deletions(-)
diff --git a/libfprint/drivers/vfs301.c b/libfprint/drivers/vfs301.c
index f912a36..fffd31a 100644
--- a/libfprint/drivers/vfs301.c
+++ b/libfprint/drivers/vfs301.c
@@ -147,18 +147,6 @@ m_loop_state (FpiSsm *ssm, FpDevice *_dev)
}
}
-/* Complete loop sequential state machine */
-static void
-m_loop_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
-{
- if (error)
- {
- g_warning ("State machine completed with an error: %s", error->message);
- g_error_free (error);
- }
- /* Free sequential state machine */
-}
-
/* Exec init sequential state machine */
static void
m_init_state (FpiSsm *ssm, FpDevice *_dev)
@@ -176,19 +164,7 @@ m_init_state (FpiSsm *ssm, FpDevice *_dev)
static void
m_init_complete (FpiSsm *ssm, FpDevice *dev, GError *error)
{
- FpiSsm *ssm_loop;
-
fpi_image_device_activate_complete (FP_IMAGE_DEVICE (dev), error);
- if (!error)
- {
- /* Notify activate complete */
-
- /* Start loop ssm */
- ssm_loop = fpi_ssm_new (dev, m_loop_state, M_LOOP_NUM_STATES);
- fpi_ssm_start (ssm_loop, m_loop_complete);
- }
-
- /* Free sequential state machine */
}
/* Activate device */
@@ -213,6 +189,19 @@ dev_deactivate (FpImageDevice *dev)
fpi_image_device_deactivate_complete (dev, NULL);
}
+static void
+dev_change_state (FpImageDevice *dev, FpiImageDeviceState state)
+{
+ FpiSsm *ssm_loop;
+
+ if (state != FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON)
+ return;
+
+ /* Start a capture operation. */
+ ssm_loop = fpi_ssm_new (FP_DEVICE (dev), m_loop_state, M_LOOP_NUM_STATES);
+ fpi_ssm_start (ssm_loop, NULL);
+}
+
static void
dev_open (FpImageDevice *dev)
{
@@ -273,6 +262,7 @@ fpi_device_vfs301_class_init (FpDeviceVfs301Class *klass)
img_class->img_close = dev_close;
img_class->activate = dev_activate;
img_class->deactivate = dev_deactivate;
+ img_class->change_state = dev_change_state;
img_class->bz3_threshold = 24;