Commit graph

1388 commits

Author SHA1 Message Date
Benjamin Berg 947420d2ce demo: Do not build udev_rules inside flatpak
This fixes flatpak generation after the new SPI related rule generation
has landet.
2021-06-25 09:54:00 +02:00
Benjamin Berg 793cad57f3 demo: Add libgudev into flatpak manifest
It is needed for SPI support.
2021-06-25 09:54:00 +02:00
Benjamin Berg f37e20b8a0 meson: Permit disabling (and forcing) installation of udev rules
In some cases (e.g. inside the flatpak), it does not make sense to
generate and install udev rules.
2021-06-25 09:54:00 +02:00
Benjamin Berg e2f199bb6a vfs301: Fix leak of USB transfer
vfs301_proto_peek_event would leak the returned transfer. Use a
g_autoptr to fix this.
2021-06-23 22:49:59 +02:00
Matthew Mirvish 059ab65081 tests: Add capture test for elanspi 2021-06-23 20:42:52 +00:00
Benjamin Berg 7893278cc6 tests: Add handling for SPI ioctl replay
This will only be supported with umockdev version 0.15.6.
2021-06-23 20:42:52 +00:00
Matthew Mirvish 0697191387 tests: Allow multiple mock devices per driver
Instead of only loading `DRIVER/device`, now we also load all files
matching device-*[!~] in the DRIVER folder..
2021-06-23 20:42:52 +00:00
Matthew Mirvish 8be666bb05 elanspi: Permit running in emulated environment
This removes the HID reset, which we cannot emulate currently and also
disabes the line timeout to as simulation might run too slowly at times.
2021-06-23 20:42:52 +00:00
Matthew Mirvish 019a294ec4 elanspi: Add driver supporting various ELAN SPI sensors
Closes: #339
2021-06-23 20:42:52 +00:00
Matthew Mirvish f6e80456d9 ci: Add gudev to dependencies 2021-06-23 20:42:52 +00:00
Benjamin Berg 51cab75b1e assembling: Fix copying only partial tile on overhang
If the tile in question was hanging over the left edge we would not be
copying the full available width. Fix this and change the test to catch
the error condition (by forcing a too small image and overlap both
ways).

Simplify the code by only selecting the starting point inside the
image/frame and then just checking the both image and frame boundary in
the loop. Not quite as efficient, but it really shouldn't matter too
much here.
2021-06-23 22:33:07 +02:00
boger 1ed2b23902 goodixmoc: add PID 609C/6584/658C/6592/659C
add some new PID support,
609C: Framework fingerprint sensor
65xx: Thinkpad series fingerprint sensor
2021-06-23 15:30:28 +08:00
Benjamin Berg 9dd72611bf list-udev-rules: Add udev rule generation for SPI 2021-06-22 19:13:48 +00:00
Benjamin Berg 4bcb55e412 meson: Fix indentation
Change tab indented areas to 4 spaces.
2021-06-22 19:13:48 +00:00
Benjamin Berg 5bda7aef38 ci: Use --status-bugs option for scan-build
This removes the need to check the output directory for files.
2021-06-22 19:54:42 +02:00
Benjamin Berg b4f564cafc spi-transfer: Keep CS asserted during long transfers
Long transfers need to be split into multiple chunks because of
limitations by the spidev kernel driver. If this happens, we need to
make sure that the CS line remains high between the different chunks.

Add code to split the transfer into chunks and ask the driver to not
deassert CS after the transfer. Technically, this is only an
optimization as concurrent access to another device might still cause
deselection. However, this should mean that devices work without having
to change the spidev module parameter.

Use the feature in the hope that it will work. However, print a message
(not a warning), to help with debugging in case someone does run into
issues because of this.
2021-06-21 22:24:58 +00:00
Matthew Mirvish a3f568db3d fp-context: Check hidraw VID/PID with udev instead of an ioctl
Previously, we checked hidraw devices against drivers by using the
HIDIOCGRAWINFO ioctl. While this works, it's not ideal for doing unit
tests since umockdev would have to implement hidraw ioctls.

The new approach uses the HID_ID property on the parent hid device,
which contains the VID/PID pair.
2021-06-21 13:39:24 -04:00
Benjamin Berg ba920aa41b goodixmoc: Remove internal cancellable
The driver has an internal cancellable that simply forwards the external
cancellation in the cancel callback. This is not really needed, we can
instead just use the external cancellable directly by fetching it using
fpi_device_get_cancellable().
2021-06-21 15:11:18 +00:00
Benjamin Berg db1e88138b meson: Add dependency to gobject-introspection
We seem to need this to build the introspection bindings.

Closes: #385
2021-06-21 17:07:16 +02:00
Benjamin Berg 7ff95dc39a tests: Add clear_storage related tests
Closes: #382
2021-06-21 16:50:18 +02:00
Benjamin Berg 098ff97edd drivers: Fix upekts/upek_proto license
The (trivial) CRC code was copied from gstreamer. However, the license
stated here was LGPLv2 rather than LGPLv2.1+. Identical code can currently
be found upstream in gstreamer licensed under LGPLv2+. As such, update
the license, making it more compatible with the rest of libfprint.

Also add the "or any later version" to upekts.c. The library was already
LGPL2.1+ at the time and libthinkfinger authors approved a license
change.
2021-06-17 13:08:19 +00:00
Benjamin Berg 90cbcd7fb5 tests: Update README to describe pcapng replay 2021-06-17 14:35:47 +02:00
Benjamin Berg 182367a079 tests: Use pcap recording for synaptics and test clear_storage 2021-06-17 14:35:47 +02:00
Benjamin Berg daaafc80c3 tests: Detect pcap vs. ioctl recording and run correct one 2021-06-17 14:21:08 +02:00
Benjamin Berg c989cc4b95 ci: Build umockdev from git for pcap replay support 2021-06-17 14:21:08 +02:00
Vincent Huang 0edae7b641 synaptics: Remove PID 0xE9 2021-06-17 08:00:47 +00:00
Vincent Huang 49e3963783 synaptics: Return success when deleting a print that doesn't exist in
the database or database empty
2021-06-16 15:53:46 +00:00
Aris Lin 040d0d34fd synaptics: Send a cancel to sensor if it returns busy
fix #380
2021-06-16 15:40:02 +00:00
Nelson Jeppesen 82c406dace goodixmoc: Add PID 6A94 2021-06-07 10:40:45 +00:00
Benjamin Berg 046607add6 device: Add void return type tag to fp_device_delete_print_sync
This way it matches the other _sync functions that return a boolean just
to show that an error was set.
2021-05-14 15:28:54 +00:00
Benjamin Berg 9c0cd3fb23 device: Move fp_device_clear_storage_sync into _sync block
Just so that all the _sync functions are together.
2021-05-14 15:28:54 +00:00
Benjamin Berg 439223cac3 virtual-device-storage: Actually clear storage when requested 2021-05-14 15:28:54 +00:00
Benjamin Berg 992a207ede virtual-device: Refactor command handling and add CONT command
This command is useful to immediately continue rather than waiting for
input. It is only useful for non-scanning device actions and can be
important when steps need to be explicitly skipped (e.g. to inject an
error in the second command without a way to wait in between).
2021-05-14 15:28:54 +00:00
Benjamin Berg ae6be6837b doc: Use includes from the source diretory
Before we try to use installed system includes, which is obviously not
the best idea.
2021-05-14 15:28:54 +00:00
Benjamin Berg 261ba3a4a4 meson: Add -Wswitch-enum
This would have caught the issue where we forgot to add
FPI_DEVICE_ACTION_CLEAR_STORAGE to fpi_device_action_error.
2021-05-14 15:28:54 +00:00
Benjamin Berg e9dddcc87a virtual-image: Fix compilation with -Wswitch-enum 2021-05-14 15:28:54 +00:00
Benjamin Berg 7e02f3faf9 virtual-device: Avoid/Fix -Wswitch-enum warnings 2021-05-14 15:28:54 +00:00
Benjamin Berg b61303500e utilities: Explicitly list default enum value 2021-05-14 15:28:54 +00:00
Benjamin Berg 668b3517a9 upeksonly: Explicit list default enum value 2021-05-14 15:28:54 +00:00
Benjamin Berg 657fe85c25 device: Add missing CLEAR_STORAGE to fpi_device_action_error
This was missed in the previous commit that added the support.
2021-05-14 15:28:54 +00:00
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