Commit Graph

2086 Commits

Author SHA1 Message Date
Aris Lin 4d5e2775b2 synaptics: add new PID 0xF0 and 0x103 2021-05-05 15:24:25 +08:00
Vincent Huang 8a04578847 synaptics: Add clear_storage() and remove list() 2021-04-29 11:49:27 +00:00
Vincent Huang 77e95aa545 fp-device: Add fp_device_clear_storage and clear_storage vfunc 2021-04-29 11:49:27 +00:00
Benjamin Berg b9df7a4e70 device: Attach sources to correct main context
We were attaching the sources to the default main context. Instead, we
should be attaching them to the current tasks main context (or, failing
that, the current thread local main context).
2021-04-28 22:16:37 +02:00
Benjamin Berg 1ca56adff5 usb-transfer: Use fpi_device_add_timeout instead of g_idle_add
g_idle_add attaches to the default main context, but the rest of
libfprint is using the thread local main context. Switch to use the
internal fpi_device_add_timeout API for the workaround in order to
not rely on the default main context.
2021-04-28 22:16:37 +02:00
Benjamin Berg d683b271d4 ssm: Remove delayed action GCancellable integration
Unfortunately, the implementation was not thread safe and was not
sticking to the thread local main context.

In addition to this, it is not entirely clear to me how this API should
behave. The current approach is to simply cancel the transition with the
state machine halting in its current state. Instead, it could also make
sense for cancellation to cause the state machine to return a
G_IO_ERROR_CANCELLED.

As such, simply remove the feature for now. If anyone actually has a
good use-case then we can add it again.
2021-04-28 22:16:37 +02:00
Benjamin Berg 94e86875ae context: Remove idle sources and use thread local context
libfprint uses the thread local context in almost all cases. Update
FpContext to also use it and make sure that any sources are removed when
the FpContext object is finalized. Otherwise we may run into
use-after-free issues.
2021-04-28 22:16:37 +02:00
Benjamin Berg 511d456006 context: Use g_signal_connect_object for removal handling
Technically the API user might not keep the FpContext around after getting
the device object. Really bad idea, but we shouldn't rely on that.
2021-04-28 22:16:34 +02:00
Benjamin Berg 11e379050f goodixmoc: Ensure power button shield is always turned off
Use the new cleanup feature of the SSM to ensure that the power button
shield is turned off again even if the operation is cancelled.
2021-04-28 20:10:20 +00:00
Benjamin Berg 9416f91c75 ssm: Add cleanup state feature
In some situations one may want to guarantee that the last steps of an
SSM are run even when the SSM is completed early or failed.

This can easily be done by making fpi_ssm_mark_completed jump to the
next cleanup stage when called (this also includes mark_failed). Due to
the mechanism, it is still possible to explicitly jump cleanup states by
using fpi_ssm_jump_to_state, including a jump to the final state in
order to skip all cleanup states.
2021-04-28 20:10:20 +00:00
Benjamin Berg c4ae89575a ssm: Fix up the SSM documentation a bit 2021-04-28 20:10:20 +00:00
Benjamin Berg 04f6cac7ec elan: Add PID 0c63
Users are reporting that the sensor works fine.

Closes: #357
2021-04-28 22:04:16 +02:00
Benjamin Berg d2981fc6a4 elan: Add PID 0c4f
Users are reporting that the sensor works fine.
2021-04-28 22:04:16 +02:00
Benjamin Berg 8c9167d836 elan: Add PID 0c3d
Users are reporting that the sensor works fine.

Closes: #214
2021-04-28 15:26:05 +02:00
Marco Trevisan (Treviño) df36c66730 tod: Use dynamically defined version script
So we don't have to manage the soname manually
2021-04-14 18:15:07 +02:00
Marco Trevisan (Treviño) 35bcd4326c libfprint-tod.ver: Add new symbols to newer TOD subversion
This should be something to do every time, as it may allow to define
multiple symbol versions, if something changes upstream.
2021-04-14 18:14:35 +02:00
Marco Trevisan (Treviño) 00128e11fd README: Link to TOD README file 2021-04-13 22:35:34 +02:00
Marco Trevisan (Treviño) 81ecee3ead tests/tod-drivers: Add newly supported types 2021-04-13 22:35:34 +02:00
Marco Trevisan (Treviño) 18b3acdfb0 fpi-spi-transfer: Add structure padding 2021-04-13 22:35:34 +02:00
Marco Trevisan (Treviño) 1d7a561b0b tod-inspector: Add support reading features 2021-04-13 22:35:28 +02:00
Marco Trevisan (Treviño) a79a8d0e22 device: Keep device type ordering as default 2021-04-13 22:35:28 +02:00
Marco Trevisan (Treviño) 344d5cb2a9 fpi-device: Reduce padding on FpIdEntry to make space to new elements 2021-04-13 22:35:28 +02:00
Marco Trevisan (Treviño) c906b30cba tod: Add support for device features, keeping ABI compatibility 2021-04-13 22:35:28 +02:00
Marco Trevisan (Treviño) eb329903b4 test-fp-device-tod: Ignore deprecated functions and use new ones 2021-04-13 22:17:39 +02:00
Marco Trevisan (Treviño) 20ac5c10a4 Merge branch 'origin/master' into tod 2021-04-13 22:17:37 +02:00
Marco Trevisan (Treviño) 58756ab62e tests: Ensure that we don't break ABI with expected TODv1 structures
We can check whether each relevant structure element has not changed and
that the supported enum and flag values didn't change value.
2021-04-13 22:14:56 +02:00
Marco Trevisan (Treviño) e5e999de2c fpi-image: Add missing padding
This breaks the ABI with such TOD drivers, but we don't have any using
an image device so far, so it's a safe break.
2021-04-13 22:14:56 +02:00
Marco Trevisan (Treviño) 9aa3060d32 ci: Expose valgrind test logs 2021-04-13 19:39:50 +02:00
Marco Trevisan (Treviño) 9a1dcaa801 tests: Use native meson exec wrapper in test setups instead of our script
No need to provide a script that will break usage of `meson test --gdb`
when we can use a native and cleaner alternative.

We can then ignore LIBFPRINT_TEST_WRAPPER in basic tests, while it is
still needed by umockdev tests.
2021-04-13 19:38:58 +02:00
Marco Trevisan (Treviño) 683ac48e21 libfprint2-sections: Add missing FpFingerStatusFlags 2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño) 3b34fc9b5b ci: Expose coverage report and meson logs in MRs 2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño) 41f8737b48 device: Deprecate fp_device_{supports,has}_* functions for has_feature
We can avoid having multiple device feature-check functions now and
just rely on a few.

Add uncrustify config to properly handle begin/end deprecation macros.
2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño) ef805f2341 device: Expose supported features publicly as FpDeviceFeature
It can be convenient for device users to check what it supports, without
having multiple functions to check each single feature.

So expose this and add tests.
2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño) bd99f865d8 fp-device: Gracefully handle capture calls on devices with no support 2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño) 3717468a8a device: Make verification support optional
We always assumed a device can verify, but nothing prevents from having
a device that only can identify or capture.

So, given that we've more fine grained checks, let's stop the task if
this is the case.
2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño) 8d545a0b95 fpi-device: Add FpiDeviceFeature flags to FpDeviceClass
Allows drivers to define more fine grained features for devices, not
strictly depending on assumptions we can make depending on the
implemented vfuncs.

We keep this per class but could be in theory moved to each instance.

In any case, added an utility function to initialize it in the way we
can ensure that we've a consistent way for setting them across all the
devices.
2021-04-12 22:14:06 +02:00
Huan Wang 355957919e Add nb1010 driver 2021-04-12 20:24:13 +02:00
Matthew Mirvish 07778f6bfa upeksonly: fix double free in usb transfer cbs
Some USB transfer callbacks in this driver were freeing their transfer
buffer in their callbacks, which causes a double free since the transfer
itself frees them afterwards. Probably just got missed during the V2 api
changes.
2021-04-11 07:25:48 -04:00
Benjamin Berg 7fcce7891a spi-transfer: Add SPI transfer helper routines
These routines assume that any messages is composed of a write and/or
read part. While the API allows sending and receiving as part of one
messages/transfer, it does not permit full duplex operation where data is
both send and received at the same time.
2021-04-08 16:52:20 +00:00
Matthew Mirvish b0d9d00762 Add support for udev based device discovery
This is primarily useful for SPI devices. These devices sometimes needs
a combination of an SPI and HID device, so discovery is a bit more
complicated.
2021-04-08 17:08:53 +02:00
mincrmatt12 e95056aa86 fpi-image-device: Allow overriding of enroll stages 2021-04-06 18:51:50 -04:00
Matthias Klose 4f14b6e5b0 Import Debian changes 1:1.90.7+git20210222+tod1-0ubuntu2
libfprint (1:1.90.7+git20210222+tod1-0ubuntu2) hirsute; urgency=medium
.
  * Disable lto for now, failing test
    ibfprint:unit-tests+tod+fake_test_dev_tod_current / fpi-device-tod-fake_test_dev_tod_current
2021-04-02 00:51:06 +02:00
Marco Trevisan (Treviño) 9321791d0e ci: Do not use verbose logging for tests, just rely on artifacts
Only print errors if any
2021-04-01 18:01:29 +02:00
Marco Trevisan (Treviño) 4031bb62d7 device: Gracefully handle identify on devices with no support
We were crashing as trying to still call the identify vfunc, so check if
identification is supported and if not return a relative error.

Added test as well
2021-04-01 17:44:56 +02:00
Marco Trevisan (Treviño) 59767af552 doc/libfprint-2.types: Also include fp-image-device to get image type 2021-04-01 17:13:11 +02:00
Aris Lin 3fb8860dc4 synaptics: add new PID 0x100 and remove PID 0xE7 2021-03-21 17:08:34 +08:00
Benjamin Berg 03e0efe7ea doc: Add a few missing functions to documentation 2021-03-17 10:51:32 +01:00
Benjamin Berg df9483e723 doc: Remove symbol that does not exist
fpi_ssm_next_state_timeout_cb simply does not exist, remove it.
2021-03-17 10:44:29 +01:00
Benjamin Berg 870468c741 doc: Add .types file for signals and properties
Without this the signals/properties are simply missing from the
documentation, which is obviously not very useful.
2021-03-17 10:41:48 +01:00
Julius Piso 47223e551f Added test for vfs7552 2021-03-12 11:29:43 +01:00