Compare commits

..

64 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
bebe8565cd Release 1.94.7 2024-02-20 01:09:54 +01:00
Marco Trevisan (Treviño)
5501dc7b47 build: Stop using deprecated dep.get_pkgconfig_variable() method
Use generic get_variable() instead
2024-02-20 01:02:00 +01:00
Marco Trevisan (Treviño)
3e5ab6fdad egismoc: Convert value check values to big endian only when needed
Since the driver seem to require a big-endian value it's just better
to use architecture native endianness to compute the check value and
eventually just convert to big endian as the chip wants.
2024-02-19 23:38:40 +01:00
Marco Trevisan (Treviño)
5462db9901 egismoc: Convert the check value to little endian
In this way we can support the big-endian architectures too.
2024-02-19 23:38:40 +01:00
Marco Trevisan (Treviño)
59dc585ccd egismoc: Simplify check bytes computation
We use big endian values for generating the check bytes, but we can do
the same logic in a simpler way.
2024-02-19 23:38:40 +01:00
Marco Trevisan (Treviño)
6768bd0ff4 egismoc: Use strictly sized types to hold check bytes contents
So we are sure about the size we're sending at compile time too.
2024-02-19 23:38:40 +01:00
Marco Trevisan (Treviño)
ed1815c3d9 build: Allow testing more drivers in both big and little endian
I've tested them in a s390x host and many more tests work fine, so let's
enable them.
2024-02-19 23:38:40 +01:00
Marco Trevisan (Treviño)
057c209beb build: Build-depend on glib 2.68
GLib 2.68 is now more than 3 years old, so we can definitely start
using it without thinking too much.

This allows us to drop lots of compat code that we had around.

And like the previous commit tells us, it will also help us to have
more correct code around.
2024-02-19 22:23:02 +01:00
Marco Trevisan (Treviño)
90c4afded4 cleanup: Use non-const pointers for non constant cases
We had various cases in which we were using const pointers for
non constant data, and in fact we were allocating and free'ing
them.

So let's handle all these case properly, so that we won't have
newer GLib complaining at us!
2024-02-19 22:14:14 +01:00
Marco Trevisan (Treviño)
f8f28a066b egismoc: Simplify fingerprint id and firmware reading
We can do copy and duplicate in oneshot since we are handling strings
after all.
2024-02-19 17:25:21 +01:00
Marco Trevisan (Treviño)
adc66edd8d egismoc: Implement suspension properly
In case of suspension we can't just cancel the operations but
also return when completed, and this may not happen immediately
if there are ongoing operations.

This is automagically handled by libfprint internals, but in order
to make it happen, we need to cancel the ongoing operations and then
mark it completed. libfprint will then wait for the task completion
before actually marking the device as suspended.
2024-02-19 17:21:58 +01:00
Marco Trevisan (Treviño)
9af211cc89 egismoc: Use device cancellable on transfers 2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
904bddd988 egismoc: Use g_new0 instead of g_malloc to make the type clearer 2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
8badfa84e9 egismoc: Assert that current transfer is unset when setting it
We need to ensure that we are not overwriting the instance transfer, so
that we can be sure that we are only doing one transfer at time.

Also we need to ensure that the ssm unsetting it, is the owner of it.
2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
b97efa6fed egismoc: Assert that task ssm is unset when setting it
We need to ensure that we are not overwriting the instance SSM, so that
we can be sure that we are only doing one operation at time.

Also we need to ensure that the task unsetting it, is the owner of it.
2024-02-19 17:12:12 +01:00
Joshua Grisham
591f9ad3cf egismoc: clear task pointers also after dev_init_done 2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
6767cd1a4f egismoc: Ensure that the command callback is after SSM is completed
We need to make sure that we won't trigger a callback when a SSM is
already in progress or we may end up overwriting it
2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
226b6abfab egismoc: Use an autopointer to cleanup error on command done callback 2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
9e2c14d64e egismoc: Clarify delete print ownership in delete callback 2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
92aeb53ee8 egismoc: Simplify egismoc identification stage handling 2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
87f68e3ac1 egismoc: Avoid gotos in init code, just handle the errors immediately 2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
8073a5dc34 egismoc: Remove unused increments
This is also to please static analyzer
2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
eb09156244 egismoc: Clear enrolled IDs using nicer GLib api 2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
b8cfb95b49 egismoc: Ensure we've enough null bytes at the end of strings 2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
a7843add0f egismoc: Do not initialize to zero twice 2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
b0f0322726 egismoc: Indentation and syntax fixes 2024-02-19 17:12:12 +01:00
Marco Trevisan (Treviño)
7476faba68 data, libfprint: Update list of unsupported drivers 2024-02-19 16:16:02 +01:00
Joshua Grisham
89ab54794e egismoc: added test and capture for 05a1 variant 2024-02-19 16:16:02 +01:00
Joshua Grisham
85da0e104b egismoc: add support for 1c7a:05a1 2024-02-19 16:16:02 +01:00
Joshua Grisham
47fe3668e4 egismoc: Return truncated text instead of null for description when using list 2024-02-19 16:16:02 +01:00
Joshua Grisham
7aae2181e2 egismoc: Add support for usernames longer than 8 chars 2024-02-19 16:16:02 +01:00
Joshua Grisham
a9269980eb egismoc: Fix crash during close 2024-02-19 16:16:02 +01:00
Joshua Grisham
0b9a64331f Initial commit of egismoc driver 2024-02-19 16:16:02 +01:00
Adam Jones
54ff730f0c Fix typo of libfprint in supported devices list
This also updates the title of the website page at https://fprint.freedesktop.org/supported-devices.html
2024-02-13 16:13:10 +00:00
Marco Trevisan (Treviño)
e05fbaa8ab realtek: Do not initialize variables in switch cases
Handles scan-build warning
2024-02-13 14:54:42 +00:00
Marco Trevisan (Treviño)
61f9346aaf realtek: Do not leak an error
Found by scan-build.
2024-02-13 14:54:42 +00:00
Marco Trevisan (Treviño)
d878148b5e ci: Expose scan build artifacts on failures
That's the only case we care about
2024-02-13 14:54:42 +00:00
Marco Trevisan (Treviño)
ee509c7ee6 libfprint/fprint-list-udev-hwdb: Update unsupported list from wiki 2024-02-13 15:28:53 +01:00
Marco Trevisan (Treviño)
2fa0975dec cleanup: Address some newer uncrustify syntax cleanups 2024-02-13 15:25:15 +01:00
Marco Trevisan (Treviño)
f3ab1f996f fp-context: use g_strv_contains instead of manual labor 2024-02-13 15:25:15 +01:00
Marco Trevisan (Treviño)
92c5fc4643 cleanup: Use allow/deny lists instead of color based ones
There was nothing racist on those names here (what? Do human races even
exist?!), but let's avoid any confusion.
2024-02-13 15:19:47 +01:00
Puspendu Banerjee
c64fa9c81b synaptics: Add new PID 0x0124 2024-02-13 14:45:47 +01:00
Marco Trevisan (Treviño)
85ec9ec5b2 ci: Allow flatpak failure
It's not a critical thing, so if it fails (as it does currently) we
should not block on that.
2024-02-13 14:42:18 +01:00
Marco Trevisan (Treviño)
b8933d8f81 fp-print: Do not check compile-time macros at runtime 2024-02-13 14:36:46 +01:00
xiaofei
631da4654f focaltechmoc:Support FocalTech moc devices
Supported UID: 0x2808
    Supported PIDs: 0x9E48, 0xD979, 0xa959
2024-02-13 14:34:12 +01:00
Mohammed Anas
1701d72ff9 tests: make mktemp command call work with Chimera Linux's mktemp
On Chimera Linux, which uses FreeBSD's userland tools, the original call
fails with the following error:

mktemp: mkstemp failed on /tmp/libfprint-XXXXXX.hwdb: Invalid argument

Moving the X's to the end of the template passed to `mktemp` fixes the
error, and also works with GNU's `mktemp`.
2024-01-22 15:52:46 +00:00
Mohammed Anas
d3ec9a80d3 tests: remove Bash dependency in favor of sh
The script works just fine with `sh`.

Also replace nonstandard `test` operator `==` with the standard `=`.

The other changes are mostly cosmetic.
2024-01-22 15:27:33 +00:00
Marco Trevisan (Treviño)
5a1253e37c fp-image: Do not start thread detection task thread if already running 2023-11-24 21:02:50 +01:00
Marco Trevisan (Treviño)
2b008b52d7 fp-image: Simplify minutiae detection tasks
We can just use a GTask to handle the detection while using the
finish function to process the results to the image, so that it
is more predictable when this happens and it does not depend on
a thread returning.

Also remove data duplication when possible, this class wasn't
fully safe anyway to be used concurrently, so there's no point
to copy data when not needed. Also added the hard constraint to
not proceed with minutiae detection if something else is already
doing this.

At the same time we can mark the task to finish early on
cancellation.
2023-11-21 16:43:04 +00:00
Marco Trevisan (Treviño)
83939abe10 fp-image: Add FP_IMAGE_NONE flags definition 2023-11-21 16:43:04 +00:00
Marco Trevisan (Treviño)
16d02b3ed5 fp-image: Remove unused ref_count flag
It's an object so we already ref-count it.
2023-11-21 16:43:04 +00:00
huan_huang
79be91831c drivers: add realtek rts5813 driver 2023-10-27 13:21:06 +00:00
Aris Lin
427139f347 synaptics: Add new PID 0x0106 2023-10-24 14:56:15 +08:00
Aris Lin
3ebd2c3f97 synaptics: Add new PID 0x0173 2023-10-19 14:25:09 +08:00
Marco Trevisan (Treviño)
2414dbdbd4 libfprint/fprint-list-udev-hwdb: Update unsupported devices from wiki 2023-09-27 19:44:37 +02:00
swbgdx
0eae0e8cc0 goodixmoc: Add PID 0x6582 2023-09-27 16:10:03 +00:00
Marco Trevisan (Treviño)
efba965b0c ci: Build flatpak using gnome master
Also bump dependencies versions
2023-09-27 17:47:38 +02:00
Marco Trevisan (Treviño)
26d2c77c3d ci: Allow manual flatpak build in any fork and MR 2023-09-27 17:29:24 +02:00
Marco Trevisan (Treviño)
eb01d7c97d ci: Fix building flatpak using GNOME 42 runtime
Use versioned ci template so we are sure what we're using
2023-09-27 17:10:31 +02:00
Vincent Huang
5bff5bfea6 synaptics: Add null check to prevent g_propagate_error assertion failure 2023-09-11 16:58:33 +08:00
Vincent Huang
206e92218c synaptics: fix enroll_identify problem after user reset database 2023-09-01 09:47:12 +00:00
Marco Trevisan (Treviño)
af3dca9003 tests/egis0570/capture.pcapng: Remove execution permission 2023-08-22 23:08:55 +00:00
Marco Trevisan (Treviño)
b924d715c9 ci: Move build dir during installed tests so we check that we don't use built artifacts 2023-08-21 14:19:27 +00:00
Marco Trevisan (Treviño)
1372d6f081 tests: Use native GTest utils to generate assets names 2023-08-21 14:19:27 +00:00
44 changed files with 7110 additions and 196 deletions

View File

@@ -22,7 +22,6 @@ variables:
FDO_DISTRIBUTION_VERSION: rawhide FDO_DISTRIBUTION_VERSION: rawhide
FDO_UPSTREAM_REPO: "libfprint/$CI_PROJECT_NAME" FDO_UPSTREAM_REPO: "libfprint/$CI_PROJECT_NAME"
FEDORA_IMAGE: "$CI_REGISTRY/libfprint/$CI_PROJECT_NAME/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG" FEDORA_IMAGE: "$CI_REGISTRY/libfprint/$CI_PROJECT_NAME/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG"
BUNDLE: "org.freedesktop.libfprint.Demo.flatpak"
LAST_ABI_BREAK: "056ea541ddc97f5806cffbd99a12dc87e4da3546" LAST_ABI_BREAK: "056ea541ddc97f5806cffbd99a12dc87e4da3546"
workflow: workflow:
@@ -125,17 +124,19 @@ test_installed:
script: script:
- meson setup _build --prefix=/usr -Ddrivers=all - meson setup _build --prefix=/usr -Ddrivers=all
- meson install -C _build - meson install -C _build
- mv _build _build_dir
- rm -rf tests
- gnome-desktop-testing-runner --list libfprint-2 - gnome-desktop-testing-runner --list libfprint-2
- gnome-desktop-testing-runner libfprint-2 - gnome-desktop-testing-runner libfprint-2
--report-directory=_build/installed-tests-report/failed/ --report-directory=_installed-tests-report/failed/
--log-directory=_build/installed-tests-report/logs/ --log-directory=_installed-tests-report/logs/
--parallel=0 --parallel=0
artifacts: artifacts:
expose_as: 'GNOME Tests Runner logs' expose_as: 'GNOME Tests Runner logs'
when: always when: always
paths: paths:
- _build/meson-logs - _build_dir/meson-logs
- _build/installed-tests-report - _installed-tests-report
expire_in: 1 week expire_in: 1 week
@@ -151,6 +152,7 @@ test_scan_build:
- SCANBUILD=$CI_PROJECT_DIR/.gitlab-ci/scan-build - SCANBUILD=$CI_PROJECT_DIR/.gitlab-ci/scan-build
ninja -C _build scan-build ninja -C _build scan-build
artifacts: artifacts:
when: on_failure
paths: paths:
- _build/meson-logs - _build/meson-logs
expire_in: 1 week expire_in: 1 week
@@ -176,27 +178,35 @@ test_unsupported_list:
flatpak: flatpak:
stage: flatpak stage: flatpak
extends: .flatpak extends: .flatpak@x86_64
# From https://gitlab.gnome.org/GNOME/gnome-runtime-images/container_registry
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:42
variables: variables:
MANIFEST_PATH: "demo/org.freedesktop.libfprint.Demo.json" MANIFEST_PATH: "demo/org.freedesktop.libfprint.Demo.json"
FLATPAK_MODULE: "libfprint" FLATPAK_MODULE: "libfprint"
APP_ID: "org.freedesktop.libfprint.Demo" APP_ID: "org.freedesktop.libfprint.Demo"
BUNDLE: "org.freedesktop.libfprint.Demo.flatpak"
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
# Build with any builder
tags: []
rules: rules:
- if: '$CI_PROJECT_PATH != "libfprint/libfprint"' - if: '$CI_PROJECT_PATH != "libfprint/libfprint"'
when: never when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "schedule"' - if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == "master"'
allow_failure: true
when: always when: always
- if: '$CI_COMMIT_TAG' - if: '$CI_COMMIT_TAG'
allow_failure: true
when: always when: always
# For any other (commit), allow manual run. # For any other (commit), allow manual run.
# This excludes MRs which would create a duplicate pipeline # This excludes MRs which would create a duplicate pipeline
- if: '$CI_COMMIT_BRANCH' - if: '$CI_COMMIT_BRANCH'
when: manual when: manual
allow_failure: true allow_failure: true
- if: '$CI_MERGE_REQUEST_ID'
when: manual
allow_failure: true
# CONTAINERS creation stage # CONTAINERS creation stage
.container_fedora_build_base: .container_fedora_build_base:

19
NEWS
View File

@@ -1,6 +1,21 @@
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.
2024-02-20: v1.94.7 release
Highlights:
* synaptics: fix enroll identify problem after user reset database.
* synaptics: New PIDs 0x0173, 0x0106, 0x0124.
* goodixmoc: New PID 0x6582.
* build: Do not require bash to build, only posix sh.
* fp-image: Simplify minutiae detection tasks.
* GLib 2.68 is now required to build libfprint.
New drivers:
* realtek (PID 0x5813).
* focaltech_moc (PIDs 0x9E48, 0xD979, 0xA959).
* egismoc (PIDs 0x0582, 0x05a1).
2023-08-17: v1.94.6 release 2023-08-17: v1.94.6 release
Highlights: Highlights:
@@ -357,7 +372,7 @@ tests of the drivers using umockdev.
- Mark fp_dscv_print functions as deprecated - Mark fp_dscv_print functions as deprecated
* Udev rules: * Udev rules:
- Add some unsupported devices to the whitelist - Add some unsupported devices to the allowlist
2017-05-14: v0.7.0 release 2017-05-14: v0.7.0 release
* Drivers: * Drivers:
@@ -407,7 +422,7 @@ tests of the drivers using umockdev.
- Fix possible race condition, and cancellation in uru4000 driver - Fix possible race condition, and cancellation in uru4000 driver
* Udev rules: * Udev rules:
- Add Microsoft keyboard to the suspend blacklist - Add Microsoft keyboard to the suspend denylist
* Plenty of build fixes * Plenty of build fixes

View File

@@ -77,6 +77,12 @@ usb:v1C7Ap0571*
ID_AUTOSUSPEND=1 ID_AUTOSUSPEND=1
ID_PERSIST=0 ID_PERSIST=0
# Supported by libfprint driver egismoc
usb:v1C7Ap0582*
usb:v1C7Ap05A1*
ID_AUTOSUSPEND=1
ID_PERSIST=0
# Supported by libfprint driver elan # Supported by libfprint driver elan
usb:v04F3p0903* usb:v04F3p0903*
usb:v04F3p0907* usb:v04F3p0907*
@@ -158,6 +164,13 @@ usb:v1C7Ap0603*
ID_AUTOSUSPEND=1 ID_AUTOSUSPEND=1
ID_PERSIST=0 ID_PERSIST=0
# Supported by libfprint driver focaltech_moc
usb:v2808p9E48*
usb:v2808pD979*
usb:v2808pA959*
ID_AUTOSUSPEND=1
ID_PERSIST=0
# Supported by libfprint driver fpcmoc # Supported by libfprint driver fpcmoc
usb:v10A5pFFE0* usb:v10A5pFFE0*
usb:v10A5pA305* usb:v10A5pA305*
@@ -186,6 +199,7 @@ usb:v27C6p63AC*
usb:v27C6p63BC* usb:v27C6p63BC*
usb:v27C6p63CC* usb:v27C6p63CC*
usb:v27C6p6496* usb:v27C6p6496*
usb:v27C6p6582*
usb:v27C6p6584* usb:v27C6p6584*
usb:v27C6p658C* usb:v27C6p658C*
usb:v27C6p6592* usb:v27C6p6592*
@@ -201,6 +215,11 @@ usb:v298Dp1010*
ID_AUTOSUSPEND=1 ID_AUTOSUSPEND=1
ID_PERSIST=0 ID_PERSIST=0
# Supported by libfprint driver realtek
usb:v0BDAp5813*
ID_AUTOSUSPEND=1
ID_PERSIST=0
# Supported by libfprint driver synaptics # Supported by libfprint driver synaptics
usb:v06CBp00BD* usb:v06CBp00BD*
usb:v06CBp00DF* usb:v06CBp00DF*
@@ -211,11 +230,14 @@ usb:v06CBp0100*
usb:v06CBp00F0* usb:v06CBp00F0*
usb:v06CBp0103* usb:v06CBp0103*
usb:v06CBp0123* usb:v06CBp0123*
usb:v06CBp0124*
usb:v06CBp0126* usb:v06CBp0126*
usb:v06CBp0129* usb:v06CBp0129*
usb:v06CBp0168* usb:v06CBp0168*
usb:v06CBp015F* usb:v06CBp015F*
usb:v06CBp0104* usb:v06CBp0104*
usb:v06CBp0173*
usb:v06CBp0106*
ID_AUTOSUSPEND=1 ID_AUTOSUSPEND=1
ID_PERSIST=0 ID_PERSIST=0
@@ -284,6 +306,7 @@ usb:v138Ap0091*
ID_PERSIST=0 ID_PERSIST=0
# Known unsupported devices # Known unsupported devices
usb:v047Dp00F2*
usb:v04E8p730B* usb:v04E8p730B*
usb:v04F3p036B* usb:v04F3p036B*
usb:v04F3p0C00* usb:v04F3p0C00*
@@ -291,12 +314,16 @@ usb:v04F3p0C4C*
usb:v04F3p0C57* usb:v04F3p0C57*
usb:v04F3p0C5E* usb:v04F3p0C5E*
usb:v04F3p0C5A* usb:v04F3p0C5A*
usb:v04F3p0C6C*
usb:v04F3p0C70* usb:v04F3p0C70*
usb:v04F3p0C72* usb:v04F3p0C72*
usb:v04F3p0C77*
usb:v04F3p2706* usb:v04F3p2706*
usb:v04F3p3032*
usb:v04F3p3057* usb:v04F3p3057*
usb:v04F3p3104* usb:v04F3p3104*
usb:v04F3p310D* usb:v04F3p310D*
usb:v04F3p3128*
usb:v06CBp0081* usb:v06CBp0081*
usb:v06CBp0088* usb:v06CBp0088*
usb:v06CBp008A* usb:v06CBp008A*
@@ -330,6 +357,7 @@ usb:v0BDAp5812*
usb:v10A5p0007* usb:v10A5p0007*
usb:v10A5p9200* usb:v10A5p9200*
usb:v10A5p9800* usb:v10A5p9800*
usb:v10A5pE340*
usb:v1188p9545* usb:v1188p9545*
usb:v138Ap0007* usb:v138Ap0007*
usb:v138Ap003A* usb:v138Ap003A*
@@ -342,12 +370,14 @@ usb:v138Ap0094*
usb:v138Ap0097* usb:v138Ap0097*
usb:v138Ap009D* usb:v138Ap009D*
usb:v138Ap00AB* usb:v138Ap00AB*
usb:v138Ap00A6*
usb:v147Ep1002* usb:v147Ep1002*
usb:v1491p0088* usb:v1491p0088*
usb:v16D1p1027* usb:v16D1p1027*
usb:v1C7Ap0300* usb:v1C7Ap0300*
usb:v1C7Ap0575* usb:v1C7Ap0575*
usb:v1C7Ap0576* usb:v1C7Ap0576*
usb:v1C7Ap0577*
usb:v27C6p5042* usb:v27C6p5042*
usb:v27C6p5110* usb:v27C6p5110*
usb:v27C6p5117* usb:v27C6p5117*
@@ -375,6 +405,8 @@ usb:v27C6p55B4*
usb:v27C6p5740* usb:v27C6p5740*
usb:v27C6p5E0A* usb:v27C6p5E0A*
usb:v27C6p581A* usb:v27C6p581A*
usb:v27C6p589A*
usb:v27C6p6382*
usb:v2808p9338* usb:v2808p9338*
usb:v2808p93A9* usb:v2808p93A9*
usb:v298Dp2020* usb:v298Dp2020*

View File

@@ -1,7 +1,7 @@
{ {
"app-id": "org.freedesktop.libfprint.Demo", "app-id": "org.freedesktop.libfprint.Demo",
"runtime": "org.gnome.Platform", "runtime": "org.gnome.Platform",
"runtime-version": "42", "runtime-version": "master",
"sdk": "org.gnome.Sdk", "sdk": "org.gnome.Sdk",
"command": "gtk-libfprint-test", "command": "gtk-libfprint-test",
"finish-args": [ "finish-args": [
@@ -38,24 +38,24 @@
{ {
"name": "libgusb", "name": "libgusb",
"buildsystem": "meson", "buildsystem": "meson",
"config-opts": [ "-Dtests=false", "-Dvapi=false", "-Ddocs=false", "-Dintrospection=false" ], "config-opts": [ "-Dtests=false", "-Dvapi=false", "-Ddocs=false" ],
"sources": [ "sources": [
{ {
"type": "archive", "type": "archive",
"url": "https://github.com/hughsie/libgusb/archive/0.3.0.tar.gz", "url": "https://github.com/hughsie/libgusb/releases/download/0.4.6/libgusb-0.4.6.tar.xz",
"sha256": "b36310f8405d5fd68f6caf4a829f7ab4c627b38fd3d02a139d411fce0f3a49f1" "sha256": "1b0422bdcd72183272ac42eec9398c5a0bc48a02f618fa3242c468cbbd003049"
} }
] ]
}, },
{ {
"name": "gudev", "name": "gudev",
"buildsystem": "meson", "buildsystem": "meson",
"config-opts": [ "-Dtests=disabled", "-Dintrospection=disabled" ], "config-opts": [ "-Dtests=disabled", "-Dintrospection=disabled", "-Dvapi=disabled" ],
"sources": [ "sources": [
{ {
"type": "archive", "type": "archive",
"url": "https://download.gnome.org/sources/libgudev/236/libgudev-236.tar.xz", "url": "https://download.gnome.org/sources/libgudev/238/libgudev-238.tar.xz",
"sha256": "e50369d06d594bae615eb7aeb787de304ebaad07a26d1043cef8e9c7ab7c9524" "sha256": "61266ab1afc9d73dbc60a8b2af73e99d2fdff47d99544d085760e4fa667b5dd1"
} }
] ]
}, },

View File

@@ -19,7 +19,7 @@ content_files = [
expand_content_files = content_files expand_content_files = content_files
glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix') glib_prefix = dependency('glib-2.0').get_variable(pkgconfig: 'prefix')
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html') docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html')

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,222 @@
/*
* Driver for Egis Technology (LighTuning) Match-On-Chip sensors
* Originally authored 2023 by Joshua Grisham <josh@joshuagrisham.com>
*
* Portions of code and logic inspired from the elanmoc libfprint driver
* which is copyright (C) 2021 Elan Microelectronics Inc (see elanmoc.c)
*
* Based on original reverse-engineering work by Joshua Grisham. The protocol has
* been reverse-engineered from captures of the official Windows driver, and by
* testing commands on the sensor with a multiplatform Python prototype driver:
* https://github.com/joshuagrisham/galaxy-book2-pro-linux/tree/main/fingerprint/
*
* 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 "fpi-device.h"
#include "fpi-ssm.h"
G_DECLARE_FINAL_TYPE (FpiDeviceEgisMoc, fpi_device_egismoc, FPI, DEVICE_EGISMOC, FpDevice)
#define EGISMOC_DRIVER_FULLNAME "Egis Technology (LighTuning) Match-on-Chip"
#define EGISMOC_DRIVER_CHECK_PREFIX_TYPE1 (1 << 0)
#define EGISMOC_DRIVER_CHECK_PREFIX_TYPE2 (1 << 1)
#define EGISMOC_EP_CMD_OUT (0x02 | FPI_USB_ENDPOINT_OUT)
#define EGISMOC_EP_CMD_IN (0x81 | FPI_USB_ENDPOINT_IN)
#define EGISMOC_EP_CMD_INTERRUPT_IN 0x83
#define EGISMOC_USB_CONTROL_TIMEOUT 5000
#define EGISMOC_USB_SEND_TIMEOUT 5000
#define EGISMOC_USB_RECV_TIMEOUT 5000
#define EGISMOC_USB_INTERRUPT_TIMEOUT 60000
#define EGISMOC_USB_IN_RECV_LENGTH 4096
#define EGISMOC_USB_INTERRUPT_IN_RECV_LENGTH 64
#define EGISMOC_ENROLL_TIMES 10
#define EGISMOC_MAX_ENROLL_NUM 10
#define EGISMOC_FINGERPRINT_DATA_SIZE 32
#define EGISMOC_LIST_RESPONSE_PREFIX_SIZE 14
#define EGISMOC_LIST_RESPONSE_SUFFIX_SIZE 2
/* standard prefixes for all read/writes */
static guchar egismoc_write_prefix[] = {'E', 'G', 'I', 'S', 0x00, 0x00, 0x00, 0x01};
static gsize egismoc_write_prefix_len = sizeof (egismoc_write_prefix) / sizeof (egismoc_write_prefix[0]);
static guchar egismoc_read_prefix[] = {'S', 'I', 'G', 'E', 0x00, 0x00, 0x00, 0x01};
static gsize egismoc_read_prefix_len = sizeof (egismoc_read_prefix) / sizeof (egismoc_read_prefix[0]);
/* hard-coded command payloads */
static guchar cmd_fw_version[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x0c};
static gsize cmd_fw_version_len = sizeof (cmd_fw_version) / sizeof (cmd_fw_version[0]);
static guchar rsp_fw_version_suffix[] = {0x90, 0x00};
static gsize rsp_fw_version_suffix_len = sizeof (rsp_fw_version_suffix) / sizeof (rsp_fw_version_suffix[0]);
static guchar cmd_list[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x19, 0x04, 0x00, 0x00, 0x01, 0x40};
static gsize cmd_list_len = sizeof (cmd_list) / sizeof (cmd_list[0]);
static guchar cmd_sensor_reset[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x1a, 0x00, 0x00};
static gsize cmd_sensor_reset_len = sizeof (cmd_sensor_reset) / sizeof (cmd_sensor_reset[0]);
static guchar cmd_sensor_check[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x17, 0x02, 0x00};
static gsize cmd_sensor_check_len = sizeof (cmd_sensor_check) / sizeof (cmd_sensor_check[0]);
static guchar cmd_sensor_identify[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x17, 0x01, 0x01};
static gsize cmd_sensor_identify_len = sizeof (cmd_sensor_identify) / sizeof (cmd_sensor_identify[0]);
static guchar rsp_identify_match_suffix[] = {0x90, 0x00};
static gsize rsp_identify_match_suffix_len = sizeof (rsp_identify_match_suffix) / sizeof (rsp_identify_match_suffix[0]);
static guchar rsp_identify_notmatch_suffix[] = {0x90, 0x04};
static gsize rsp_identify_notmatch_suffix_len = sizeof (rsp_identify_notmatch_suffix) / sizeof (rsp_identify_notmatch_suffix[0]);
static guchar cmd_sensor_enroll[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x17, 0x01, 0x00};
static gsize cmd_sensor_enroll_len = sizeof (cmd_sensor_enroll) / sizeof (cmd_sensor_enroll[0]);
static guchar cmd_enroll_starting[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x01, 0x00, 0x00, 0x00, 0x20};
static gsize cmd_enroll_starting_len = sizeof (cmd_enroll_starting) / sizeof (cmd_enroll_starting[0]);
static guchar cmd_sensor_start_capture[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x16, 0x02, 0x01};
static gsize cmd_sensor_start_capture_len = sizeof (cmd_sensor_start_capture) / sizeof (cmd_sensor_start_capture[0]);
static guchar cmd_read_capture[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x02, 0x02, 0x00, 0x00, 0x02};
static gsize cmd_read_capture_len = sizeof (cmd_read_capture) / sizeof (cmd_read_capture[0]);
static guchar rsp_read_success_prefix[] = {0x00, 0x00, 0x00, 0x04};
static gsize rsp_read_success_prefix_len = sizeof (rsp_read_success_prefix) / sizeof (rsp_read_success_prefix[0]);
static guchar rsp_read_success_suffix[] = {0x0a, 0x90, 0x00};
static gsize rsp_read_success_suffix_len = sizeof (rsp_read_success_suffix) / sizeof (rsp_read_success_suffix[0]);
static guchar rsp_read_offcenter_prefix[] = {0x00, 0x00, 0x00, 0x04};
static gsize rsp_read_offcenter_prefix_len = sizeof (rsp_read_offcenter_prefix) / sizeof (rsp_read_offcenter_prefix[0]);
static guchar rsp_read_offcenter_suffix[] = {0x0a, 0x64, 0x91};
static gsize rsp_read_offcenter_suffix_len = sizeof (rsp_read_offcenter_suffix) / sizeof (rsp_read_offcenter_suffix[0]);
static guchar rsp_read_dirty_prefix[] = {0x00, 0x00, 0x00, 0x02, 0x64};
static gsize rsp_read_dirty_prefix_len = sizeof (rsp_read_dirty_prefix) / sizeof (rsp_read_dirty_prefix[0]);
static guchar cmd_commit_starting[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x05, 0x00, 0x00, 0x00, 0x20};
static gsize cmd_commit_starting_len = sizeof (cmd_commit_starting) / sizeof (cmd_commit_starting[0]);
/* commands which exist on the device but are currently not used */
/*
static guchar cmd_sensor_cancel[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x16, 0x04, 0x00};
static gsize cmd_sensor_cancel_len = sizeof(cmd_sensor_cancel) / sizeof(cmd_sensor_cancel[0]);
static guchar cmd_sensor_verify[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x04, 0x01, 0x00};
static gsize cmd_sensor_verify_len = sizeof(cmd_sensor_verify) / sizeof(cmd_sensor_verify[0]);
static guchar cmd_read_verify[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x04, 0x02, 0x00};
static gsize cmd_read_verify_len = sizeof(cmd_read_verify) / sizeof(cmd_read_verify[0]);
*/
/* prefixes/suffixes and other things for dynamically created command payloads */
#define EGISMOC_CHECK_BYTES_LENGTH 2
#define EGISMOC_IDENTIFY_RESPONSE_PRINT_ID_OFFSET 46
#define EGISMOC_CMD_CHECK_SEPARATOR_LENGTH 32
static guchar cmd_new_print_prefix[] = {0x00, 0x00, 0x00, 0x27, 0x50, 0x16, 0x03, 0x00, 0x00, 0x00, 0x20};
static gsize cmd_new_print_prefix_len = sizeof (cmd_new_print_prefix) / sizeof (cmd_new_print_prefix[0]);
static guchar cmd_delete_prefix[] = {0x50, 0x18, 0x04, 0x00, 0x00};
static gsize cmd_delete_prefix_len = sizeof (cmd_delete_prefix) / sizeof (cmd_delete_prefix[0]);
static guchar rsp_delete_success_prefix[] = {0x00, 0x00, 0x00, 0x02, 0x90, 0x00};
static gsize rsp_delete_success_prefix_len = sizeof (rsp_delete_success_prefix) / sizeof (rsp_delete_success_prefix[0]);
static guchar cmd_check_prefix_type1[] = {0x50, 0x17, 0x03, 0x00, 0x00};
static gsize cmd_check_prefix_type1_len = sizeof (cmd_check_prefix_type1) / sizeof (cmd_check_prefix_type1[0]);
static guchar cmd_check_prefix_type2[] = {0x50, 0x17, 0x03, 0x80, 0x00};
static gsize cmd_check_prefix_type2_len = sizeof (cmd_check_prefix_type2) / sizeof (cmd_check_prefix_type2[0]);
static guchar cmd_check_suffix[] = {0x00, 0x40};
static gsize cmd_check_suffix_len = sizeof (cmd_check_suffix) / sizeof (cmd_check_suffix[0]);
static guchar rsp_check_not_yet_enrolled_suffix[] = {0x90, 0x04};
static gsize rsp_check_not_yet_enrolled_suffix_len = sizeof (rsp_check_not_yet_enrolled_suffix) / sizeof (rsp_check_not_yet_enrolled_suffix[0]);
/* SSM task states and various status enums */
typedef enum {
CMD_SEND,
CMD_GET,
CMD_STATES,
} CommandStates;
typedef enum {
DEV_INIT_CONTROL1,
DEV_INIT_CONTROL2,
DEV_INIT_CONTROL3,
DEV_INIT_CONTROL4,
DEV_INIT_CONTROL5,
DEV_GET_FW_VERSION,
DEV_INIT_STATES,
} DeviceInitStates;
typedef enum {
IDENTIFY_GET_ENROLLED_IDS,
IDENTIFY_CHECK_ENROLLED_NUM,
IDENTIFY_SENSOR_RESET,
IDENTIFY_SENSOR_IDENTIFY,
IDENTIFY_WAIT_FINGER,
IDENTIFY_SENSOR_CHECK,
IDENTIFY_CHECK,
IDENTIFY_COMPLETE_SENSOR_RESET,
IDENTIFY_COMPLETE,
IDENTIFY_STATES,
} IdentifyStates;
typedef enum {
ENROLL_GET_ENROLLED_IDS,
ENROLL_CHECK_ENROLLED_NUM,
ENROLL_SENSOR_RESET,
ENROLL_SENSOR_ENROLL,
ENROLL_WAIT_FINGER,
ENROLL_SENSOR_CHECK,
ENROLL_CHECK,
ENROLL_START,
ENROLL_CAPTURE_SENSOR_RESET,
ENROLL_CAPTURE_SENSOR_START_CAPTURE,
ENROLL_CAPTURE_WAIT_FINGER,
ENROLL_CAPTURE_READ_RESPONSE,
ENROLL_COMMIT_START,
ENROLL_COMMIT,
ENROLL_COMMIT_SENSOR_RESET,
ENROLL_COMPLETE,
ENROLL_STATES,
} EnrollStates;
typedef enum {
ENROLL_STATUS_DEVICE_FULL,
ENROLL_STATUS_DUPLICATE,
ENROLL_STATUS_PARTIAL_OK,
ENROLL_STATUS_RETRY,
ENROLL_STATUS_COMPLETE,
} EnrollStatus;
typedef enum {
LIST_GET_ENROLLED_IDS,
LIST_RETURN_ENROLLED_PRINTS,
LIST_STATES,
} ListStates;
typedef enum {
DELETE_GET_ENROLLED_IDS,
DELETE_DELETE,
DELETE_STATES,
} DeleteStates;

View File

@@ -50,9 +50,9 @@ elanmoc_compose_cmd (
const struct elanmoc_cmd *cmd_info const struct elanmoc_cmd *cmd_info
) )
{ {
g_autofree char *cmd_buf = NULL; g_autofree uint8_t *cmd_buf = NULL;
cmd_buf = g_malloc0 (cmd_info->cmd_len); cmd_buf = g_new0 (uint8_t, cmd_info->cmd_len);
if(cmd_info->cmd_len < ELAN_MAX_HDR_LEN) if(cmd_info->cmd_len < ELAN_MAX_HDR_LEN)
memcpy (cmd_buf, &cmd_info->cmd_header, cmd_info->cmd_len); memcpy (cmd_buf, &cmd_info->cmd_header, cmd_info->cmd_len);
else else

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
/*
* Copyright (C) 2021 Focaltech Microelectronics
*
* 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 "fpi-device.h"
#include "fpi-ssm.h"
#include <libusb.h>
#include <stdio.h>
#include <stdlib.h>
G_DECLARE_FINAL_TYPE (FpiDeviceFocaltechMoc, fpi_device_focaltech_moc, FPI, DEVICE_FOCALTECH_MOC, FpDevice)
#define FOCALTECH_MOC_DRIVER_FULLNAME "Focaltech MOC Sensors"
#define FOCALTECH_MOC_CMD_TIMEOUT 1000
#define FOCALTECH_MOC_MAX_FINGERS 10
#define FOCALTECH_MOC_UID_PREFIX_LENGTH 8
#define FOCALTECH_MOC_USER_ID_LENGTH 64
typedef void (*FocaltechCmdMsgCallback) (FpiDeviceFocaltechMoc *self,
GError *error);
struct _FpiDeviceFocaltechMoc
{
FpDevice parent;
FpiSsm *task_ssm;
FpiSsm *cmd_ssm;
FpiUsbTransfer *cmd_transfer;
gboolean cmd_cancelable;
gsize cmd_len_in;
int num_frames;
int delete_slot;
guint8 bulk_in_ep;
guint8 bulk_out_ep;
};

View File

@@ -1374,6 +1374,7 @@ gx_fp_probe (FpDevice *device)
case 0x63AC: case 0x63AC:
case 0x63BC: case 0x63BC:
case 0x63CC: case 0x63CC:
case 0x6582:
case 0x6A94: case 0x6A94:
case 0x659A: case 0x659A:
self->max_enroll_stage = 12; self->max_enroll_stage = 12;
@@ -1623,6 +1624,7 @@ static const FpIdEntry id_table[] = {
{ .vid = 0x27c6, .pid = 0x63BC, }, { .vid = 0x27c6, .pid = 0x63BC, },
{ .vid = 0x27c6, .pid = 0x63CC, }, { .vid = 0x27c6, .pid = 0x63CC, },
{ .vid = 0x27c6, .pid = 0x6496, }, { .vid = 0x27c6, .pid = 0x6496, },
{ .vid = 0x27c6, .pid = 0x6582, },
{ .vid = 0x27c6, .pid = 0x6584, }, { .vid = 0x27c6, .pid = 0x6584, },
{ .vid = 0x27c6, .pid = 0x658C, }, { .vid = 0x27c6, .pid = 0x658C, },
{ .vid = 0x27c6, .pid = 0x6592, }, { .vid = 0x27c6, .pid = 0x6592, },

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,220 @@
/*
* Copyright (C) 2022-2023 Realtek Corp.
*
* 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 "fpi-device.h"
#include "fpi-ssm.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#define EP_IN (2 | FPI_USB_ENDPOINT_IN)
#define EP_OUT (1 | FPI_USB_ENDPOINT_OUT)
#define EP_IN_MAX_BUF_SIZE 2048
#define FP_RTK_CMD_TOTAL_LEN 12
#define FP_RTK_CMD_LEN 2
#define FP_RTK_CMD_PARAM_LEN 4
#define FP_RTK_CMD_ADDR_LEN 4
#define FP_RTK_CMD_DATA_LEN 2
#define TEMPLATE_LEN 35
#define SUBFACTOR_OFFSET 2
#define UID_OFFSET 3
#define UID_PAYLOAD_LEN 32
/* Command transfer timeout :ms*/
#define CMD_TIMEOUT 1000
#define DATA_TIMEOUT 5000
#define STATUS_TIMEOUT 2000
#define MAX_ENROLL_SAMPLES 8
#define DEFAULT_UID_LEN 28
#define SUB_FINGER_01 0xFF
#define GET_CMD_TYPE(val) ((val & 0xC0) >> 6)
#define GET_TRANS_DATA_LEN(len_h, len_l) ((len_h << 8) | len_l)
#define GET_LEN_L(total_data_len) ((total_data_len) & 0xff)
#define GET_LEN_H(total_data_len) ((total_data_len) >> 8)
G_DECLARE_FINAL_TYPE (FpiDeviceRealtek, fpi_device_realtek, FPI, DEVICE_REALTEK, FpDevice)
typedef void (*SynCmdMsgCallback) (FpiDeviceRealtek *self,
uint8_t *buffer_in,
GError *error);
typedef struct
{
SynCmdMsgCallback callback;
} CommandData;
typedef enum {
FP_RTK_CMD_ONLY = 0,
FP_RTK_CMD_READ,
FP_RTK_CMD_WRITE,
} FpRtkCmdType;
typedef enum {
FP_RTK_MSG_PLAINTEXT = 0,
FP_RTK_MSG_PLAINTEXT_NO_STATUS,
} FpRtkMsgType;
typedef enum {
FP_RTK_PURPOSE_IDENTIFY = 0x01, /* identify before enroll */
FP_RTK_PURPOSE_VERIFY = 0x02,
FP_RTK_PURPOSE_ENROLL = 0x04,
} FpRtkPurpose;
typedef enum {
FP_RTK_SUCCESS = 0x0,
FP_RTK_TOO_HIGH,
FP_RTK_TOO_LOW,
FP_RTK_TOO_LEFT,
FP_RTK_TOO_RIGHT,
FP_RTK_TOO_FAST,
FP_RTK_TOO_SLOW,
FP_RTK_POOR_QUALITY,
FP_RTK_TOO_SKEWED,
FP_RTK_TOO_SHORT,
FP_RTK_MERGE_FAILURE,
FP_RTK_MATCH_FAIL,
FP_RTK_CMD_ERR,
} FpRtkInStatus;
typedef enum {
FP_RTK_ENROLL_GET_TEMPLATE = 0,
FP_RTK_ENROLL_BEGIN_POS,
FP_RTK_ENROLL_CAPTURE,
FP_RTK_ENROLL_FINISH_CAPTURE,
FP_RTK_ENROLL_ACCEPT_SAMPLE,
FP_RTK_ENROLL_CHECK_DUPLICATE,
FP_RTK_ENROLL_COMMIT,
FP_RTK_ENROLL_NUM_STATES,
} FpRtkEnrollState;
typedef enum {
FP_RTK_VERIFY_CAPTURE = 0,
FP_RTK_VERIFY_FINISH_CAPTURE,
FP_RTK_VERIFY_ACCEPT_SAMPLE,
FP_RTK_VERIFY_INDENTIFY_FEATURE,
FP_RTK_VERIFY_UPDATE_TEMPLATE,
FP_RTK_VERIFY_NUM_STATES,
} FpRtkVerifyState;
typedef enum {
FP_RTK_DELETE_GET_POS = 0,
FP_RTK_DELETE_PRINT,
FP_RTK_DELETE_NUM_STATES,
} FpRtkDeleteState;
typedef enum {
FP_RTK_INIT_SELECT_OS = 0,
FP_RTK_INIT_GET_ENROLL_NUM,
FP_RTK_INIT_NUM_STATES,
} FpRtkInitState;
typedef enum {
FP_RTK_CMD_SEND = 0,
FP_RTK_CMD_TRANS_DATA,
FP_RTK_CMD_GET_STATUS,
FP_RTK_CMD_NUM_STATES,
} FpRtkCmdState;
struct _FpiDeviceRealtek
{
FpDevice parent;
FpiSsm *task_ssm;
FpiSsm *cmd_ssm;
FpiUsbTransfer *cmd_transfer;
FpiUsbTransfer *data_transfer;
gint cmd_type;
FpRtkMsgType message_type;
gboolean cmd_cancellable;
gint enroll_stage;
gint max_enroll_stage;
guchar *read_data;
gsize trans_data_len;
FpRtkPurpose fp_purpose;
gint pos_index;
gint template_num;
};
struct realtek_fp_cmd
{
uint8_t cmd[FP_RTK_CMD_LEN];
uint8_t param[FP_RTK_CMD_PARAM_LEN];
uint8_t addr[FP_RTK_CMD_ADDR_LEN];
uint8_t data_len[FP_RTK_CMD_DATA_LEN];
};
static struct realtek_fp_cmd co_start_capture = {
.cmd = {0x05, 0x05},
};
static struct realtek_fp_cmd co_finish_capture = {
.cmd = {0x45, 0x06},
.data_len = {0x05},
};
static struct realtek_fp_cmd co_accept_sample = {
.cmd = {0x45, 0x08},
.data_len = {0x09},
};
static struct realtek_fp_cmd tls_identify_feature = {
.cmd = {0x45, 0x22},
.data_len = {0x2A},
};
static struct realtek_fp_cmd co_get_enroll_num = {
.cmd = {0x45, 0x0d},
.data_len = {0x02},
};
static struct realtek_fp_cmd co_get_template = {
.cmd = {0x45, 0x0E},
};
static struct realtek_fp_cmd tls_enroll_begin = {
.cmd = {0x05, 0x20},
};
static struct realtek_fp_cmd co_check_duplicate = {
.cmd = {0x45, 0x10},
.data_len = {0x22},
};
static struct realtek_fp_cmd tls_enroll_commit = {
.cmd = {0x85, 0x21},
.data_len = {0x20},
};
static struct realtek_fp_cmd co_update_template = {
.cmd = {0x05, 0x11},
};
static struct realtek_fp_cmd co_delete_record = {
.cmd = {0x05, 0x0F},
};
static struct realtek_fp_cmd co_select_system = {
.cmd = {0x05, 0x13},
};

View File

@@ -40,11 +40,14 @@ static const FpIdEntry id_table[] = {
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00F0, }, { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00F0, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0103, }, { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0103, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0123, }, { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0123, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0124, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0126, }, { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0126, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0129, }, { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0129, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0168, }, { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0168, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x015F, }, { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x015F, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0104, }, { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0104, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0173, },
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0106, },
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */ { .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
}; };
@@ -106,7 +109,11 @@ cmd_receive_cb (FpiUsbTransfer *transfer,
if (self->cmd_complete_on_removal) if (self->cmd_complete_on_removal)
{ {
fpi_ssm_mark_completed (transfer->ssm); if (self->delay_error)
fpi_ssm_mark_failed (transfer->ssm,
g_steal_pointer (&self->delay_error));
else
fpi_ssm_mark_completed (transfer->ssm);
return; return;
} }
} }
@@ -641,18 +648,21 @@ verify (FpDevice *device)
} }
static void static void
identify_complete_after_finger_removal (FpiDeviceSynaptics *self) identify_complete_after_finger_removal (FpiDeviceSynaptics *self, GError *error)
{ {
FpDevice *device = FP_DEVICE (self); FpDevice *device = FP_DEVICE (self);
if (self->finger_on_sensor) if (self->finger_on_sensor)
{ {
fp_dbg ("delaying identify report until after finger removal!"); fp_dbg ("delaying identify report until after finger removal!");
if (error)
g_propagate_error (&self->delay_error, error);
self->cmd_complete_on_removal = TRUE; self->cmd_complete_on_removal = TRUE;
} }
else else
{ {
fpi_device_identify_complete (device, NULL); fpi_device_identify_complete (device, error);
} }
} }
@@ -702,19 +712,18 @@ identify_msg_cb (FpiDeviceSynaptics *self,
fp_info ("Match error occurred"); fp_info ("Match error occurred");
fpi_device_identify_report (device, NULL, NULL, fpi_device_identify_report (device, NULL, NULL,
fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL)); fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL));
identify_complete_after_finger_removal (self); identify_complete_after_finger_removal (self, NULL);
} }
else if (resp->result == BMKT_FP_NO_MATCH) else if (resp->result == BMKT_FP_NO_MATCH)
{ {
fp_info ("Print didn't match"); fp_info ("Print didn't match");
fpi_device_identify_report (device, NULL, NULL, NULL); fpi_device_identify_report (device, NULL, NULL, NULL);
identify_complete_after_finger_removal (self); identify_complete_after_finger_removal (self, NULL);
} }
else if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS) else if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS || resp->result == BMKT_FP_DATABASE_EMPTY)
{ {
fp_info ("Print is not in database"); fp_info ("Print is not in database");
fpi_device_identify_complete (device, identify_complete_after_finger_removal (self, fpi_device_error_new (FP_DEVICE_ERROR_DATA_NOT_FOUND));
fpi_device_error_new (FP_DEVICE_ERROR_DATA_NOT_FOUND));
} }
else else
{ {
@@ -750,7 +759,7 @@ identify_msg_cb (FpiDeviceSynaptics *self,
else else
fpi_device_identify_report (device, NULL, print, NULL); fpi_device_identify_report (device, NULL, print, NULL);
identify_complete_after_finger_removal (self); identify_complete_after_finger_removal (self, NULL);
} }
} }
} }

View File

@@ -127,4 +127,5 @@ struct _FpiDeviceSynaptics
struct syna_enroll_resp_data enroll_resp_data; struct syna_enroll_resp_data enroll_resp_data;
syna_state_t state; syna_state_t state;
GError *delay_error;
}; };

View File

@@ -67,32 +67,26 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 }; static guint signals[LAST_SIGNAL] = { 0 };
static const char * static const char *
get_drivers_whitelist_env (void) get_drivers_allowlist_env (void)
{ {
return g_getenv ("FP_DRIVERS_WHITELIST"); return g_getenv ("FP_DRIVERS_ALLOWLIST");
} }
static gboolean static gboolean
is_driver_allowed (const gchar *driver) is_driver_allowed (const gchar *driver)
{ {
g_auto(GStrv) whitelisted_drivers = NULL; g_auto(GStrv) allowlisted_drivers = NULL;
const char *fp_drivers_whitelist_env; const char *fp_drivers_allowlist_env;
int i;
g_return_val_if_fail (driver, TRUE); g_return_val_if_fail (driver, TRUE);
fp_drivers_whitelist_env = get_drivers_whitelist_env (); fp_drivers_allowlist_env = get_drivers_allowlist_env ();
if (!fp_drivers_whitelist_env) if (!fp_drivers_allowlist_env)
return TRUE; return TRUE;
whitelisted_drivers = g_strsplit (fp_drivers_whitelist_env, ":", -1); allowlisted_drivers = g_strsplit (fp_drivers_allowlist_env, ":", -1);
return g_strv_contains ((const gchar * const *) allowlisted_drivers, driver);
for (i = 0; whitelisted_drivers[i]; ++i)
if (g_strcmp0 (driver, whitelisted_drivers[i]) == 0)
return TRUE;
return FALSE;
} }
typedef struct typedef struct
@@ -364,7 +358,7 @@ fp_context_init (FpContext *self)
priv->drivers = fpi_get_driver_types (); priv->drivers = fpi_get_driver_types ();
if (get_drivers_whitelist_env ()) if (get_drivers_allowlist_env ())
{ {
for (i = 0; i < priv->drivers->len;) for (i = 0; i < priv->drivers->len;)
{ {

View File

@@ -44,7 +44,7 @@ typedef struct
FpDeviceType type; FpDeviceType type;
GUsbDevice *usb_device; GUsbDevice *usb_device;
const gchar *virtual_env; gchar *virtual_env;
struct struct
{ {
gchar *spidev_path; gchar *spidev_path;

View File

@@ -160,60 +160,65 @@ fp_image_init (FpImage *self)
typedef struct typedef struct
{ {
GAsyncReadyCallback user_cb;
struct fp_minutiae *minutiae; struct fp_minutiae *minutiae;
gint width, height;
gdouble ppmm;
FpiImageFlags flags;
guchar *image;
guchar *binarized; guchar *binarized;
} DetectMinutiaeData; FpiImageFlags flags;
unsigned char *image;
gboolean image_changed;
} DetectMinutiaeNbisData;
static void static void
fp_image_detect_minutiae_free (DetectMinutiaeData *data) fp_image_detect_minutiae_free (DetectMinutiaeNbisData *data)
{ {
g_clear_pointer (&data->image, g_free);
g_clear_pointer (&data->minutiae, free_minutiae); g_clear_pointer (&data->minutiae, free_minutiae);
g_clear_pointer (&data->binarized, g_free); g_clear_pointer (&data->binarized, g_free);
if (data->image_changed)
g_clear_pointer (&data->image, g_free);
g_free (data); g_free (data);
} }
static void G_DEFINE_AUTOPTR_CLEANUP_FUNC (DetectMinutiaeNbisData, fp_image_detect_minutiae_free)
fp_image_detect_minutiae_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data) static gboolean
fp_image_detect_minutiae_nbis_finish (FpImage *self,
GTask *task,
GError **error)
{ {
GTask *task = G_TASK (res); g_autoptr(DetectMinutiaeNbisData) data = NULL;
FpImage *image;
DetectMinutiaeData *data = g_task_get_task_data (task);
if (!g_task_had_error (task)) data = g_task_propagate_pointer (task, error);
if (data != NULL)
{ {
gint i; self->flags = data->flags;
image = FP_IMAGE (source_object);
image->flags = data->flags; if (data->image_changed)
{
g_clear_pointer (&self->data, g_free);
self->data = g_steal_pointer (&data->image);
}
g_clear_pointer (&image->data, g_free); g_clear_pointer (&self->binarized, g_free);
image->data = g_steal_pointer (&data->image); self->binarized = g_steal_pointer (&data->binarized);
g_clear_pointer (&image->binarized, g_free); g_clear_pointer (&self->minutiae, g_ptr_array_unref);
image->binarized = g_steal_pointer (&data->binarized); self->minutiae = g_ptr_array_new_full (data->minutiae->num,
(GDestroyNotify) free_minutia);
g_clear_pointer (&image->minutiae, g_ptr_array_unref); for (int i = 0; i < data->minutiae->num; i++)
image->minutiae = g_ptr_array_new_full (data->minutiae->num, g_ptr_array_add (self->minutiae,
(GDestroyNotify) free_minutia);
for (i = 0; i < data->minutiae->num; i++)
g_ptr_array_add (image->minutiae,
g_steal_pointer (&data->minutiae->list[i])); g_steal_pointer (&data->minutiae->list[i]));
/* Don't let it delete anything. */ /* Don't let free_minutiae delete the minutiae that we now own. */
data->minutiae->num = 0; data->minutiae->num = 0;
return TRUE;
} }
if (data->user_cb) return FALSE;
data->user_cb (source_object, res, user_data);
} }
static void static void
@@ -266,70 +271,83 @@ invert_colors (guint8 *data, gint width, gint height)
} }
static void static void
fp_image_detect_minutiae_thread_func (GTask *task, fp_image_detect_minutiae_nbis_thread_func (GTask *task,
gpointer source_object, gpointer source_object,
gpointer task_data, gpointer task_data,
GCancellable *cancellable) GCancellable *cancellable)
{ {
g_autoptr(GTimer) timer = NULL; g_autoptr(GTimer) timer = NULL;
DetectMinutiaeData *data = task_data; g_autoptr(DetectMinutiaeNbisData) ret_data = NULL;
struct fp_minutiae *minutiae = NULL; g_autoptr(GTask) thread_task = g_steal_pointer (&task);
g_autofree gint *direction_map = NULL; g_autofree gint *direction_map = NULL;
g_autofree gint *low_contrast_map = NULL; g_autofree gint *low_contrast_map = NULL;
g_autofree gint *low_flow_map = NULL; g_autofree gint *low_flow_map = NULL;
g_autofree gint *high_curve_map = NULL; g_autofree gint *high_curve_map = NULL;
g_autofree gint *quality_map = NULL; g_autofree gint *quality_map = NULL;
g_autofree guchar *bdata = NULL; g_autofree LFSPARMS *lfsparms = NULL;
FpImage *self = source_object;
FpiImageFlags minutiae_flags;
unsigned char *image;
gint map_w, map_h; gint map_w, map_h;
gint bw, bh, bd; gint bw, bh, bd;
gint r; gint r;
g_autofree LFSPARMS *lfsparms = NULL;
image = self->data;
minutiae_flags = self->flags & ~(FPI_IMAGE_H_FLIPPED |
FPI_IMAGE_V_FLIPPED |
FPI_IMAGE_COLORS_INVERTED);
if (minutiae_flags != FPI_IMAGE_NONE)
image = g_memdup2 (self->data, self->width * self->height);
ret_data = g_new0 (DetectMinutiaeNbisData, 1);
ret_data->flags = minutiae_flags;
ret_data->image = image;
ret_data->image_changed = image != self->data;
/* Normalize the image first */ /* Normalize the image first */
if (data->flags & FPI_IMAGE_H_FLIPPED) if (self->flags & FPI_IMAGE_H_FLIPPED)
hflip (data->image, data->width, data->height); hflip (image, self->width, self->height);
if (data->flags & FPI_IMAGE_V_FLIPPED) if (self->flags & FPI_IMAGE_V_FLIPPED)
vflip (data->image, data->width, data->height); vflip (image, self->width, self->height);
if (data->flags & FPI_IMAGE_COLORS_INVERTED) if (self->flags & FPI_IMAGE_COLORS_INVERTED)
invert_colors (data->image, data->width, data->height); invert_colors (image, self->width, self->height);
data->flags &= ~(FPI_IMAGE_H_FLIPPED | FPI_IMAGE_V_FLIPPED | FPI_IMAGE_COLORS_INVERTED);
lfsparms = g_memdup2 (&g_lfsparms_V2, sizeof (LFSPARMS)); lfsparms = g_memdup2 (&g_lfsparms_V2, sizeof (LFSPARMS));
lfsparms->remove_perimeter_pts = data->flags & FPI_IMAGE_PARTIAL ? TRUE : FALSE; lfsparms->remove_perimeter_pts = minutiae_flags & FPI_IMAGE_PARTIAL ? TRUE : FALSE;
timer = g_timer_new (); timer = g_timer_new ();
r = get_minutiae (&minutiae, &quality_map, &direction_map, r = get_minutiae (&ret_data->minutiae, &quality_map, &direction_map,
&low_contrast_map, &low_flow_map, &high_curve_map, &low_contrast_map, &low_flow_map, &high_curve_map,
&map_w, &map_h, &bdata, &bw, &bh, &bd, &map_w, &map_h, &ret_data->binarized, &bw, &bh, &bd,
data->image, data->width, data->height, 8, image, self->width, self->height, 8,
data->ppmm, lfsparms); self->ppmm, lfsparms);
g_timer_stop (timer); g_timer_stop (timer);
fp_dbg ("Minutiae scan completed in %f secs", g_timer_elapsed (timer, NULL)); fp_dbg ("Minutiae scan completed in %f secs", g_timer_elapsed (timer, NULL));
data->binarized = g_steal_pointer (&bdata); if (g_task_had_error (thread_task))
data->minutiae = minutiae; return;
if (r) if (r)
{ {
fp_err ("get minutiae failed, code %d", r); fp_err ("get minutiae failed, code %d", r);
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "Minutiae scan failed with code %d", r); g_task_return_new_error (thread_task, G_IO_ERROR,
g_object_unref (task); G_IO_ERROR_FAILED,
"Minutiae scan failed with code %d", r);
return; return;
} }
if (!data->minutiae || data->minutiae->num == 0) if (!ret_data->minutiae || ret_data->minutiae->num == 0)
{ {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, g_task_return_new_error (thread_task, G_IO_ERROR, G_IO_ERROR_FAILED,
"No minutiae found"); "No minutiae found");
g_object_unref (task);
return; return;
} }
g_task_return_boolean (task, TRUE); g_task_return_pointer (thread_task, g_steal_pointer (&ret_data),
g_object_unref (task); (GDestroyNotify) fp_image_detect_minutiae_free);
} }
/** /**
@@ -445,21 +463,25 @@ fp_image_detect_minutiae (FpImage *self,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GTask *task; g_autoptr(GTask) task = NULL;
DetectMinutiaeData *data = g_new0 (DetectMinutiaeData, 1);
task = g_task_new (self, cancellable, fp_image_detect_minutiae_cb, user_data); g_return_if_fail (FP_IS_IMAGE (self));
g_return_if_fail (callback != NULL);
data->image = g_malloc (self->width * self->height); task = g_task_new (self, cancellable, callback, user_data);
memcpy (data->image, self->data, self->width * self->height); g_task_set_source_tag (task, fp_image_detect_minutiae);
data->flags = self->flags; g_task_set_check_cancellable (task, TRUE);
data->width = self->width;
data->height = self->height;
data->ppmm = self->ppmm;
data->user_cb = callback;
g_task_set_task_data (task, data, (GDestroyNotify) fp_image_detect_minutiae_free); if (!g_atomic_int_compare_and_exchange (&self->detection_in_progress,
g_task_run_in_thread (task, fp_image_detect_minutiae_thread_func); FALSE, TRUE))
{
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_ADDRESS_IN_USE,
"Minutiae detection is already in progress");
return;
}
g_task_run_in_thread (g_steal_pointer (&task),
fp_image_detect_minutiae_nbis_thread_func);
} }
/** /**
@@ -477,7 +499,27 @@ fp_image_detect_minutiae_finish (FpImage *self,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
return g_task_propagate_boolean (G_TASK (result), error); GTask *task;
gboolean changed;
g_return_val_if_fail (FP_IS_IMAGE (self), FALSE);
g_return_val_if_fail (g_task_is_valid (result, self), FALSE);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) ==
fp_image_detect_minutiae, FALSE);
task = G_TASK (result);
changed = g_atomic_int_compare_and_exchange (&self->detection_in_progress,
TRUE, FALSE);
g_assert (changed);
if (g_task_had_error (task))
{
gpointer data = g_task_propagate_pointer (task, error);
g_assert (data == NULL);
return FALSE;
}
return fp_image_detect_minutiae_nbis_finish (self, task, error);
} }
/** /**

View File

@@ -721,13 +721,12 @@ fp_print_serialize (FpPrint *print,
result = g_variant_builder_end (&builder); result = g_variant_builder_end (&builder);
if (G_BYTE_ORDER == G_BIG_ENDIAN) #if (G_BYTE_ORDER == G_BIG_ENDIAN)
{ GVariant *tmp;
GVariant *tmp; tmp = g_variant_byteswap (result);
tmp = g_variant_byteswap (result); g_variant_unref (result);
g_variant_unref (result); result = tmp;
result = tmp; #endif
}
len = g_variant_get_size (result); len = g_variant_get_size (result);
/* Add 3 bytes of header */ /* Add 3 bytes of header */
@@ -800,10 +799,11 @@ fp_print_deserialize (const guchar *data,
if (!raw_value) if (!raw_value)
goto invalid_format; goto invalid_format;
if (G_BYTE_ORDER == G_BIG_ENDIAN) #if (G_BYTE_ORDER == G_BIG_ENDIAN)
value = g_variant_byteswap (raw_value); value = g_variant_byteswap (raw_value);
else #else
value = g_variant_get_normal_form (raw_value); value = g_variant_get_normal_form (raw_value);
#endif
g_variant_get (value, g_variant_get (value,
"(i&s&sbymsmsi@a{sv}v)", "(i&s&sbymsmsi@a{sv}v)",

View File

@@ -20,36 +20,6 @@
#include <glib-object.h> #include <glib-object.h>
#if !GLIB_CHECK_VERSION (2, 57, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GTypeClass, g_type_class_unref);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GEnumClass, g_type_class_unref);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GFlagsClass, g_type_class_unref);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GParamSpec, g_param_spec_unref);
#else
/* Re-define G_SOURCE_FUNC as we are technically not allowed to use it with
* the version we depend on currently. */
#undef G_SOURCE_FUNC
#endif
#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void))(f))
#if !GLIB_CHECK_VERSION (2, 63, 3)
typedef struct _FpDeviceClass FpDeviceClass;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FpDeviceClass, g_type_class_unref);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDate, g_date_free);
#endif
#if !GLIB_CHECK_VERSION (2, 68, 0)
#define g_memdup2(data, size) g_memdup ((data), (size))
#else
#define g_memdup2(data, size) \
(G_GNUC_EXTENSION ({ \
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
g_memdup2 ((data), (size)); \
G_GNUC_END_IGNORE_DEPRECATIONS \
}))
#endif
#if __GNUC__ > 10 || (__GNUC__ == 10 && __GNUC_MINOR__ >= 1) #if __GNUC__ > 10 || (__GNUC__ == 10 && __GNUC_MINOR__ >= 1)
#define FP_GNUC_ACCESS(m, p, s) __attribute__((access (m, p, s))) #define FP_GNUC_ACCESS(m, p, s) __attribute__((access (m, p, s)))
#else #else

View File

@@ -33,6 +33,7 @@
* rely on the image to be normalized by libfprint before further processing. * rely on the image to be normalized by libfprint before further processing.
*/ */
typedef enum { typedef enum {
FPI_IMAGE_NONE = 0,
FPI_IMAGE_V_FLIPPED = 1 << 0, FPI_IMAGE_V_FLIPPED = 1 << 0,
FPI_IMAGE_H_FLIPPED = 1 << 1, FPI_IMAGE_H_FLIPPED = 1 << 1,
FPI_IMAGE_COLORS_INVERTED = 1 << 2, FPI_IMAGE_COLORS_INVERTED = 1 << 2,
@@ -67,7 +68,8 @@ struct _FpImage
guint8 *binarized; guint8 *binarized;
GPtrArray *minutiae; GPtrArray *minutiae;
guint ref_count;
gboolean detection_in_progress;
}; };
gint fpi_std_sq_dev (const guint8 *buf, gint fpi_std_sq_dev (const guint8 *buf,

View File

@@ -73,7 +73,7 @@
struct _FpiSsm struct _FpiSsm
{ {
FpDevice *dev; FpDevice *dev;
const char *name; char *name;
FpiSsm *parentsm; FpiSsm *parentsm;
gpointer ssm_data; gpointer ssm_data;
GDestroyNotify ssm_data_destroy; GDestroyNotify ssm_data_destroy;

View File

@@ -110,7 +110,7 @@ main (int argc, char **argv)
printed = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); printed = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
g_print ("%% lifprint — Supported Devices\n"); g_print ("%% libfprint — Supported Devices\n");
g_print ("%% Bastien Nocera, Daniel Drake\n"); g_print ("%% Bastien Nocera, Daniel Drake\n");
g_print ("%% 2018\n"); g_print ("%% 2018\n");
g_print ("\n"); g_print ("\n");

View File

@@ -24,11 +24,12 @@
#include "fpi-context.h" #include "fpi-context.h"
#include "fpi-device.h" #include "fpi-device.h"
static const FpIdEntry whitelist_id_table[] = { static const FpIdEntry allowlist_id_table[] = {
/* Currently known and unsupported devices. /* Currently known and unsupported devices.
* You can generate this list from the wiki page using e.g.: * 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' * 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 = 0x047d, .pid = 0x00f2 },
{ .vid = 0x04e8, .pid = 0x730b }, { .vid = 0x04e8, .pid = 0x730b },
{ .vid = 0x04f3, .pid = 0x036b }, { .vid = 0x04f3, .pid = 0x036b },
{ .vid = 0x04f3, .pid = 0x0c00 }, { .vid = 0x04f3, .pid = 0x0c00 },
@@ -36,12 +37,16 @@ static const FpIdEntry whitelist_id_table[] = {
{ .vid = 0x04f3, .pid = 0x0c57 }, { .vid = 0x04f3, .pid = 0x0c57 },
{ .vid = 0x04f3, .pid = 0x0c5e }, { .vid = 0x04f3, .pid = 0x0c5e },
{ .vid = 0x04f3, .pid = 0x0c5a }, { .vid = 0x04f3, .pid = 0x0c5a },
{ .vid = 0x04f3, .pid = 0x0c6c },
{ .vid = 0x04f3, .pid = 0x0c70 }, { .vid = 0x04f3, .pid = 0x0c70 },
{ .vid = 0x04f3, .pid = 0x0c72 }, { .vid = 0x04f3, .pid = 0x0c72 },
{ .vid = 0x04f3, .pid = 0x0c77 },
{ .vid = 0x04f3, .pid = 0x2706 }, { .vid = 0x04f3, .pid = 0x2706 },
{ .vid = 0x04f3, .pid = 0x3032 },
{ .vid = 0x04f3, .pid = 0x3057 }, { .vid = 0x04f3, .pid = 0x3057 },
{ .vid = 0x04f3, .pid = 0x3104 }, { .vid = 0x04f3, .pid = 0x3104 },
{ .vid = 0x04f3, .pid = 0x310d }, { .vid = 0x04f3, .pid = 0x310d },
{ .vid = 0x04f3, .pid = 0x3128 },
{ .vid = 0x06cb, .pid = 0x0081 }, { .vid = 0x06cb, .pid = 0x0081 },
{ .vid = 0x06cb, .pid = 0x0088 }, { .vid = 0x06cb, .pid = 0x0088 },
{ .vid = 0x06cb, .pid = 0x008a }, { .vid = 0x06cb, .pid = 0x008a },
@@ -75,6 +80,7 @@ static const FpIdEntry whitelist_id_table[] = {
{ .vid = 0x10a5, .pid = 0x0007 }, { .vid = 0x10a5, .pid = 0x0007 },
{ .vid = 0x10a5, .pid = 0x9200 }, { .vid = 0x10a5, .pid = 0x9200 },
{ .vid = 0x10a5, .pid = 0x9800 }, { .vid = 0x10a5, .pid = 0x9800 },
{ .vid = 0x10a5, .pid = 0xe340 },
{ .vid = 0x1188, .pid = 0x9545 }, { .vid = 0x1188, .pid = 0x9545 },
{ .vid = 0x138a, .pid = 0x0007 }, { .vid = 0x138a, .pid = 0x0007 },
{ .vid = 0x138a, .pid = 0x003a }, { .vid = 0x138a, .pid = 0x003a },
@@ -87,12 +93,14 @@ static const FpIdEntry whitelist_id_table[] = {
{ .vid = 0x138a, .pid = 0x0097 }, { .vid = 0x138a, .pid = 0x0097 },
{ .vid = 0x138a, .pid = 0x009d }, { .vid = 0x138a, .pid = 0x009d },
{ .vid = 0x138a, .pid = 0x00ab }, { .vid = 0x138a, .pid = 0x00ab },
{ .vid = 0x138a, .pid = 0x00a6 },
{ .vid = 0x147e, .pid = 0x1002 }, { .vid = 0x147e, .pid = 0x1002 },
{ .vid = 0x1491, .pid = 0x0088 }, { .vid = 0x1491, .pid = 0x0088 },
{ .vid = 0x16d1, .pid = 0x1027 }, { .vid = 0x16d1, .pid = 0x1027 },
{ .vid = 0x1c7a, .pid = 0x0300 }, { .vid = 0x1c7a, .pid = 0x0300 },
{ .vid = 0x1c7a, .pid = 0x0575 }, { .vid = 0x1c7a, .pid = 0x0575 },
{ .vid = 0x1c7a, .pid = 0x0576 }, { .vid = 0x1c7a, .pid = 0x0576 },
{ .vid = 0x1c7a, .pid = 0x0577 },
{ .vid = 0x27c6, .pid = 0x5042 }, { .vid = 0x27c6, .pid = 0x5042 },
{ .vid = 0x27c6, .pid = 0x5110 }, { .vid = 0x27c6, .pid = 0x5110 },
{ .vid = 0x27c6, .pid = 0x5117 }, { .vid = 0x27c6, .pid = 0x5117 },
@@ -120,6 +128,8 @@ static const FpIdEntry whitelist_id_table[] = {
{ .vid = 0x27c6, .pid = 0x5740 }, { .vid = 0x27c6, .pid = 0x5740 },
{ .vid = 0x27c6, .pid = 0x5e0a }, { .vid = 0x27c6, .pid = 0x5e0a },
{ .vid = 0x27c6, .pid = 0x581a }, { .vid = 0x27c6, .pid = 0x581a },
{ .vid = 0x27c6, .pid = 0x589a },
{ .vid = 0x27c6, .pid = 0x6382 },
{ .vid = 0x2808, .pid = 0x9338 }, { .vid = 0x2808, .pid = 0x9338 },
{ .vid = 0x2808, .pid = 0x93a9 }, { .vid = 0x2808, .pid = 0x93a9 },
{ .vid = 0x298d, .pid = 0x2020 }, { .vid = 0x298d, .pid = 0x2020 },
@@ -128,18 +138,18 @@ static const FpIdEntry whitelist_id_table[] = {
{ .vid = 0 }, { .vid = 0 },
}; };
static const FpIdEntry blacklist_id_table[] = { static const FpIdEntry denylist_id_table[] = {
{ .vid = 0x0483, .pid = 0x2016 }, { .vid = 0x0483, .pid = 0x2016 },
/* https://bugs.freedesktop.org/show_bug.cgi?id=66659 */ /* https://bugs.freedesktop.org/show_bug.cgi?id=66659 */
{ .vid = 0x045e, .pid = 0x00bb }, { .vid = 0x045e, .pid = 0x00bb },
{ .vid = 0 }, { .vid = 0 },
}; };
static const FpDeviceClass whitelist = { static const FpDeviceClass allowlist = {
.type = FP_DEVICE_TYPE_USB, .type = FP_DEVICE_TYPE_USB,
.id_table = whitelist_id_table, .id_table = allowlist_id_table,
.id = "whitelist", .id = "allowlist",
.full_name = "Hardcoded whitelist" .full_name = "Hardcoded allowlist"
}; };
GHashTable *printed = NULL; GHashTable *printed = NULL;
@@ -158,7 +168,7 @@ print_driver (const FpDeviceClass *cls)
const FpIdEntry *bl_entry; const FpIdEntry *bl_entry;
char *key; char *key;
for (bl_entry = blacklist_id_table; bl_entry->vid != 0; bl_entry++) for (bl_entry = denylist_id_table; bl_entry->vid != 0; bl_entry++)
if (entry->vid == bl_entry->vid && entry->pid == bl_entry->pid) if (entry->vid == bl_entry->vid && entry->pid == bl_entry->pid)
break; break;
@@ -169,7 +179,7 @@ print_driver (const FpDeviceClass *cls)
if (g_hash_table_lookup (printed, key) != NULL) if (g_hash_table_lookup (printed, key) != NULL)
{ {
if (cls == &whitelist) if (cls == &allowlist)
g_warning ("%s implemented by driver %s", g_warning ("%s implemented by driver %s",
key, (const char *) g_hash_table_lookup (printed, key)); key, (const char *) g_hash_table_lookup (printed, key));
g_free (key); g_free (key);
@@ -180,7 +190,7 @@ print_driver (const FpDeviceClass *cls)
if (num_printed == 0) if (num_printed == 0)
{ {
if (cls != &whitelist) if (cls != &allowlist)
g_print ("\n# Supported by libfprint driver %s\n", cls->id); g_print ("\n# Supported by libfprint driver %s\n", cls->id);
else else
g_print ("\n# Known unsupported devices\n"); g_print ("\n# Known unsupported devices\n");
@@ -234,7 +244,7 @@ main (int argc, char **argv)
print_driver (cls); print_driver (cls);
} }
print_driver (&whitelist); print_driver (&allowlist);
g_hash_table_destroy (printed); g_hash_table_destroy (printed);

View File

@@ -119,6 +119,8 @@ driver_sources = {
[ 'drivers/etes603.c' ], [ 'drivers/etes603.c' ],
'egis0570' : 'egis0570' :
[ 'drivers/egis0570.c' ], [ 'drivers/egis0570.c' ],
'egismoc' :
[ 'drivers/egismoc/egismoc.c' ],
'vfs0050' : 'vfs0050' :
[ 'drivers/vfs0050.c' ], [ 'drivers/vfs0050.c' ],
'elan' : 'elan' :
@@ -141,6 +143,10 @@ driver_sources = {
[ 'drivers/goodixmoc/goodix.c', 'drivers/goodixmoc/goodix_proto.c' ], [ 'drivers/goodixmoc/goodix.c', 'drivers/goodixmoc/goodix_proto.c' ],
'fpcmoc' : 'fpcmoc' :
[ 'drivers/fpcmoc/fpc.c' ], [ 'drivers/fpcmoc/fpc.c' ],
'realtek' :
[ 'drivers/realtek/realtek.c' ],
'focaltech_moc' :
[ 'drivers/focaltech_moc/focaltech_moc.c' ],
} }
helper_sources = { helper_sources = {

View File

@@ -1,5 +1,5 @@
project('libfprint', [ 'c', 'cpp' ], project('libfprint', [ 'c', 'cpp' ],
version: '1.94.6', version: '1.94.7',
license: 'LGPLv2.1+', license: 'LGPLv2.1+',
default_options: [ default_options: [
'buildtype=debugoptimized', 'buildtype=debugoptimized',
@@ -21,7 +21,7 @@ datadir = prefix / get_option('datadir')
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
cpp = meson.get_compiler('cpp') cpp = meson.get_compiler('cpp')
host_system = host_machine.system() host_system = host_machine.system()
glib_min_version = '2.56' glib_min_version = '2.68'
glib_version_def = 'GLIB_VERSION_@0@_@1@'.format( glib_version_def = 'GLIB_VERSION_@0@_@1@'.format(
glib_min_version.split('.')[0], glib_min_version.split('.')[1]) glib_min_version.split('.')[0], glib_min_version.split('.')[1])
@@ -120,6 +120,7 @@ default_drivers = [
'vfs0050', 'vfs0050',
'etes603', 'etes603',
'egis0570', 'egis0570',
'egismoc',
'vcom5s', 'vcom5s',
'synaptics', 'synaptics',
'elan', 'elan',
@@ -131,6 +132,8 @@ default_drivers = [
'goodixmoc', 'goodixmoc',
'nb1010', 'nb1010',
'fpcmoc', 'fpcmoc',
'realtek',
'focaltech_moc',
# SPI # SPI
'elanspi', 'elanspi',
@@ -139,8 +142,27 @@ default_drivers = [
# FIXME: All the drivers should be fixed by adjusting the byte order. # FIXME: All the drivers should be fixed by adjusting the byte order.
# See https://gitlab.freedesktop.org/libfprint/libfprint/-/issues/236 # See https://gitlab.freedesktop.org/libfprint/libfprint/-/issues/236
endian_independent_drivers = virtual_drivers + [ endian_independent_drivers = virtual_drivers + [
'aes1610',
'aes1660',
'aes2550',
'aes2660',
'aes3500', 'aes3500',
'aes4000',
'egis0570',
'egismoc',
'elanmoc',
'etes603',
'focaltech_moc',
'nb1010',
'realtek',
'synaptics', 'synaptics',
'upeksonly',
'upektc',
'upektc_img',
'upekts',
'vcom5s',
'vfs101',
'vfs7552',
] ]
all_drivers = default_drivers + virtual_drivers all_drivers = default_drivers + virtual_drivers
@@ -247,7 +269,7 @@ if install_udev_rules
udev_rules_dir = get_option('udev_rules_dir') udev_rules_dir = get_option('udev_rules_dir')
if udev_rules_dir == 'auto' if udev_rules_dir == 'auto'
udev_dep = dependency('udev') udev_dep = dependency('udev')
udev_rules_dir = udev_dep.get_pkgconfig_variable('udevdir') + '/rules.d' udev_rules_dir = udev_dep.get_variable(pkgconfig: 'udevdir') + '/rules.d'
endif endif
endif endif
@@ -284,7 +306,7 @@ if not udev_hwdb.disabled()
if udev_hwdb_dir == 'auto' if udev_hwdb_dir == 'auto'
udev_dep = dependency('udev') udev_dep = dependency('udev')
udev_hwdb_dir = udev_dep.get_pkgconfig_variable('udevdir') + '/hwdb.d' udev_hwdb_dir = udev_dep.get_variable(pkgconfig: 'udevdir') + '/hwdb.d'
endif endif
else else
udev_hwdb_dir = '' udev_hwdb_dir = ''

View File

@@ -44,7 +44,7 @@ if len(sys.argv) > 3:
sys.exit(1) sys.exit(1)
driver_name = sys.argv[1] driver_name = sys.argv[1]
os.environ['FP_DRIVERS_WHITELIST'] = driver_name os.environ['FP_DRIVERS_ALLOWLIST'] = driver_name
test_variant = None test_variant = None
if len(sys.argv) == 3: if len(sys.argv) == 3:

0
tests/egis0570/capture.pcapng Executable file → Normal file
View File

View File

@@ -24,7 +24,7 @@ E: ID_USB_INTERFACES=:ff0000:
E: ID_VENDOR_FROM_DATABASE=LighTuning Technology Inc. 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 allowlist
A: authorized=1\n A: authorized=1\n
A: avoid_reset_quirk=0\n A: avoid_reset_quirk=0\n
A: bConfigurationValue=1\n A: bConfigurationValue=1\n

Binary file not shown.

156
tests/egismoc-05a1/custom.py Executable file
View File

@@ -0,0 +1,156 @@
#!/usr/bin/python3
import traceback
import sys
import time
import gi
gi.require_version('FPrint', '2.0')
from gi.repository import FPrint, GLib
# Exit with error on any exception, included those happening in async callbacks
sys.excepthook = lambda *args: (traceback.print_exception(*args), sys.exit(1))
ctx = GLib.main_context_default()
c = FPrint.Context()
c.enumerate()
devices = c.get_devices()
d = devices[0]
del devices
d.open_sync()
assert d.get_driver() == "egismoc"
assert not d.has_feature(FPrint.DeviceFeature.CAPTURE)
assert d.has_feature(FPrint.DeviceFeature.IDENTIFY)
assert d.has_feature(FPrint.DeviceFeature.VERIFY)
assert d.has_feature(FPrint.DeviceFeature.DUPLICATES_CHECK)
assert d.has_feature(FPrint.DeviceFeature.STORAGE)
assert d.has_feature(FPrint.DeviceFeature.STORAGE_LIST)
assert d.has_feature(FPrint.DeviceFeature.STORAGE_DELETE)
assert d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR)
def enroll_progress(*args):
print("finger status: ", d.get_finger_status())
print('enroll progress: ' + str(args))
def identify_done(dev, res):
global identified
identified = True
identify_match, identify_print = dev.identify_finish(res)
print('indentification_done: ', identify_match, identify_print)
assert identify_match.equal(identify_print)
# Beginning with list and clear assumes you begin with >0 prints enrolled before capturing
print("listing - device should have prints")
stored = d.list_prints_sync()
assert len(stored) > 0
del stored
print("clear device storage")
d.clear_storage_sync()
print("clear done")
print("listing - device should be empty")
stored = d.list_prints_sync()
assert len(stored) == 0
del stored
print("enrolling")
template = FPrint.Print.new(d)
template.set_finger(FPrint.Finger.LEFT_INDEX)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
p1 = d.enroll_sync(template, None, enroll_progress, None)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
print("enroll done")
del template
print("listing - device should have 1 print")
stored = d.list_prints_sync()
assert len(stored) == 1
assert stored[0].equal(p1)
print("verifying")
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
verify_res, verify_print = d.verify_sync(p1)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
print("verify done")
assert verify_res == True
identified = False
deserialized_prints = []
for p in stored:
deserialized_prints.append(FPrint.Print.deserialize(p.serialize()))
assert deserialized_prints[-1].equal(p)
del stored
print('async identifying')
d.identify(deserialized_prints, callback=identify_done)
del deserialized_prints
while not identified:
ctx.iteration(True)
print("try to enroll duplicate")
template = FPrint.Print.new(d)
template.set_finger(FPrint.Finger.RIGHT_INDEX)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
try:
d.enroll_sync(template, None, enroll_progress, None)
except GLib.Error as error:
assert error.matches(FPrint.DeviceError.quark(),
FPrint.DeviceError.DATA_DUPLICATE)
except Exception as exc:
raise
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
print("duplicate enroll attempt done")
print("listing - device should still only have 1 print")
stored = d.list_prints_sync()
assert len(stored) == 1
assert stored[0].equal(p1)
del stored
print("enroll new finger")
template = FPrint.Print.new(d)
template.set_finger(FPrint.Finger.RIGHT_INDEX)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
p2 = d.enroll_sync(template, None, enroll_progress, None)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
print("enroll new finger done")
del template
print("listing - device should have 2 prints")
stored = d.list_prints_sync()
assert len(stored) == 2
assert (stored[0].equal(p1) and stored[1].equal(p2)) or (stored[0].equal(p2) and stored[1].equal(p1))
del stored
print("deleting first print")
d.delete_print_sync(p1)
print("delete done")
del p1
print("listing - device should only have second print")
stored = d.list_prints_sync()
assert len(stored) == 1
assert stored[0].equal(p2)
del stored
del p2
print("clear device storage")
d.clear_storage_sync()
print("clear done")
print("listing - device should be empty")
stored = d.list_prints_sync()
assert len(stored) == 0
del stored
d.close_sync()
del d
del c

262
tests/egismoc-05a1/device Normal file
View File

@@ -0,0 +1,262 @@
P: /devices/pci0000:00/0000:00:14.0/usb1/1-5
N: bus/usb/001/003=12010002FF0000407A1CA10513120102030109022700010100A0320904000003FF000000070581020002000705020200020007058303400005
E: BUSNUM=001
E: DEVNAME=/dev/bus/usb/001/003
E: DEVNUM=003
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_BUS=usb
E: ID_MODEL=ETU905A80-E
E: ID_MODEL_ENC=ETU905A80-E
E: ID_MODEL_ID=05a1
E: ID_REVISION=1213
E: ID_SERIAL=EGIS_ETU905A80-E_0C5A44PCU833
E: ID_SERIAL_SHORT=0C5A44PCU833
E: ID_USB_INTERFACES=:ff0000:
E: ID_USB_MODEL=ETU905A80-E
E: ID_USB_MODEL_ENC=ETU905A80-E
E: ID_USB_MODEL_ID=05a1
E: ID_USB_REVISION=1213
E: ID_USB_SERIAL=EGIS_ETU905A80-E_0C5A44PCU833
E: ID_USB_SERIAL_SHORT=0C5A44PCU833
E: ID_USB_VENDOR=EGIS
E: ID_USB_VENDOR_ENC=EGIS
E: ID_USB_VENDOR_ID=1c7a
E: ID_VENDOR=EGIS
E: ID_VENDOR_ENC=EGIS
E: ID_VENDOR_FROM_DATABASE=LighTuning Technology Inc.
E: ID_VENDOR_ID=1c7a
E: MAJOR=189
E: MINOR=2
E: PRODUCT=1c7a/5a1/1213
E: SUBSYSTEM=usb
E: TYPE=255/0/0
A: authorized=1\n
A: avoid_reset_quirk=0\n
A: bConfigurationValue=1\n
A: bDeviceClass=ff\n
A: bDeviceProtocol=00\n
A: bDeviceSubClass=00\n
A: bMaxPacketSize0=64\n
A: bMaxPower=100mA\n
A: bNumConfigurations=1\n
A: bNumInterfaces= 1\n
A: bcdDevice=1213\n
A: bmAttributes=a0\n
A: busnum=1\n
A: configuration=
H: descriptors=12010002FF0000407A1CA10513120102030109022700010100A0320904000003FF000000070581020002000705020200020007058303400005
A: dev=189:2\n
A: devnum=3\n
A: devpath=5\n
L: driver=../../../../../bus/usb/drivers/usb
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:51/device:52/device:57
A: idProduct=05a1\n
A: idVendor=1c7a\n
A: ltm_capable=no\n
A: manufacturer=EGIS\n
A: maxchild=0\n
A: physical_location/dock=no\n
A: physical_location/horizontal_position=center\n
A: physical_location/lid=no\n
A: physical_location/panel=unknown\n
A: physical_location/vertical_position=center\n
L: port=../1-0:1.0/usb1-port5
A: power/active_duration=955612\n
A: power/async=enabled\n
A: power/autosuspend=2\n
A: power/autosuspend_delay_ms=2000\n
A: power/connected_duration=955612\n
A: power/control=on\n
A: power/level=on\n
A: power/persist=0\n
A: power/runtime_active_kids=0\n
A: power/runtime_active_time=955338\n
A: power/runtime_enabled=forbidden\n
A: power/runtime_status=active\n
A: power/runtime_suspended_time=0\n
A: power/runtime_usage=1\n
A: power/wakeup=disabled\n
A: power/wakeup_abort_count=\n
A: power/wakeup_active=\n
A: power/wakeup_active_count=\n
A: power/wakeup_count=\n
A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms=\n
A: product=ETU905A80-E\n
A: quirks=0x0\n
A: removable=fixed\n
A: rx_lanes=1\n
A: serial=0C5A44PCU833\n
A: speed=480\n
A: tx_lanes=1\n
A: urbnum=491\n
A: version= 2.00\n
P: /devices/pci0000:00/0000:00:14.0/usb1
N: bus/usb/001/001=12010002090001406B1D020005060302010109021900010100E0000904000001090000000705810304000C
E: BUSNUM=001
E: CURRENT_TAGS=:seat:
E: DEVNAME=/dev/bus/usb/001/001
E: DEVNUM=001
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_AUTOSUSPEND=1
E: ID_BUS=usb
E: ID_FOR_SEAT=usb-pci-0000_00_14_0
E: ID_MODEL=xHCI_Host_Controller
E: ID_MODEL_ENC=xHCI\x20Host\x20Controller
E: ID_MODEL_FROM_DATABASE=2.0 root hub
E: ID_MODEL_ID=0002
E: ID_PATH=pci-0000:00:14.0
E: ID_PATH_TAG=pci-0000_00_14_0
E: ID_REVISION=0605
E: ID_SERIAL=Linux_6.5.0-9-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
E: ID_SERIAL_SHORT=0000:00:14.0
E: ID_USB_INTERFACES=:090000:
E: ID_USB_MODEL=xHCI_Host_Controller
E: ID_USB_MODEL_ENC=xHCI\x20Host\x20Controller
E: ID_USB_MODEL_ID=0002
E: ID_USB_REVISION=0605
E: ID_USB_SERIAL=Linux_6.5.0-9-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
E: ID_USB_SERIAL_SHORT=0000:00:14.0
E: ID_USB_VENDOR=Linux_6.5.0-9-generic_xhci-hcd
E: ID_USB_VENDOR_ENC=Linux\x206.5.0-9-generic\x20xhci-hcd
E: ID_USB_VENDOR_ID=1d6b
E: ID_VENDOR=Linux_6.5.0-9-generic_xhci-hcd
E: ID_VENDOR_ENC=Linux\x206.5.0-9-generic\x20xhci-hcd
E: ID_VENDOR_FROM_DATABASE=Linux Foundation
E: ID_VENDOR_ID=1d6b
E: MAJOR=189
E: MINOR=0
E: PRODUCT=1d6b/2/605
E: SUBSYSTEM=usb
E: TAGS=:seat:
E: TYPE=9/0/1
A: authorized=1\n
A: authorized_default=1\n
A: avoid_reset_quirk=0\n
A: bConfigurationValue=1\n
A: bDeviceClass=09\n
A: bDeviceProtocol=01\n
A: bDeviceSubClass=00\n
A: bMaxPacketSize0=64\n
A: bMaxPower=0mA\n
A: bNumConfigurations=1\n
A: bNumInterfaces= 1\n
A: bcdDevice=0605\n
A: bmAttributes=e0\n
A: busnum=1\n
A: configuration=
H: descriptors=12010002090001406B1D020005060302010109021900010100E0000904000001090000000705810304000C
A: dev=189:0\n
A: devnum=1\n
A: devpath=0\n
L: driver=../../../../bus/usb/drivers/usb
L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:51/device:52
A: idProduct=0002\n
A: idVendor=1d6b\n
A: interface_authorized_default=1\n
A: ltm_capable=no\n
A: manufacturer=Linux 6.5.0-9-generic xhci-hcd\n
A: maxchild=12\n
A: power/active_duration=956044\n
A: power/async=enabled\n
A: power/autosuspend=0\n
A: power/autosuspend_delay_ms=0\n
A: power/connected_duration=956044\n
A: power/control=auto\n
A: power/level=auto\n
A: power/runtime_active_kids=2\n
A: power/runtime_active_time=956041\n
A: power/runtime_enabled=enabled\n
A: power/runtime_status=active\n
A: power/runtime_suspended_time=0\n
A: power/runtime_usage=0\n
A: power/wakeup=disabled\n
A: power/wakeup_abort_count=\n
A: power/wakeup_active=\n
A: power/wakeup_active_count=\n
A: power/wakeup_count=\n
A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms=\n
A: product=xHCI Host Controller\n
A: quirks=0x0\n
A: removable=unknown\n
A: rx_lanes=1\n
A: serial=0000:00:14.0\n
A: speed=480\n
A: tx_lanes=1\n
A: urbnum=181\n
A: version= 2.00\n
P: /devices/pci0000:00/0000:00:14.0
E: DRIVER=xhci_hcd
E: ID_MODEL_FROM_DATABASE=Alder Lake PCH USB 3.2 xHCI Host Controller
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: MODALIAS=pci:v00008086d000051EDsv0000144Dsd0000C1CAbc0Csc03i30
E: PCI_CLASS=C0330
E: PCI_ID=8086:51ED
E: PCI_SLOT_NAME=0000:00:14.0
E: PCI_SUBSYS_ID=144D:C1CA
E: SUBSYSTEM=pci
A: ari_enabled=0\n
A: broken_parity_status=0\n
A: class=0x0c0330\n
H: config=8680ED51060490020130030C0000800004001A3E6000000000000000000000000000000000000000000000004D14CAC1000000007000000000000000FF010000FD0134A089C27F8000000000000000003F6DD80F000000000000000000000000316000000000000000000000000000000180C2C108000000000000000000000005908700D804E0FE000000000000000009B014F01000400100000000C10A080000080E00001800008F50020000010000090000018680C00009001014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B50F110112000000
A: consistent_dma_mask_bits=64\n
A: d3cold_allowed=1\n
A: dbc=disabled\n
A: dbc_bInterfaceProtocol=01\n
A: dbc_bcdDevice=0010\n
A: dbc_idProduct=0010\n
A: dbc_idVendor=1d6b\n
A: device=0x51ed\n
A: dma_mask_bits=64\n
L: driver=../../../bus/pci/drivers/xhci_hcd
A: driver_override=(null)\n
A: enable=1\n
L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:51
A: index=9\n
L: iommu=../../virtual/iommu/dmar2
L: iommu_group=../../../kernel/iommu_groups/11
A: irq=142\n
A: label=Onboard - Other\n
A: local_cpulist=0-15\n
A: local_cpus=ffff\n
A: modalias=pci:v00008086d000051EDsv0000144Dsd0000C1CAbc0Csc03i30\n
A: msi_bus=1\n
A: msi_irqs/142=msi\n
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 6 7 2112 7\nxHCI ring segments 28 28 4096 28\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 1 32 128 1\nbuffer-32 0 0 32 0\n
A: power/async=enabled\n
A: power/control=auto\n
A: power/runtime_active_kids=1\n
A: power/runtime_active_time=957198\n
A: power/runtime_enabled=enabled\n
A: power/runtime_status=active\n
A: power/runtime_suspended_time=0\n
A: power/runtime_usage=0\n
A: power/wakeup=enabled\n
A: power/wakeup_abort_count=0\n
A: power/wakeup_active=0\n
A: power/wakeup_active_count=0\n
A: power/wakeup_count=0\n
A: power/wakeup_expire_count=0\n
A: power/wakeup_last_time_ms=0\n
A: power/wakeup_max_time_ms=0\n
A: power/wakeup_total_time_ms=0\n
A: power_state=D0\n
A: resource=0x000000603e1a0000 0x000000603e1affff 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=0x01\n
A: subsystem_device=0xc1ca\n
A: subsystem_vendor=0x144d\n
A: vendor=0x8086\n

BIN
tests/egismoc/custom.pcapng Normal file

Binary file not shown.

156
tests/egismoc/custom.py Executable file
View File

@@ -0,0 +1,156 @@
#!/usr/bin/python3
import traceback
import sys
import time
import gi
gi.require_version('FPrint', '2.0')
from gi.repository import FPrint, GLib
# Exit with error on any exception, included those happening in async callbacks
sys.excepthook = lambda *args: (traceback.print_exception(*args), sys.exit(1))
ctx = GLib.main_context_default()
c = FPrint.Context()
c.enumerate()
devices = c.get_devices()
d = devices[0]
del devices
d.open_sync()
assert d.get_driver() == "egismoc"
assert not d.has_feature(FPrint.DeviceFeature.CAPTURE)
assert d.has_feature(FPrint.DeviceFeature.IDENTIFY)
assert d.has_feature(FPrint.DeviceFeature.VERIFY)
assert d.has_feature(FPrint.DeviceFeature.DUPLICATES_CHECK)
assert d.has_feature(FPrint.DeviceFeature.STORAGE)
assert d.has_feature(FPrint.DeviceFeature.STORAGE_LIST)
assert d.has_feature(FPrint.DeviceFeature.STORAGE_DELETE)
assert d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR)
def enroll_progress(*args):
print("finger status: ", d.get_finger_status())
print('enroll progress: ' + str(args))
def identify_done(dev, res):
global identified
identified = True
identify_match, identify_print = dev.identify_finish(res)
print('indentification_done: ', identify_match, identify_print)
assert identify_match.equal(identify_print)
# Beginning with list and clear assumes you begin with >0 prints enrolled before capturing
print("listing - device should have prints")
stored = d.list_prints_sync()
assert len(stored) > 0
del stored
print("clear device storage")
d.clear_storage_sync()
print("clear done")
print("listing - device should be empty")
stored = d.list_prints_sync()
assert len(stored) == 0
del stored
print("enrolling")
template = FPrint.Print.new(d)
template.set_finger(FPrint.Finger.LEFT_INDEX)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
p1 = d.enroll_sync(template, None, enroll_progress, None)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
print("enroll done")
del template
print("listing - device should have 1 print")
stored = d.list_prints_sync()
assert len(stored) == 1
assert stored[0].equal(p1)
print("verifying")
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
verify_res, verify_print = d.verify_sync(p1)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
print("verify done")
assert verify_res == True
identified = False
deserialized_prints = []
for p in stored:
deserialized_prints.append(FPrint.Print.deserialize(p.serialize()))
assert deserialized_prints[-1].equal(p)
del stored
print('async identifying')
d.identify(deserialized_prints, callback=identify_done)
del deserialized_prints
while not identified:
ctx.iteration(True)
print("try to enroll duplicate")
template = FPrint.Print.new(d)
template.set_finger(FPrint.Finger.RIGHT_INDEX)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
try:
d.enroll_sync(template, None, enroll_progress, None)
except GLib.Error as error:
assert error.matches(FPrint.DeviceError.quark(),
FPrint.DeviceError.DATA_DUPLICATE)
except Exception as exc:
raise
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
print("duplicate enroll attempt done")
print("listing - device should still only have 1 print")
stored = d.list_prints_sync()
assert len(stored) == 1
assert stored[0].equal(p1)
del stored
print("enroll new finger")
template = FPrint.Print.new(d)
template.set_finger(FPrint.Finger.RIGHT_INDEX)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
p2 = d.enroll_sync(template, None, enroll_progress, None)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
print("enroll new finger done")
del template
print("listing - device should have 2 prints")
stored = d.list_prints_sync()
assert len(stored) == 2
assert (stored[0].equal(p1) and stored[1].equal(p2)) or (stored[0].equal(p2) and stored[1].equal(p1))
del stored
print("deleting first print")
d.delete_print_sync(p1)
print("delete done")
del p1
print("listing - device should only have second print")
stored = d.list_prints_sync()
assert len(stored) == 1
assert stored[0].equal(p2)
del stored
del p2
print("clear device storage")
d.clear_storage_sync()
print("clear done")
print("listing - device should be empty")
stored = d.list_prints_sync()
assert len(stored) == 0
del stored
d.close_sync()
del d
del c

262
tests/egismoc/device Normal file
View File

@@ -0,0 +1,262 @@
P: /devices/pci0000:00/0000:00:14.0/usb3/3-5
N: bus/usb/003/012=12010002FF0000407A1C820581110102030109022700010100A0320904000003FF000000070581020002000705020200020007058303400005
E: BUSNUM=003
E: CURRENT_TAGS=:snap_cups_ippeveprinter:snap_cups_cupsd:
E: DEVNAME=/dev/bus/usb/003/012
E: DEVNUM=012
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_BUS=usb
E: ID_MODEL=ETU905A80-E
E: ID_MODEL_ENC=ETU905A80-E
E: ID_MODEL_ID=0582
E: ID_PATH=pci-0000:00:14.0-usb-0:5
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_5
E: ID_REVISION=1181
E: ID_SERIAL=EGIS_ETU905A80-E_0E7828PBS393
E: ID_SERIAL_SHORT=0E7828PBS393
E: ID_USB_INTERFACES=:ff0000:
E: ID_USB_MODEL=ETU905A80-E
E: ID_USB_MODEL_ENC=ETU905A80-E
E: ID_USB_MODEL_ID=0582
E: ID_USB_REVISION=1181
E: ID_USB_SERIAL=EGIS_ETU905A80-E_0E7828PBS393
E: ID_USB_SERIAL_SHORT=0E7828PBS393
E: ID_USB_VENDOR=EGIS
E: ID_USB_VENDOR_ENC=EGIS
E: ID_USB_VENDOR_ID=1c7a
E: ID_VENDOR=EGIS
E: ID_VENDOR_ENC=EGIS
E: ID_VENDOR_FROM_DATABASE=LighTuning Technology Inc.
E: ID_VENDOR_ID=1c7a
E: MAJOR=189
E: MINOR=267
E: PRODUCT=1c7a/582/1181
E: SUBSYSTEM=usb
E: TAGS=:snap_cups_ippeveprinter:snap_cups_cupsd:
E: TYPE=255/0/0
A: authorized=1\n
A: avoid_reset_quirk=0\n
A: bConfigurationValue=1\n
A: bDeviceClass=ff\n
A: bDeviceProtocol=00\n
A: bDeviceSubClass=00\n
A: bMaxPacketSize0=64\n
A: bMaxPower=100mA\n
A: bNumConfigurations=1\n
A: bNumInterfaces= 1\n
A: bcdDevice=1181\n
A: bmAttributes=a0\n
A: busnum=3\n
A: configuration=
H: descriptors=12010002FF0000407A1C820581110102030109022700010100A0320904000003FF000000070581020002000705020200020007058303400005
A: dev=189:267\n
A: devnum=12\n
A: devpath=5\n
L: driver=../../../../../bus/usb/drivers/usb
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:51/device:52/device:57
A: idProduct=0582\n
A: idVendor=1c7a\n
A: ltm_capable=no\n
A: manufacturer=EGIS\n
A: maxchild=0\n
A: physical_location/dock=no\n
A: physical_location/horizontal_position=center\n
A: physical_location/lid=no\n
A: physical_location/panel=unknown\n
A: physical_location/vertical_position=center\n
L: port=../3-0:1.0/usb3-port5
A: power/active_duration=1425996\n
A: power/async=enabled\n
A: power/autosuspend=2\n
A: power/autosuspend_delay_ms=2000\n
A: power/connected_duration=1426656\n
A: power/control=on\n
A: power/level=on\n
A: power/persist=0\n
A: power/runtime_active_kids=0\n
A: power/runtime_active_time=1426124\n
A: power/runtime_enabled=forbidden\n
A: power/runtime_status=active\n
A: power/runtime_suspended_time=0\n
A: power/runtime_usage=1\n
A: power/wakeup=disabled\n
A: power/wakeup_abort_count=\n
A: power/wakeup_active=\n
A: power/wakeup_active_count=\n
A: power/wakeup_count=\n
A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms=\n
A: product=ETU905A80-E\n
A: quirks=0x0\n
A: removable=fixed\n
A: rx_lanes=1\n
A: serial=0E7828PBS393\n
A: speed=480\n
A: tx_lanes=1\n
A: urbnum=2803\n
A: version= 2.00\n
P: /devices/pci0000:00/0000:00:14.0/usb3
N: bus/usb/003/001=12010002090001406B1D020002060302010109021900010100E0000904000001090000000705810304000C
E: BUSNUM=003
E: CURRENT_TAGS=:seat:snap_cups_cupsd:snap_cups_ippeveprinter:
E: DEVNAME=/dev/bus/usb/003/001
E: DEVNUM=001
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_AUTOSUSPEND=1
E: ID_BUS=usb
E: ID_FOR_SEAT=usb-pci-0000_00_14_0
E: ID_MODEL=xHCI_Host_Controller
E: ID_MODEL_ENC=xHCI\x20Host\x20Controller
E: ID_MODEL_FROM_DATABASE=2.0 root hub
E: ID_MODEL_ID=0002
E: ID_PATH=pci-0000:00:14.0
E: ID_PATH_TAG=pci-0000_00_14_0
E: ID_REVISION=0602
E: ID_SERIAL=Linux_6.2.0-34-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
E: ID_SERIAL_SHORT=0000:00:14.0
E: ID_USB_INTERFACES=:090000:
E: ID_USB_MODEL=xHCI_Host_Controller
E: ID_USB_MODEL_ENC=xHCI\x20Host\x20Controller
E: ID_USB_MODEL_ID=0002
E: ID_USB_REVISION=0602
E: ID_USB_SERIAL=Linux_6.2.0-34-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
E: ID_USB_SERIAL_SHORT=0000:00:14.0
E: ID_USB_VENDOR=Linux_6.2.0-34-generic_xhci-hcd
E: ID_USB_VENDOR_ENC=Linux\x206.2.0-34-generic\x20xhci-hcd
E: ID_USB_VENDOR_ID=1d6b
E: ID_VENDOR=Linux_6.2.0-34-generic_xhci-hcd
E: ID_VENDOR_ENC=Linux\x206.2.0-34-generic\x20xhci-hcd
E: ID_VENDOR_FROM_DATABASE=Linux Foundation
E: ID_VENDOR_ID=1d6b
E: MAJOR=189
E: MINOR=256
E: PRODUCT=1d6b/2/602
E: SUBSYSTEM=usb
E: TAGS=:snap_cups_cupsd:seat:snap_cups_ippeveprinter:
E: TYPE=9/0/1
A: authorized=1\n
A: authorized_default=1\n
A: avoid_reset_quirk=0\n
A: bConfigurationValue=1\n
A: bDeviceClass=09\n
A: bDeviceProtocol=01\n
A: bDeviceSubClass=00\n
A: bMaxPacketSize0=64\n
A: bMaxPower=0mA\n
A: bNumConfigurations=1\n
A: bNumInterfaces= 1\n
A: bcdDevice=0602\n
A: bmAttributes=e0\n
A: busnum=3\n
A: configuration=
H: descriptors=12010002090001406B1D020002060302010109021900010100E0000904000001090000000705810304000C
A: dev=189:256\n
A: devnum=1\n
A: devpath=0\n
L: driver=../../../../bus/usb/drivers/usb
L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:51/device:52
A: idProduct=0002\n
A: idVendor=1d6b\n
A: interface_authorized_default=1\n
A: ltm_capable=no\n
A: manufacturer=Linux 6.2.0-34-generic xhci-hcd\n
A: maxchild=12\n
A: power/active_duration=337953872\n
A: power/async=enabled\n
A: power/autosuspend=0\n
A: power/autosuspend_delay_ms=0\n
A: power/connected_duration=337978524\n
A: power/control=auto\n
A: power/level=auto\n
A: power/runtime_active_kids=1\n
A: power/runtime_active_time=337962424\n
A: power/runtime_enabled=enabled\n
A: power/runtime_status=active\n
A: power/runtime_suspended_time=616\n
A: power/runtime_usage=0\n
A: power/wakeup=disabled\n
A: power/wakeup_abort_count=\n
A: power/wakeup_active=\n
A: power/wakeup_active_count=\n
A: power/wakeup_count=\n
A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms=\n
A: product=xHCI Host Controller\n
A: quirks=0x0\n
A: removable=unknown\n
A: rx_lanes=1\n
A: serial=0000:00:14.0\n
A: speed=480\n
A: tx_lanes=1\n
A: urbnum=4969\n
A: version= 2.00\n
P: /devices/pci0000:00/0000:00:14.0
E: DRIVER=xhci_hcd
E: ID_MODEL_FROM_DATABASE=Alder Lake PCH USB 3.2 xHCI Host Controller
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: MODALIAS=pci:v00008086d000051EDsv0000144Dsd0000C870bc0Csc03i30
E: PCI_CLASS=C0330
E: PCI_ID=8086:51ED
E: PCI_SLOT_NAME=0000:00:14.0
E: PCI_SUBSYS_ID=144D:C870
E: SUBSYSTEM=pci
A: ari_enabled=0\n
A: broken_parity_status=0\n
A: class=0x0c0330\n
H: config=8680ED51060490020130030C000080000400161D6000000000000000000000000000000000000000000000004D1470C8000000007000000000000000FF010000FD0134A089C27F8000000000000000003F6DD80F000000000000000000000000316000000000000000000000000000000180C2C1080000000000000000000000059087007805E0FE000000000000000009B014F01000400100000000C10A080000080E00001800008F50020000010000090000018680C00009001014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B50F010112000000
A: consistent_dma_mask_bits=64\n
A: d3cold_allowed=1\n
A: dbc=disabled\n
A: device=0x51ed\n
A: dma_mask_bits=64\n
L: driver=../../../bus/pci/drivers/xhci_hcd
A: driver_override=(null)\n
A: enable=1\n
L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:51
A: index=7\n
L: iommu=../../virtual/iommu/dmar1
L: iommu_group=../../../kernel/iommu_groups/8
A: irq=145\n
A: label=Onboard - Other\n
A: local_cpulist=0-15\n
A: local_cpus=ffff\n
A: modalias=pci:v00008086d000051EDsv0000144Dsd0000C870bc0Csc03i30\n
A: msi_bus=1\n
A: msi_irqs/145=msi\n
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 6 9 2112 9\nxHCI ring segments 26 34 4096 34\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 32 128 1\nbuffer-32 0 0 32 0\n
A: power/async=enabled\n
A: power/control=auto\n
A: power/runtime_active_kids=1\n
A: power/runtime_active_time=337964621\n
A: power/runtime_enabled=enabled\n
A: power/runtime_status=active\n
A: power/runtime_suspended_time=438\n
A: power/runtime_usage=0\n
A: power/wakeup=enabled\n
A: power/wakeup_abort_count=0\n
A: power/wakeup_active=0\n
A: power/wakeup_active_count=7\n
A: power/wakeup_count=0\n
A: power/wakeup_expire_count=7\n
A: power/wakeup_last_time_ms=336554844\n
A: power/wakeup_max_time_ms=105\n
A: power/wakeup_total_time_ms=721\n
A: power_state=D0\n
A: resource=0x000000601d160000 0x000000601d16ffff 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=0x01\n
A: subsystem_device=0xc870\n
A: subsystem_vendor=0x144d\n
A: vendor=0x8086\n

Binary file not shown.

89
tests/focaltech_moc/custom.py Executable file
View File

@@ -0,0 +1,89 @@
#!/usr/bin/python3
import traceback
import sys
import gi
gi.require_version('FPrint', '2.0')
from gi.repository import FPrint, GLib
# Exit with error on any exception, included those happening in async callbacks
sys.excepthook = lambda *args: (traceback.print_exception(*args), sys.exit(1))
ctx = GLib.main_context_default()
c = FPrint.Context()
c.enumerate()
devices = c.get_devices()
d = devices[0]
del devices
assert d.get_driver() == "focaltech_moc"
assert not d.has_feature(FPrint.DeviceFeature.CAPTURE)
assert d.has_feature(FPrint.DeviceFeature.IDENTIFY)
assert d.has_feature(FPrint.DeviceFeature.VERIFY)
assert not d.has_feature(FPrint.DeviceFeature.DUPLICATES_CHECK)
assert d.has_feature(FPrint.DeviceFeature.STORAGE)
assert d.has_feature(FPrint.DeviceFeature.STORAGE_LIST)
assert d.has_feature(FPrint.DeviceFeature.STORAGE_DELETE)
assert not d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR)
d.open_sync()
template = FPrint.Print.new(d)
def enroll_progress(*args):
#assert d.get_finger_status() == FPrint.FingerStatusFlags.NEEDED
print("finger status: ", d.get_finger_status())
print('enroll progress: ' + str(args))
def identify_done(dev, res):
global identified
identified = True
identify_match, identify_print = dev.identify_finish(res)
print('indentification_done: ', identify_match, identify_print)
assert identify_match.equal(identify_print)
# List, enroll, list, verify, identify, delete
print("enrolling")
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
p = d.enroll_sync(template, None, enroll_progress, None)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
print("enroll done")
print("listing")
stored = d.list_prints_sync()
print("listing done")
assert len(stored) == 1
assert stored[0].equal(p)
print("verifying")
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
verify_res, verify_print = d.verify_sync(p)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
print("verify done")
del p
assert verify_res == True
identified = False
deserialized_prints = []
for p in stored:
deserialized_prints.append(FPrint.Print.deserialize(p.serialize()))
assert deserialized_prints[-1].equal(p)
del stored
print('async identifying')
d.identify(deserialized_prints, callback=identify_done)
del deserialized_prints
while not identified:
ctx.iteration(True)
print("deleting")
d.delete_print_sync(p)
print("delete done")
d.close_sync()
del d
del c

385
tests/focaltech_moc/device Normal file

File diff suppressed because one or more lines are too long

View File

@@ -6,6 +6,8 @@ envs.set('G_MESSAGES_DEBUG', 'all')
# Setup paths # Setup paths
envs.set('MESON_SOURCE_ROOT', meson.project_source_root()) envs.set('MESON_SOURCE_ROOT', meson.project_source_root())
envs.set('MESON_BUILD_ROOT', meson.project_build_root()) envs.set('MESON_BUILD_ROOT', meson.project_build_root())
envs.set('G_TEST_SRCDIR', meson.current_source_dir())
envs.set('G_TEST_BUILDDIR', meson.current_build_dir())
envs.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libfprint') envs.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libfprint')
# Set FP_DEVICE_EMULATION so that drivers can adapt (e.g. to use fixed # Set FP_DEVICE_EMULATION so that drivers can adapt (e.g. to use fixed
@@ -13,7 +15,7 @@ envs.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libfprint')
envs.set('FP_DEVICE_EMULATION', '1') envs.set('FP_DEVICE_EMULATION', '1')
# Set a colon-separated list of native drivers we enable in tests # Set a colon-separated list of native drivers we enable in tests
envs.set('FP_DRIVERS_WHITELIST', ':'.join([ envs.set('FP_DRIVERS_ALLOWLIST', ':'.join([
'virtual_image', 'virtual_image',
'virtual_device', 'virtual_device',
'virtual_device_storage', 'virtual_device_storage',
@@ -49,7 +51,11 @@ drivers_tests = [
'goodixmoc', 'goodixmoc',
'nb1010', 'nb1010',
'egis0570', 'egis0570',
'egismoc',
'egismoc-05a1',
'fpcmoc', 'fpcmoc',
'realtek',
'focaltech_moc',
] ]
if get_option('introspection') if get_option('introspection')
@@ -71,6 +77,12 @@ envs_str = run_command(python3, '-c', env_parser_cmd,
env: envs, env: envs,
check: installed_tests).stdout().strip() check: installed_tests).stdout().strip()
envs_str = ' '.join([
envs_str,
'G_TEST_SRCDIR=' + installed_tests_testdir,
'G_TEST_BUILDDIR=' + installed_tests_execdir,
])
if get_option('introspection') if get_option('introspection')
envs.prepend('GI_TYPELIB_PATH', meson.project_build_root() / 'libfprint') envs.prepend('GI_TYPELIB_PATH', meson.project_build_root() / 'libfprint')
virtual_devices_tests = [ virtual_devices_tests = [
@@ -149,7 +161,7 @@ if get_option('introspection')
foreach driver_test: drivers_tests foreach driver_test: drivers_tests
driver_name = driver_test.split('-')[0] driver_name = driver_test.split('-')[0]
driver_envs = envs driver_envs = envs
driver_envs.set('FP_DRIVERS_WHITELIST', driver_name) driver_envs.set('FP_DRIVERS_ALLOWLIST', driver_name)
if (driver_name in supported_drivers and if (driver_name in supported_drivers and
gusb_dep.version().version_compare('>= 0.3.0')) gusb_dep.version().version_compare('>= 0.3.0'))
@@ -247,10 +259,6 @@ endif
unit_tests_deps = { 'fpi-assembling' : [cairo_dep] } unit_tests_deps = { 'fpi-assembling' : [cairo_dep] }
test_config = configuration_data()
test_config.set_quoted('SOURCE_ROOT', meson.project_source_root())
test_config_h = configure_file(output: 'test-config.h', configuration: test_config)
foreach test_name: unit_tests foreach test_name: unit_tests
if unit_tests_deps.has_key(test_name) if unit_tests_deps.has_key(test_name)
missing_deps = false missing_deps = false
@@ -278,7 +286,7 @@ foreach test_name: unit_tests
basename = 'test-' + test_name basename = 'test-' + test_name
test_exe = executable(basename, test_exe = executable(basename,
sources: [basename + '.c', test_config_h], sources: basename + '.c',
dependencies: [ libfprint_private_dep ] + extra_deps, dependencies: [ libfprint_private_dep ] + extra_deps,
c_args: common_cflags, c_args: common_cflags,
link_whole: test_utils, link_whole: test_utils,
@@ -331,7 +339,7 @@ endif
valgrind = find_program('valgrind', required: false) valgrind = find_program('valgrind', required: false)
if valgrind.found() if valgrind.found()
glib_share = glib_dep.get_pkgconfig_variable('prefix') / 'share' / glib_dep.name() glib_share = glib_dep.get_variable(pkgconfig: 'prefix') / 'share' / glib_dep.name()
glib_suppressions = glib_share + '/valgrind/glib.supp' glib_suppressions = glib_share + '/valgrind/glib.supp'
libfprint_suppressions = '@0@/@1@'.format(meson.project_source_root(), libfprint_suppressions = '@0@/@1@'.format(meson.project_source_root(),
files('libfprint.supp')[0]) files('libfprint.supp')[0])

BIN
tests/realtek/custom.pcapng Normal file

Binary file not shown.

110
tests/realtek/custom.py Executable file
View File

@@ -0,0 +1,110 @@
#!/usr/bin/python3
import traceback
import sys
import gi
gi.require_version('FPrint', '2.0')
from gi.repository import FPrint, GLib
# Exit with error on any exception, included those happening in async callbacks
sys.excepthook = lambda *args: (traceback.print_exception(*args), sys.exit(1))
ctx = GLib.main_context_default()
c = FPrint.Context()
c.enumerate()
devices = c.get_devices()
d = devices[0]
del devices
assert d.get_driver() == "realtek"
assert not d.has_feature(FPrint.DeviceFeature.CAPTURE)
assert d.has_feature(FPrint.DeviceFeature.IDENTIFY)
assert d.has_feature(FPrint.DeviceFeature.VERIFY)
assert not d.has_feature(FPrint.DeviceFeature.DUPLICATES_CHECK)
assert d.has_feature(FPrint.DeviceFeature.STORAGE)
assert d.has_feature(FPrint.DeviceFeature.STORAGE_LIST)
assert d.has_feature(FPrint.DeviceFeature.STORAGE_DELETE)
assert d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR)
d.open_sync()
# 1. verify clear storage command, 2. make sure later asserts are good
d.clear_storage_sync()
template = FPrint.Print.new(d)
def enroll_progress(*args):
# assert d.get_finger_status() & FPrint.FingerStatusFlags.NEEDED
print('enroll progress: ' + str(args))
def identify_done(dev, res):
global identified
identified = True
try:
identify_match, identify_print = dev.identify_finish(res)
except gi.repository.GLib.GError as e:
print("Please try again")
else:
print('indentification_done: ', identify_match, identify_print)
assert identify_match.equal(identify_print)
def start_identify_async(prints):
global identified
print('async identifying')
d.identify(prints, callback=identify_done)
del prints
while not identified:
ctx.iteration(True)
identified = False
# List, enroll, list, verify, identify, delete
print("enrolling")
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
p = d.enroll_sync(template, None, enroll_progress, None)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
print("enroll done")
print("listing")
stored = d.list_prints_sync()
print("listing done")
assert len(stored) == 1
assert stored[0].equal(p)
print("verifying")
try:
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
verify_res, verify_print = d.verify_sync(p)
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
except gi.repository.GLib.GError as e:
print("Please try again")
else:
print("verify done")
del p
assert verify_res == True
identified = False
deserialized_prints = []
for p in stored:
deserialized_prints.append(FPrint.Print.deserialize(p.serialize()))
assert deserialized_prints[-1].equal(p)
del stored
print('async identifying')
d.identify(deserialized_prints, callback=identify_done)
del deserialized_prints
while not identified:
ctx.iteration(True)
print("deleting")
d.delete_print_sync(p)
print("delete done")
d.close_sync()
del d
del c

240
tests/realtek/device Normal file
View File

@@ -0,0 +1,240 @@
P: /devices/pci0000:00/0000:00:14.0/usb1/1-4
N: bus/usb/001/005=12010102EF020140DA0B135801210301020109022E00010104A0FA0904000004FF02000507050102000200070583031000080705840310000807058202000200
E: DEVNAME=/dev/bus/usb/001/005
E: DEVTYPE=usb_device
E: DRIVER=usb
E: PRODUCT=bda/5813/2101
E: TYPE=239/2/1
E: BUSNUM=001
E: DEVNUM=005
E: MAJOR=189
E: MINOR=4
E: SUBSYSTEM=usb
E: ID_VENDOR=Generic
E: ID_VENDOR_ENC=Generic
E: ID_VENDOR_ID=0bda
E: ID_MODEL=Realtek_USB2.0_Finger_Print_Bridge
E: ID_MODEL_ENC=Realtek\x20USB2.0\x20Finger\x20Print\x20Bridge
E: ID_MODEL_ID=5813
E: ID_REVISION=2101
E: ID_SERIAL=Generic_Realtek_USB2.0_Finger_Print_Bridge_201801010001
E: ID_SERIAL_SHORT=201801010001
E: ID_BUS=usb
E: ID_USB_INTERFACES=:ff0200:
E: ID_VENDOR_FROM_DATABASE=Realtek Semiconductor Corp.
E: ID_PATH=pci-0000:00:14.0-usb-0:4
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_4
A: authorized=1\n
A: avoid_reset_quirk=0\n
A: bConfigurationValue=1\n
A: bDeviceClass=ef\n
A: bDeviceProtocol=01\n
A: bDeviceSubClass=02\n
A: bMaxPacketSize0=64\n
A: bMaxPower=500mA\n
A: bNumConfigurations=1\n
A: bNumInterfaces= 1\n
A: bcdDevice=2101\n
A: bmAttributes=a0\n
A: busnum=1\n
A: configuration=Realtek USB2.0 Finger Print Bridge\n
H: descriptors=12010102EF020140DA0B135801210301020109022E00010104A0FA0904000004FF02000507050102000200070583031000080705840310000807058202000200
A: dev=189:4\n
A: devnum=5\n
A: devpath=4\n
L: driver=../../../../../bus/usb/drivers/usb
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4b/device:4c/device:50
A: idProduct=5813\n
A: idVendor=0bda\n
A: ltm_capable=no\n
A: manufacturer=Generic\n
A: maxchild=0\n
A: physical_location/dock=no\n
A: physical_location/horizontal_position=left\n
A: physical_location/lid=no\n
A: physical_location/panel=top\n
A: physical_location/vertical_position=upper\n
L: port=../1-0:1.0/usb1-port4
A: power/active_duration=91232868\n
A: power/async=enabled\n
A: power/autosuspend=2\n
A: power/autosuspend_delay_ms=2000\n
A: power/connected_duration=91232868\n
A: power/control=on\n
A: power/level=on\n
A: power/persist=1\n
A: power/runtime_active_kids=0\n
A: power/runtime_active_time=91232594\n
A: power/runtime_enabled=forbidden\n
A: power/runtime_status=active\n
A: power/runtime_suspended_time=0\n
A: power/runtime_usage=7\n
A: power/wakeup=disabled\n
A: power/wakeup_abort_count=\n
A: power/wakeup_active=\n
A: power/wakeup_active_count=\n
A: power/wakeup_count=\n
A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms=\n
A: product=Realtek USB2.0 Finger Print Bridge\n
A: quirks=0x0\n
A: removable=removable\n
A: rx_lanes=1\n
A: serial=201801010001\n
A: speed=480\n
A: tx_lanes=1\n
A: urbnum=15076313\n
A: version= 2.01\n
P: /devices/pci0000:00/0000:00:14.0/usb1
N: bus/usb/001/001=12010002090001406B1D020002060302010109021900010100E0000904000001090000000705810304000C
E: DEVNAME=/dev/bus/usb/001/001
E: DEVTYPE=usb_device
E: DRIVER=usb
E: PRODUCT=1d6b/2/602
E: TYPE=9/0/1
E: BUSNUM=001
E: DEVNUM=001
E: MAJOR=189
E: MINOR=0
E: SUBSYSTEM=usb
E: ID_VENDOR=Linux_6.2.0-35-generic_xhci-hcd
E: ID_VENDOR_ENC=Linux\x206.2.0-35-generic\x20xhci-hcd
E: ID_VENDOR_ID=1d6b
E: ID_MODEL=xHCI_Host_Controller
E: ID_MODEL_ENC=xHCI\x20Host\x20Controller
E: ID_MODEL_ID=0002
E: ID_REVISION=0602
E: ID_SERIAL=Linux_6.2.0-35-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
E: ID_SERIAL_SHORT=0000:00:14.0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:090000:
E: ID_VENDOR_FROM_DATABASE=Linux Foundation
E: ID_AUTOSUSPEND=1
E: ID_MODEL_FROM_DATABASE=2.0 root hub
E: ID_PATH=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: TAGS=:seat:
E: CURRENT_TAGS=:seat:
A: authorized=1\n
A: authorized_default=1\n
A: avoid_reset_quirk=0\n
A: bConfigurationValue=1\n
A: bDeviceClass=09\n
A: bDeviceProtocol=01\n
A: bDeviceSubClass=00\n
A: bMaxPacketSize0=64\n
A: bMaxPower=0mA\n
A: bNumConfigurations=1\n
A: bNumInterfaces= 1\n
A: bcdDevice=0602\n
A: bmAttributes=e0\n
A: busnum=1\n
A: configuration=
H: descriptors=12010002090001406B1D020002060302010109021900010100E0000904000001090000000705810304000C
A: dev=189:0\n
A: devnum=1\n
A: devpath=0\n
L: driver=../../../../bus/usb/drivers/usb
L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4b/device:4c
A: idProduct=0002\n
A: idVendor=1d6b\n
A: interface_authorized_default=1\n
A: ltm_capable=no\n
A: manufacturer=Linux 6.2.0-35-generic xhci-hcd\n
A: maxchild=16\n
A: power/active_duration=264747968\n
A: power/async=enabled\n
A: power/autosuspend=0\n
A: power/autosuspend_delay_ms=0\n
A: power/connected_duration=264747968\n
A: power/control=auto\n
A: power/level=auto\n
A: power/runtime_active_kids=3\n
A: power/runtime_active_time=264747968\n
A: power/runtime_enabled=enabled\n
A: power/runtime_status=active\n
A: power/runtime_suspended_time=0\n
A: power/runtime_usage=0\n
A: power/wakeup=disabled\n
A: power/wakeup_abort_count=\n
A: power/wakeup_active=\n
A: power/wakeup_active_count=\n
A: power/wakeup_count=\n
A: power/wakeup_expire_count=\n
A: power/wakeup_last_time_ms=\n
A: power/wakeup_max_time_ms=\n
A: power/wakeup_total_time_ms=\n
A: product=xHCI Host Controller\n
A: quirks=0x0\n
A: removable=unknown\n
A: rx_lanes=1\n
A: serial=0000:00:14.0\n
A: speed=480\n
A: tx_lanes=1\n
A: urbnum=3177\n
A: version= 2.00\n
P: /devices/pci0000:00/0000:00:14.0
E: DRIVER=xhci_hcd
E: PCI_CLASS=C0330
E: PCI_ID=8086:A36D
E: PCI_SUBSYS_ID=1028:085C
E: PCI_SLOT_NAME=0000:00:14.0
E: MODALIAS=pci:v00008086d0000A36Dsv00001028sd0000085Cbc0Csc03i30
E: SUBSYSTEM=pci
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_MODEL_FROM_DATABASE=Cannon Lake PCH USB 3.1 xHCI Host Controller
A: ari_enabled=0\n
A: broken_parity_status=0\n
A: class=0x0c0330\n
H: config=86806DA3060590021030030C00008000040030D200000000000000000000000000000000000000000000000028105C08000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F000000005919041B00000000316000000000000000000000000000000180C2C108000000000000000000000005908700D802E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000030000000C00000000000000C000000000000000000100003000000000000000030000000C0000000000000000000000000000000000000000000000000000000000000000000000B50F120112000000
A: consistent_dma_mask_bits=64\n
A: d3cold_allowed=1\n
A: dbc=disabled\n
A: device=0xa36d\n
A: dma_mask_bits=64\n
L: driver=../../../bus/pci/drivers/xhci_hcd
A: driver_override=(null)\n
A: enable=1\n
L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4b
A: index=4\n
A: irq=125\n
A: label=Onboard - Other\n
A: local_cpulist=0-3\n
A: local_cpus=f\n
A: modalias=pci:v00008086d0000A36Dsv00001028sd0000085Cbc0Csc03i30\n
A: msi_bus=1\n
A: msi_irqs/125=msi\n
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 6 7 2112 7\nxHCI ring segments 24 24 4096 24\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 12 32 128 1\nbuffer-32 0 0 32 0\n
A: power/async=enabled\n
A: power/control=on\n
A: power/runtime_active_kids=1\n
A: power/runtime_active_time=264748677\n
A: power/runtime_enabled=forbidden\n
A: power/runtime_status=active\n
A: power/runtime_suspended_time=0\n
A: power/runtime_usage=1\n
A: power/wakeup=enabled\n
A: power/wakeup_abort_count=0\n
A: power/wakeup_active=0\n
A: power/wakeup_active_count=0\n
A: power/wakeup_count=0\n
A: power/wakeup_expire_count=0\n
A: power/wakeup_last_time_ms=0\n
A: power/wakeup_max_time_ms=0\n
A: power/wakeup_total_time_ms=0\n
A: power_state=D0\n
A: resource=0x00000000d2300000 0x00000000d230ffff 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=0x10\n
A: subsystem_device=0x085c\n
A: subsystem_vendor=0x1028\n
A: vendor=0x8086\n

View File

@@ -22,7 +22,6 @@
#include <cairo.h> #include <cairo.h>
#include "fpi-assembling.h" #include "fpi-assembling.h"
#include "fpi-image.h" #include "fpi-image.h"
#include "test-config.h"
typedef struct typedef struct
{ {
@@ -67,8 +66,7 @@ test_frame_assembling (void)
g_autoptr(FpImage) fp_img = NULL; g_autoptr(FpImage) fp_img = NULL;
GSList *frames = NULL; GSList *frames = NULL;
g_assert_false (SOURCE_ROOT == NULL); path = g_test_build_filename (G_TEST_DIST, "vfs5011", "capture.png", NULL);
path = g_build_path (G_DIR_SEPARATOR_S, SOURCE_ROOT, "tests", "vfs5011", "capture.png", NULL);
img = cairo_image_surface_create_from_png (path); img = cairo_image_surface_create_from_png (path);
data = cairo_image_surface_get_data (img); data = cairo_image_surface_get_data (img);

View File

@@ -1,13 +1,12 @@
#!/usr/bin/env bash #!/bin/sh -e
set -e
if [ ! -x "$UDEV_HWDB" ]; then if [ ! -x "$UDEV_HWDB" ]; then
echo "E: UDEV_HWDB (${UDEV_HWDB}) unset or not executable." echo "E: UDEV_HWDB (${UDEV_HWDB}) unset or not executable."
exit 1 exit 1
fi fi
if [ "$UDEV_HWDB_CHECK_CONTENTS" == 1 ]; then if [ "$UDEV_HWDB_CHECK_CONTENTS" = 1 ]; then
generated_rules=$(mktemp "${TMPDIR:-/tmp}/libfprint-XXXXXX.hwdb") generated_rules=$(mktemp "${TMPDIR:-/tmp}/libfprint.hwdb.XXXXXX")
else else
generated_rules=/dev/null generated_rules=/dev/null
fi fi