mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
Compare commits
118 Commits
v1.92.0
...
benzea/sel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a9ad74ec4 | ||
|
|
56ae75d2b2 | ||
|
|
54a98bb286 | ||
|
|
bfbe24b172 | ||
|
|
1f925fef7c | ||
|
|
7b0093b4c6 | ||
|
|
0fd5a617ab | ||
|
|
e7d041d258 | ||
|
|
eda8d13927 | ||
|
|
5ba7ff8be9 | ||
|
|
da1a56a600 | ||
|
|
2b760dfa38 | ||
|
|
f1a61c060f | ||
|
|
5fb3b8b43a | ||
|
|
8fad2652ee | ||
|
|
6f5ba3cbb5 | ||
|
|
754ccfb865 | ||
|
|
d3014f1684 | ||
|
|
3568051686 | ||
|
|
9ce6ed4164 | ||
|
|
e0fd178bec | ||
|
|
168ab98021 | ||
|
|
ae5696a9bb | ||
|
|
038c7108a6 | ||
|
|
eb1013cdb6 | ||
|
|
5beac0ded7 | ||
|
|
7565562903 | ||
|
|
999bca076c | ||
|
|
e198b04222 | ||
|
|
3981c42d3e | ||
|
|
31afd3ba5c | ||
|
|
05fd2c58cb | ||
|
|
a033154b2e | ||
|
|
5e4bb26801 | ||
|
|
2cfff27729 | ||
|
|
378fae0ea2 | ||
|
|
01b0f7aba0 | ||
|
|
17ff49f85c | ||
|
|
de46e1e4b8 | ||
|
|
5e934a4fa0 | ||
|
|
5d0a3eab5c | ||
|
|
7efb860381 | ||
|
|
f9492d5345 | ||
|
|
46669e9f53 | ||
|
|
a949594050 | ||
|
|
20e8355c01 | ||
|
|
f579a77bfd | ||
|
|
03deb3011b | ||
|
|
c7650b6ec9 | ||
|
|
128d809227 | ||
|
|
9356e895a2 | ||
|
|
3c2883b992 | ||
|
|
eb568a62aa | ||
|
|
d763f8f41a | ||
|
|
df41ed56f6 | ||
|
|
aff063c23c | ||
|
|
e2511095d1 | ||
|
|
9515cc2e59 | ||
|
|
b3cfc40dea | ||
|
|
c162b895c0 | ||
|
|
40b3923ca6 | ||
|
|
d7e7d8e036 | ||
|
|
ec53abfc3a | ||
|
|
83541a2ddc | ||
|
|
e22497d51b | ||
|
|
0dcb4be4d3 | ||
|
|
8f93aef122 | ||
|
|
8dfa12e41d | ||
|
|
88cb452e05 | ||
|
|
909865ed8d | ||
|
|
39333a0642 | ||
|
|
4340be728c | ||
|
|
dba5ca5535 | ||
|
|
2a70cd7e02 | ||
|
|
3108ac3144 | ||
|
|
c928d7bd8f | ||
|
|
ec42b2ade1 | ||
|
|
4edfa48608 | ||
|
|
1a5df96751 | ||
|
|
62448492af | ||
|
|
874513e79a | ||
|
|
5c89bda7f3 | ||
|
|
8147372bdd | ||
|
|
43336a204f | ||
|
|
968331c383 | ||
|
|
d547c000fc | ||
|
|
ff6caca2e3 | ||
|
|
77756e111d | ||
|
|
23a4f5b77a | ||
|
|
5b7c5e7c09 | ||
|
|
da28731adc | ||
|
|
6440a7d12f | ||
|
|
71e0c29f28 | ||
|
|
a2d950044d | ||
|
|
96e5888110 | ||
|
|
dd476c0ccf | ||
|
|
4cdca4da24 | ||
|
|
a68fce0f2c | ||
|
|
1f5e0821e0 | ||
|
|
d6b4adec73 | ||
|
|
9e7bfa05b3 | ||
|
|
9ecd6236ee | ||
|
|
a07011bac2 | ||
|
|
f7290255e0 | ||
|
|
29048c51db | ||
|
|
42676dd300 | ||
|
|
45c5d17f3b | ||
|
|
fc76db562e | ||
|
|
9f93f5ded7 | ||
|
|
74c4125827 | ||
|
|
4f6d908390 | ||
|
|
575bd369d5 | ||
|
|
304219b65c | ||
|
|
23bca2a8ac | ||
|
|
4bf064d873 | ||
|
|
d2c2410a6f | ||
|
|
e8f9cc1fce | ||
|
|
0ee274946d |
@@ -1,6 +1,6 @@
|
||||
include:
|
||||
- local: '.gitlab-ci/libfprint-templates.yaml'
|
||||
- project: 'wayland/ci-templates'
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: master
|
||||
file: '/templates/fedora.yml'
|
||||
- remote: 'https://gitlab.gnome.org/GNOME/citemplates/-/raw/master/flatpak/flatpak_ci_initiative.yml'
|
||||
@@ -9,6 +9,7 @@ variables:
|
||||
extends: .libfprint_common_variables
|
||||
FDO_DISTRIBUTION_TAG: latest
|
||||
FDO_DISTRIBUTION_VERSION: rawhide
|
||||
FDO_UPSTREAM_REPO: "libfprint/$CI_PROJECT_NAME"
|
||||
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"
|
||||
@@ -19,7 +20,7 @@ stages:
|
||||
- test
|
||||
- flatpak
|
||||
|
||||
image: "$FEDORA_IMAGE"
|
||||
image: $FEDORA_IMAGE
|
||||
|
||||
.build_one_driver_template: &build_one_driver
|
||||
script:
|
||||
@@ -69,6 +70,7 @@ test:
|
||||
- cat _build/meson-logs/coverage.txt
|
||||
artifacts:
|
||||
expose_as: 'Coverage Report'
|
||||
when: always
|
||||
paths:
|
||||
- _build/meson-logs
|
||||
- _build/meson-logs/coveragereport/index.html
|
||||
@@ -86,6 +88,7 @@ test_valgrind:
|
||||
- meson test -C _build --print-errorlogs --no-stdsplit --setup=valgrind
|
||||
artifacts:
|
||||
expose_as: 'Valgrind test logs'
|
||||
when: always
|
||||
paths:
|
||||
- _build/meson-logs
|
||||
- _build/meson-logs/testlog-valgrind.txt
|
||||
@@ -157,6 +160,7 @@ container_fedora_build:
|
||||
- $CI_PIPELINE_SOURCE == "schedule" && $CRON_TASK == "BUILD_CI_IMAGES"
|
||||
variables:
|
||||
GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
|
||||
FDO_FORCE_REBUILD: 1
|
||||
# a list of packages to install
|
||||
FDO_DISTRIBUTION_PACKAGES:
|
||||
$LIBFPRINT_DEPENDENCIES
|
||||
|
||||
@@ -26,3 +26,4 @@
|
||||
uncrustify
|
||||
valgrind
|
||||
clang-analyzer
|
||||
diffutils
|
||||
|
||||
48
NEWS
48
NEWS
@@ -1,6 +1,54 @@
|
||||
This file lists notable changes in each release. For the full history of all
|
||||
changes, see ChangeLog.
|
||||
|
||||
2021-11-02: v1.94.3 release
|
||||
|
||||
Highlights:
|
||||
* Ensure idle mainloop before completing enumeration (fprintd#119)
|
||||
* It is now possible to extend already enrolled prints
|
||||
* elanspi: Fix timeout error with some hardware (#438)
|
||||
* elanspi: Fix cancellation issues
|
||||
* goodixmoc: Return matching device print; fixes duplicate checking (#444)
|
||||
* goodixmoc: Support clearing the storage (usually unused)
|
||||
|
||||
2021-11-02: v1.94.2 release
|
||||
|
||||
Highlights:
|
||||
* goodixmoc: Fix protocol error with certain username lengths
|
||||
* elanmoc: New PID 0x0c7d
|
||||
* goodixmoc: New PID 0x63cc
|
||||
|
||||
2021-09-24: v1.94.1 release
|
||||
|
||||
Highlights:
|
||||
* Ship a simple script to create new CI tests using tshark
|
||||
* Added CI tests for elan, uru4000, aes2501
|
||||
* goodixmoc: Remove duplicate checking during enroll and let fprintd handle it
|
||||
* uru4000: Fix USB transfer type
|
||||
* synaptics: Support for new PIDs
|
||||
* goodixmoc: Support for new PIDs
|
||||
|
||||
2021-08-20: v1.94.0 release
|
||||
|
||||
Highlights:
|
||||
* Implement suspend/resume handling including USB wakeup configuration.
|
||||
This requires writing the "persist" and "wakeup" sysfs attributes.
|
||||
* Add simple temperature module to prevent devices from becoming too hot
|
||||
* Add feature for continuous scanning
|
||||
* New internal "critical section" API to simplify driver development
|
||||
* elan: new PID 0x0c58
|
||||
* elanmoc: Fixes for multi-user handling and FW changes
|
||||
* virtual-device: Do not time out for SCAN command
|
||||
|
||||
2021-06-30: v1.92.1 release
|
||||
|
||||
Highlights:
|
||||
* elanmoc: New driver for ELAN match-on-chip devices
|
||||
* egis0570: New driver for some Egis Technology devices
|
||||
* synaptics: Fix empty identify causing enroll issues
|
||||
* elan: Support more PIDs
|
||||
* misc: Architecture related bugfixes
|
||||
|
||||
2021-06-30: v1.92.0 release
|
||||
|
||||
Highlights:
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
libfprint
|
||||
=========
|
||||
# libfprint
|
||||
|
||||
libfprint is part of the fprint project:
|
||||
https://fprint.freedesktop.org/
|
||||
|
||||
## History
|
||||
|
||||
libfprint was originally developed as part of an academic project at the
|
||||
University of Manchester with the aim of hiding differences between different
|
||||
consumer fingerprint scanners and providing a single uniform API to application
|
||||
@@ -15,6 +16,8 @@ from this one, although I try to keep them as similar as possible (I'm not
|
||||
hiding anything in the academic branch, it's just the open source release
|
||||
contains some commits excluded from the academic project).
|
||||
|
||||
## License
|
||||
|
||||
THE UNIVERSITY OF MANCHESTER DOES NOT ENDORSE THIS THIS SOFTWARE RELEASE AND
|
||||
IS IN NO WAY RESPONSIBLE FOR THE CODE CONTAINED WITHIN, OR ANY DAMAGES CAUSED
|
||||
BY USING OR DISTRIBUTING THE SOFTWARE. Development does not happen on
|
||||
30
TODO
30
TODO
@@ -1,30 +0,0 @@
|
||||
LIBRARY
|
||||
=======
|
||||
test suite against NFIQ compliance set
|
||||
make library optionally asynchronous and maybe thread-safe
|
||||
nbis cleanups
|
||||
API function to determine if img device supports uncond. capture
|
||||
race-free way of saying "save this print but don't overwrite"
|
||||
|
||||
NEW DRIVERS
|
||||
===========
|
||||
Sunplus 895 driver
|
||||
AES3400/3500 driver
|
||||
ID Mouse driver
|
||||
Support for 2nd generation MS devices
|
||||
Support for 2nd generation UPEK devices
|
||||
|
||||
IMAGING
|
||||
=======
|
||||
ignore first frame or two with aes2501
|
||||
aes2501: increase threshold "sum" for end-of-image detection
|
||||
aes2501 gain calibration
|
||||
aes4000 gain calibration
|
||||
aes4000 resampling
|
||||
PPMM parameter to get_minutiae seems to have no effect
|
||||
nbis minutiae should be stored in endian-independent format
|
||||
|
||||
PORTABILITY
|
||||
===========
|
||||
OpenBSD can't do -Wshadow or visibility
|
||||
OpenBSD: add compat codes for ENOTSUP ENODATA and EPROTO
|
||||
@@ -4,6 +4,7 @@
|
||||
# Supported by libfprint driver aes1610
|
||||
usb:v08FFp1600*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes1660
|
||||
usb:v08FFp1660*
|
||||
@@ -24,16 +25,19 @@ usb:v08FFp168D*
|
||||
usb:v08FFp168E*
|
||||
usb:v08FFp168F*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes2501
|
||||
usb:v08FFp2500*
|
||||
usb:v08FFp2580*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes2550
|
||||
usb:v08FFp2550*
|
||||
usb:v08FFp2810*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes2660
|
||||
usb:v08FFp2660*
|
||||
@@ -55,14 +59,23 @@ usb:v08FFp268E*
|
||||
usb:v08FFp268F*
|
||||
usb:v08FFp2691*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes3500
|
||||
usb:v08FFp5731*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes4000
|
||||
usb:v5501p08FF*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver egis0570
|
||||
usb:v1C7Ap0570*
|
||||
usb:v1C7Ap0571*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver elan
|
||||
usb:v04F3p0903*
|
||||
@@ -120,14 +133,26 @@ usb:v04F3p0C32*
|
||||
usb:v04F3p0C33*
|
||||
usb:v04F3p0C3D*
|
||||
usb:v04F3p0C42*
|
||||
usb:v04F3p0C4B*
|
||||
usb:v04F3p0C4D*
|
||||
usb:v04F3p0C4F*
|
||||
usb:v04F3p0C63*
|
||||
usb:v04F3p0C6E*
|
||||
usb:v04F3p0C58*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver elanmoc
|
||||
usb:v04F3p0C7D*
|
||||
usb:v04F3p0C7E*
|
||||
usb:v04F3p0C82*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver etes603
|
||||
usb:v1C7Ap0603*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver goodixmoc
|
||||
usb:v27C6p5840*
|
||||
@@ -135,6 +160,8 @@ usb:v27C6p609C*
|
||||
usb:v27C6p60A2*
|
||||
usb:v27C6p639C*
|
||||
usb:v27C6p63AC*
|
||||
usb:v27C6p63BC*
|
||||
usb:v27C6p63CC*
|
||||
usb:v27C6p6496*
|
||||
usb:v27C6p6584*
|
||||
usb:v27C6p658C*
|
||||
@@ -143,10 +170,12 @@ usb:v27C6p6594*
|
||||
usb:v27C6p659C*
|
||||
usb:v27C6p6A94*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver nb1010
|
||||
usb:v298Dp1010*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver synaptics
|
||||
usb:v06CBp00BD*
|
||||
@@ -154,26 +183,33 @@ usb:v06CBp00DF*
|
||||
usb:v06CBp00F9*
|
||||
usb:v06CBp00FC*
|
||||
usb:v06CBp00C2*
|
||||
usb:v06CBp00C9*
|
||||
usb:v06CBp0100*
|
||||
usb:v06CBp00F0*
|
||||
usb:v06CBp0103*
|
||||
usb:v06CBp0123*
|
||||
usb:v06CBp0126*
|
||||
usb:v06CBp0129*
|
||||
usb:v06CBp0168*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver upeksonly
|
||||
usb:v147Ep2016*
|
||||
usb:v147Ep1000*
|
||||
usb:v147Ep1001*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver upektc
|
||||
usb:v0483p2015*
|
||||
usb:v147Ep3001*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver upektc_img
|
||||
usb:v147Ep2020*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver uru4000
|
||||
usb:v045Ep00BC*
|
||||
@@ -183,23 +219,28 @@ usb:v05BAp0007*
|
||||
usb:v05BAp0008*
|
||||
usb:v05BAp000A*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vcom5s
|
||||
usb:v061Ap0110*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vfs0050
|
||||
usb:v138Ap0050*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vfs101
|
||||
usb:v138Ap0001*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vfs301
|
||||
usb:v138Ap0005*
|
||||
usb:v138Ap0008*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vfs5011
|
||||
usb:v138Ap0010*
|
||||
@@ -208,15 +249,16 @@ usb:v138Ap0015*
|
||||
usb:v138Ap0017*
|
||||
usb:v138Ap0018*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vfs7552
|
||||
usb:v138Ap0091*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Known unsupported devices
|
||||
usb:v04F3p036B*
|
||||
usb:v04F3p0C00*
|
||||
usb:v04F3p0C4B*
|
||||
usb:v04F3p0C4C*
|
||||
usb:v04F3p0C57*
|
||||
usb:v04F3p0C5E*
|
||||
@@ -227,14 +269,19 @@ usb:v06CBp008A*
|
||||
usb:v06CBp009A*
|
||||
usb:v06CBp009B*
|
||||
usb:v06CBp00A2*
|
||||
usb:v06CBp00A8*
|
||||
usb:v06CBp00B7*
|
||||
usb:v06CBp00BB*
|
||||
usb:v06CBp00BE*
|
||||
usb:v06CBp00C4*
|
||||
usb:v06CBp00CB*
|
||||
usb:v06CBp00C9*
|
||||
usb:v06CBp00D8*
|
||||
usb:v06CBp00DA*
|
||||
usb:v06CBp00DC*
|
||||
usb:v06CBp00E7*
|
||||
usb:v06CBp00E9*
|
||||
usb:v06CBp00FD*
|
||||
usb:v0A5Cp5801*
|
||||
usb:v0A5Cp5805*
|
||||
usb:v0A5Cp5834*
|
||||
@@ -242,8 +289,11 @@ usb:v0A5Cp5840*
|
||||
usb:v0A5Cp5841*
|
||||
usb:v0A5Cp5842*
|
||||
usb:v0A5Cp5843*
|
||||
usb:v0A5Cp5844*
|
||||
usb:v0A5Cp5845*
|
||||
usb:v0BDAp5812*
|
||||
usb:v10A5p0007*
|
||||
usb:v10A5p9200*
|
||||
usb:v1188p9545*
|
||||
usb:v138Ap0007*
|
||||
usb:v138Ap003A*
|
||||
@@ -260,8 +310,8 @@ usb:v147Ep1002*
|
||||
usb:v1491p0088*
|
||||
usb:v16D1p1027*
|
||||
usb:v1C7Ap0300*
|
||||
usb:v1C7Ap0570*
|
||||
usb:v1C7Ap0575*
|
||||
usb:v1C7Ap0576*
|
||||
usb:v27C6p5042*
|
||||
usb:v27C6p5110*
|
||||
usb:v27C6p5117*
|
||||
@@ -281,7 +331,10 @@ usb:v27C6p55A2*
|
||||
usb:v27C6p55A4*
|
||||
usb:v27C6p55B4*
|
||||
usb:v27C6p5740*
|
||||
usb:v27C6p5E0A*
|
||||
usb:v2808p9338*
|
||||
usb:v298Dp2020*
|
||||
usb:v298Dp2033*
|
||||
usb:v3538p0930*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
@@ -50,6 +50,8 @@ fp_device_capture
|
||||
fp_device_delete_print
|
||||
fp_device_list_prints
|
||||
fp_device_clear_storage
|
||||
fp_device_suspend
|
||||
fp_device_resume
|
||||
fp_device_open_finish
|
||||
fp_device_close_finish
|
||||
fp_device_enroll_finish
|
||||
@@ -59,6 +61,8 @@ fp_device_capture_finish
|
||||
fp_device_delete_print_finish
|
||||
fp_device_list_prints_finish
|
||||
fp_device_clear_storage_finish
|
||||
fp_device_suspend_finish
|
||||
fp_device_resume_finish
|
||||
fp_device_open_sync
|
||||
fp_device_close_sync
|
||||
fp_device_enroll_sync
|
||||
@@ -68,6 +72,8 @@ fp_device_capture_sync
|
||||
fp_device_delete_print_sync
|
||||
fp_device_list_prints_sync
|
||||
fp_device_clear_storage_sync
|
||||
fp_device_suspend_sync
|
||||
fp_device_resume_sync
|
||||
FpDevice
|
||||
</SECTION>
|
||||
|
||||
@@ -160,6 +166,8 @@ fpi_device_add_timeout
|
||||
fpi_device_set_nr_enroll_stages
|
||||
fpi_device_set_scan_type
|
||||
fpi_device_update_features
|
||||
fpi_device_critical_enter
|
||||
fpi_device_critical_leave
|
||||
fpi_device_remove
|
||||
fpi_device_report_finger_status
|
||||
fpi_device_report_finger_status_changes
|
||||
@@ -171,11 +179,14 @@ fpi_device_enroll_complete
|
||||
fpi_device_verify_complete
|
||||
fpi_device_identify_complete
|
||||
fpi_device_capture_complete
|
||||
fpi_device_clear_storage_complete
|
||||
fpi_device_delete_complete
|
||||
fpi_device_list_complete
|
||||
fpi_device_suspend_complete
|
||||
fpi_device_resume_complete
|
||||
fpi_device_enroll_progress
|
||||
fpi_device_verify_report
|
||||
fpi_device_identify_report
|
||||
fpi_device_list_complete
|
||||
fpi_device_class_auto_initialize_features
|
||||
</SECTION>
|
||||
|
||||
@@ -249,7 +260,11 @@ fpi_ssm_get_device
|
||||
fpi_ssm_get_error
|
||||
fpi_ssm_dup_error
|
||||
fpi_ssm_get_cur_state
|
||||
fpi_ssm_silence_debug
|
||||
fpi_ssm_spi_transfer_cb
|
||||
fpi_ssm_spi_transfer_with_weak_pointer_cb
|
||||
fpi_ssm_usb_transfer_cb
|
||||
fpi_ssm_usb_transfer_with_weak_pointer_cb
|
||||
FpiSsm
|
||||
</SECTION>
|
||||
|
||||
@@ -276,3 +291,20 @@ FPI_TYPE_USB_TRANSFER
|
||||
fpi_usb_transfer_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fpi-spi-transfer</FILE>
|
||||
FpiSpiTransferCallback
|
||||
FpiSpiTransfer
|
||||
fpi_spi_transfer_new
|
||||
fpi_spi_transfer_ref
|
||||
fpi_spi_transfer_unref
|
||||
fpi_spi_transfer_write
|
||||
fpi_spi_transfer_write_full
|
||||
fpi_spi_transfer_read
|
||||
fpi_spi_transfer_read_full
|
||||
fpi_spi_transfer_submit
|
||||
fpi_spi_transfer_submit_sync
|
||||
<SUBSECTION Standard>
|
||||
FPI_TYPE_SPI_TRANSFER
|
||||
fpi_spi_transfer_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
</chapter>
|
||||
|
||||
<chapter id="driver-helpers">
|
||||
<title>USB and State Machine helpers</title>
|
||||
<title>USB, SPI and State Machine helpers</title>
|
||||
<xi:include href="xml/fpi-spi-transfer.xml"/>
|
||||
<xi:include href="xml/fpi-usb-transfer.xml"/>
|
||||
<xi:include href="xml/fpi-ssm.xml"/>
|
||||
<xi:include href="xml/fpi-log.xml"/>
|
||||
|
||||
@@ -35,6 +35,7 @@ typedef struct _EnrollData
|
||||
unsigned int sigint_handler;
|
||||
FpFinger finger;
|
||||
int ret_value;
|
||||
gboolean update_fingerprint;
|
||||
} EnrollData;
|
||||
|
||||
static void
|
||||
@@ -84,7 +85,8 @@ on_enroll_completed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
/* Even if the device has storage, it may not be able to save all the
|
||||
* metadata that the print contains, so we can always save a local copy
|
||||
* containing the handle to the device print */
|
||||
int r = print_data_save (print, enroll_data->finger);
|
||||
int r = print_data_save (print, enroll_data->finger,
|
||||
enroll_data->update_fingerprint);
|
||||
if (r < 0)
|
||||
{
|
||||
g_warning ("Data save failed, code %d", r);
|
||||
@@ -124,6 +126,40 @@ on_enroll_progress (FpDevice *device,
|
||||
fp_device_get_nr_enroll_stages (device));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_update_fingerprint (void)
|
||||
{
|
||||
int update_choice;
|
||||
gboolean update_fingerprint = FALSE;
|
||||
|
||||
printf ("Should an existing fingerprint be updated instead of being replaced (if present)? "
|
||||
"Enter Y/y or N/n to make a choice.\n");
|
||||
update_choice = getchar ();
|
||||
if (update_choice == EOF)
|
||||
{
|
||||
g_warning ("EOF encountered while reading a character");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
switch (update_choice)
|
||||
{
|
||||
case 'y':
|
||||
case 'Y':
|
||||
update_fingerprint = TRUE;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
case 'N':
|
||||
update_fingerprint = FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
g_warning ("Invalid choice %c, should be Y/y or N/n.", update_choice);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return update_fingerprint;
|
||||
}
|
||||
|
||||
static void
|
||||
on_device_opened (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
@@ -139,13 +175,26 @@ on_device_opened (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
return;
|
||||
}
|
||||
|
||||
printf ("Opened device. It's now time to enroll your finger.\n\n");
|
||||
printf ("Opened device.\n");
|
||||
|
||||
if (fp_device_has_feature (dev, FP_DEVICE_FEATURE_UPDATE_PRINT))
|
||||
{
|
||||
printf ("The device supports fingerprint updates.\n");
|
||||
enroll_data->update_fingerprint = should_update_fingerprint ();
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("The device doesn't support fingerprint updates. Old prints will be erased.\n");
|
||||
enroll_data->update_fingerprint = FALSE;
|
||||
}
|
||||
|
||||
printf ("It's now time to enroll your finger.\n\n");
|
||||
printf ("You will need to successfully scan your %s finger %d times to "
|
||||
"complete the process.\n\n", finger_to_string (enroll_data->finger),
|
||||
fp_device_get_nr_enroll_stages (dev));
|
||||
printf ("Scan your finger now.\n");
|
||||
|
||||
print_template = print_create_template (dev, enroll_data->finger);
|
||||
print_template = print_create_template (dev, enroll_data->finger, enroll_data->update_fingerprint);
|
||||
fp_device_enroll (dev, print_template, enroll_data->cancellable,
|
||||
on_enroll_progress, NULL, NULL,
|
||||
(GAsyncReadyCallback) on_enroll_completed,
|
||||
@@ -171,11 +220,9 @@ main (void)
|
||||
FpDevice *dev;
|
||||
FpFinger finger;
|
||||
|
||||
g_print ("This program will enroll the selected finger, unconditionally "
|
||||
"overwriting any print for the same finger that was enrolled "
|
||||
"previously. If you want to continue, press enter, otherwise hit "
|
||||
"Ctrl+C\n");
|
||||
getchar ();
|
||||
g_print ("This program will enroll the selected finger overwriting any print for the same"
|
||||
" finger that was enrolled previously. Fingerprint updates without erasing old data"
|
||||
" are possible on devices supporting that. Ctrl+C interrupts program execution.\n");
|
||||
|
||||
g_print ("Choose the finger to enroll:\n");
|
||||
finger = finger_chooser ();
|
||||
|
||||
@@ -143,6 +143,7 @@ on_identify_cb (FpDevice *dev, FpPrint *match, FpPrint *print,
|
||||
if (match)
|
||||
{
|
||||
g_autoptr(FpPrint) matched_print = g_object_ref (match);
|
||||
const GDate *date;
|
||||
char date_str[128] = {};
|
||||
|
||||
identify_data->ret_value = EXIT_SUCCESS;
|
||||
@@ -155,7 +156,8 @@ on_identify_cb (FpDevice *dev, FpPrint *match, FpPrint *print,
|
||||
matched_print = g_steal_pointer (&stored_print);
|
||||
}
|
||||
|
||||
if (fp_print_get_enroll_date (matched_print))
|
||||
date = fp_print_get_enroll_date (matched_print);
|
||||
if (date && g_date_valid (date))
|
||||
g_date_strftime (date_str, G_N_ELEMENTS (date_str), "%Y-%m-%d\0",
|
||||
fp_print_get_enroll_date (matched_print));
|
||||
else
|
||||
|
||||
@@ -161,7 +161,7 @@ on_list_completed (FpDevice *dev,
|
||||
finger_to_string (fp_print_get_finger (print)),
|
||||
fp_print_get_username (print));
|
||||
|
||||
if (date)
|
||||
if (date && g_date_valid (date))
|
||||
{
|
||||
g_date_strftime (buf, G_N_ELEMENTS (buf), "%Y-%m-%d\0", date);
|
||||
g_print (", enrolled on %s", buf);
|
||||
|
||||
@@ -102,8 +102,23 @@ save_data (GVariant *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static FpPrint *
|
||||
load_print_from_data (GVariant *data)
|
||||
{
|
||||
const guchar *stored_data = NULL;
|
||||
gsize stored_len;
|
||||
FpPrint *print;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
stored_data = (const guchar *) g_variant_get_fixed_array (data, &stored_len, 1);
|
||||
print = fp_print_deserialize (stored_data, stored_len, &error);
|
||||
if (error)
|
||||
g_warning ("Error deserializing data: %s", error->message);
|
||||
return print;
|
||||
}
|
||||
|
||||
int
|
||||
print_data_save (FpPrint *print, FpFinger finger)
|
||||
print_data_save (FpPrint *print, FpFinger finger, gboolean update_fingerprint)
|
||||
{
|
||||
g_autofree gchar *descr = get_print_data_descriptor (print, NULL, finger);
|
||||
|
||||
@@ -137,25 +152,12 @@ print_data_load (FpDevice *dev, FpFinger finger)
|
||||
|
||||
g_autoptr(GVariant) val = NULL;
|
||||
g_autoptr(GVariantDict) dict = NULL;
|
||||
const guchar *stored_data = NULL;
|
||||
gsize stored_len;
|
||||
|
||||
dict = load_data ();
|
||||
val = g_variant_dict_lookup_value (dict, descr, G_VARIANT_TYPE ("ay"));
|
||||
|
||||
if (val)
|
||||
{
|
||||
FpPrint *print;
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
stored_data = (const guchar *) g_variant_get_fixed_array (val, &stored_len, 1);
|
||||
print = fp_print_deserialize (stored_data, stored_len, &error);
|
||||
|
||||
if (error)
|
||||
g_warning ("Error deserializing data: %s", error->message);
|
||||
|
||||
return print;
|
||||
}
|
||||
return load_print_from_data (val);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -207,16 +209,30 @@ gallery_data_load (FpDevice *dev)
|
||||
}
|
||||
|
||||
FpPrint *
|
||||
print_create_template (FpDevice *dev, FpFinger finger)
|
||||
print_create_template (FpDevice *dev, FpFinger finger, gboolean load_existing)
|
||||
{
|
||||
g_autoptr(GVariantDict) dict = NULL;
|
||||
g_autoptr(GDateTime) datetime = NULL;
|
||||
g_autoptr(GDate) date = NULL;
|
||||
g_autoptr(GVariant) existing_val = NULL;
|
||||
g_autofree gchar *descr = get_print_data_descriptor (NULL, dev, finger);
|
||||
FpPrint *template = NULL;
|
||||
gint year, month, day;
|
||||
|
||||
template = fp_print_new (dev);
|
||||
fp_print_set_finger (template, finger);
|
||||
fp_print_set_username (template, g_get_user_name ());
|
||||
if (load_existing)
|
||||
{
|
||||
dict = load_data ();
|
||||
existing_val = g_variant_dict_lookup_value (dict, descr, G_VARIANT_TYPE ("ay"));
|
||||
if (existing_val != NULL)
|
||||
template = load_print_from_data (existing_val);
|
||||
}
|
||||
if (template == NULL)
|
||||
{
|
||||
template = fp_print_new (dev);
|
||||
fp_print_set_finger (template, finger);
|
||||
fp_print_set_username (template, g_get_user_name ());
|
||||
}
|
||||
|
||||
datetime = g_date_time_new_now_local ();
|
||||
g_date_time_get_ymd (datetime, &year, &month, &day);
|
||||
date = g_date_new_dmy (day, month, year);
|
||||
|
||||
@@ -21,12 +21,14 @@
|
||||
#pragma once
|
||||
|
||||
int print_data_save (FpPrint *print,
|
||||
FpFinger finger);
|
||||
FpFinger finger,
|
||||
gboolean update_fingerprint);
|
||||
FpPrint * print_data_load (FpDevice *dev,
|
||||
FpFinger finger);
|
||||
GPtrArray * gallery_data_load (FpDevice *dev);
|
||||
FpPrint * print_create_template (FpDevice *dev,
|
||||
FpFinger finger);
|
||||
FpPrint * print_create_template (FpDevice *dev,
|
||||
FpFinger finger,
|
||||
const gboolean load_existing);
|
||||
gboolean print_image_save (FpPrint *print,
|
||||
const char *path);
|
||||
gboolean save_image_to_pgm (FpImage *img,
|
||||
|
||||
@@ -130,12 +130,14 @@ on_match_cb (FpDevice *dev, FpPrint *match, FpPrint *print,
|
||||
|
||||
if (match)
|
||||
{
|
||||
char date_str[128];
|
||||
const GDate *date = fp_print_get_enroll_date (match);
|
||||
char date_str[128] = "<unknown>";
|
||||
|
||||
verify_data->ret_value = EXIT_SUCCESS;
|
||||
|
||||
g_date_strftime (date_str, G_N_ELEMENTS (date_str), "%Y-%m-%d\0",
|
||||
fp_print_get_enroll_date (match));
|
||||
if (date && g_date_valid (date))
|
||||
g_date_strftime (date_str, G_N_ELEMENTS (date_str), "%Y-%m-%d\0",
|
||||
fp_print_get_enroll_date (match));
|
||||
g_debug ("Match report: device %s matched finger %s successifully "
|
||||
"with print %s, enrolled on date %s by user %s",
|
||||
fp_device_get_name (dev),
|
||||
|
||||
@@ -365,7 +365,7 @@ capture_read_stripe_data_cb (FpiUsbTransfer *transfer,
|
||||
return;
|
||||
}
|
||||
|
||||
fp_dbg ("Got %lu bytes of data", actual_length);
|
||||
fp_dbg ("Got %" G_GSIZE_FORMAT " bytes of data", actual_length);
|
||||
while (actual_length)
|
||||
{
|
||||
gssize payload_length;
|
||||
@@ -386,7 +386,7 @@ capture_read_stripe_data_cb (FpiUsbTransfer *transfer,
|
||||
(priv->stripe_packet->data[AESX660_RESPONSE_SIZE_MSB_OFFSET] << 8);
|
||||
fp_dbg ("Got frame, type %.2x payload of size %.4lx",
|
||||
priv->stripe_packet->data[AESX660_RESPONSE_TYPE_OFFSET],
|
||||
payload_length);
|
||||
(long) payload_length);
|
||||
|
||||
still_needed_len = MAX (0, AESX660_HEADER_SIZE + payload_length - (gssize) priv->stripe_packet->len);
|
||||
copy_len = MIN (actual_length, still_needed_len);
|
||||
@@ -441,7 +441,7 @@ capture_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
break;
|
||||
|
||||
case CAPTURE_SET_IDLE:
|
||||
fp_dbg ("Got %lu frames", priv->strips_len);
|
||||
fp_dbg ("Got %" G_GSIZE_FORMAT " frames", priv->strips_len);
|
||||
aesX660_send_cmd (ssm, _dev, set_idle_cmd, sizeof (set_idle_cmd),
|
||||
capture_set_idle_cmd_cb);
|
||||
break;
|
||||
|
||||
444
libfprint/drivers/egis0570.c
Normal file
444
libfprint/drivers/egis0570.c
Normal file
@@ -0,0 +1,444 @@
|
||||
/*
|
||||
* Egis Technology Inc. (aka. LighTuning) 0570 driver for libfprint
|
||||
* Copyright (C) 2021 Maxim Kolesnikov <kolesnikov@svyazcom.ru>
|
||||
* Copyright (C) 2021 Saeed/Ali Rk <saeed.ali.rahimi@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FP_COMPONENT "egis0570"
|
||||
|
||||
#include "egis0570.h"
|
||||
#include "drivers_api.h"
|
||||
|
||||
/* Packet types */
|
||||
#define PKT_TYPE_INIT 0
|
||||
#define PKT_TYPE_REPEAT 1
|
||||
|
||||
/* Struct */
|
||||
struct _FpDeviceEgis0570
|
||||
{
|
||||
FpImageDevice parent;
|
||||
|
||||
gboolean running;
|
||||
gboolean stop;
|
||||
|
||||
GSList *strips;
|
||||
guint8 *background;
|
||||
gsize strips_len;
|
||||
|
||||
int pkt_num;
|
||||
int pkt_type;
|
||||
};
|
||||
G_DECLARE_FINAL_TYPE (FpDeviceEgis0570, fpi_device_egis0570, FPI, DEVICE_EGIS0570, FpImageDevice);
|
||||
G_DEFINE_TYPE (FpDeviceEgis0570, fpi_device_egis0570, FP_TYPE_IMAGE_DEVICE);
|
||||
|
||||
static unsigned char
|
||||
egis_get_pixel (struct fpi_frame_asmbl_ctx *ctx, struct fpi_frame *frame, unsigned int x, unsigned int y)
|
||||
{
|
||||
return frame->data[x + y * ctx->frame_width];
|
||||
}
|
||||
|
||||
static struct fpi_frame_asmbl_ctx assembling_ctx = {
|
||||
.frame_width = EGIS0570_IMGWIDTH,
|
||||
.frame_height = EGIS0570_RFMGHEIGHT,
|
||||
.image_width = EGIS0570_IMGWIDTH * 4 / 3,
|
||||
.get_pixel = egis_get_pixel,
|
||||
};
|
||||
|
||||
/*
|
||||
* Service
|
||||
*/
|
||||
|
||||
static gboolean
|
||||
is_last_pkt (FpDevice *dev)
|
||||
{
|
||||
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||
|
||||
int type = self->pkt_type;
|
||||
int num = self->pkt_num;
|
||||
|
||||
gboolean r;
|
||||
|
||||
r = ((type == PKT_TYPE_INIT) && (num == (EGIS0570_INIT_TOTAL - 1)));
|
||||
r |= ((type == PKT_TYPE_REPEAT) && (num == (EGIS0570_REPEAT_TOTAL - 1)));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns a bit for each frame on whether or not a finger has been detected.
|
||||
* e.g. 00110 means that there is a finger in frame two and three.
|
||||
*/
|
||||
static char
|
||||
postprocess_frames (FpDeviceEgis0570 *self, guint8 * img)
|
||||
{
|
||||
size_t mean[EGIS0570_IMGCOUNT] = {0, 0, 0, 0, 0};
|
||||
|
||||
if (!self->background)
|
||||
{
|
||||
self->background = g_malloc (EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT);
|
||||
memset (self->background, 255, EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT);
|
||||
|
||||
for (size_t k = 0; k < EGIS0570_IMGCOUNT; k += 1)
|
||||
{
|
||||
guint8 * frame = &img[(k * EGIS0570_IMGSIZE) + EGIS0570_RFMDIS * EGIS0570_IMGWIDTH];
|
||||
|
||||
for (size_t i = 0; i < EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT; i += 1)
|
||||
self->background[i] = MIN (self->background[i], frame[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (size_t k = 0; k < EGIS0570_IMGCOUNT; k += 1)
|
||||
{
|
||||
guint8 * frame = &img[(k * EGIS0570_IMGSIZE) + EGIS0570_RFMDIS * EGIS0570_IMGWIDTH];
|
||||
|
||||
for (size_t i = 0; i < EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT; i += 1)
|
||||
{
|
||||
if (frame[i] - EGIS0570_MARGIN > self->background[i])
|
||||
frame[i] -= self->background[i];
|
||||
else
|
||||
frame[i] = 0;
|
||||
|
||||
mean[k] += frame[i];
|
||||
}
|
||||
|
||||
mean[k] /= EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT;
|
||||
}
|
||||
|
||||
char result = 0;
|
||||
|
||||
for (size_t k = 0; k < EGIS0570_IMGCOUNT; k += 1)
|
||||
{
|
||||
fp_dbg ("Finger status (picture number, mean) : %ld , %ld", k, mean[k]);
|
||||
if (mean[k] > EGIS0570_MIN_MEAN)
|
||||
result |= 1 << k;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Device communication
|
||||
*/
|
||||
|
||||
static void
|
||||
data_resp_cb (FpiUsbTransfer *transfer, FpDevice *dev, gpointer user_data, GError *error)
|
||||
{
|
||||
unsigned char *stripdata;
|
||||
gboolean end = FALSE;
|
||||
FpImageDevice *img_self = FP_IMAGE_DEVICE (dev);
|
||||
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||
return;
|
||||
}
|
||||
|
||||
int where_finger_is = postprocess_frames (self, transfer->buffer);
|
||||
|
||||
if (where_finger_is > 0)
|
||||
{
|
||||
FpiImageDeviceState state;
|
||||
|
||||
fpi_image_device_report_finger_status (img_self, TRUE);
|
||||
|
||||
g_object_get (dev, "fpi-image-device-state", &state, NULL);
|
||||
if (state == FPI_IMAGE_DEVICE_STATE_CAPTURE)
|
||||
{
|
||||
for (size_t k = 0; k < EGIS0570_IMGCOUNT; k += 1)
|
||||
{
|
||||
if (where_finger_is & (1 << k))
|
||||
{
|
||||
struct fpi_frame *stripe = g_malloc (EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT + sizeof (struct fpi_frame));
|
||||
stripe->delta_x = 0;
|
||||
stripe->delta_y = 0;
|
||||
stripdata = stripe->data;
|
||||
memcpy (stripdata, (transfer->buffer) + (((k) * EGIS0570_IMGSIZE) + EGIS0570_IMGWIDTH * EGIS0570_RFMDIS), EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT);
|
||||
self->strips = g_slist_prepend (self->strips, stripe);
|
||||
self->strips_len += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
end = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
end = TRUE;
|
||||
}
|
||||
|
||||
if (end)
|
||||
{
|
||||
if (!self->stop && (self->strips_len > 0))
|
||||
{
|
||||
FpImage *img;
|
||||
self->strips = g_slist_reverse (self->strips);
|
||||
fpi_do_movement_estimation (&assembling_ctx, self->strips);
|
||||
img = fpi_assemble_frames (&assembling_ctx, self->strips);
|
||||
img->flags |= (FPI_IMAGE_COLORS_INVERTED | FPI_IMAGE_PARTIAL);
|
||||
g_slist_free_full (self->strips, g_free);
|
||||
self->strips = NULL;
|
||||
self->strips_len = 0;
|
||||
FpImage *resizeImage = fpi_image_resize (img, EGIS0570_RESIZE, EGIS0570_RESIZE);
|
||||
fpi_image_device_image_captured (img_self, resizeImage);
|
||||
}
|
||||
|
||||
fpi_image_device_report_finger_status (img_self, FALSE);
|
||||
}
|
||||
|
||||
fpi_ssm_next_state (transfer->ssm);
|
||||
}
|
||||
|
||||
static void
|
||||
recv_data_resp (FpiSsm *ssm, FpDevice *dev)
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
|
||||
fpi_usb_transfer_fill_bulk (transfer, EGIS0570_EPIN, EGIS0570_INPSIZE);
|
||||
|
||||
transfer->ssm = ssm;
|
||||
transfer->short_is_error = TRUE;
|
||||
|
||||
fpi_usb_transfer_submit (transfer, EGIS0570_TIMEOUT, NULL, data_resp_cb, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_resp_cb (FpiUsbTransfer *transfer, FpDevice *dev, gpointer user_data, GError *error)
|
||||
{
|
||||
if (error)
|
||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||
}
|
||||
|
||||
static void
|
||||
recv_cmd_resp (FpiSsm *ssm, FpDevice *dev)
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
|
||||
fpi_usb_transfer_fill_bulk (transfer, EGIS0570_EPIN, EGIS0570_PKTSIZE);
|
||||
|
||||
transfer->ssm = ssm;
|
||||
|
||||
fpi_usb_transfer_submit (transfer, EGIS0570_TIMEOUT, NULL, cmd_resp_cb, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
send_cmd_req (FpiSsm *ssm, FpDevice *dev, unsigned char *pkt)
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
|
||||
fpi_usb_transfer_fill_bulk_full (transfer, EGIS0570_EPOUT, pkt, EGIS0570_PKTSIZE, NULL);
|
||||
|
||||
transfer->ssm = ssm;
|
||||
transfer->short_is_error = TRUE;
|
||||
|
||||
fpi_usb_transfer_submit (transfer, EGIS0570_TIMEOUT, NULL, fpi_ssm_usb_transfer_cb, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* SSM States
|
||||
*/
|
||||
|
||||
enum sm_states {
|
||||
SM_INIT,
|
||||
SM_START,
|
||||
SM_REQ,
|
||||
SM_RESP,
|
||||
SM_REC_DATA,
|
||||
SM_DONE,
|
||||
SM_STATES_NUM
|
||||
};
|
||||
|
||||
static void
|
||||
ssm_run_state (FpiSsm *ssm, FpDevice *dev)
|
||||
{
|
||||
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||
FpImageDevice *img_dev = FP_IMAGE_DEVICE (dev);
|
||||
|
||||
switch (fpi_ssm_get_cur_state (ssm))
|
||||
{
|
||||
case SM_INIT:
|
||||
self->pkt_type = PKT_TYPE_INIT;
|
||||
fpi_ssm_next_state (ssm);
|
||||
break;
|
||||
|
||||
case SM_START:
|
||||
if (self->stop)
|
||||
{
|
||||
fp_dbg ("deactivating, marking completed");
|
||||
fpi_ssm_mark_completed (ssm);
|
||||
fpi_image_device_deactivate_complete (img_dev, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
self->pkt_num = 0;
|
||||
fpi_ssm_next_state (ssm);
|
||||
}
|
||||
break;
|
||||
|
||||
case SM_REQ:
|
||||
if (self->pkt_type == PKT_TYPE_INIT)
|
||||
send_cmd_req (ssm, dev, init_pkts[self->pkt_num]);
|
||||
else
|
||||
send_cmd_req (ssm, dev, repeat_pkts[self->pkt_num]);
|
||||
break;
|
||||
|
||||
case SM_RESP:
|
||||
if (is_last_pkt (dev) == FALSE)
|
||||
{
|
||||
recv_cmd_resp (ssm, dev);
|
||||
self->pkt_num += 1;
|
||||
fpi_ssm_jump_to_state (ssm, SM_REQ);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (self->pkt_type == PKT_TYPE_INIT)
|
||||
self->pkt_type = PKT_TYPE_REPEAT;
|
||||
|
||||
fpi_ssm_next_state (ssm);
|
||||
}
|
||||
break;
|
||||
|
||||
case SM_REC_DATA:
|
||||
recv_data_resp (ssm, dev);
|
||||
break;
|
||||
|
||||
case SM_DONE:
|
||||
fpi_ssm_jump_to_state (ssm, SM_START);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Activation
|
||||
*/
|
||||
|
||||
static void
|
||||
loop_complete (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||
{
|
||||
FpImageDevice *img_dev = FP_IMAGE_DEVICE (dev);
|
||||
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||
|
||||
self->running = FALSE;
|
||||
g_clear_pointer (&self->background, g_free);
|
||||
|
||||
if (error)
|
||||
fpi_image_device_session_error (img_dev, error);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_activate (FpImageDevice *dev)
|
||||
{
|
||||
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||
FpiSsm *ssm = fpi_ssm_new (FP_DEVICE (dev), ssm_run_state, SM_STATES_NUM);
|
||||
|
||||
self->stop = FALSE;
|
||||
|
||||
fpi_ssm_start (ssm, loop_complete);
|
||||
|
||||
self->running = TRUE;
|
||||
|
||||
fpi_image_device_activate_complete (dev, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Opening
|
||||
*/
|
||||
|
||||
static void
|
||||
dev_init (FpImageDevice *dev)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_usb_device_claim_interface (fpi_device_get_usb_device (FP_DEVICE (dev)), 0, 0, &error);
|
||||
|
||||
fpi_image_device_open_complete (dev, error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Closing
|
||||
*/
|
||||
|
||||
static void
|
||||
dev_deinit (FpImageDevice *dev)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (dev)), 0, 0, &error);
|
||||
|
||||
fpi_image_device_close_complete (dev, error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Deactivation
|
||||
*/
|
||||
|
||||
static void
|
||||
dev_deactivate (FpImageDevice *dev)
|
||||
{
|
||||
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||
|
||||
if (self->running)
|
||||
self->stop = TRUE;
|
||||
else
|
||||
fpi_image_device_deactivate_complete (dev, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Driver data
|
||||
*/
|
||||
|
||||
static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x1c7a, .pid = 0x0570, },
|
||||
{ .vid = 0x1c7a, .pid = 0x0571, },
|
||||
{ .vid = 0, .pid = 0, },
|
||||
};
|
||||
|
||||
static void
|
||||
fpi_device_egis0570_init (FpDeviceEgis0570 *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
fpi_device_egis0570_class_init (FpDeviceEgis0570Class *klass)
|
||||
{
|
||||
FpDeviceClass *dev_class = FP_DEVICE_CLASS (klass);
|
||||
FpImageDeviceClass *img_class = FP_IMAGE_DEVICE_CLASS (klass);
|
||||
|
||||
dev_class->id = "egis0570";
|
||||
dev_class->full_name = "Egis Technology Inc. (aka. LighTuning) 0570";
|
||||
dev_class->type = FP_DEVICE_TYPE_USB;
|
||||
dev_class->id_table = id_table;
|
||||
dev_class->scan_type = FP_SCAN_TYPE_SWIPE;
|
||||
|
||||
img_class->img_open = dev_init;
|
||||
img_class->img_close = dev_deinit;
|
||||
img_class->activate = dev_activate;
|
||||
img_class->deactivate = dev_deactivate;
|
||||
|
||||
img_class->img_width = EGIS0570_IMGWIDTH;
|
||||
img_class->img_height = -1;
|
||||
|
||||
img_class->bz3_threshold = EGIS0570_BZ3_THRESHOLD; /* security issue */
|
||||
}
|
||||
177
libfprint/drivers/egis0570.h
Normal file
177
libfprint/drivers/egis0570.h
Normal file
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
* Egis Technology Inc. (aka. LighTuning) 0570 driver for libfprint
|
||||
* Copyright (C) 2021 Maxim Kolesnikov <kolesnikov@svyazcom.ru>
|
||||
* Copyright (C) 2021 Saeed/Ali Rk <saeed.ali.rahimi@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef __EGIS0570_H
|
||||
|
||||
#define __EGIS0570_H 1
|
||||
|
||||
/*
|
||||
* Device data
|
||||
*/
|
||||
|
||||
#define EGIS0570_CONF 1
|
||||
#define EGIS0570_INTF 0
|
||||
|
||||
/*
|
||||
* Device endpoints
|
||||
*/
|
||||
|
||||
#define EGIS0570_EPOUT 0x04 /* ( 4 | FPI_USB_ENDPOINT_OUT ) */
|
||||
#define EGIS0570_EPIN 0x83 /* ( 3 | FPI_USB_ENDPOINT_IN ) */
|
||||
|
||||
/*
|
||||
* Initialization packets (7 bytes each)
|
||||
*
|
||||
* First 4 bytes are equivalent to string "EGIS", which must be just a company identificator
|
||||
* Other 3 bytes are not recognized yet and may be not important, as they are always the same
|
||||
|
||||
* Answers for each packet contain 7 bytes again
|
||||
* First 4 bytes are reversed "EGIS", which is "SIGE", which is company ID again
|
||||
* Other 3 bytes are not recognized yet
|
||||
* But there is a pattern.
|
||||
* Sending last packet makes sensor return image
|
||||
*/
|
||||
|
||||
#define EGIS0570_TIMEOUT 10000
|
||||
#define EGIS0570_PKTSIZE 7
|
||||
|
||||
#define EGIS0570_INIT_TOTAL (sizeof ((init_pkts)) / sizeof ((init_pkts[0])))
|
||||
|
||||
static unsigned char init_pkts[][EGIS0570_PKTSIZE] =
|
||||
{
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x20, 0x3f },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x58, 0x3f },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x21, 0x09 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x57, 0x09 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x22, 0x03 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x56, 0x03 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x23, 0x01 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x55, 0x01 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x24, 0x01 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x54, 0x01 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x16, 0x3e },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x09, 0x0b },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x14, 0x03 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x15, 0x00 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x0f },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x10, 0x00 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x11, 0x38 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x12, 0x00 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x13, 0x71 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x03, 0x80 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x00, 0x02, 0x80 },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x2f },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x06, 0x00, 0xfe } /* image returned after this packet */
|
||||
};
|
||||
|
||||
/* There is another Packet !
|
||||
* That just Work the same !!
|
||||
* And the Size is different !!!
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
#define EGIS0570_INIT_TOTAL2 (sizeof((init_pkts2)) / sizeof((init_pkts2[0])))
|
||||
|
||||
static unsigned char init_pkts2[][EGIS0570_PKTSIZE] =
|
||||
{
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x10, 0x00},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x11, 0x38},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x12, 0x00},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x13, 0x71},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x20, 0x3f},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x58, 0x3f},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x21, 0x07},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x57, 0x07},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x22, 0x02},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x56, 0x02},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x23, 0x00},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x55, 0x00},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x24, 0x00},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x54, 0x00},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x25, 0x00},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x53, 0x00},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x15, 0x00},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x16, 0x3b},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x09, 0x0a},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x14, 0x00},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x0f},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x03, 0x80},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x00, 0x02, 0x80},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x2f},
|
||||
{0x45, 0x47, 0x49, 0x53, 0x06, 0x00, 0xfe}
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* After sending initial packets device returns image data (32512 bytes)
|
||||
* To ask device to send image data again, host needs to send four additional packets
|
||||
* Further work is to repeatedly send four repeat packets and read image data
|
||||
*/
|
||||
|
||||
#define EGIS0570_INPSIZE 32512
|
||||
|
||||
/* 5 image with captured in different time of size 114 * 57 = 6498
|
||||
* 5 * 6498 = 32490 plus 22 extra unrecognized char size data
|
||||
* Two continuous image in this 5 images may have time delay of less than 20ms
|
||||
*/
|
||||
|
||||
#define EGIS0570_IMGSIZE 6498
|
||||
#define EGIS0570_IMGWIDTH 114
|
||||
#define EGIS0570_IMGHEIGHT 57
|
||||
|
||||
/* size of middle area that is used from each frame */
|
||||
#define EGIS0570_RFMGHEIGHT 17
|
||||
/* rows to ignore from top and bottom of the image*/
|
||||
#define EGIS0570_RFMDIS (EGIS0570_IMGHEIGHT - EGIS0570_RFMGHEIGHT) / 2
|
||||
#define EGIS0570_IMGCOUNT 5
|
||||
|
||||
/*
|
||||
* Image repeat request
|
||||
* First 4 bytes are the same as in initialization packets
|
||||
* Have no idea what the other 3 bytes mean
|
||||
*/
|
||||
|
||||
#define EGIS0570_REPEAT_TOTAL (sizeof ((repeat_pkts)) / sizeof ((repeat_pkts[0])))
|
||||
|
||||
static unsigned char repeat_pkts[][EGIS0570_PKTSIZE] =
|
||||
{
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x0f },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x00, 0x02, 0x0f },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x2f },
|
||||
{ 0x45, 0x47, 0x49, 0x53, 0x06, 0x00, 0xfe } /* image returned after this packet */
|
||||
};
|
||||
|
||||
/*
|
||||
* This sensor is small so I decided to reduce bz3_threshold from
|
||||
* 40 to 10 to have more success to fail ratio
|
||||
* Bozorth3 Algorithm seems not fine at the end
|
||||
* foreget about security :))
|
||||
*/
|
||||
|
||||
#define EGIS0570_BZ3_THRESHOLD 25 /* and even less What a joke */
|
||||
|
||||
#define EGIS0570_MIN_MEAN 20
|
||||
#define EGIS0570_MARGIN 3
|
||||
|
||||
#define EGIS0570_RESIZE 2
|
||||
|
||||
#endif
|
||||
@@ -215,9 +215,12 @@ static const FpIdEntry elan_id_table[] = {
|
||||
{.vid = ELAN_VEND_ID, .pid = 0x0c33, .driver_data = ELAN_ALL_DEV},
|
||||
{.vid = ELAN_VEND_ID, .pid = 0x0c3d, .driver_data = ELAN_ALL_DEV},
|
||||
{.vid = ELAN_VEND_ID, .pid = 0x0c42, .driver_data = ELAN_0C42},
|
||||
{.vid = ELAN_VEND_ID, .pid = 0x0c4b, .driver_data = ELAN_ALL_DEV},
|
||||
{.vid = ELAN_VEND_ID, .pid = 0x0c4d, .driver_data = ELAN_ALL_DEV},
|
||||
{.vid = ELAN_VEND_ID, .pid = 0x0c4f, .driver_data = ELAN_ALL_DEV},
|
||||
{.vid = ELAN_VEND_ID, .pid = 0x0c63, .driver_data = ELAN_ALL_DEV},
|
||||
{.vid = ELAN_VEND_ID, .pid = 0x0c6e, .driver_data = ELAN_ALL_DEV},
|
||||
{.vid = ELAN_VEND_ID, .pid = 0x0c58, .driver_data = ELAN_ALL_DEV},
|
||||
{.vid = 0, .pid = 0, .driver_data = 0},
|
||||
};
|
||||
|
||||
|
||||
1141
libfprint/drivers/elanmoc/elanmoc.c
Normal file
1141
libfprint/drivers/elanmoc/elanmoc.c
Normal file
File diff suppressed because it is too large
Load Diff
195
libfprint/drivers/elanmoc/elanmoc.h
Normal file
195
libfprint/drivers/elanmoc/elanmoc.h
Normal file
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Elan 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 (FpiDeviceElanmoc, fpi_device_elanmoc, FPI, DEVICE_ELANMOC, FpDevice)
|
||||
|
||||
#define ELAN_MOC_DRIVER_FULLNAME "Elan MOC Sensors"
|
||||
#define ELAN_M0C_CMD_LEN 0x3
|
||||
#define ELAN_EP_CMD_OUT (0x1 | LIBUSB_ENDPOINT_OUT)
|
||||
#define ELAN_EP_CMD_IN (0x3 | LIBUSB_ENDPOINT_IN)
|
||||
#define ELAN_EP_MOC_CMD_IN (0x4 | LIBUSB_ENDPOINT_IN)
|
||||
#define ELAN_EP_IMG_IN (0x2 | LIBUSB_ENDPOINT_IN)
|
||||
|
||||
#define ELAN_MOC_CMD_TIMEOUT 5000
|
||||
#define ELAN_MOC_CAL_RETRY 500
|
||||
#define ELAN_MOC_ENROLL_TIMES 9
|
||||
#define ELAN_MAX_USER_ID_LEN 92
|
||||
#define ELAN_MAX_ENROLL_NUM 9
|
||||
|
||||
#define ELAN_MSG_VERIFY_ERR 0xfd
|
||||
#define ELAN_MSG_DIRTY 0xfb
|
||||
#define ELAN_MSG_AREA_NOT_ENOUGH 0xfe
|
||||
#define ELAN_MSG_TOO_HIGH 0x41
|
||||
#define ELAN_MSG_TOO_LEFT 0x42
|
||||
#define ELAN_MSG_TOO_LOW 0x43
|
||||
#define ELAN_MSG_TOO_RIGHT 0x44
|
||||
#define ELAN_MSG_OK 0x00
|
||||
|
||||
#define ELAN_MAX_HDR_LEN 3
|
||||
#define ELAN_USERDATE_SIZE (ELAN_MAX_USER_ID_LEN + 3)
|
||||
|
||||
#define ELAN_MSG_DRIVER_VERSION "1004"
|
||||
|
||||
struct elanmoc_cmd
|
||||
{
|
||||
unsigned char cmd_header[ELAN_MAX_HDR_LEN];
|
||||
int cmd_len;
|
||||
int resp_len;
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd fw_ver_cmd = {
|
||||
.cmd_header = {0x40, 0x19},
|
||||
.cmd_len = 2,
|
||||
.resp_len = 2,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd sensor_dim_cmd = {
|
||||
.cmd_header = {0x00, 0x0c},
|
||||
.cmd_len = 2,
|
||||
.resp_len = 4,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd cal_status_cmd = {
|
||||
.cmd_header = {0x40, 0xff, 0x00},
|
||||
.cmd_len = 3,
|
||||
.resp_len = 2,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd enrolled_number_cmd = {
|
||||
.cmd_header = {0x40, 0xff, 0x04},
|
||||
.cmd_len = 3,
|
||||
.resp_len = 2,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd elanmoc_verify_cmd = {
|
||||
.cmd_header = {0x40, 0xff, 0x73},
|
||||
.cmd_len = 5,
|
||||
.resp_len = 2,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd elanmoc_above_cmd = {
|
||||
.cmd_header = {0x40, 0xff, 0x02},
|
||||
.cmd_len = 3,
|
||||
.resp_len = 0,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd elanmoc_enroll_cmd = {
|
||||
.cmd_header = {0x40, 0xff, 0x01},
|
||||
.cmd_len = 7,
|
||||
.resp_len = 2,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd elanmoc_delete_cmd = {
|
||||
.cmd_header = {0x40, 0xff, 0x13},
|
||||
.cmd_len = 128,
|
||||
.resp_len = 2,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd elanmoc_enroll_commit_cmd = {
|
||||
.cmd_header = {0x40, 0xff, 0x11},
|
||||
.cmd_len = 128,
|
||||
.resp_len = 2,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd elanmoc_remove_all_cmd = {
|
||||
.cmd_header = {0x40, 0xff, 0x98},
|
||||
.cmd_len = 3,
|
||||
.resp_len = 2,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd elanmoc_get_userid_cmd = {
|
||||
.cmd_header = {0x43, 0x21, 0x00},
|
||||
.cmd_len = 3,
|
||||
.resp_len = 97,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd elanmoc_set_mod_cmd = {
|
||||
.cmd_header = {0x40, 0xff, 0x14},
|
||||
.cmd_len = 4,
|
||||
.resp_len = 2,
|
||||
};
|
||||
|
||||
static const struct elanmoc_cmd elanmoc_check_reenroll_cmd = {
|
||||
.cmd_header = {0x40, 0xff, 0x22},
|
||||
.cmd_len = 3 + ELAN_USERDATE_SIZE,
|
||||
.resp_len = 2,
|
||||
};
|
||||
|
||||
typedef void (*ElanCmdMsgCallback) (FpiDeviceElanmoc *self,
|
||||
GError *error);
|
||||
|
||||
enum moc_enroll_states {
|
||||
MOC_ENROLL_GET_ENROLLED_NUM,
|
||||
MOC_ENROLL_REENROLL_CHECK,
|
||||
MOC_ENROLL_WAIT_FINGER,
|
||||
MOC_ENROLL_COMMIT_RESULT,
|
||||
MOC_ENROLL_NUM_STATES,
|
||||
};
|
||||
|
||||
enum moc_list_states {
|
||||
MOC_LIST_GET_ENROLLED,
|
||||
MOC_LIST_GET_FINGER,
|
||||
MOC_LIST_NUM_STATES,
|
||||
};
|
||||
|
||||
enum delete_states {
|
||||
DELETE_SEND_CMD,
|
||||
DELETE_NUM_STATES,
|
||||
};
|
||||
|
||||
enum dev_init_states {
|
||||
DEV_WAIT_READY,
|
||||
DEV_SET_MODE,
|
||||
DEV_GET_VER,
|
||||
DEV_GET_DIM,
|
||||
DEV_GET_ENROLLED,
|
||||
DEV_INIT_STATES,
|
||||
};
|
||||
|
||||
enum dev_exit_states {
|
||||
DEV_EXIT_ABOVE,
|
||||
DEV_EXIT_STATES,
|
||||
};
|
||||
|
||||
struct _FpiDeviceElanmoc
|
||||
{
|
||||
FpDevice parent;
|
||||
FpiSsm *task_ssm;
|
||||
FpiSsm *cmd_ssm;
|
||||
FpiUsbTransfer *cmd_transfer;
|
||||
gboolean cmd_cancelable;
|
||||
gsize cmd_len_in;
|
||||
unsigned short fw_ver;
|
||||
unsigned char x_trace;
|
||||
unsigned char y_trace;
|
||||
int num_frames;
|
||||
int curr_enrolled;
|
||||
int cancel_result;
|
||||
int cmd_retry_cnt;
|
||||
int list_index;
|
||||
GPtrArray *list_result;
|
||||
};
|
||||
@@ -439,6 +439,12 @@ elanspi_capture_old_line_handler (FpiSpiTransfer *transfer, FpDevice *dev, gpoin
|
||||
}
|
||||
else
|
||||
{
|
||||
/* check for termination */
|
||||
if (fpi_device_get_current_action (dev) == FPI_DEVICE_ACTION_NONE)
|
||||
{
|
||||
fpi_ssm_mark_completed (transfer->ssm);
|
||||
return;
|
||||
}
|
||||
/* check for cancellation */
|
||||
if (fpi_device_action_is_cancelled (dev))
|
||||
{
|
||||
@@ -606,6 +612,7 @@ elanspi_calibrate_old_handler (FpiSsm *ssm, FpDevice *dev)
|
||||
case ELANSPI_CALIBOLD_CHECKFIN_CAPTURE:
|
||||
case ELANSPI_CALIBOLD_DACFINE_CAPTURE:
|
||||
chld = fpi_ssm_new (dev, elanspi_capture_old_handler, ELANSPI_CAPTOLD_NSTATES);
|
||||
fpi_ssm_silence_debug (chld);
|
||||
fpi_ssm_start_subsm (ssm, chld);
|
||||
return;
|
||||
|
||||
@@ -860,6 +867,7 @@ elanspi_calibrate_hv_handler (FpiSsm *ssm, FpDevice *dev)
|
||||
|
||||
case ELANSPI_CALIBHV_CAPTURE:
|
||||
chld = fpi_ssm_new (dev, elanspi_capture_hv_handler, ELANSPI_CAPTHV_NSTATES);
|
||||
fpi_ssm_silence_debug (chld);
|
||||
fpi_ssm_start_subsm (ssm, chld);
|
||||
return;
|
||||
|
||||
@@ -1115,6 +1123,7 @@ do_sw_reset:
|
||||
chld = fpi_ssm_new_full (dev, elanspi_calibrate_hv_handler, ELANSPI_CALIBHV_NSTATES, ELANSPI_CALIBHV_PROTECT, "HV calibrate");
|
||||
else
|
||||
chld = fpi_ssm_new_full (dev, elanspi_calibrate_old_handler, ELANSPI_CALIBOLD_NSTATES, ELANSPI_CALIBOLD_PROTECT, "old calibrate");
|
||||
fpi_ssm_silence_debug (chld);
|
||||
fpi_ssm_start_subsm (ssm, chld);
|
||||
return;
|
||||
|
||||
@@ -1123,6 +1132,7 @@ do_sw_reset:
|
||||
chld = fpi_ssm_new (dev, elanspi_capture_hv_handler, ELANSPI_CAPTHV_NSTATES);
|
||||
else
|
||||
chld = fpi_ssm_new (dev, elanspi_capture_old_handler, ELANSPI_CAPTOLD_NSTATES);
|
||||
fpi_ssm_silence_debug (chld);
|
||||
fpi_ssm_start_subsm (ssm, chld);
|
||||
return;
|
||||
|
||||
@@ -1219,8 +1229,6 @@ elanspi_guess_image (FpiDeviceElanSpi *self, guint16 *raw_image)
|
||||
|
||||
sq_stddev /= (frame_width * frame_height);
|
||||
|
||||
fp_dbg ("<guess> stddev=%ld, ip=%d, is_fp=%d, is_empty=%d", sq_stddev, invalid_percent, is_fp, is_empty);
|
||||
|
||||
if (invalid_percent < ELANSPI_MAX_REAL_INVALID_PERCENT)
|
||||
is_fp += 1;
|
||||
if (invalid_percent > ELANSPI_MIN_EMPTY_INVALID_PERCENT)
|
||||
@@ -1231,6 +1239,8 @@ elanspi_guess_image (FpiDeviceElanSpi *self, guint16 *raw_image)
|
||||
if (sq_stddev < ELANSPI_MAX_EMPTY_STDDEV)
|
||||
is_empty += 1;
|
||||
|
||||
fp_dbg ("<guess> stddev=%" G_GUINT64_FORMAT "d, ip=%d, is_fp=%d, is_empty=%d", sq_stddev, invalid_percent, is_fp, is_empty);
|
||||
|
||||
if (is_fp > is_empty)
|
||||
return ELANSPI_GUESS_FINGERPRINT;
|
||||
else if (is_empty > is_fp)
|
||||
@@ -1482,11 +1492,12 @@ elanspi_fp_capture_ssm_handler (FpiSsm *ssm, FpDevice *dev)
|
||||
if (self->deactivating)
|
||||
{
|
||||
fp_dbg ("<capture> got deactivate; exiting");
|
||||
|
||||
self->deactivating = FALSE;
|
||||
fpi_ssm_mark_completed (ssm);
|
||||
|
||||
/* mark deactivate done */
|
||||
fpi_image_device_deactivate_complete (FP_IMAGE_DEVICE (dev), NULL);
|
||||
self->deactivating = FALSE;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1495,6 +1506,7 @@ elanspi_fp_capture_ssm_handler (FpiSsm *ssm, FpDevice *dev)
|
||||
chld = fpi_ssm_new (dev, elanspi_capture_hv_handler, ELANSPI_CAPTHV_NSTATES);
|
||||
else
|
||||
chld = fpi_ssm_new (dev, elanspi_capture_old_handler, ELANSPI_CAPTOLD_NSTATES);
|
||||
fpi_ssm_silence_debug (chld);
|
||||
fpi_ssm_start_subsm (ssm, chld);
|
||||
return;
|
||||
|
||||
|
||||
@@ -97,7 +97,37 @@ static const struct elanspi_reg_entry elanspi_calibration_table_default[] = {
|
||||
{0xff, 0xff}
|
||||
};
|
||||
|
||||
static const struct elanspi_reg_entry elanspi_calibration_table_id567[] = {
|
||||
static const struct elanspi_reg_entry elanspi_calibration_table_id6[] = {
|
||||
{0x2A, 0x07},
|
||||
{0x1, 0x00},
|
||||
{0x2, 0x5f},
|
||||
{0x3, 0x00},
|
||||
{0x4, 0x5f},
|
||||
{0x5, 0x60},
|
||||
{0x6, 0xC0},
|
||||
{0x7, 0x80},
|
||||
{0x8, 0x04},
|
||||
{0xA, 0x97},
|
||||
{0xB, 0x72},
|
||||
{0xC, 0x69},
|
||||
{0xF, 0x2A},
|
||||
{0x11, 0x2A},
|
||||
{0x13, 0x27},
|
||||
{0x15, 0x67},
|
||||
{0x18, 0x04},
|
||||
{0x21, 0x20},
|
||||
{0x22, 0x36},
|
||||
{0x29, 0x02},
|
||||
{0x2A, 0x03},
|
||||
{0x2A, 0x5F},
|
||||
{0x2B, 0xC0},
|
||||
{0x2C, 0x10},
|
||||
{0x2E, 0xFF},
|
||||
|
||||
{0xff, 0xff}
|
||||
};
|
||||
|
||||
static const struct elanspi_reg_entry elanspi_calibration_table_id57[] = {
|
||||
{0x2A, 0x07},
|
||||
{0x5, 0x60},
|
||||
{0x6, 0xC0},
|
||||
@@ -143,9 +173,9 @@ static const struct elanspi_regtable elanspi_calibration_table_old = {
|
||||
.other = elanspi_calibration_table_default,
|
||||
.entries = {
|
||||
{ .sid = 0x0, .table = elanspi_calibration_table_id0 },
|
||||
{ .sid = 0x5, .table = elanspi_calibration_table_id567 },
|
||||
{ .sid = 0x6, .table = elanspi_calibration_table_id567 },
|
||||
{ .sid = 0x7, .table = elanspi_calibration_table_id567 },
|
||||
{ .sid = 0x5, .table = elanspi_calibration_table_id57 },
|
||||
{ .sid = 0x6, .table = elanspi_calibration_table_id6 },
|
||||
{ .sid = 0x7, .table = elanspi_calibration_table_id57 },
|
||||
{ .sid = 0x0, .table = NULL }
|
||||
}
|
||||
};
|
||||
@@ -318,6 +348,7 @@ static const FpIdEntry elanspi_id_table[] = {
|
||||
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x30b2}, .driver_data = ELANSPI_NO_ROTATE},
|
||||
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN70A1", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x30b2}, .driver_data = ELANSPI_NO_ROTATE},
|
||||
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x309f}, .driver_data = ELANSPI_180_ROTATE},
|
||||
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x241f}, .driver_data = ELANSPI_NO_ROTATE},
|
||||
{.udev_types = 0}
|
||||
};
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ struct _FpiDeviceGoodixMoc
|
||||
gint max_stored_prints;
|
||||
GPtrArray *list_result;
|
||||
guint8 template_id[TEMPLATE_ID_SIZE];
|
||||
gboolean is_enroll_identify;
|
||||
gboolean is_power_button_shield_on;
|
||||
|
||||
};
|
||||
@@ -79,6 +78,44 @@ static gboolean parse_print_data (GVariant *data,
|
||||
gsize *tid_len,
|
||||
const guint8 **user_id,
|
||||
gsize *user_id_len);
|
||||
|
||||
static FpPrint *
|
||||
fp_print_from_template (FpiDeviceGoodixMoc *self, template_format_t *template)
|
||||
{
|
||||
FpPrint *print;
|
||||
GVariant *data;
|
||||
GVariant *tid;
|
||||
GVariant *uid;
|
||||
g_autofree gchar *userid = NULL;
|
||||
|
||||
userid = g_strndup ((gchar *) template->payload.data, template->payload.size);
|
||||
|
||||
print = fp_print_new (FP_DEVICE (self));
|
||||
|
||||
tid = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
|
||||
template->tid,
|
||||
TEMPLATE_ID_SIZE,
|
||||
1);
|
||||
|
||||
uid = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
|
||||
template->payload.data,
|
||||
template->payload.size,
|
||||
1);
|
||||
|
||||
data = g_variant_new ("(y@ay@ay)",
|
||||
template->finger_index,
|
||||
tid,
|
||||
uid);
|
||||
|
||||
fpi_print_set_type (print, FPI_PRINT_RAW);
|
||||
fpi_print_set_device_stored (print, TRUE);
|
||||
g_object_set (print, "fpi-data", data, NULL);
|
||||
g_object_set (print, "description", userid, NULL);
|
||||
fpi_print_fill_from_user_id (print, userid);
|
||||
|
||||
return print;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* fp_cmd_xxx Function
|
||||
@@ -122,7 +159,7 @@ fp_cmd_receive_cb (FpiUsbTransfer *transfer,
|
||||
{
|
||||
fpi_ssm_mark_failed (transfer->ssm,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||
"Corrupted message received"));
|
||||
"Corrupted message header received"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -383,11 +420,9 @@ fp_verify_cb (FpiDeviceGoodixMoc *self,
|
||||
gxfp_cmd_response_t *resp,
|
||||
GError *error)
|
||||
{
|
||||
g_autoptr(GPtrArray) templates = NULL;
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
FpPrint *print = NULL;
|
||||
gint cnt = 0;
|
||||
gboolean find = false;
|
||||
FpPrint *new_scan = NULL;
|
||||
FpPrint *matching = NULL;
|
||||
|
||||
if (error)
|
||||
{
|
||||
@@ -396,57 +431,34 @@ fp_verify_cb (FpiDeviceGoodixMoc *self,
|
||||
}
|
||||
if (resp->verify.match)
|
||||
{
|
||||
new_scan = fp_print_from_template (self, &resp->verify.template);
|
||||
|
||||
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_VERIFY)
|
||||
{
|
||||
templates = g_ptr_array_sized_new (1);
|
||||
fpi_device_get_verify_data (device, &print);
|
||||
g_ptr_array_add (templates, print);
|
||||
fpi_device_get_verify_data (device, &matching);
|
||||
if (!fp_print_equal (matching, new_scan))
|
||||
matching = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
GPtrArray *templates = NULL;
|
||||
fpi_device_get_identify_data (device, &templates);
|
||||
g_ptr_array_ref (templates);
|
||||
}
|
||||
for (cnt = 0; cnt < templates->len; cnt++)
|
||||
{
|
||||
g_autoptr(GVariant) data = NULL;
|
||||
guint8 finger;
|
||||
const guint8 *user_id;
|
||||
gsize user_id_len = 0;
|
||||
const guint8 *tid;
|
||||
gsize tid_len = 0;
|
||||
print = g_ptr_array_index (templates, cnt);
|
||||
g_object_get (print, "fpi-data", &data, NULL);
|
||||
if (!parse_print_data (data, &finger, &tid, &tid_len, &user_id, &user_id_len))
|
||||
{
|
||||
fpi_ssm_mark_failed (self->task_ssm,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_INVALID,
|
||||
"Parse print error"));
|
||||
return;
|
||||
}
|
||||
if (memcmp (&resp->verify.template.tid, tid, TEMPLATE_ID_SIZE) == 0)
|
||||
{
|
||||
find = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if (find)
|
||||
{
|
||||
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_VERIFY)
|
||||
fpi_device_verify_report (device, FPI_MATCH_SUCCESS, NULL, error);
|
||||
else
|
||||
fpi_device_identify_report (device, print, print, error);
|
||||
for (gint i = 0; i < templates->len; i++)
|
||||
{
|
||||
if (fp_print_equal (g_ptr_array_index (templates, i), new_scan))
|
||||
{
|
||||
matching = g_ptr_array_index (templates, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!find)
|
||||
{
|
||||
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_VERIFY)
|
||||
fpi_device_verify_report (device, FPI_MATCH_FAIL, NULL, error);
|
||||
else
|
||||
fpi_device_identify_report (device, NULL, NULL, error);
|
||||
}
|
||||
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_VERIFY)
|
||||
fpi_device_verify_report (device, matching ? FPI_MATCH_SUCCESS : FPI_MATCH_FAIL, new_scan, error);
|
||||
else
|
||||
fpi_device_identify_report (device, matching, new_scan, error);
|
||||
|
||||
fpi_ssm_next_state (self->task_ssm);
|
||||
|
||||
@@ -622,28 +634,6 @@ fp_enroll_enum_cb (FpiDeviceGoodixMoc *self,
|
||||
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_CAPTURE);
|
||||
}
|
||||
|
||||
static void
|
||||
fp_enroll_identify_cb (FpiDeviceGoodixMoc *self,
|
||||
gxfp_cmd_response_t *resp,
|
||||
GError *error)
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
fpi_ssm_mark_failed (self->task_ssm, error);
|
||||
return;
|
||||
}
|
||||
if (resp->verify.match)
|
||||
{
|
||||
fpi_ssm_mark_failed (self->task_ssm,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_DUPLICATE,
|
||||
"Finger is too similar to another, try use a different finger"));
|
||||
// maybe need fpi_device_enroll_report_message ...
|
||||
return;
|
||||
}
|
||||
fpi_ssm_next_state (self->task_ssm);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
fp_enroll_init_cb (FpiDeviceGoodixMoc *self,
|
||||
gxfp_cmd_response_t *resp,
|
||||
@@ -697,11 +687,6 @@ fp_enroll_capture_cb (FpiDeviceGoodixMoc *self,
|
||||
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_CAPTURE);
|
||||
return;
|
||||
}
|
||||
if (self->is_enroll_identify)
|
||||
{
|
||||
self->is_enroll_identify = false;
|
||||
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_IDENTIFY);
|
||||
}
|
||||
else
|
||||
{
|
||||
fpi_ssm_next_state (self->task_ssm);
|
||||
@@ -764,9 +749,14 @@ fp_enroll_check_duplicate_cb (FpiDeviceGoodixMoc *self,
|
||||
}
|
||||
if (resp->check_duplicate_resp.duplicate)
|
||||
{
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
|
||||
print = g_object_ref_sink (fp_print_from_template (self, &resp->check_duplicate_resp.template));
|
||||
|
||||
fpi_ssm_mark_failed (self->task_ssm,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_DUPLICATE,
|
||||
"Finger has already enrolled"));
|
||||
"Finger was already enrolled as '%s'",
|
||||
fp_print_get_description (print)));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -867,19 +857,6 @@ fp_enroll_sm_run_state (FpiSsm *ssm, FpDevice *device)
|
||||
}
|
||||
break;
|
||||
|
||||
case FP_ENROLL_IDENTIFY:
|
||||
{
|
||||
dummy[0] = 0x01;
|
||||
dummy[1] = self->sensorcfg->config[10];
|
||||
dummy[2] = self->sensorcfg->config[11];
|
||||
goodix_sensor_cmd (self, MOC_CMD0_IDENTIFY, MOC_CMD1_DEFAULT,
|
||||
false,
|
||||
(const guint8 *) &self->template_id,
|
||||
TEMPLATE_ID_SIZE,
|
||||
fp_enroll_identify_cb);
|
||||
}
|
||||
break;
|
||||
|
||||
case FP_ENROLL_CREATE:
|
||||
{
|
||||
goodix_sensor_cmd (self, MOC_CMD0_ENROLL_INIT, MOC_CMD1_DEFAULT,
|
||||
@@ -1183,6 +1160,32 @@ fp_template_delete_cb (FpiDeviceGoodixMoc *self,
|
||||
fp_info ("Successfully deleted enrolled user");
|
||||
fpi_device_delete_complete (device, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
fp_template_delete_all_cb (FpiDeviceGoodixMoc *self,
|
||||
gxfp_cmd_response_t *resp,
|
||||
GError *error)
|
||||
{
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_device_clear_storage_complete (device, error);
|
||||
return;
|
||||
}
|
||||
if ((resp->result >= GX_FAILED) && (resp->result != GX_ERROR_FINGER_ID_NOEXIST))
|
||||
{
|
||||
fpi_device_clear_storage_complete (FP_DEVICE (self),
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
|
||||
"Failed clear storage, result: 0x%x",
|
||||
resp->result));
|
||||
return;
|
||||
}
|
||||
|
||||
fp_info ("Successfully cleared storage");
|
||||
fpi_device_clear_storage_complete (device, NULL);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* fp_template_list Function
|
||||
@@ -1224,36 +1227,10 @@ fp_template_list_cb (FpiDeviceGoodixMoc *self,
|
||||
|
||||
for (int n = 0; n < resp->finger_list_resp.finger_num; n++)
|
||||
{
|
||||
GVariant *data = NULL;
|
||||
GVariant *tid = NULL;
|
||||
GVariant *uid = NULL;
|
||||
FpPrint *print;
|
||||
gchar *userid;
|
||||
|
||||
userid = (gchar *) resp->finger_list_resp.finger_list[n].payload.data;
|
||||
print = fp_print_from_template (self, &resp->finger_list_resp.finger_list[n]);
|
||||
|
||||
print = fp_print_new (FP_DEVICE (self));
|
||||
|
||||
tid = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
|
||||
resp->finger_list_resp.finger_list[n].tid,
|
||||
TEMPLATE_ID_SIZE,
|
||||
1);
|
||||
|
||||
uid = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
|
||||
resp->finger_list_resp.finger_list[n].payload.data,
|
||||
resp->finger_list_resp.finger_list[n].payload.size,
|
||||
1);
|
||||
|
||||
data = g_variant_new ("(y@ay@ay)",
|
||||
resp->finger_list_resp.finger_list[n].finger_index,
|
||||
tid,
|
||||
uid);
|
||||
|
||||
fpi_print_set_type (print, FPI_PRINT_RAW);
|
||||
fpi_print_set_device_stored (print, TRUE);
|
||||
g_object_set (print, "fpi-data", data, NULL);
|
||||
g_object_set (print, "description", userid, NULL);
|
||||
fpi_print_fill_from_user_id (print, userid);
|
||||
g_ptr_array_add (self->list_result, g_object_ref_sink (print));
|
||||
}
|
||||
|
||||
@@ -1320,6 +1297,8 @@ gx_fp_probe (FpDevice *device)
|
||||
case 0x609C:
|
||||
case 0x639C:
|
||||
case 0x63AC:
|
||||
case 0x63BC:
|
||||
case 0x63CC:
|
||||
case 0x6A94:
|
||||
self->max_enroll_stage = 12;
|
||||
break;
|
||||
@@ -1459,7 +1438,6 @@ gx_fp_enroll (FpDevice *device)
|
||||
FpiDeviceGoodixMoc *self = FPI_DEVICE_GOODIXMOC (device);
|
||||
|
||||
self->enroll_stage = 0;
|
||||
self->is_enroll_identify = true;
|
||||
|
||||
self->task_ssm = fpi_ssm_new_full (device, fp_enroll_sm_run_state,
|
||||
FP_ENROLL_NUM_STATES,
|
||||
@@ -1531,6 +1509,19 @@ gx_fp_template_delete (FpDevice *device)
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
gx_fp_template_delete_all (FpDevice *device)
|
||||
{
|
||||
FpiDeviceGoodixMoc *self = FPI_DEVICE_GOODIXMOC (device);
|
||||
|
||||
goodix_sensor_cmd (self, MOC_CMD0_DELETETEMPLATE, MOC_CMD1_DELETE_ALL,
|
||||
false,
|
||||
NULL,
|
||||
0,
|
||||
fp_template_delete_all_cb);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
fpi_device_goodixmoc_init (FpiDeviceGoodixMoc *self)
|
||||
{
|
||||
@@ -1543,6 +1534,8 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x27c6, .pid = 0x60A2, },
|
||||
{ .vid = 0x27c6, .pid = 0x639C, },
|
||||
{ .vid = 0x27c6, .pid = 0x63AC, },
|
||||
{ .vid = 0x27c6, .pid = 0x63BC, },
|
||||
{ .vid = 0x27c6, .pid = 0x63CC, },
|
||||
{ .vid = 0x27c6, .pid = 0x6496, },
|
||||
{ .vid = 0x27c6, .pid = 0x6584, },
|
||||
{ .vid = 0x27c6, .pid = 0x658C, },
|
||||
@@ -1565,12 +1558,14 @@ fpi_device_goodixmoc_class_init (FpiDeviceGoodixMocClass *klass)
|
||||
dev_class->scan_type = FP_SCAN_TYPE_PRESS;
|
||||
dev_class->id_table = id_table;
|
||||
dev_class->nr_enroll_stages = DEFAULT_ENROLL_SAMPLES;
|
||||
dev_class->temp_hot_seconds = -1;
|
||||
|
||||
dev_class->open = gx_fp_init;
|
||||
dev_class->close = gx_fp_exit;
|
||||
dev_class->probe = gx_fp_probe;
|
||||
dev_class->enroll = gx_fp_enroll;
|
||||
dev_class->delete = gx_fp_template_delete;
|
||||
dev_class->clear_storage = gx_fp_template_delete_all;
|
||||
dev_class->list = gx_fp_template_list;
|
||||
dev_class->verify = gx_fp_verify_identify;
|
||||
dev_class->identify = gx_fp_verify_identify;
|
||||
|
||||
@@ -259,12 +259,9 @@ gx_proto_parse_fingerid (
|
||||
|
||||
if (buffer[Offset++] != 67)
|
||||
return -1;
|
||||
fid_buffer_size--;
|
||||
|
||||
template->type = buffer[Offset++];
|
||||
fid_buffer_size--;
|
||||
template->finger_index = buffer[Offset++];
|
||||
fid_buffer_size--;
|
||||
Offset++;
|
||||
memcpy (template->accountid, &buffer[Offset], sizeof (template->accountid));
|
||||
Offset += sizeof (template->accountid);
|
||||
@@ -273,6 +270,8 @@ gx_proto_parse_fingerid (
|
||||
template->payload.size = buffer[Offset++];
|
||||
if (template->payload.size > sizeof (template->payload.data))
|
||||
return -1;
|
||||
if (template->payload.size + Offset > fid_buffer_size)
|
||||
return -1;
|
||||
memset (template->payload.data, 0, template->payload.size);
|
||||
memcpy (template->payload.data, &buffer[Offset], template->payload.size);
|
||||
|
||||
@@ -365,9 +364,12 @@ gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint16_t buffer_len, pgxfp_c
|
||||
if (buffer_len < 3)
|
||||
return -1;
|
||||
uint16_t tid_size = GUINT16_FROM_LE (*(uint16_t *) (buffer + 1));
|
||||
if ((buffer_len < tid_size + 3) || (buffer_len > sizeof (template_format_t)) + 3)
|
||||
offset += 3;
|
||||
|
||||
if (buffer_len < tid_size + offset)
|
||||
return -1;
|
||||
if (gx_proto_parse_fingerid (buffer + offset, tid_size, &presp->check_duplicate_resp.template) != 0)
|
||||
return -1;
|
||||
memcpy (&presp->check_duplicate_resp.template, buffer + 3, tid_size);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -380,9 +382,12 @@ gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint16_t buffer_len, pgxfp_c
|
||||
fingerlist = buffer + 2;
|
||||
for(uint8_t num = 0; num < presp->finger_list_resp.finger_num; num++)
|
||||
{
|
||||
uint16_t fingerid_length = GUINT16_FROM_LE (*(uint16_t *) (fingerlist + offset));
|
||||
uint16_t fingerid_length;
|
||||
if (buffer_len < offset + 2)
|
||||
return -1;
|
||||
fingerid_length = GUINT16_FROM_LE (*(uint16_t *) (fingerlist + offset));
|
||||
offset += 2;
|
||||
if (buffer_len < fingerid_length + offset + 2)
|
||||
if (buffer_len < fingerid_length + offset)
|
||||
return -1;
|
||||
if (gx_proto_parse_fingerid (fingerlist + offset,
|
||||
fingerid_length,
|
||||
@@ -405,7 +410,7 @@ gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint16_t buffer_len, pgxfp_c
|
||||
presp->verify.match = (buffer[0] == 0) ? true : false;
|
||||
if (presp->verify.match)
|
||||
{
|
||||
if (buffer_len < sizeof (template_format_t) + 10)
|
||||
if (buffer_len < 10)
|
||||
return -1;
|
||||
offset += 1;
|
||||
presp->verify.rejectdetail = GUINT16_FROM_LE (*(uint16_t *) (buffer + offset));
|
||||
@@ -416,6 +421,8 @@ gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint16_t buffer_len, pgxfp_c
|
||||
offset += 1;
|
||||
fingerid_size = GUINT16_FROM_LE (*(uint16_t *) (buffer + offset));
|
||||
offset += 2;
|
||||
if (buffer_len < fingerid_size + offset)
|
||||
return -1;
|
||||
if (gx_proto_parse_fingerid (buffer + offset, fingerid_size, &presp->verify.template) != 0)
|
||||
{
|
||||
presp->result = GX_FAILED;
|
||||
|
||||
@@ -113,14 +113,16 @@ typedef struct _gxfp_enroll_init
|
||||
#pragma pack(push, 1)
|
||||
typedef struct _template_format
|
||||
{
|
||||
uint8_t _0x43_byte;
|
||||
uint8_t type;
|
||||
uint8_t finger_index;
|
||||
uint8_t pad0;
|
||||
uint8_t accountid[32];
|
||||
uint8_t tid[32];
|
||||
struct
|
||||
{
|
||||
uint32_t size;
|
||||
uint8_t data[56];
|
||||
uint8_t size;
|
||||
uint8_t data[56];
|
||||
} payload;
|
||||
uint8_t reserve[2];
|
||||
} template_format_t, *ptemplate_format_t;
|
||||
|
||||
@@ -36,10 +36,13 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00F9, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00FC, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00C2, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00C9, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0100, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00F0, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0103, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0123, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0126, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0129, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0168, },
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
||||
};
|
||||
|
||||
@@ -198,12 +201,17 @@ cmd_interrupt_cb (FpiUsbTransfer *transfer,
|
||||
GError *error)
|
||||
{
|
||||
g_debug ("interrupt transfer done");
|
||||
fpi_device_critical_enter (device);
|
||||
|
||||
if (error)
|
||||
{
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
{
|
||||
g_error_free (error);
|
||||
fpi_ssm_jump_to_state (transfer->ssm, SYNAPTICS_CMD_GET_RESP);
|
||||
if (FPI_DEVICE_SYNAPTICS (device)->cmd_suspended)
|
||||
fpi_ssm_jump_to_state (transfer->ssm, SYNAPTICS_CMD_SUSPENDED);
|
||||
else
|
||||
fpi_ssm_jump_to_state (transfer->ssm, SYNAPTICS_CMD_GET_RESP);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -217,6 +225,7 @@ cmd_interrupt_cb (FpiUsbTransfer *transfer,
|
||||
}
|
||||
else
|
||||
{
|
||||
fpi_device_critical_leave (device);
|
||||
fpi_usb_transfer_submit (fpi_usb_transfer_ref (transfer),
|
||||
0,
|
||||
NULL,
|
||||
@@ -264,6 +273,9 @@ synaptics_cmd_run_state (FpiSsm *ssm,
|
||||
break;
|
||||
|
||||
case SYNAPTICS_CMD_WAIT_INTERRUPT:
|
||||
/* Interruptions are permitted only during an interrupt transfer */
|
||||
fpi_device_critical_leave (dev);
|
||||
|
||||
transfer = fpi_usb_transfer_new (dev);
|
||||
transfer->ssm = ssm;
|
||||
fpi_usb_transfer_fill_interrupt (transfer, USB_EP_INTERRUPT, USB_INTERRUPT_DATA_SIZE);
|
||||
@@ -291,6 +303,17 @@ synaptics_cmd_run_state (FpiSsm *ssm,
|
||||
case SYNAPTICS_CMD_RESTART:
|
||||
fpi_ssm_jump_to_state (ssm, SYNAPTICS_CMD_SEND_PENDING);
|
||||
break;
|
||||
|
||||
case SYNAPTICS_CMD_SUSPENDED:
|
||||
/* The resume handler continues to the next state! */
|
||||
fpi_device_critical_leave (dev);
|
||||
fpi_device_suspend_complete (dev, NULL);
|
||||
break;
|
||||
|
||||
case SYNAPTICS_CMD_RESUME:
|
||||
fpi_device_critical_enter (dev);
|
||||
fpi_ssm_jump_to_state (ssm, SYNAPTICS_CMD_WAIT_INTERRUPT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,6 +329,7 @@ cmd_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||
if (error || self->cmd_complete_on_removal)
|
||||
callback (self, NULL, error);
|
||||
|
||||
fpi_device_critical_leave (dev);
|
||||
self->cmd_complete_on_removal = FALSE;
|
||||
}
|
||||
|
||||
@@ -415,6 +439,7 @@ synaptics_sensor_cmd (FpiDeviceSynaptics *self,
|
||||
SYNAPTICS_CMD_NUM_STATES);
|
||||
fpi_ssm_set_data (self->cmd_ssm, callback, NULL);
|
||||
|
||||
fpi_device_critical_enter (FP_DEVICE (self));
|
||||
fpi_ssm_start (self->cmd_ssm, cmd_ssm_done);
|
||||
}
|
||||
}
|
||||
@@ -510,6 +535,12 @@ verify_msg_cb (FpiDeviceSynaptics *self,
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
bmkt_verify_resp_t *verify_resp;
|
||||
|
||||
if (self->action_starting)
|
||||
{
|
||||
fpi_device_critical_leave (device);
|
||||
self->action_starting = FALSE;
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_device_verify_complete (device, error);
|
||||
@@ -602,6 +633,8 @@ verify (FpDevice *device)
|
||||
|
||||
G_DEBUG_HERE ();
|
||||
|
||||
self->action_starting = TRUE;
|
||||
fpi_device_critical_enter (device);
|
||||
synaptics_sensor_cmd (self, 0, BMKT_CMD_VERIFY_USER, user_id, user_id_len, verify_msg_cb);
|
||||
}
|
||||
|
||||
@@ -629,6 +662,12 @@ identify_msg_cb (FpiDeviceSynaptics *self,
|
||||
{
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
|
||||
if (self->action_starting)
|
||||
{
|
||||
fpi_device_critical_leave (device);
|
||||
self->action_starting = FALSE;
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_device_identify_complete (device, error);
|
||||
@@ -717,6 +756,25 @@ identify_msg_cb (FpiDeviceSynaptics *self,
|
||||
static void
|
||||
identify (FpDevice *device)
|
||||
{
|
||||
GPtrArray *prints = NULL;
|
||||
FpiDeviceSynaptics *self = FPI_DEVICE_SYNAPTICS (device);
|
||||
|
||||
fpi_device_get_identify_data (device, &prints);
|
||||
|
||||
/* Identify over no prints does not work for synaptics.
|
||||
* This *may* make sense for other devices though, as identify may return
|
||||
* a matched print even if it is not in the list of prints.
|
||||
*/
|
||||
if (prints->len == 0)
|
||||
{
|
||||
fpi_device_identify_report (device, NULL, NULL, NULL);
|
||||
fpi_device_identify_complete (device, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
self->action_starting = TRUE;
|
||||
fpi_device_critical_enter (device);
|
||||
|
||||
init_identify_msg (device);
|
||||
compose_and_send_identify_msg (device);
|
||||
}
|
||||
@@ -819,6 +877,12 @@ enroll_msg_cb (FpiDeviceSynaptics *self,
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
bmkt_enroll_resp_t *enroll_resp;
|
||||
|
||||
if (self->action_starting)
|
||||
{
|
||||
fpi_device_critical_leave (device);
|
||||
self->action_starting = FALSE;
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_device_enroll_complete (device, NULL, error);
|
||||
@@ -965,6 +1029,9 @@ enroll (FpDevice *device)
|
||||
payload[1] = finger;
|
||||
memcpy (payload + 2, user_id, user_id_len);
|
||||
|
||||
self->action_starting = TRUE;
|
||||
fpi_device_critical_enter (device);
|
||||
|
||||
synaptics_sensor_cmd (self, 0, BMKT_CMD_ENROLL_USER, payload, user_id_len + 2, enroll_msg_cb);
|
||||
}
|
||||
|
||||
@@ -978,6 +1045,7 @@ delete_msg_cb (FpiDeviceSynaptics *self,
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_device_critical_leave (device);
|
||||
fpi_device_delete_complete (device, error);
|
||||
return;
|
||||
}
|
||||
@@ -992,6 +1060,7 @@ delete_msg_cb (FpiDeviceSynaptics *self,
|
||||
break;
|
||||
|
||||
case BMKT_RSP_DEL_USER_FP_FAIL:
|
||||
fpi_device_critical_leave (device);
|
||||
if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS ||
|
||||
resp->result == BMKT_FP_DATABASE_EMPTY)
|
||||
{
|
||||
@@ -1008,6 +1077,7 @@ delete_msg_cb (FpiDeviceSynaptics *self,
|
||||
|
||||
case BMKT_RSP_DEL_USER_FP_OK:
|
||||
fp_info ("Successfully deleted enrolled user");
|
||||
fpi_device_critical_leave (device);
|
||||
fpi_device_delete_complete (device, NULL);
|
||||
break;
|
||||
}
|
||||
@@ -1042,6 +1112,7 @@ delete_print (FpDevice *device)
|
||||
payload[0] = finger;
|
||||
memcpy (payload + 1, user_id, user_id_len);
|
||||
|
||||
fpi_device_critical_enter (device);
|
||||
synaptics_sensor_cmd (self, 0, BMKT_CMD_DEL_USER_FP, payload, user_id_len + 1, delete_msg_cb);
|
||||
}
|
||||
|
||||
@@ -1281,8 +1352,12 @@ fps_deinit_cb (FpiDeviceSynaptics *self,
|
||||
bmkt_response_t *resp,
|
||||
GError *error)
|
||||
{
|
||||
g_autoptr(GError) err = NULL;
|
||||
|
||||
/* Release usb interface */
|
||||
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (self)), 0, 0, &error);
|
||||
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (self)), 0, 0, &err);
|
||||
if (!error)
|
||||
error = g_steal_pointer (&err);
|
||||
|
||||
g_clear_object (&self->interrupt_cancellable);
|
||||
|
||||
@@ -1353,6 +1428,59 @@ cancel (FpDevice *dev)
|
||||
self->interrupt_cancellable = g_cancellable_new ();
|
||||
}
|
||||
|
||||
static void
|
||||
suspend (FpDevice *dev)
|
||||
{
|
||||
FpiDeviceSynaptics *self = FPI_DEVICE_SYNAPTICS (dev);
|
||||
FpiDeviceAction action = fpi_device_get_current_action (dev);
|
||||
|
||||
g_debug ("got suspend request");
|
||||
|
||||
if (action != FPI_DEVICE_ACTION_VERIFY && action != FPI_DEVICE_ACTION_IDENTIFY)
|
||||
{
|
||||
fpi_device_suspend_complete (dev, fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED));
|
||||
return;
|
||||
}
|
||||
|
||||
/* We are guaranteed to have a cmd_ssm running at this time. */
|
||||
g_assert (self->cmd_ssm);
|
||||
g_assert (fpi_ssm_get_cur_state (self->cmd_ssm) == SYNAPTICS_CMD_WAIT_INTERRUPT);
|
||||
self->cmd_suspended = TRUE;
|
||||
|
||||
/* Cancel the current transfer.
|
||||
* The CMD SSM will go into the suspend state and signal readyness. */
|
||||
g_cancellable_cancel (self->interrupt_cancellable);
|
||||
g_clear_object (&self->interrupt_cancellable);
|
||||
self->interrupt_cancellable = g_cancellable_new ();
|
||||
}
|
||||
|
||||
static void
|
||||
resume (FpDevice *dev)
|
||||
{
|
||||
FpiDeviceSynaptics *self = FPI_DEVICE_SYNAPTICS (dev);
|
||||
FpiDeviceAction action = fpi_device_get_current_action (dev);
|
||||
|
||||
g_debug ("got resume request");
|
||||
|
||||
if (action != FPI_DEVICE_ACTION_VERIFY && action != FPI_DEVICE_ACTION_IDENTIFY)
|
||||
{
|
||||
g_assert_not_reached ();
|
||||
fpi_device_resume_complete (dev, fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED));
|
||||
return;
|
||||
}
|
||||
|
||||
/* We must have a suspended cmd_ssm at this point */
|
||||
g_assert (self->cmd_ssm);
|
||||
g_assert (self->cmd_suspended);
|
||||
g_assert (fpi_ssm_get_cur_state (self->cmd_ssm) == SYNAPTICS_CMD_SUSPENDED);
|
||||
self->cmd_suspended = FALSE;
|
||||
|
||||
/* Restart interrupt transfer. */
|
||||
fpi_ssm_jump_to_state (self->cmd_ssm, SYNAPTICS_CMD_RESUME);
|
||||
|
||||
fpi_device_resume_complete (dev, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
fpi_device_synaptics_init (FpiDeviceSynaptics *self)
|
||||
{
|
||||
@@ -1370,6 +1498,7 @@ fpi_device_synaptics_class_init (FpiDeviceSynapticsClass *klass)
|
||||
dev_class->scan_type = FP_SCAN_TYPE_PRESS;
|
||||
dev_class->id_table = id_table;
|
||||
dev_class->nr_enroll_stages = ENROLL_SAMPLES;
|
||||
dev_class->temp_hot_seconds = -1;
|
||||
|
||||
dev_class->open = dev_init;
|
||||
dev_class->close = dev_exit;
|
||||
@@ -1380,6 +1509,8 @@ fpi_device_synaptics_class_init (FpiDeviceSynapticsClass *klass)
|
||||
dev_class->delete = delete_print;
|
||||
dev_class->clear_storage = clear_storage;
|
||||
dev_class->cancel = cancel;
|
||||
dev_class->suspend = suspend;
|
||||
dev_class->resume = resume;
|
||||
|
||||
fpi_device_class_auto_initialize_features (dev_class);
|
||||
}
|
||||
|
||||
@@ -93,6 +93,8 @@ typedef enum {
|
||||
SYNAPTICS_CMD_WAIT_INTERRUPT,
|
||||
SYNAPTICS_CMD_SEND_ASYNC,
|
||||
SYNAPTICS_CMD_RESTART,
|
||||
SYNAPTICS_CMD_SUSPENDED,
|
||||
SYNAPTICS_CMD_RESUME,
|
||||
SYNAPTICS_CMD_NUM_STATES,
|
||||
} SynapticsCmdState;
|
||||
|
||||
@@ -110,10 +112,12 @@ struct _FpiDeviceSynaptics
|
||||
FpiSsm *cmd_ssm;
|
||||
FpiUsbTransfer *cmd_pending_transfer;
|
||||
gboolean cmd_complete_on_removal;
|
||||
gboolean cmd_suspended;
|
||||
guint8 id_idx;
|
||||
|
||||
bmkt_sensor_version_t mis_version;
|
||||
|
||||
gboolean action_starting;
|
||||
GCancellable *interrupt_cancellable;
|
||||
|
||||
gint enroll_stage;
|
||||
|
||||
@@ -79,7 +79,7 @@ struct _FpiDeviceUpeksonly
|
||||
int num_flying;
|
||||
|
||||
GSList *rows;
|
||||
size_t num_rows;
|
||||
unsigned num_rows;
|
||||
unsigned char *rowbuf;
|
||||
int rowbuf_offset;
|
||||
|
||||
@@ -215,7 +215,7 @@ handoff_img (FpImageDevice *dev)
|
||||
|
||||
self->rows = g_slist_reverse (self->rows);
|
||||
|
||||
fp_dbg ("%lu rows", self->num_rows);
|
||||
fp_dbg ("%u rows", self->num_rows);
|
||||
img = fpi_assemble_lines (&self->assembling_ctx, self->rows, self->num_rows);
|
||||
|
||||
g_slist_free_full (self->rows, g_free);
|
||||
@@ -295,7 +295,7 @@ row_complete (FpImageDevice *dev)
|
||||
if (self->num_blank > FINGER_REMOVED_THRESHOLD)
|
||||
{
|
||||
self->finger_state = FINGER_REMOVED;
|
||||
fp_dbg ("detected finger removal. Blank rows: %d, Full rows: %lu",
|
||||
fp_dbg ("detected finger removal. Blank rows: %d, Full rows: %u",
|
||||
self->num_blank, self->num_rows);
|
||||
handoff_img (dev);
|
||||
return;
|
||||
|
||||
@@ -411,7 +411,7 @@ dev_init (FpImageDevice *dev)
|
||||
break;
|
||||
|
||||
default:
|
||||
fp_err ("Device variant %lu is not known", driver_data);
|
||||
fp_err ("Device variant %" G_GUINT64_FORMAT " is not known", driver_data);
|
||||
g_assert_not_reached ();
|
||||
fpi_image_device_open_complete (dev, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
|
||||
return;
|
||||
|
||||
@@ -221,7 +221,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
if (response_size > transfer->actual_length)
|
||||
{
|
||||
fp_dbg ("response_size is %lu, actual_length is %d",
|
||||
response_size, (gint) transfer->actual_length);
|
||||
(gulong) response_size, (gint) transfer->actual_length);
|
||||
fp_dbg ("Waiting for rest of transfer");
|
||||
BUG_ON (self->response_rest);
|
||||
self->response_rest = response_size - transfer->actual_length;
|
||||
@@ -309,7 +309,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
data);
|
||||
BUG_ON (self->image_size != IMAGE_SIZE);
|
||||
fp_dbg ("Image size is %lu",
|
||||
self->image_size);
|
||||
(gulong) self->image_size);
|
||||
img = fp_image_new (IMAGE_WIDTH, IMAGE_HEIGHT);
|
||||
img->flags |= FPI_IMAGE_PARTIAL;
|
||||
memcpy (img->data, self->image_bits,
|
||||
|
||||
@@ -366,7 +366,7 @@ read_msg_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
fp_err ("async msg read too short (%d)",
|
||||
(gint) transfer->actual_length);
|
||||
error = fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||
"Packet from device was too short (%lu)",
|
||||
"Packet from device was too short (%" G_GSSIZE_FORMAT ")",
|
||||
transfer->actual_length);
|
||||
goto err;
|
||||
}
|
||||
@@ -993,7 +993,7 @@ e_handle_resp00 (FpDevice *dev, unsigned char *data,
|
||||
|
||||
if (data_len != 14)
|
||||
{
|
||||
fp_err ("received 3001 poll response of %lu bytes?", data_len);
|
||||
fp_err ("received 3001 poll response of %" G_GSIZE_FORMAT " bytes?", data_len);
|
||||
do_enroll_stop (dev, NULL,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||
"received 3001 response with wrong length"));
|
||||
@@ -1090,7 +1090,7 @@ e_handle_resp02 (FpDevice *dev, unsigned char *data,
|
||||
|
||||
if (data_len < sizeof (scan_comp))
|
||||
{
|
||||
fp_err ("fingerprint data too short (%lu bytes)", data_len);
|
||||
fp_err ("fingerprint data too short (%" G_GSIZE_FORMAT "u bytes)", data_len);
|
||||
error = fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, "fingerprint data too short");
|
||||
}
|
||||
else if (memcmp (data, scan_comp, sizeof (scan_comp)) != 0)
|
||||
@@ -1318,7 +1318,7 @@ v_handle_resp00 (FpDevice *dev, unsigned char *data,
|
||||
|
||||
if (data_len != 14)
|
||||
{
|
||||
fp_warn ("received 3001 poll response of %lu bytes?", data_len);
|
||||
fp_warn ("received 3001 poll response of %" G_GSIZE_FORMAT "u bytes?", data_len);
|
||||
error = fpi_device_error_new (FP_DEVICE_ERROR_PROTO);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -360,9 +360,9 @@ start_irq_handler (FpImageDevice *dev)
|
||||
transfer = fpi_usb_transfer_new (FP_DEVICE (dev));
|
||||
transfer->ssm = NULL;
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_fill_bulk (transfer,
|
||||
EP_INTR,
|
||||
IRQ_LENGTH);
|
||||
fpi_usb_transfer_fill_interrupt (transfer,
|
||||
EP_INTR,
|
||||
IRQ_LENGTH);
|
||||
fpi_usb_transfer_submit (transfer, 0, self->irq_cancellable, irq_handler, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,12 +67,17 @@ dev_identify (FpDevice *dev)
|
||||
new_scan,
|
||||
(GEqualFunc) fp_print_equal,
|
||||
NULL))
|
||||
error = fpi_device_error_new (FP_DEVICE_ERROR_DATA_NOT_FOUND);
|
||||
{
|
||||
match = FALSE;
|
||||
g_clear_object (&new_scan);
|
||||
}
|
||||
else if (g_ptr_array_find_with_equal_func (prints,
|
||||
new_scan,
|
||||
(GEqualFunc) fp_print_equal,
|
||||
&idx))
|
||||
match = g_ptr_array_index (prints, idx);
|
||||
{
|
||||
match = g_ptr_array_index (prints, idx);
|
||||
}
|
||||
|
||||
if (!self->match_reported)
|
||||
{
|
||||
|
||||
@@ -150,6 +150,8 @@ process_cmds (FpDeviceVirtualDevice * self,
|
||||
char **scan_id,
|
||||
GError **error)
|
||||
{
|
||||
gboolean removed;
|
||||
|
||||
if (g_cancellable_is_cancelled (self->cancellable) ||
|
||||
(fpi_device_get_current_action (FP_DEVICE (self)) != FPI_DEVICE_ACTION_NONE &&
|
||||
g_cancellable_is_cancelled (fpi_device_get_cancellable (FP_DEVICE (self)))))
|
||||
@@ -192,7 +194,7 @@ process_cmds (FpDeviceVirtualDevice * self,
|
||||
{
|
||||
guint64 sleep_ms = g_ascii_strtoull (cmd + strlen (SLEEP_CMD_PREFIX), NULL, 10);
|
||||
|
||||
g_debug ("Sleeping %lums", sleep_ms);
|
||||
g_debug ("Sleeping %" G_GUINT64_FORMAT "ms", sleep_ms);
|
||||
self->sleep_timeout_id = g_timeout_add (sleep_ms, sleep_timeout_cb, self);
|
||||
|
||||
return FALSE;
|
||||
@@ -250,8 +252,11 @@ process_cmds (FpDeviceVirtualDevice * self,
|
||||
if (self->ignore_wait)
|
||||
return TRUE;
|
||||
|
||||
g_object_get (self, "removed", &removed, NULL);
|
||||
|
||||
g_assert (self->wait_command_id == 0);
|
||||
self->wait_command_id = g_timeout_add (500, wait_for_command_timeout, self);
|
||||
if (!scan || removed)
|
||||
self->wait_command_id = g_timeout_add (500, wait_for_command_timeout, self);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -275,7 +280,7 @@ recv_instruction_cb (GObject *source_object,
|
||||
gsize bytes;
|
||||
|
||||
bytes = fpi_device_virtual_listener_read_finish (listener, res, &error);
|
||||
fp_dbg ("Got instructions of length %ld", bytes);
|
||||
fp_dbg ("Got instructions of length %" G_GSIZE_FORMAT, bytes);
|
||||
|
||||
if (error)
|
||||
{
|
||||
@@ -304,6 +309,7 @@ recv_instruction_cb (GObject *source_object,
|
||||
else if (g_str_has_prefix (cmd, UNPLUG_CMD))
|
||||
{
|
||||
fpi_device_remove (FP_DEVICE (self));
|
||||
maybe_continue_current_action (self);
|
||||
}
|
||||
else if (g_str_has_prefix (cmd, SET_ENROLL_STAGES_PREFIX))
|
||||
{
|
||||
@@ -537,7 +543,7 @@ dev_verify (FpDevice *dev)
|
||||
|
||||
if (self->prints_storage && !g_hash_table_contains (self->prints_storage, scan_id))
|
||||
{
|
||||
error = fpi_device_error_new (FP_DEVICE_ERROR_DATA_NOT_FOUND);
|
||||
g_clear_object (&new_scan);
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -361,6 +361,8 @@ fp_context_init (FpContext *self)
|
||||
FpContextPrivate *priv = fp_context_get_instance_private (self);
|
||||
guint i;
|
||||
|
||||
g_debug ("Initializing FpContext (libfprint version " LIBFPRINT_VERSION ")");
|
||||
|
||||
priv->drivers = fpi_get_driver_types ();
|
||||
|
||||
if (get_drivers_whitelist_env ())
|
||||
@@ -426,6 +428,7 @@ void
|
||||
fp_context_enumerate (FpContext *context)
|
||||
{
|
||||
FpContextPrivate *priv = fp_context_get_instance_private (context);
|
||||
gboolean dispatched;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (FP_IS_CONTEXT (context));
|
||||
@@ -564,8 +567,19 @@ fp_context_enumerate (FpContext *context)
|
||||
}
|
||||
#endif
|
||||
|
||||
while (priv->pending_devices)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
/* Iterate until 1. we have no pending devices, and 2. the mainloop is idle
|
||||
* This takes care of processing hotplug events that happened during
|
||||
* enumeration.
|
||||
* This is important due to USB `persist` being turned off. At resume time,
|
||||
* devices will disappear and immediately re-appear. In this situation,
|
||||
* enumerate could first see the old state with a removed device resulting
|
||||
* in it to not be discovered.
|
||||
* As a hotplug event is seemingly emitted by the kernel immediately, we can
|
||||
* simply make sure to process all events before returning from enumerate.
|
||||
*/
|
||||
dispatched = TRUE;
|
||||
while (priv->pending_devices || dispatched)
|
||||
dispatched = g_main_context_iteration (NULL, !!priv->pending_devices);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -574,7 +588,7 @@ fp_context_enumerate (FpContext *context)
|
||||
*
|
||||
* Get all devices. fp_context_enumerate() will be called as needed.
|
||||
*
|
||||
* Returns: (transfer none) (element-type FpDevice): a new #GPtrArray of #GUsbDevice's.
|
||||
* Returns: (transfer none) (element-type FpDevice): a new #GPtrArray of #FpDevice's.
|
||||
*/
|
||||
GPtrArray *
|
||||
fp_context_get_devices (FpContext *context)
|
||||
|
||||
@@ -22,6 +22,23 @@
|
||||
|
||||
#include "fpi-device.h"
|
||||
|
||||
/* Chosen so that if we turn on after WARM -> COLD, it takes exactly one time
|
||||
* constant to go from COLD -> HOT.
|
||||
* TEMP_COLD_THRESH = 1 / (e + 1)
|
||||
*/
|
||||
#define TEMP_COLD_THRESH (0.26894142136999512075)
|
||||
#define TEMP_WARM_HOT_THRESH (1.0 - TEMP_COLD_THRESH)
|
||||
#define TEMP_HOT_WARM_THRESH (0.5)
|
||||
|
||||
/* Delay updates by 100ms to avoid hitting the border exactly */
|
||||
#define TEMP_DELAY_SECONDS 0.1
|
||||
|
||||
/* Hopefully 3min is long enough to not get in the way, while also not
|
||||
* properly overheating any devices.
|
||||
*/
|
||||
#define DEFAULT_TEMP_HOT_SECONDS (3 * 60)
|
||||
#define DEFAULT_TEMP_COLD_SECONDS (9 * 60)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FpDeviceType type;
|
||||
@@ -36,6 +53,7 @@ typedef struct
|
||||
|
||||
gboolean is_removed;
|
||||
gboolean is_open;
|
||||
gboolean is_suspended;
|
||||
|
||||
gchar *device_id;
|
||||
gchar *device_name;
|
||||
@@ -50,14 +68,37 @@ typedef struct
|
||||
/* We always make sure that only one task is run at a time. */
|
||||
FpiDeviceAction current_action;
|
||||
GTask *current_task;
|
||||
GError *current_cancellation_reason;
|
||||
GAsyncReadyCallback current_user_cb;
|
||||
GCancellable *current_cancellable;
|
||||
gulong current_cancellable_id;
|
||||
gulong current_task_cancellable_id;
|
||||
GSource *current_idle_cancel_source;
|
||||
GSource *current_task_idle_return_source;
|
||||
|
||||
/* State for tasks */
|
||||
gboolean wait_for_finger;
|
||||
FpFingerStatusFlags finger_status;
|
||||
|
||||
/* Driver critical sections */
|
||||
guint critical_section;
|
||||
GSource *critical_section_flush_source;
|
||||
gboolean cancel_queued;
|
||||
gboolean suspend_queued;
|
||||
gboolean resume_queued;
|
||||
|
||||
/* Suspend/resume tasks */
|
||||
GTask *suspend_resume_task;
|
||||
GError *suspend_error;
|
||||
|
||||
/* Device temperature model information and state */
|
||||
GSource *temp_timeout;
|
||||
FpTemperature temp_current;
|
||||
gint32 temp_hot_seconds;
|
||||
gint32 temp_cold_seconds;
|
||||
gint64 temp_last_update;
|
||||
gboolean temp_last_active;
|
||||
gdouble temp_current_ratio;
|
||||
} FpDevicePrivate;
|
||||
|
||||
|
||||
@@ -88,3 +129,11 @@ typedef struct
|
||||
} FpMatchData;
|
||||
|
||||
void match_data_free (FpMatchData *match_data);
|
||||
|
||||
void fpi_device_suspend (FpDevice *device);
|
||||
void fpi_device_resume (FpDevice *device);
|
||||
|
||||
void fpi_device_configure_wakeup (FpDevice *device,
|
||||
gboolean enabled);
|
||||
void fpi_device_update_temp (FpDevice *device,
|
||||
gboolean is_active);
|
||||
|
||||
@@ -48,6 +48,7 @@ enum {
|
||||
PROP_NR_ENROLL_STAGES,
|
||||
PROP_SCAN_TYPE,
|
||||
PROP_FINGER_STATUS,
|
||||
PROP_TEMPERATURE,
|
||||
PROP_FPI_ENVIRON,
|
||||
PROP_FPI_USB_DEVICE,
|
||||
PROP_FPI_UDEV_DATA_SPIDEV,
|
||||
@@ -93,7 +94,10 @@ fp_device_cancel_in_idle_cb (gpointer user_data)
|
||||
|
||||
priv->current_idle_cancel_source = NULL;
|
||||
|
||||
cls->cancel (self);
|
||||
if (priv->critical_section)
|
||||
priv->cancel_queued = TRUE;
|
||||
else
|
||||
cls->cancel (self);
|
||||
|
||||
fpi_device_report_finger_status (self, FP_FINGER_STATUS_NONE);
|
||||
|
||||
@@ -118,20 +122,40 @@ fp_device_cancelled_cb (GCancellable *cancellable, FpDevice *self)
|
||||
g_source_unref (priv->current_idle_cancel_source);
|
||||
}
|
||||
|
||||
/* Forward the external task cancellable to the internal one. */
|
||||
static void
|
||||
maybe_cancel_on_cancelled (FpDevice *device,
|
||||
GCancellable *cancellable)
|
||||
fp_device_task_cancelled_cb (GCancellable *cancellable, FpDevice *self)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (self);
|
||||
|
||||
g_cancellable_cancel (priv->current_cancellable);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_task_cancellable (FpDevice *device)
|
||||
{
|
||||
FpDeviceClass *cls = FP_DEVICE_GET_CLASS (device);
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
FpDeviceClass *cls = FP_DEVICE_GET_CLASS (device);
|
||||
|
||||
if (!cancellable || !cls->cancel)
|
||||
return;
|
||||
/* Create an internal cancellable and hook it up. */
|
||||
priv->current_cancellable = g_cancellable_new ();
|
||||
if (cls->cancel)
|
||||
{
|
||||
priv->current_cancellable_id = g_cancellable_connect (priv->current_cancellable,
|
||||
G_CALLBACK (fp_device_cancelled_cb),
|
||||
device,
|
||||
NULL);
|
||||
}
|
||||
|
||||
priv->current_cancellable_id = g_cancellable_connect (cancellable,
|
||||
G_CALLBACK (fp_device_cancelled_cb),
|
||||
device,
|
||||
NULL);
|
||||
/* Task cancellable is the externally visible one, make our internal one
|
||||
* a slave of the external one. */
|
||||
if (g_task_get_cancellable (priv->current_task))
|
||||
{
|
||||
priv->current_task_cancellable_id = g_cancellable_connect (g_task_get_cancellable (priv->current_task),
|
||||
G_CALLBACK (fp_device_task_cancelled_cb),
|
||||
device,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -151,6 +175,36 @@ fp_device_constructed (GObject *object)
|
||||
priv->device_name = g_strdup (cls->full_name);
|
||||
priv->device_id = g_strdup ("0");
|
||||
|
||||
if (cls->temp_hot_seconds > 0)
|
||||
{
|
||||
priv->temp_hot_seconds = cls->temp_hot_seconds;
|
||||
priv->temp_cold_seconds = cls->temp_cold_seconds;
|
||||
g_assert (priv->temp_cold_seconds > 0);
|
||||
}
|
||||
else if (cls->temp_hot_seconds == 0)
|
||||
{
|
||||
priv->temp_hot_seconds = DEFAULT_TEMP_HOT_SECONDS;
|
||||
priv->temp_cold_seconds = DEFAULT_TEMP_COLD_SECONDS;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Temperature management disabled */
|
||||
priv->temp_hot_seconds = -1;
|
||||
priv->temp_cold_seconds = -1;
|
||||
}
|
||||
|
||||
/* Start out at not completely cold (i.e. assume we are only at the upper
|
||||
* bound of COLD).
|
||||
* To be fair, the warm-up from 0 to WARM should be really short either way.
|
||||
*
|
||||
* Note that a call to fpi_device_update_temp() is not needed here as no
|
||||
* timeout must be registered.
|
||||
*/
|
||||
priv->temp_current = FP_TEMPERATURE_COLD;
|
||||
priv->temp_current_ratio = TEMP_COLD_THRESH;
|
||||
priv->temp_last_update = g_get_monotonic_time ();
|
||||
priv->temp_last_active = FALSE;
|
||||
|
||||
G_OBJECT_CLASS (fp_device_parent_class)->constructed (object);
|
||||
}
|
||||
|
||||
@@ -165,10 +219,13 @@ fp_device_finalize (GObject *object)
|
||||
if (priv->is_open)
|
||||
g_warning ("User destroyed open device! Not cleaning up properly!");
|
||||
|
||||
g_clear_pointer (&priv->temp_timeout, g_source_destroy);
|
||||
|
||||
g_slist_free_full (priv->sources, (GDestroyNotify) g_source_destroy);
|
||||
|
||||
g_clear_pointer (&priv->current_idle_cancel_source, g_source_destroy);
|
||||
g_clear_pointer (&priv->current_task_idle_return_source, g_source_destroy);
|
||||
g_clear_pointer (&priv->critical_section_flush_source, g_source_destroy);
|
||||
|
||||
g_clear_pointer (&priv->device_id, g_free);
|
||||
g_clear_pointer (&priv->device_name, g_free);
|
||||
@@ -189,6 +246,7 @@ fp_device_get_property (GObject *object,
|
||||
{
|
||||
FpDevice *self = FP_DEVICE (object);
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (self);
|
||||
FpDeviceClass *cls = FP_DEVICE_GET_CLASS (self);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@@ -204,6 +262,10 @@ fp_device_get_property (GObject *object,
|
||||
g_value_set_flags (value, priv->finger_status);
|
||||
break;
|
||||
|
||||
case PROP_TEMPERATURE:
|
||||
g_value_set_enum (value, priv->temp_current);
|
||||
break;
|
||||
|
||||
case PROP_DRIVER:
|
||||
g_value_set_static_string (value, FP_DEVICE_GET_CLASS (self)->id);
|
||||
break;
|
||||
@@ -224,6 +286,24 @@ fp_device_get_property (GObject *object,
|
||||
g_value_set_boolean (value, priv->is_removed);
|
||||
break;
|
||||
|
||||
case PROP_FPI_USB_DEVICE:
|
||||
g_value_set_object (value, priv->usb_device);
|
||||
break;
|
||||
|
||||
case PROP_FPI_UDEV_DATA_SPIDEV:
|
||||
if (cls->type == FP_DEVICE_TYPE_UDEV)
|
||||
g_value_set_string (value, g_strdup (priv->udev_data.spidev_path));
|
||||
else
|
||||
g_value_set_string (value, NULL);
|
||||
break;
|
||||
|
||||
case PROP_FPI_UDEV_DATA_HIDRAW:
|
||||
if (cls->type == FP_DEVICE_TYPE_UDEV)
|
||||
g_value_set_string (value, g_strdup (priv->udev_data.hidraw_path));
|
||||
else
|
||||
g_value_set_string (value, NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
@@ -279,6 +359,24 @@ fp_device_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
device_idle_probe_cb (FpDevice *self, gpointer user_data)
|
||||
{
|
||||
/* This should not be an idle handler, see comment where it is registered.
|
||||
*
|
||||
* This effectively disables USB "persist" for us, and possibly turns off
|
||||
* USB wakeup if it was enabled for some reason.
|
||||
*/
|
||||
fpi_device_configure_wakeup (self, FALSE);
|
||||
|
||||
if (!FP_DEVICE_GET_CLASS (self)->probe)
|
||||
fpi_device_probe_complete (self, NULL, NULL, NULL);
|
||||
else
|
||||
FP_DEVICE_GET_CLASS (self)->probe (self);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
fp_device_async_initable_init_async (GAsyncInitable *initable,
|
||||
int io_priority,
|
||||
@@ -298,17 +396,16 @@ fp_device_async_initable_init_async (GAsyncInitable *initable,
|
||||
if (g_task_return_error_if_cancelled (task))
|
||||
return;
|
||||
|
||||
if (!FP_DEVICE_GET_CLASS (self)->probe)
|
||||
{
|
||||
g_task_return_boolean (task, TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
priv->current_action = FPI_DEVICE_ACTION_PROBE;
|
||||
priv->current_task = g_steal_pointer (&task);
|
||||
maybe_cancel_on_cancelled (self, cancellable);
|
||||
setup_task_cancellable (self);
|
||||
|
||||
FP_DEVICE_GET_CLASS (self)->probe (self);
|
||||
/* We push this into an idle handler for compatibility with libgusb
|
||||
* 0.3.7 and before.
|
||||
* See https://github.com/hughsie/libgusb/pull/50
|
||||
*/
|
||||
g_source_set_name (fpi_device_add_timeout (self, 0, device_idle_probe_cb, NULL, NULL),
|
||||
"libusb probe in idle");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -358,6 +455,13 @@ fp_device_class_init (FpDeviceClass *klass)
|
||||
FP_TYPE_FINGER_STATUS_FLAGS, FP_FINGER_STATUS_NONE,
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
|
||||
|
||||
properties[PROP_TEMPERATURE] =
|
||||
g_param_spec_enum ("temperature",
|
||||
"Temperature",
|
||||
"The temperature estimation for device to prevent overheating.",
|
||||
FP_TYPE_TEMPERATURE, FP_TEMPERATURE_COLD,
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
|
||||
|
||||
properties[PROP_DRIVER] =
|
||||
g_param_spec_string ("driver",
|
||||
"Driver",
|
||||
@@ -446,7 +550,7 @@ fp_device_class_init (FpDeviceClass *klass)
|
||||
"USB Device",
|
||||
"Private: The USB device for the device",
|
||||
G_USB_TYPE_DEVICE,
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
/**
|
||||
* FpDevice::fpi-udev-data-spidev: (skip)
|
||||
*
|
||||
@@ -459,7 +563,7 @@ fp_device_class_init (FpDeviceClass *klass)
|
||||
"Udev data: spidev path",
|
||||
"Private: The path to /dev/spidevN.M",
|
||||
NULL,
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
/**
|
||||
* FpDevice::fpi-udev-data-hidraw: (skip)
|
||||
*
|
||||
@@ -472,7 +576,7 @@ fp_device_class_init (FpDeviceClass *klass)
|
||||
"Udev data: hidraw path",
|
||||
"Private: The path to /dev/hidrawN",
|
||||
NULL,
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
|
||||
/**
|
||||
* FpDevice::fpi-driver-data: (skip)
|
||||
@@ -616,6 +720,25 @@ fp_device_get_nr_enroll_stages (FpDevice *device)
|
||||
return priv->nr_enroll_stages;
|
||||
}
|
||||
|
||||
/**
|
||||
* fp_device_get_temperature:
|
||||
* @device: A #FpDevice
|
||||
*
|
||||
* Retrieves simple temperature information for device. It is not possible
|
||||
* to use a device when this is #FP_TEMPERATURE_HOT.
|
||||
*
|
||||
* Returns: The current temperature estimation.
|
||||
*/
|
||||
FpTemperature
|
||||
fp_device_get_temperature (FpDevice *device)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
g_return_val_if_fail (FP_IS_DEVICE (device), -1);
|
||||
|
||||
return priv->temp_current;
|
||||
}
|
||||
|
||||
/**
|
||||
* fp_device_supports_identify:
|
||||
* @device: A #FpDevice
|
||||
@@ -708,7 +831,7 @@ fp_device_open (FpDevice *device,
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->current_task)
|
||||
if (priv->current_task || priv->is_suspended)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_BUSY));
|
||||
@@ -737,7 +860,7 @@ fp_device_open (FpDevice *device,
|
||||
|
||||
priv->current_action = FPI_DEVICE_ACTION_OPEN;
|
||||
priv->current_task = g_steal_pointer (&task);
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
setup_task_cancellable (device);
|
||||
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
|
||||
|
||||
FP_DEVICE_GET_CLASS (device)->open (device);
|
||||
@@ -793,7 +916,7 @@ fp_device_close (FpDevice *device,
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->current_task)
|
||||
if (priv->current_task || priv->is_suspended)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_BUSY));
|
||||
@@ -802,7 +925,7 @@ fp_device_close (FpDevice *device,
|
||||
|
||||
priv->current_action = FPI_DEVICE_ACTION_CLOSE;
|
||||
priv->current_task = g_steal_pointer (&task);
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
setup_task_cancellable (device);
|
||||
|
||||
FP_DEVICE_GET_CLASS (device)->close (device);
|
||||
}
|
||||
@@ -826,6 +949,145 @@ fp_device_close_finish (FpDevice *device,
|
||||
return g_task_propagate_boolean (G_TASK (result), error);
|
||||
}
|
||||
|
||||
/**
|
||||
* fp_device_suspend:
|
||||
* @device: a #FpDevice
|
||||
* @cancellable: (nullable): a #GCancellable, or %NULL, currently not used
|
||||
* @callback: the function to call on completion
|
||||
* @user_data: the data to pass to @callback
|
||||
*
|
||||
* Prepare the device for system suspend. Retrieve the result with
|
||||
* fp_device_suspend_finish().
|
||||
*
|
||||
* The suspend method can be called at any time (even if the device is not
|
||||
* opened) and must be paired with a corresponding resume call. It is undefined
|
||||
* when or how any ongoing operation is finished. This call might wait for an
|
||||
* ongoing operation to finish, might cancel the ongoing operation or may
|
||||
* prepare the device so that the host is resumed when the operation can be
|
||||
* finished.
|
||||
*
|
||||
* If an ongoing operation must be cancelled then it will complete with an error
|
||||
* code of #FP_DEVICE_ERROR_BUSY before the suspend async routine finishes.
|
||||
*
|
||||
* Any operation started while the device is suspended will fail with
|
||||
* #FP_DEVICE_ERROR_BUSY, this includes calls to open or close the device.
|
||||
*/
|
||||
void
|
||||
fp_device_suspend (FpDevice *device,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_autoptr(GTask) task = NULL;
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
task = g_task_new (device, cancellable, callback, user_data);
|
||||
|
||||
if (priv->suspend_resume_task || priv->is_suspended)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->is_removed)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_REMOVED));
|
||||
return;
|
||||
}
|
||||
|
||||
priv->suspend_resume_task = g_steal_pointer (&task);
|
||||
|
||||
fpi_device_suspend (device);
|
||||
}
|
||||
|
||||
/**
|
||||
* fp_device_suspend_finish:
|
||||
* @device: A #FpDevice
|
||||
* @result: A #GAsyncResult
|
||||
* @error: Return location for errors, or %NULL to ignore
|
||||
*
|
||||
* Finish an asynchronous operation to prepare the device for suspend.
|
||||
* See fp_device_suspend().
|
||||
*
|
||||
* The API user should accept an error of #FP_DEVICE_ERROR_NOT_SUPPORTED.
|
||||
*
|
||||
* Returns: (type void): %FALSE on error, %TRUE otherwise
|
||||
*/
|
||||
gboolean
|
||||
fp_device_suspend_finish (FpDevice *device,
|
||||
GAsyncResult *result,
|
||||
GError **error)
|
||||
{
|
||||
return g_task_propagate_boolean (G_TASK (result), error);
|
||||
}
|
||||
|
||||
/**
|
||||
* fp_device_resume:
|
||||
* @device: a #FpDevice
|
||||
* @cancellable: (nullable): a #GCancellable, or %NULL, currently not used
|
||||
* @callback: the function to call on completion
|
||||
* @user_data: the data to pass to @callback
|
||||
*
|
||||
* Resume device after system suspend. Retrieve the result with
|
||||
* fp_device_suspend_finish().
|
||||
*
|
||||
* Note that it is not defined when any ongoing operation may return (success or
|
||||
* error). You must be ready to handle this before, during or after the
|
||||
* resume operation.
|
||||
*/
|
||||
void
|
||||
fp_device_resume (FpDevice *device,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_autoptr(GTask) task = NULL;
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
task = g_task_new (device, cancellable, callback, user_data);
|
||||
|
||||
if (priv->suspend_resume_task || !priv->is_suspended)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->is_removed)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_REMOVED));
|
||||
return;
|
||||
}
|
||||
|
||||
priv->suspend_resume_task = g_steal_pointer (&task);
|
||||
|
||||
fpi_device_resume (device);
|
||||
}
|
||||
|
||||
/**
|
||||
* fp_device_resume_finish:
|
||||
* @device: A #FpDevice
|
||||
* @result: A #GAsyncResult
|
||||
* @error: Return location for errors, or %NULL to ignore
|
||||
*
|
||||
* Finish an asynchronous operation to resume the device after suspend.
|
||||
* See fp_device_resume().
|
||||
*
|
||||
* The API user should accept an error of #FP_DEVICE_ERROR_NOT_SUPPORTED.
|
||||
*
|
||||
* Returns: (type void): %FALSE on error, %TRUE otherwise
|
||||
*/
|
||||
gboolean
|
||||
fp_device_resume_finish (FpDevice *device,
|
||||
GAsyncResult *result,
|
||||
GError **error)
|
||||
{
|
||||
return g_task_propagate_boolean (G_TASK (result), error);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fp_device_enroll:
|
||||
@@ -843,10 +1105,11 @@ fp_device_close_finish (FpDevice *device,
|
||||
* fp_device_enroll_finish().
|
||||
*
|
||||
* The @template_print parameter is a #FpPrint with available metadata filled
|
||||
* in. The driver may make use of this metadata, when e.g. storing the print on
|
||||
* device memory. It is undefined whether this print is filled in by the driver
|
||||
* and returned, or whether the driver will return a newly created print after
|
||||
* enrollment succeeded.
|
||||
* in and, optionally, with existing fingerprint data to be updated with newly
|
||||
* enrolled fingerprints if a device driver supports it. The driver may make use
|
||||
* of the metadata, when e.g. storing the print on device memory. It is undefined
|
||||
* whether this print is filled in by the driver and returned, or whether the
|
||||
* driver will return a newly created print after enrollment succeeded.
|
||||
*/
|
||||
void
|
||||
fp_device_enroll (FpDevice *device,
|
||||
@@ -874,7 +1137,7 @@ fp_device_enroll (FpDevice *device,
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->current_task)
|
||||
if (priv->current_task || priv->is_suspended)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_BUSY));
|
||||
@@ -883,24 +1146,43 @@ fp_device_enroll (FpDevice *device,
|
||||
|
||||
if (!FP_IS_PRINT (template_print))
|
||||
{
|
||||
g_warning ("User did not pass a print template!");
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID));
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_INVALID,
|
||||
"User did not pass a print template!"));
|
||||
return;
|
||||
}
|
||||
|
||||
g_object_get (template_print, "fpi-type", &print_type, NULL);
|
||||
if (print_type != FPI_PRINT_UNDEFINED)
|
||||
{
|
||||
g_warning ("Passed print template must be newly created and blank!");
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID));
|
||||
return;
|
||||
if (!fp_device_has_feature (device, FP_DEVICE_FEATURE_UPDATE_PRINT))
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_INVALID,
|
||||
"A device does not support print updates!"));
|
||||
return;
|
||||
}
|
||||
if (!fp_print_compatible (template_print, device))
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_INVALID,
|
||||
"The print and device must have a matching driver and device id"
|
||||
" for a fingerprint update to succeed"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
priv->current_action = FPI_DEVICE_ACTION_ENROLL;
|
||||
priv->current_task = g_steal_pointer (&task);
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
setup_task_cancellable (device);
|
||||
|
||||
fpi_device_update_temp (device, TRUE);
|
||||
if (priv->temp_current == FP_TEMPERATURE_HOT)
|
||||
{
|
||||
g_task_return_error (task, fpi_device_error_new (FP_DEVICE_ERROR_TOO_HOT));
|
||||
fpi_device_update_temp (device, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
data = g_new0 (FpEnrollData, 1);
|
||||
data->print = g_object_ref_sink (template_print);
|
||||
@@ -976,7 +1258,7 @@ fp_device_verify (FpDevice *device,
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->current_task)
|
||||
if (priv->current_task || priv->is_suspended)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_BUSY));
|
||||
@@ -993,7 +1275,15 @@ fp_device_verify (FpDevice *device,
|
||||
|
||||
priv->current_action = FPI_DEVICE_ACTION_VERIFY;
|
||||
priv->current_task = g_steal_pointer (&task);
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
setup_task_cancellable (device);
|
||||
|
||||
fpi_device_update_temp (device, TRUE);
|
||||
if (priv->temp_current == FP_TEMPERATURE_HOT)
|
||||
{
|
||||
g_task_return_error (task, fpi_device_error_new (FP_DEVICE_ERROR_TOO_HOT));
|
||||
fpi_device_update_temp (device, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
data = g_new0 (FpMatchData, 1);
|
||||
data->enrolled_print = g_object_ref (enrolled_print);
|
||||
@@ -1095,7 +1385,7 @@ fp_device_identify (FpDevice *device,
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->current_task)
|
||||
if (priv->current_task || priv->is_suspended)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_BUSY));
|
||||
@@ -1112,7 +1402,15 @@ fp_device_identify (FpDevice *device,
|
||||
|
||||
priv->current_action = FPI_DEVICE_ACTION_IDENTIFY;
|
||||
priv->current_task = g_steal_pointer (&task);
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
setup_task_cancellable (device);
|
||||
|
||||
fpi_device_update_temp (device, TRUE);
|
||||
if (priv->temp_current == FP_TEMPERATURE_HOT)
|
||||
{
|
||||
g_task_return_error (task, fpi_device_error_new (FP_DEVICE_ERROR_TOO_HOT));
|
||||
fpi_device_update_temp (device, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
data = g_new0 (FpMatchData, 1);
|
||||
/* We cannot store the gallery directly, because the ptr array may not own
|
||||
@@ -1212,7 +1510,7 @@ fp_device_capture (FpDevice *device,
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->current_task)
|
||||
if (priv->current_task || priv->is_suspended)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_BUSY));
|
||||
@@ -1229,7 +1527,15 @@ fp_device_capture (FpDevice *device,
|
||||
|
||||
priv->current_action = FPI_DEVICE_ACTION_CAPTURE;
|
||||
priv->current_task = g_steal_pointer (&task);
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
setup_task_cancellable (device);
|
||||
|
||||
fpi_device_update_temp (device, TRUE);
|
||||
if (priv->temp_current == FP_TEMPERATURE_HOT)
|
||||
{
|
||||
g_task_return_error (task, fpi_device_error_new (FP_DEVICE_ERROR_TOO_HOT));
|
||||
fpi_device_update_temp (device, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
priv->wait_for_finger = wait_for_finger;
|
||||
|
||||
@@ -1295,7 +1601,7 @@ fp_device_delete_print (FpDevice *device,
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->current_task)
|
||||
if (priv->current_task || priv->is_suspended)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_BUSY));
|
||||
@@ -1311,7 +1617,7 @@ fp_device_delete_print (FpDevice *device,
|
||||
|
||||
priv->current_action = FPI_DEVICE_ACTION_DELETE;
|
||||
priv->current_task = g_steal_pointer (&task);
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
setup_task_cancellable (device);
|
||||
|
||||
g_task_set_task_data (priv->current_task,
|
||||
g_object_ref (enrolled_print),
|
||||
@@ -1373,7 +1679,7 @@ fp_device_list_prints (FpDevice *device,
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->current_task)
|
||||
if (priv->current_task || priv->is_suspended)
|
||||
{
|
||||
g_task_return_error (task,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_BUSY));
|
||||
@@ -1390,7 +1696,7 @@ fp_device_list_prints (FpDevice *device,
|
||||
|
||||
priv->current_action = FPI_DEVICE_ACTION_LIST;
|
||||
priv->current_task = g_steal_pointer (&task);
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
setup_task_cancellable (device);
|
||||
|
||||
cls->list (device);
|
||||
}
|
||||
@@ -1475,7 +1781,7 @@ fp_device_clear_storage (FpDevice *device,
|
||||
|
||||
priv->current_action = FPI_DEVICE_ACTION_CLEAR_STORAGE;
|
||||
priv->current_task = g_steal_pointer (&task);
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
setup_task_cancellable (device);
|
||||
|
||||
cls->clear_storage (device);
|
||||
|
||||
@@ -1769,6 +2075,7 @@ fp_device_list_prints_sync (FpDevice *device,
|
||||
return fp_device_list_prints_finish (device, task, error);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fp_device_clear_storage_sync:
|
||||
* @device: a #FpDevice
|
||||
@@ -1797,6 +2104,58 @@ fp_device_clear_storage_sync (FpDevice *device,
|
||||
return fp_device_clear_storage_finish (device, task, error);
|
||||
}
|
||||
|
||||
/**
|
||||
* fp_device_suspend_sync:
|
||||
* @device: a #FpDevice
|
||||
* @cancellable: (nullable): a #GCancellable, or %NULL, currently not used
|
||||
* @error: Return location for errors, or %NULL to ignore
|
||||
*
|
||||
* Prepare device for suspend.
|
||||
*
|
||||
* Returns: (type void): %FALSE on error, %TRUE otherwise
|
||||
*/
|
||||
gboolean
|
||||
fp_device_suspend_sync (FpDevice *device,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
g_autoptr(GAsyncResult) task = NULL;
|
||||
|
||||
g_return_val_if_fail (FP_IS_DEVICE (device), FALSE);
|
||||
|
||||
fp_device_suspend (device, cancellable, async_result_ready, &task);
|
||||
while (!task)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
|
||||
return fp_device_suspend_finish (device, task, error);
|
||||
}
|
||||
|
||||
/**
|
||||
* fp_device_resume_sync:
|
||||
* @device: a #FpDevice
|
||||
* @cancellable: (nullable): a #GCancellable, or %NULL, currently not used
|
||||
* @error: Return location for errors, or %NULL to ignore
|
||||
*
|
||||
* Resume device after suspend.
|
||||
*
|
||||
* Returns: (type void): %FALSE on error, %TRUE otherwise
|
||||
*/
|
||||
gboolean
|
||||
fp_device_resume_sync (FpDevice *device,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
g_autoptr(GAsyncResult) task = NULL;
|
||||
|
||||
g_return_val_if_fail (FP_IS_DEVICE (device), FALSE);
|
||||
|
||||
fp_device_resume (device, cancellable, async_result_ready, &task);
|
||||
while (!task)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
|
||||
return fp_device_resume_finish (device, task, error);
|
||||
}
|
||||
|
||||
/**
|
||||
* fp_device_get_features:
|
||||
* @device: a #FpDevice
|
||||
|
||||
@@ -58,6 +58,8 @@ typedef enum {
|
||||
* @FP_DEVICE_FEATURE_STORAGE_DELETE: Supports deleting stored templates
|
||||
* @FP_DEVICE_FEATURE_STORAGE_CLEAR: Supports clearing the whole storage
|
||||
* @FP_DEVICE_FEATURE_DUPLICATES_CHECK: Natively supports duplicates detection
|
||||
* @FP_DEVICE_FEATURE_ALWAYS_ON: Whether the device can run continuously
|
||||
* @FP_DEVICE_FEATURE_UPDATE_PRINT: Supports updating an existing print record using new scans
|
||||
*/
|
||||
typedef enum /*< flags >*/ {
|
||||
FP_DEVICE_FEATURE_NONE = 0,
|
||||
@@ -69,6 +71,8 @@ typedef enum /*< flags >*/ {
|
||||
FP_DEVICE_FEATURE_STORAGE_DELETE = 1 << 5,
|
||||
FP_DEVICE_FEATURE_STORAGE_CLEAR = 1 << 6,
|
||||
FP_DEVICE_FEATURE_DUPLICATES_CHECK = 1 << 7,
|
||||
FP_DEVICE_FEATURE_ALWAYS_ON = 1 << 8,
|
||||
FP_DEVICE_FEATURE_UPDATE_PRINT = 1 << 9,
|
||||
} FpDeviceFeature;
|
||||
|
||||
/**
|
||||
@@ -81,6 +85,23 @@ typedef enum {
|
||||
FP_SCAN_TYPE_PRESS,
|
||||
} FpScanType;
|
||||
|
||||
/**
|
||||
* FpTemperature:
|
||||
* @FP_TEMPERATURE_COLD: Sensor is considered cold.
|
||||
* @FP_TEMPERATURE_WARM: Sensor is warm, usage time may be limited.
|
||||
* @FP_TEMPERATURE_HOT: Sensor is hot and cannot be used.
|
||||
*
|
||||
* When a device is created, it is assumed to be cold. Applications such as
|
||||
* fprintd may want to ensure all devices on the system are cold before
|
||||
* shutting down in order to ensure that the cool-off period is not violated
|
||||
* because the internal libfprint state about the device is lost.
|
||||
*/
|
||||
typedef enum {
|
||||
FP_TEMPERATURE_COLD,
|
||||
FP_TEMPERATURE_WARM,
|
||||
FP_TEMPERATURE_HOT,
|
||||
} FpTemperature;
|
||||
|
||||
/**
|
||||
* FpDeviceRetry:
|
||||
* @FP_DEVICE_RETRY_GENERAL: The scan did not succeed due to poor scan quality
|
||||
@@ -118,6 +139,7 @@ typedef enum {
|
||||
* @FP_DEVICE_ERROR_DATA_FULL: No space on device available for operation
|
||||
* @FP_DEVICE_ERROR_DATA_DUPLICATE: Enrolling template duplicates storaged templates
|
||||
* @FP_DEVICE_ERROR_REMOVED: The device has been removed.
|
||||
* @FP_DEVICE_ERROR_TOO_HOT: The device might be getting too hot
|
||||
*
|
||||
* Error codes for device operations. More specific errors from other domains
|
||||
* such as #G_IO_ERROR or #G_USB_DEVICE_ERROR may also be reported.
|
||||
@@ -135,6 +157,7 @@ typedef enum {
|
||||
FP_DEVICE_ERROR_DATA_DUPLICATE,
|
||||
/* Leave some room to add more DATA related errors */
|
||||
FP_DEVICE_ERROR_REMOVED = 0x100,
|
||||
FP_DEVICE_ERROR_TOO_HOT,
|
||||
} FpDeviceError;
|
||||
|
||||
GQuark fp_device_retry_quark (void);
|
||||
@@ -201,6 +224,7 @@ gboolean fp_device_is_open (FpDevice *device);
|
||||
FpScanType fp_device_get_scan_type (FpDevice *device);
|
||||
FpFingerStatusFlags fp_device_get_finger_status (FpDevice *device);
|
||||
gint fp_device_get_nr_enroll_stages (FpDevice *device);
|
||||
FpTemperature fp_device_get_temperature (FpDevice *device);
|
||||
|
||||
FpDeviceFeature fp_device_get_features (FpDevice *device);
|
||||
gboolean fp_device_has_feature (FpDevice *device,
|
||||
@@ -217,6 +241,16 @@ void fp_device_close (FpDevice *device,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
void fp_device_suspend (FpDevice *device,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
void fp_device_resume (FpDevice *device,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
void fp_device_enroll (FpDevice *device,
|
||||
FpPrint *template_print,
|
||||
GCancellable *cancellable,
|
||||
@@ -272,6 +306,12 @@ gboolean fp_device_open_finish (FpDevice *device,
|
||||
gboolean fp_device_close_finish (FpDevice *device,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
gboolean fp_device_suspend_finish (FpDevice *device,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
gboolean fp_device_resume_finish (FpDevice *device,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
FpPrint *fp_device_enroll_finish (FpDevice *device,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
@@ -340,6 +380,13 @@ GPtrArray * fp_device_list_prints_sync (FpDevice *device,
|
||||
gboolean fp_device_clear_storage_sync (FpDevice *device,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
gboolean fp_device_suspend_sync (FpDevice *device,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
gboolean fp_device_resume_sync (FpDevice *device,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
/* Deprecated functions */
|
||||
G_DEPRECATED_FOR (fp_device_get_features)
|
||||
gboolean fp_device_supports_identify (FpDevice *device);
|
||||
|
||||
@@ -101,6 +101,7 @@ fp_image_device_start_capture_action (FpDevice *device)
|
||||
FpImageDevice *self = FP_IMAGE_DEVICE (device);
|
||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||
FpiDeviceAction action;
|
||||
FpiPrintType print_type;
|
||||
|
||||
/* There is just one action that we cannot support out
|
||||
* of the box, which is a capture without first waiting
|
||||
@@ -124,7 +125,9 @@ fp_image_device_start_capture_action (FpDevice *device)
|
||||
FpPrint *enroll_print = NULL;
|
||||
|
||||
fpi_device_get_enroll_data (device, &enroll_print);
|
||||
fpi_print_set_type (enroll_print, FPI_PRINT_NBIS);
|
||||
g_object_get (enroll_print, "fpi-type", &print_type, NULL);
|
||||
if (print_type != FPI_PRINT_NBIS)
|
||||
fpi_print_set_type (enroll_print, FPI_PRINT_NBIS);
|
||||
}
|
||||
|
||||
priv->enroll_stage = 0;
|
||||
@@ -221,6 +224,7 @@ fp_image_device_class_init (FpImageDeviceClass *klass)
|
||||
fp_device_class->cancel = fp_image_device_cancel_action;
|
||||
|
||||
fpi_device_class_auto_initialize_features (fp_device_class);
|
||||
fp_device_class->features |= FP_DEVICE_FEATURE_UPDATE_PRINT;
|
||||
|
||||
/* Default implementations */
|
||||
klass->activate = fp_image_device_default_activate;
|
||||
|
||||
@@ -61,6 +61,7 @@ enum {
|
||||
/* Private property*/
|
||||
PROP_FPI_TYPE,
|
||||
PROP_FPI_DATA,
|
||||
PROP_FPI_PRINTS,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
@@ -133,6 +134,10 @@ fp_print_get_property (GObject *object,
|
||||
g_value_set_variant (value, self->data);
|
||||
break;
|
||||
|
||||
case PROP_FPI_PRINTS:
|
||||
g_value_set_pointer (value, self->prints);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
@@ -188,6 +193,11 @@ fp_print_set_property (GObject *object,
|
||||
self->data = g_value_dup_variant (value);
|
||||
break;
|
||||
|
||||
case PROP_FPI_PRINTS:
|
||||
g_clear_pointer (&self->prints, g_ptr_array_unref);
|
||||
self->prints = g_value_get_pointer (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
@@ -281,7 +291,7 @@ fp_print_class_init (FpPrintClass *klass)
|
||||
"Type",
|
||||
"Private: The type of the print data",
|
||||
FPI_TYPE_PRINT_TYPE,
|
||||
FPI_PRINT_RAW,
|
||||
FPI_PRINT_UNDEFINED,
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
/**
|
||||
@@ -299,6 +309,19 @@ fp_print_class_init (FpPrintClass *klass)
|
||||
NULL,
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
|
||||
|
||||
/**
|
||||
* FpPrint::fpi-prints: (skip)
|
||||
*
|
||||
* This property is only for internal purposes.
|
||||
*
|
||||
* Stability: private
|
||||
*/
|
||||
properties[PROP_FPI_PRINTS] =
|
||||
g_param_spec_pointer ("fpi-prints",
|
||||
"Prints",
|
||||
"Prints for internal use only",
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
*/
|
||||
|
||||
#define FP_COMPONENT "device"
|
||||
#include <math.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "fpi-log.h"
|
||||
|
||||
#include "fp-device-private.h"
|
||||
@@ -78,6 +81,9 @@ fpi_device_class_auto_initialize_features (FpDeviceClass *device_class)
|
||||
|
||||
if (device_class->delete && (device_class->list || device_class->clear_storage))
|
||||
device_class->features |= FP_DEVICE_FEATURE_STORAGE;
|
||||
|
||||
if (device_class->temp_hot_seconds < 0)
|
||||
device_class->features |= FP_DEVICE_FEATURE_ALWAYS_ON;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,6 +183,10 @@ fpi_device_error_new (FpDeviceError error)
|
||||
msg = "This device has been removed from the system.";
|
||||
break;
|
||||
|
||||
case FP_DEVICE_ERROR_TOO_HOT:
|
||||
msg = "Device disabled to prevent overheating.";
|
||||
break;
|
||||
|
||||
default:
|
||||
g_warning ("Unsupported error, returning general error instead!");
|
||||
error = FP_DEVICE_ERROR_GENERAL;
|
||||
@@ -488,14 +498,11 @@ gboolean
|
||||
fpi_device_action_is_cancelled (FpDevice *device)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
GCancellable *cancellable;
|
||||
|
||||
g_return_val_if_fail (FP_IS_DEVICE (device), TRUE);
|
||||
g_return_val_if_fail (priv->current_action != FPI_DEVICE_ACTION_NONE, TRUE);
|
||||
|
||||
cancellable = g_task_get_cancellable (priv->current_task);
|
||||
|
||||
return g_cancellable_is_cancelled (cancellable);
|
||||
return g_cancellable_is_cancelled (priv->current_cancellable);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -673,7 +680,7 @@ fpi_device_get_cancellable (FpDevice *device)
|
||||
g_return_val_if_fail (FP_IS_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (priv->current_action != FPI_DEVICE_ACTION_NONE, NULL);
|
||||
|
||||
return g_task_get_cancellable (priv->current_task);
|
||||
return priv->current_cancellable;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -802,6 +809,121 @@ fpi_device_action_error (FpDevice *device,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_device_critical_enter:
|
||||
* @device: The #FpDevice
|
||||
*
|
||||
* Enter a critical section in the driver code where no outside calls from
|
||||
* libfprint should happen. Drivers can already assume that everything
|
||||
* happens from the same thread, however, that still allows e.g. the cancel
|
||||
* vfunc to be called at any point in time.
|
||||
*
|
||||
* Using this kind of critical section, the driver can assume that libfprint
|
||||
* will not forward any external requests to the driver for the time being.
|
||||
* This is for example useful to prevent cancellation while the device is being
|
||||
* set up. Or, said differently, using this feature means that the cancel
|
||||
* handler is able to make more assumptions about the current state.
|
||||
*
|
||||
* Please note that the driver is not shielded from all external changes. For
|
||||
* example the cancellable as returned by fpi_device_get_cancellable() will
|
||||
* still change immediately.
|
||||
*
|
||||
* The driver may call this function multiple times, but must also ensure that
|
||||
* fpi_device_critical_leave() is called an equal amount of times and that all
|
||||
* critical sections are left before command completion.
|
||||
*/
|
||||
void
|
||||
fpi_device_critical_enter (FpDevice *device)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
g_return_if_fail (priv->current_action != FPI_DEVICE_ACTION_NONE);
|
||||
|
||||
priv->critical_section += 1;
|
||||
|
||||
/* Stop flushing events if that was previously queued. */
|
||||
if (priv->critical_section_flush_source)
|
||||
g_source_destroy (priv->critical_section_flush_source);
|
||||
priv->critical_section_flush_source = NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
fpi_device_critical_section_flush_idle_cb (FpDevice *device)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
FpDeviceClass *cls = FP_DEVICE_GET_CLASS (device);
|
||||
|
||||
if (priv->cancel_queued)
|
||||
{
|
||||
/* Cancellation must only happen if the driver is busy. */
|
||||
if (priv->current_action != FPI_DEVICE_ACTION_NONE &&
|
||||
priv->current_task_idle_return_source == NULL)
|
||||
cls->cancel (device);
|
||||
priv->cancel_queued = FALSE;
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
if (priv->suspend_queued)
|
||||
{
|
||||
priv->suspend_queued = FALSE;
|
||||
fpi_device_suspend (device);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
if (priv->resume_queued)
|
||||
{
|
||||
priv->resume_queued = FALSE;
|
||||
fpi_device_resume (device);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
priv->critical_section_flush_source = NULL;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_device_critical_leave:
|
||||
* @device: The #FpDevice
|
||||
*
|
||||
* Leave a critical section started by fpi_device_critical_enter().
|
||||
*
|
||||
* Once all critical sections have been left, libfprint will start flushing
|
||||
* out the queued up requests. This is done from the mainloop and the driver
|
||||
* is protected from reentrency issues.
|
||||
*/
|
||||
void
|
||||
fpi_device_critical_leave (FpDevice *device)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
g_return_if_fail (priv->current_action != FPI_DEVICE_ACTION_NONE);
|
||||
g_return_if_fail (priv->critical_section);
|
||||
|
||||
priv->critical_section -= 1;
|
||||
if (priv->critical_section)
|
||||
return;
|
||||
|
||||
/* We left the critical section, make sure a flush is queued. */
|
||||
if (priv->critical_section_flush_source)
|
||||
return;
|
||||
|
||||
priv->critical_section_flush_source = g_idle_source_new ();
|
||||
g_source_set_priority (priv->critical_section_flush_source, G_PRIORITY_HIGH);
|
||||
g_source_set_callback (priv->critical_section_flush_source,
|
||||
(GSourceFunc) fpi_device_critical_section_flush_idle_cb,
|
||||
device,
|
||||
NULL);
|
||||
g_source_set_name (priv->critical_section_flush_source,
|
||||
"Flush libfprint driver critical section");
|
||||
g_source_attach (priv->critical_section_flush_source,
|
||||
g_task_get_context (priv->current_task));
|
||||
g_source_unref (priv->critical_section_flush_source);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_device_cancel_action (FpDevice *device)
|
||||
{
|
||||
@@ -811,10 +933,17 @@ clear_device_cancel_action (FpDevice *device)
|
||||
|
||||
if (priv->current_cancellable_id)
|
||||
{
|
||||
g_cancellable_disconnect (g_task_get_cancellable (priv->current_task),
|
||||
g_cancellable_disconnect (priv->current_cancellable,
|
||||
priv->current_cancellable_id);
|
||||
priv->current_cancellable_id = 0;
|
||||
}
|
||||
|
||||
if (priv->current_task_cancellable_id)
|
||||
{
|
||||
g_cancellable_disconnect (g_task_get_cancellable (priv->current_task),
|
||||
priv->current_task_cancellable_id);
|
||||
priv->current_task_cancellable_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
typedef enum _FpDeviceTaskReturnType {
|
||||
@@ -841,6 +970,7 @@ fp_device_task_return_in_idle_cb (gpointer user_data)
|
||||
FpiDeviceAction action;
|
||||
|
||||
g_autoptr(GTask) task = NULL;
|
||||
g_autoptr(GError) cancellation_reason = NULL;
|
||||
|
||||
|
||||
action_str = g_enum_to_string (FPI_TYPE_DEVICE_ACTION, priv->current_action);
|
||||
@@ -850,6 +980,10 @@ fp_device_task_return_in_idle_cb (gpointer user_data)
|
||||
action = priv->current_action;
|
||||
priv->current_action = FPI_DEVICE_ACTION_NONE;
|
||||
priv->current_task_idle_return_source = NULL;
|
||||
g_clear_object (&priv->current_cancellable);
|
||||
cancellation_reason = g_steal_pointer (&priv->current_cancellation_reason);
|
||||
|
||||
fpi_device_update_temp (data->device, FALSE);
|
||||
|
||||
if (action == FPI_DEVICE_ACTION_OPEN &&
|
||||
data->type != FP_DEVICE_TASK_RETURN_ERROR)
|
||||
@@ -866,6 +1000,8 @@ fp_device_task_return_in_idle_cb (gpointer user_data)
|
||||
g_object_notify (G_OBJECT (data->device), "open");
|
||||
}
|
||||
|
||||
/* TODO: Port/use the cancellation mechanism for device removal! */
|
||||
|
||||
/* Return FP_DEVICE_ERROR_REMOVED if the device is removed,
|
||||
* with the exception of a successful open, which is an odd corner case. */
|
||||
if (priv->is_removed &&
|
||||
@@ -901,7 +1037,18 @@ fp_device_task_return_in_idle_cb (gpointer user_data)
|
||||
break;
|
||||
|
||||
case FP_DEVICE_TASK_RETURN_ERROR:
|
||||
g_task_return_error (task, g_steal_pointer (&data->result));
|
||||
/* Return internal cancellation reason instead if we have one.
|
||||
* Note that an external cancellation always returns G_IO_ERROR_CANCELLED
|
||||
*/
|
||||
if (cancellation_reason)
|
||||
{
|
||||
g_task_set_task_data (task, NULL, NULL);
|
||||
g_task_return_error (task, g_steal_pointer (&cancellation_reason));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_task_return_error (task, g_steal_pointer (&data->result));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1404,6 +1551,302 @@ fpi_device_list_complete (FpDevice *device,
|
||||
fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_ERROR, error);
|
||||
}
|
||||
|
||||
static int
|
||||
update_attr (const char *attr, const char *value)
|
||||
{
|
||||
int fd, err;
|
||||
gssize r;
|
||||
char buf[50] = { 0 };
|
||||
|
||||
fd = open (attr, O_RDONLY);
|
||||
err = -errno;
|
||||
if (fd < 0)
|
||||
return -err;
|
||||
|
||||
r = read (fd, buf, sizeof (buf) - 1);
|
||||
err = errno;
|
||||
close (fd);
|
||||
if (r < 0)
|
||||
return -err;
|
||||
|
||||
g_strchomp (buf);
|
||||
if (g_strcmp0 (buf, value) == 0)
|
||||
return 0;
|
||||
|
||||
/* O_TRUNC makes things work in the umockdev environment */
|
||||
fd = open (attr, O_WRONLY | O_TRUNC);
|
||||
err = errno;
|
||||
if (fd < 0)
|
||||
return -err;
|
||||
|
||||
r = write (fd, value, strlen (value));
|
||||
err = -errno;
|
||||
close (fd);
|
||||
if (r < 0)
|
||||
{
|
||||
/* Write failures are weird, and are worth a warning */
|
||||
g_warning ("Could not write %s to %s", value, attr);
|
||||
return -err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
complete_suspend_resume_task (FpDevice *device)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
g_assert (priv->suspend_resume_task);
|
||||
|
||||
g_task_return_boolean (g_steal_pointer (&priv->suspend_resume_task), TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
fpi_device_suspend (FpDevice *device)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
/* If the device is currently idle, just complete immediately.
|
||||
* For long running tasks, call the driver handler right away, for short
|
||||
* tasks, wait for completion and then return the task.
|
||||
*/
|
||||
switch (priv->current_action)
|
||||
{
|
||||
case FPI_DEVICE_ACTION_NONE:
|
||||
fpi_device_suspend_complete (device, NULL);
|
||||
break;
|
||||
|
||||
case FPI_DEVICE_ACTION_ENROLL:
|
||||
case FPI_DEVICE_ACTION_VERIFY:
|
||||
case FPI_DEVICE_ACTION_IDENTIFY:
|
||||
case FPI_DEVICE_ACTION_CAPTURE:
|
||||
if (FP_DEVICE_GET_CLASS (device)->suspend)
|
||||
{
|
||||
if (priv->critical_section)
|
||||
priv->suspend_queued = TRUE;
|
||||
else
|
||||
FP_DEVICE_GET_CLASS (device)->suspend (device);
|
||||
}
|
||||
else
|
||||
{
|
||||
fpi_device_suspend_complete (device, fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
case FPI_DEVICE_ACTION_PROBE:
|
||||
case FPI_DEVICE_ACTION_OPEN:
|
||||
case FPI_DEVICE_ACTION_CLOSE:
|
||||
case FPI_DEVICE_ACTION_DELETE:
|
||||
case FPI_DEVICE_ACTION_LIST:
|
||||
case FPI_DEVICE_ACTION_CLEAR_STORAGE:
|
||||
g_signal_connect_object (priv->current_task,
|
||||
"notify::completed",
|
||||
G_CALLBACK (complete_suspend_resume_task),
|
||||
device,
|
||||
G_CONNECT_SWAPPED);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fpi_device_resume (FpDevice *device)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
switch (priv->current_action)
|
||||
{
|
||||
case FPI_DEVICE_ACTION_NONE:
|
||||
fpi_device_resume_complete (device, NULL);
|
||||
break;
|
||||
|
||||
case FPI_DEVICE_ACTION_ENROLL:
|
||||
case FPI_DEVICE_ACTION_VERIFY:
|
||||
case FPI_DEVICE_ACTION_IDENTIFY:
|
||||
case FPI_DEVICE_ACTION_CAPTURE:
|
||||
if (FP_DEVICE_GET_CLASS (device)->resume)
|
||||
{
|
||||
if (priv->critical_section)
|
||||
priv->resume_queued = TRUE;
|
||||
else
|
||||
FP_DEVICE_GET_CLASS (device)->resume (device);
|
||||
}
|
||||
else
|
||||
{
|
||||
fpi_device_resume_complete (device, fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
case FPI_DEVICE_ACTION_PROBE:
|
||||
case FPI_DEVICE_ACTION_OPEN:
|
||||
case FPI_DEVICE_ACTION_CLOSE:
|
||||
case FPI_DEVICE_ACTION_DELETE:
|
||||
case FPI_DEVICE_ACTION_LIST:
|
||||
case FPI_DEVICE_ACTION_CLEAR_STORAGE:
|
||||
/* cannot happen as we make sure these tasks complete before suspend */
|
||||
g_assert_not_reached ();
|
||||
complete_suspend_resume_task (device);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fpi_device_configure_wakeup (FpDevice *device, gboolean enabled)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
switch (priv->type)
|
||||
{
|
||||
case FP_DEVICE_TYPE_USB:
|
||||
{
|
||||
g_autoptr(GString) ports = NULL;
|
||||
GUsbDevice *dev, *parent;
|
||||
const char *wakeup_command = enabled ? "enabled" : "disabled";
|
||||
guint8 bus, port;
|
||||
g_autofree gchar *sysfs_wakeup = NULL;
|
||||
g_autofree gchar *sysfs_persist = NULL;
|
||||
int res;
|
||||
|
||||
ports = g_string_new (NULL);
|
||||
bus = g_usb_device_get_bus (priv->usb_device);
|
||||
|
||||
/* Walk up, skipping the root hub. */
|
||||
dev = priv->usb_device;
|
||||
while ((parent = g_usb_device_get_parent (dev)))
|
||||
{
|
||||
port = g_usb_device_get_port_number (dev);
|
||||
g_string_prepend (ports, g_strdup_printf ("%d.", port));
|
||||
dev = parent;
|
||||
}
|
||||
g_string_set_size (ports, ports->len - 1);
|
||||
|
||||
sysfs_wakeup = g_strdup_printf ("/sys/bus/usb/devices/%d-%s/power/wakeup", bus, ports->str);
|
||||
res = update_attr (sysfs_wakeup, wakeup_command);
|
||||
if (res < 0)
|
||||
g_debug ("Failed to set %s to %s", sysfs_wakeup, wakeup_command);
|
||||
|
||||
/* Persist means that the kernel tries to keep the USB device open
|
||||
* in case it is "replugged" due to suspend.
|
||||
* This is not helpful, as it will receive a reset and will be in a bad
|
||||
* state. Instead, seeing an unplug and a new device makes more sense.
|
||||
*/
|
||||
sysfs_persist = g_strdup_printf ("/sys/bus/usb/devices/%d-%s/power/persist", bus, ports->str);
|
||||
res = update_attr (sysfs_persist, "0");
|
||||
if (res < 0)
|
||||
g_warning ("Failed to disable USB persist by writing to %s", sysfs_persist);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case FP_DEVICE_TYPE_VIRTUAL:
|
||||
case FP_DEVICE_TYPE_UDEV:
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_ERROR,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fpi_device_suspend_completed (FpDevice *device)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
/* We have an ongoing operation, allow the device to wake up the machine. */
|
||||
if (priv->current_action != FPI_DEVICE_ACTION_NONE)
|
||||
fpi_device_configure_wakeup (device, TRUE);
|
||||
|
||||
if (priv->critical_section)
|
||||
g_warning ("Driver was in a critical section at suspend time. It likely deadlocked!");
|
||||
|
||||
if (priv->suspend_error)
|
||||
g_task_return_error (g_steal_pointer (&priv->suspend_resume_task),
|
||||
g_steal_pointer (&priv->suspend_error));
|
||||
else
|
||||
g_task_return_boolean (g_steal_pointer (&priv->suspend_resume_task), TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_device_suspend_complete:
|
||||
* @device: The #FpDevice
|
||||
* @error: The #GError or %NULL on success
|
||||
*
|
||||
* Finish a suspend request. Only return a %NULL error if suspend has been
|
||||
* correctly configured and the current action as returned by
|
||||
* fpi_device_get_current_action() will continue to run after resume.
|
||||
*
|
||||
* In all other cases an error must be returned. Should this happen, the
|
||||
* current action will be cancelled before the error is forwarded to the
|
||||
* application.
|
||||
*
|
||||
* It is recommended to set @error to #FP_ERROR_NOT_IMPLEMENTED.
|
||||
*/
|
||||
void
|
||||
fpi_device_suspend_complete (FpDevice *device,
|
||||
GError *error)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
g_return_if_fail (FP_IS_DEVICE (device));
|
||||
g_return_if_fail (priv->suspend_resume_task);
|
||||
g_return_if_fail (priv->suspend_error == NULL);
|
||||
|
||||
priv->suspend_error = error;
|
||||
priv->is_suspended = TRUE;
|
||||
|
||||
/* If there is no error, we have no running task, return immediately. */
|
||||
if (error == NULL || !priv->current_task || g_task_get_completed (priv->current_task))
|
||||
{
|
||||
fpi_device_suspend_completed (device);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Wait for completion of the current task. */
|
||||
g_signal_connect_object (priv->current_task,
|
||||
"notify::completed",
|
||||
G_CALLBACK (fpi_device_suspend_completed),
|
||||
device,
|
||||
G_CONNECT_SWAPPED);
|
||||
|
||||
/* And cancel any action that might be long-running. */
|
||||
if (!priv->current_cancellation_reason)
|
||||
priv->current_cancellation_reason = fpi_device_error_new_msg (FP_DEVICE_ERROR_BUSY,
|
||||
"Cannot run while suspended.");
|
||||
|
||||
g_cancellable_cancel (priv->current_cancellable);
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_device_resume_complete:
|
||||
* @device: The #FpDevice
|
||||
* @error: The #GError or %NULL on success
|
||||
*
|
||||
* Finish a resume request.
|
||||
*/
|
||||
void
|
||||
fpi_device_resume_complete (FpDevice *device,
|
||||
GError *error)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
g_return_if_fail (FP_IS_DEVICE (device));
|
||||
g_return_if_fail (priv->suspend_resume_task);
|
||||
|
||||
priv->is_suspended = FALSE;
|
||||
fpi_device_configure_wakeup (device, FALSE);
|
||||
|
||||
if (error)
|
||||
g_task_return_error (g_steal_pointer (&priv->suspend_resume_task), error);
|
||||
else
|
||||
g_task_return_boolean (g_steal_pointer (&priv->suspend_resume_task), TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_device_clear_storage_complete:
|
||||
* @device: The #FpDevice
|
||||
@@ -1685,3 +2128,128 @@ fpi_device_report_finger_status_changes (FpDevice *device,
|
||||
|
||||
return fpi_device_report_finger_status (device, finger_status);
|
||||
}
|
||||
|
||||
static void
|
||||
update_temp_timeout (FpDevice *device, gpointer user_data)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
fpi_device_update_temp (device, priv->temp_last_active);
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_device_update_temp:
|
||||
* @device: The #FpDevice
|
||||
* @is_active: Whether the device is now active
|
||||
*
|
||||
* Purely internal function to update the temperature. Also ensure that the
|
||||
* state is updated once a threshold is reached.
|
||||
*/
|
||||
void
|
||||
fpi_device_update_temp (FpDevice *device, gboolean is_active)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
gint64 now = g_get_monotonic_time ();
|
||||
gdouble passed_seconds;
|
||||
gdouble alpha;
|
||||
gdouble next_threshold;
|
||||
gdouble old_ratio;
|
||||
FpTemperature old_temp;
|
||||
g_autofree char *old_temp_str = NULL;
|
||||
g_autofree char *new_temp_str = NULL;
|
||||
|
||||
if (priv->temp_hot_seconds < 0)
|
||||
{
|
||||
g_debug ("Not updating temperature model, device can run continuously!");
|
||||
return;
|
||||
}
|
||||
|
||||
passed_seconds = (now - priv->temp_last_update) / 1e6;
|
||||
old_ratio = priv->temp_current_ratio;
|
||||
|
||||
if (priv->temp_last_active)
|
||||
{
|
||||
alpha = exp (-passed_seconds / priv->temp_hot_seconds);
|
||||
priv->temp_current_ratio = alpha * priv->temp_current_ratio + 1 - alpha;
|
||||
}
|
||||
else
|
||||
{
|
||||
alpha = exp (-passed_seconds / priv->temp_cold_seconds);
|
||||
priv->temp_current_ratio = alpha * priv->temp_current_ratio;
|
||||
}
|
||||
|
||||
priv->temp_last_active = is_active;
|
||||
priv->temp_last_update = now;
|
||||
|
||||
old_temp = priv->temp_current;
|
||||
if (priv->temp_current_ratio < TEMP_COLD_THRESH)
|
||||
{
|
||||
priv->temp_current = FP_TEMPERATURE_COLD;
|
||||
next_threshold = is_active ? TEMP_COLD_THRESH : -1.0;
|
||||
}
|
||||
else if (priv->temp_current_ratio < TEMP_HOT_WARM_THRESH)
|
||||
{
|
||||
priv->temp_current = FP_TEMPERATURE_WARM;
|
||||
next_threshold = is_active ? TEMP_WARM_HOT_THRESH : TEMP_COLD_THRESH;
|
||||
}
|
||||
else if (priv->temp_current_ratio < TEMP_WARM_HOT_THRESH)
|
||||
{
|
||||
/* Keep HOT until we reach TEMP_HOT_WARM_THRESH */
|
||||
if (priv->temp_current != FP_TEMPERATURE_HOT)
|
||||
priv->temp_current = FP_TEMPERATURE_WARM;
|
||||
|
||||
next_threshold = is_active ? TEMP_WARM_HOT_THRESH : TEMP_HOT_WARM_THRESH;
|
||||
}
|
||||
else
|
||||
{
|
||||
priv->temp_current = FP_TEMPERATURE_HOT;
|
||||
next_threshold = is_active ? -1.0 : TEMP_HOT_WARM_THRESH;
|
||||
}
|
||||
|
||||
old_temp_str = g_enum_to_string (FP_TYPE_TEMPERATURE, old_temp);
|
||||
new_temp_str = g_enum_to_string (FP_TYPE_TEMPERATURE, priv->temp_current);
|
||||
g_debug ("Updated temperature model after %0.2f seconds, ratio %0.2f -> %0.2f, active %d -> %d, %s -> %s",
|
||||
passed_seconds,
|
||||
old_ratio,
|
||||
priv->temp_current_ratio,
|
||||
priv->temp_last_active,
|
||||
is_active,
|
||||
old_temp_str,
|
||||
new_temp_str);
|
||||
|
||||
if (priv->temp_current != old_temp)
|
||||
g_object_notify (G_OBJECT (device), "temperature");
|
||||
|
||||
/* If the device is HOT, then do an internal cancellation of long running tasks. */
|
||||
if (priv->temp_current == FP_TEMPERATURE_HOT)
|
||||
{
|
||||
if (priv->current_action == FPI_DEVICE_ACTION_ENROLL ||
|
||||
priv->current_action == FPI_DEVICE_ACTION_VERIFY ||
|
||||
priv->current_action == FPI_DEVICE_ACTION_IDENTIFY ||
|
||||
priv->current_action == FPI_DEVICE_ACTION_CAPTURE)
|
||||
{
|
||||
if (!priv->current_cancellation_reason)
|
||||
priv->current_cancellation_reason = fpi_device_error_new (FP_DEVICE_ERROR_TOO_HOT);
|
||||
|
||||
g_cancellable_cancel (priv->current_cancellable);
|
||||
}
|
||||
}
|
||||
|
||||
g_clear_pointer (&priv->temp_timeout, g_source_destroy);
|
||||
|
||||
if (next_threshold < 0)
|
||||
return;
|
||||
|
||||
/* Set passed_seconds to the time until the next update is needed */
|
||||
if (is_active)
|
||||
passed_seconds = -priv->temp_hot_seconds * log ((next_threshold - 1.0) / (priv->temp_current_ratio - 1.0));
|
||||
else
|
||||
passed_seconds = -priv->temp_cold_seconds * log (next_threshold / priv->temp_current_ratio);
|
||||
|
||||
passed_seconds += TEMP_DELAY_SECONDS;
|
||||
|
||||
priv->temp_timeout = fpi_device_add_timeout (device,
|
||||
passed_seconds * 1000,
|
||||
update_temp_timeout,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
#include "fp-image.h"
|
||||
#include "fpi-print.h"
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/**
|
||||
* FpiDeviceUdevSubtype:
|
||||
* FpiDeviceUdevSubtypeFlags:
|
||||
* @FPI_DEVICE_UDEV_SUBTYPE_SPIDEV: The device requires an spidev node
|
||||
* @FPI_DEVICE_UDEV_SUBTYPE_HIDRAW: The device requires a hidraw node
|
||||
*
|
||||
* Bitfield of required hardware resources for a udev-backed device.
|
||||
*/
|
||||
typedef enum {
|
||||
FPI_DEVICE_UDEV_SUBTYPE_SPIDEV = 1 << 0,
|
||||
@@ -82,6 +82,10 @@ struct _FpIdEntry
|
||||
* fpi_device_set_nr_enroll_stages() from @probe if this is dynamic.
|
||||
* @scan_type: The scan type of supported devices; use
|
||||
* fpi_device_set_scan_type() from @probe if this is dynamic.
|
||||
* @temp_hot_seconds: Assumed time in seconds for the device to become too hot
|
||||
* after being mostly cold. Set to -1 if the device can be always-on.
|
||||
* @temp_cold_seconds: Assumed time in seconds for the device to be mostly cold
|
||||
* after having been too hot to operate.
|
||||
* @usb_discover: Class method to check whether a USB device is supported by
|
||||
* the driver. Should return 0 if the device is unsupported and a positive
|
||||
* score otherwise. The default score is 50 and the driver with the highest
|
||||
@@ -104,6 +108,10 @@ struct _FpIdEntry
|
||||
* @clear_storage: Delete all prints from the device
|
||||
* @cancel: Called on cancellation, this is a convenience to not need to handle
|
||||
* the #GCancellable directly by using fpi_device_get_cancellable().
|
||||
* @suspend: Called when an interactive action is running (ENROLL, VERIFY,
|
||||
* IDENTIFY or CAPTURE) and the system is about to go into suspend.
|
||||
* @resume: Called to resume an ongoing interactive action after the system has
|
||||
* resumed from suspend.
|
||||
*
|
||||
* NOTE: If your driver is image based, then you should subclass #FpImageDevice
|
||||
* instead. #FpImageDevice based drivers use a different way of interacting
|
||||
@@ -122,6 +130,9 @@ struct _FpIdEntry
|
||||
* operation (i.e. any operation that requires capturing). It is entirely fine
|
||||
* to ignore cancellation requests for short operations (e.g. open/close).
|
||||
*
|
||||
* Note that @cancel, @suspend and @resume will not be called while the device
|
||||
* is within a fpi_device_critical_enter()/fpi_device_critical_leave() block.
|
||||
*
|
||||
* This API is solely intended for drivers. It is purely internal and neither
|
||||
* API nor ABI stable.
|
||||
*/
|
||||
@@ -142,6 +153,10 @@ struct _FpDeviceClass
|
||||
gint nr_enroll_stages;
|
||||
FpScanType scan_type;
|
||||
|
||||
/* Simple device temperature model constants */
|
||||
gint32 temp_hot_seconds;
|
||||
gint32 temp_cold_seconds;
|
||||
|
||||
/* Callbacks */
|
||||
gint (*usb_discover) (GUsbDevice *usb_device);
|
||||
void (*probe) (FpDevice *device);
|
||||
@@ -156,6 +171,8 @@ struct _FpDeviceClass
|
||||
void (*clear_storage) (FpDevice * device);
|
||||
|
||||
void (*cancel) (FpDevice *device);
|
||||
void (*suspend) (FpDevice *device);
|
||||
void (*resume) (FpDevice *device);
|
||||
};
|
||||
|
||||
void fpi_device_class_auto_initialize_features (FpDeviceClass *device_class);
|
||||
@@ -256,6 +273,9 @@ void fpi_device_update_features (FpDevice *device,
|
||||
void fpi_device_action_error (FpDevice *device,
|
||||
GError *error);
|
||||
|
||||
void fpi_device_critical_enter (FpDevice *device);
|
||||
void fpi_device_critical_leave (FpDevice *device);
|
||||
|
||||
void fpi_device_probe_complete (FpDevice *device,
|
||||
const gchar *device_id,
|
||||
const gchar *device_name,
|
||||
@@ -281,6 +301,10 @@ void fpi_device_list_complete (FpDevice *device,
|
||||
GError *error);
|
||||
void fpi_device_clear_storage_complete (FpDevice *device,
|
||||
GError *error);
|
||||
void fpi_device_suspend_complete (FpDevice *device,
|
||||
GError *error);
|
||||
void fpi_device_resume_complete (FpDevice *device,
|
||||
GError *error);
|
||||
|
||||
void fpi_device_enroll_progress (FpDevice *device,
|
||||
gint completed_stages,
|
||||
|
||||
@@ -277,7 +277,7 @@ fpi_image_device_minutiae_detected (GObject *source_object, GAsyncResult *res, g
|
||||
{
|
||||
print = fp_print_new (device);
|
||||
fpi_print_set_type (print, FPI_PRINT_NBIS);
|
||||
if (!fpi_print_add_from_image (print, image, &error))
|
||||
if (!fpi_print_add_from_image (print, image, priv->bz3_threshold, &error))
|
||||
{
|
||||
g_clear_object (&print);
|
||||
|
||||
|
||||
@@ -154,11 +154,14 @@ minutiae_to_xyt (struct fp_minutiae *minutiae,
|
||||
gboolean
|
||||
fpi_print_add_from_image (FpPrint *print,
|
||||
FpImage *image,
|
||||
gint bz3_threshold,
|
||||
GError **error)
|
||||
{
|
||||
g_autofree struct xyt_struct *xyt = NULL;
|
||||
GPtrArray *minutiae;
|
||||
struct fp_minutiae _minutiae;
|
||||
struct xyt_struct *xyt;
|
||||
gint probe_len;
|
||||
gint score;
|
||||
|
||||
if (print->type != FPI_PRINT_NBIS || !image)
|
||||
{
|
||||
@@ -173,8 +176,8 @@ fpi_print_add_from_image (FpPrint *print,
|
||||
if (!minutiae || minutiae->len == 0)
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_INVALID_DATA,
|
||||
FP_DEVICE_RETRY,
|
||||
FP_DEVICE_RETRY_GENERAL,
|
||||
"No minutiae found in image or not yet detected!");
|
||||
return FALSE;
|
||||
}
|
||||
@@ -185,7 +188,20 @@ fpi_print_add_from_image (FpPrint *print,
|
||||
|
||||
xyt = g_new0 (struct xyt_struct, 1);
|
||||
minutiae_to_xyt (&_minutiae, image->width, image->height, xyt);
|
||||
g_ptr_array_add (print->prints, xyt);
|
||||
|
||||
probe_len = bozorth_probe_init (xyt);
|
||||
score = bozorth_to_gallery (probe_len, xyt, xyt);
|
||||
fp_dbg ("self-match score %d/%d", score, bz3_threshold);
|
||||
if (score <= bz3_threshold)
|
||||
{
|
||||
g_set_error (error,
|
||||
FP_DEVICE_RETRY,
|
||||
FP_DEVICE_RETRY_GENERAL,
|
||||
"Not enough minutiae to generate a match!");
|
||||
return FPI_MATCH_SUCCESS;
|
||||
}
|
||||
|
||||
g_ptr_array_add (print->prints, g_steal_pointer (&xyt));
|
||||
|
||||
g_clear_object (&print->image);
|
||||
print->image = g_object_ref (image);
|
||||
|
||||
@@ -40,6 +40,7 @@ void fpi_print_set_device_stored (FpPrint *print,
|
||||
|
||||
gboolean fpi_print_add_from_image (FpPrint *print,
|
||||
FpImage *image,
|
||||
gint bz3_threshold,
|
||||
GError **error);
|
||||
|
||||
FpiMatchResult fpi_print_bz3_match (FpPrint * template,
|
||||
|
||||
@@ -323,7 +323,7 @@ transfer_chunk (FpiSpiTransfer *transfer, gsize full_length, gsize *transferred)
|
||||
{
|
||||
if (skip < transfer->length_wr && len < block_size)
|
||||
{
|
||||
xfer[transfers].tx_buf = (guint64) transfer->buffer_wr + skip;
|
||||
xfer[transfers].tx_buf = (gsize) transfer->buffer_wr + skip;
|
||||
xfer[transfers].len = MIN (block_size, transfer->length_wr - skip);
|
||||
|
||||
len += xfer[transfers].len;
|
||||
@@ -340,7 +340,7 @@ transfer_chunk (FpiSpiTransfer *transfer, gsize full_length, gsize *transferred)
|
||||
{
|
||||
if (skip < transfer->length_rd && len < block_size)
|
||||
{
|
||||
xfer[transfers].rx_buf = (guint64) transfer->buffer_rd + skip;
|
||||
xfer[transfers].rx_buf = (gsize) transfer->buffer_rd + skip;
|
||||
xfer[transfers].len = MIN (block_size, transfer->length_rd - skip);
|
||||
|
||||
len += xfer[transfers].len;
|
||||
|
||||
@@ -81,6 +81,7 @@ struct _FpiSsm
|
||||
int start_cleanup;
|
||||
int cur_state;
|
||||
gboolean completed;
|
||||
gboolean silence;
|
||||
GSource *timeout;
|
||||
GError *error;
|
||||
FpiSsmCompletedCallback callback;
|
||||
@@ -245,10 +246,11 @@ fpi_ssm_free (FpiSsm *machine)
|
||||
|
||||
/* Invoke the state handler */
|
||||
static void
|
||||
__ssm_call_handler (FpiSsm *machine)
|
||||
__ssm_call_handler (FpiSsm *machine, gboolean force_msg)
|
||||
{
|
||||
fp_dbg ("[%s] %s entering state %d", fp_device_get_driver (machine->dev),
|
||||
machine->name, machine->cur_state);
|
||||
if (force_msg || !machine->silence)
|
||||
fp_dbg ("[%s] %s entering state %d", fp_device_get_driver (machine->dev),
|
||||
machine->name, machine->cur_state);
|
||||
machine->handler (machine, machine->dev);
|
||||
}
|
||||
|
||||
@@ -275,7 +277,7 @@ fpi_ssm_start (FpiSsm *ssm, FpiSsmCompletedCallback callback)
|
||||
ssm->cur_state = 0;
|
||||
ssm->completed = FALSE;
|
||||
ssm->error = NULL;
|
||||
__ssm_call_handler (ssm);
|
||||
__ssm_call_handler (ssm, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -346,7 +348,7 @@ fpi_ssm_mark_completed (FpiSsm *machine)
|
||||
if (next_state < machine->nr_states)
|
||||
{
|
||||
machine->cur_state = next_state;
|
||||
__ssm_call_handler (machine);
|
||||
__ssm_call_handler (machine, TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -460,7 +462,7 @@ fpi_ssm_next_state (FpiSsm *machine)
|
||||
if (machine->cur_state == machine->nr_states)
|
||||
fpi_ssm_mark_completed (machine);
|
||||
else
|
||||
__ssm_call_handler (machine);
|
||||
__ssm_call_handler (machine, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -537,7 +539,7 @@ fpi_ssm_jump_to_state (FpiSsm *machine, int state)
|
||||
if (machine->cur_state == machine->nr_states)
|
||||
fpi_ssm_mark_completed (machine);
|
||||
else
|
||||
__ssm_call_handler (machine);
|
||||
__ssm_call_handler (machine, FALSE);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
@@ -642,6 +644,22 @@ fpi_ssm_dup_error (FpiSsm *machine)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_ssm_silence_debug:
|
||||
* @machine: an #FpiSsm state machine
|
||||
*
|
||||
* Turn off state change debug messages from this SSM. This does not disable
|
||||
* all messages, as e.g. the initial state, SSM completion and cleanup states
|
||||
* are still printed out.
|
||||
*
|
||||
* Use if the SSM loops and would flood the debug log otherwise.
|
||||
*/
|
||||
void
|
||||
fpi_ssm_silence_debug (FpiSsm *machine)
|
||||
{
|
||||
machine->silence = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_ssm_usb_transfer_cb:
|
||||
* @transfer: a #FpiUsbTransfer
|
||||
|
||||
@@ -96,6 +96,8 @@ GError * fpi_ssm_get_error (FpiSsm *machine);
|
||||
GError * fpi_ssm_dup_error (FpiSsm *machine);
|
||||
int fpi_ssm_get_cur_state (FpiSsm *machine);
|
||||
|
||||
void fpi_ssm_silence_debug (FpiSsm *machine);
|
||||
|
||||
/* Callbacks to be used by the driver instead of implementing their own
|
||||
* logic.
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,6 @@ static const FpIdEntry whitelist_id_table[] = {
|
||||
*/
|
||||
{ .vid = 0x04f3, .pid = 0x036b },
|
||||
{ .vid = 0x04f3, .pid = 0x0c00 },
|
||||
{ .vid = 0x04f3, .pid = 0x0c4b },
|
||||
{ .vid = 0x04f3, .pid = 0x0c4c },
|
||||
{ .vid = 0x04f3, .pid = 0x0c57 },
|
||||
{ .vid = 0x04f3, .pid = 0x0c5e },
|
||||
@@ -42,14 +41,19 @@ static const FpIdEntry whitelist_id_table[] = {
|
||||
{ .vid = 0x06cb, .pid = 0x009a },
|
||||
{ .vid = 0x06cb, .pid = 0x009b },
|
||||
{ .vid = 0x06cb, .pid = 0x00a2 },
|
||||
{ .vid = 0x06cb, .pid = 0x00a8 },
|
||||
{ .vid = 0x06cb, .pid = 0x00b7 },
|
||||
{ .vid = 0x06cb, .pid = 0x00bb },
|
||||
{ .vid = 0x06cb, .pid = 0x00be },
|
||||
{ .vid = 0x06cb, .pid = 0x00c4 },
|
||||
{ .vid = 0x06cb, .pid = 0x00cb },
|
||||
{ .vid = 0x06cb, .pid = 0x00c9 },
|
||||
{ .vid = 0x06cb, .pid = 0x00d8 },
|
||||
{ .vid = 0x06cb, .pid = 0x00da },
|
||||
{ .vid = 0x06cb, .pid = 0x00dc },
|
||||
{ .vid = 0x06cb, .pid = 0x00e7 },
|
||||
{ .vid = 0x06cb, .pid = 0x00e9 },
|
||||
{ .vid = 0x06cb, .pid = 0x00fd },
|
||||
{ .vid = 0x0a5c, .pid = 0x5801 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5805 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5834 },
|
||||
@@ -57,8 +61,11 @@ static const FpIdEntry whitelist_id_table[] = {
|
||||
{ .vid = 0x0a5c, .pid = 0x5841 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5842 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5843 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5844 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5845 },
|
||||
{ .vid = 0x0bda, .pid = 0x5812 },
|
||||
{ .vid = 0x10a5, .pid = 0x0007 },
|
||||
{ .vid = 0x10a5, .pid = 0x9200 },
|
||||
{ .vid = 0x1188, .pid = 0x9545 },
|
||||
{ .vid = 0x138a, .pid = 0x0007 },
|
||||
{ .vid = 0x138a, .pid = 0x003a },
|
||||
@@ -75,8 +82,8 @@ static const FpIdEntry whitelist_id_table[] = {
|
||||
{ .vid = 0x1491, .pid = 0x0088 },
|
||||
{ .vid = 0x16d1, .pid = 0x1027 },
|
||||
{ .vid = 0x1c7a, .pid = 0x0300 },
|
||||
{ .vid = 0x1c7a, .pid = 0x0570 },
|
||||
{ .vid = 0x1c7a, .pid = 0x0575 },
|
||||
{ .vid = 0x1c7a, .pid = 0x0576 },
|
||||
{ .vid = 0x27c6, .pid = 0x5042 },
|
||||
{ .vid = 0x27c6, .pid = 0x5110 },
|
||||
{ .vid = 0x27c6, .pid = 0x5117 },
|
||||
@@ -96,7 +103,9 @@ static const FpIdEntry whitelist_id_table[] = {
|
||||
{ .vid = 0x27c6, .pid = 0x55a4 },
|
||||
{ .vid = 0x27c6, .pid = 0x55b4 },
|
||||
{ .vid = 0x27c6, .pid = 0x5740 },
|
||||
{ .vid = 0x27c6, .pid = 0x5e0a },
|
||||
{ .vid = 0x2808, .pid = 0x9338 },
|
||||
{ .vid = 0x298d, .pid = 0x2020 },
|
||||
{ .vid = 0x298d, .pid = 0x2033 },
|
||||
{ .vid = 0x3538, .pid = 0x0930 },
|
||||
{ .vid = 0 },
|
||||
@@ -166,7 +175,10 @@ print_driver (const FpDeviceClass *cls)
|
||||
}
|
||||
|
||||
if (num_printed > 0)
|
||||
g_print (" ID_AUTOSUSPEND=1\n");
|
||||
{
|
||||
g_print (" ID_AUTOSUSPEND=1\n");
|
||||
g_print (" ID_PERSIST=0\n");
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -80,128 +80,91 @@ nbis_sources = [
|
||||
'nbis/mindtct/xytreps.c',
|
||||
]
|
||||
|
||||
aeslib = false
|
||||
aesx660 = false
|
||||
aes3k = false
|
||||
driver_sources = {
|
||||
'upekts' :
|
||||
[ 'drivers/upekts.c', 'drivers/upek_proto.c' ],
|
||||
'upektc' :
|
||||
[ 'drivers/upektc.c' ],
|
||||
'upeksonly' :
|
||||
[ 'drivers/upeksonly.c' ],
|
||||
'uru4000' :
|
||||
[ 'drivers/uru4000.c' ],
|
||||
'aes1610' :
|
||||
[ 'drivers/aes1610.c' ],
|
||||
'aes1660' :
|
||||
[ 'drivers/aes1660.c' ],
|
||||
'aes2501' :
|
||||
[ 'drivers/aes2501.c' ],
|
||||
'aes2550' :
|
||||
[ 'drivers/aes2550.c' ],
|
||||
'aes2660' :
|
||||
[ 'drivers/aes2660.c' ],
|
||||
'aes3500' :
|
||||
[ 'drivers/aes3500.c' ],
|
||||
'aes4000' :
|
||||
[ 'drivers/aes4000.c' ],
|
||||
'vcom5s' :
|
||||
[ 'drivers/vcom5s.c' ],
|
||||
'vfs101' :
|
||||
[ 'drivers/vfs101.c' ],
|
||||
'vfs301' :
|
||||
[ 'drivers/vfs301.c', 'drivers/vfs301_proto.c' ],
|
||||
'vfs5011' :
|
||||
[ 'drivers/vfs5011.c' ],
|
||||
'vfs7552' :
|
||||
[ 'drivers/vfs7552.c' ],
|
||||
'upektc_img' :
|
||||
[ 'drivers/upektc_img.c', 'drivers/upek_proto.c' ],
|
||||
'etes603' :
|
||||
[ 'drivers/etes603.c' ],
|
||||
'egis0570' :
|
||||
[ 'drivers/egis0570.c' ],
|
||||
'vfs0050' :
|
||||
[ 'drivers/vfs0050.c' ],
|
||||
'elan' :
|
||||
[ 'drivers/elan.c' ],
|
||||
'elanmoc' :
|
||||
[ 'drivers/elanmoc/elanmoc.c' ],
|
||||
'elanspi' :
|
||||
[ 'drivers/elanspi.c' ],
|
||||
'nb1010' :
|
||||
[ 'drivers/nb1010.c' ],
|
||||
'virtual_image' :
|
||||
[ 'drivers/virtual-image.c' ],
|
||||
'virtual_device' :
|
||||
[ 'drivers/virtual-device.c' ],
|
||||
'virtual_device_storage' :
|
||||
[ 'drivers/virtual-device-storage.c' ],
|
||||
'synaptics' :
|
||||
[ 'drivers/synaptics/synaptics.c', 'drivers/synaptics/bmkt_message.c' ],
|
||||
'goodixmoc' :
|
||||
[ 'drivers/goodixmoc/goodix.c', 'drivers/goodixmoc/goodix_proto.c' ],
|
||||
}
|
||||
|
||||
helper_sources = {
|
||||
'aeslib' :
|
||||
[ 'drivers/aeslib.c' ],
|
||||
'aesx660' :
|
||||
[ 'drivers/aesx660.c' ],
|
||||
'aes3k' :
|
||||
[ 'drivers/aes3k.c' ],
|
||||
'nss' :
|
||||
[ ],
|
||||
'udev' :
|
||||
[ ],
|
||||
'virtual' :
|
||||
[ 'drivers/virtual-device-listener.c' ],
|
||||
}
|
||||
|
||||
drivers_sources = []
|
||||
drivers_cflags = []
|
||||
foreach driver: drivers
|
||||
if driver == 'upekts'
|
||||
drivers_sources += [ 'drivers/upekts.c', 'drivers/upek_proto.c' ]
|
||||
endif
|
||||
if driver == 'upektc'
|
||||
drivers_sources += [ 'drivers/upektc.c' ]
|
||||
endif
|
||||
if driver == 'upeksonly'
|
||||
drivers_sources += [ 'drivers/upeksonly.c' ]
|
||||
endif
|
||||
if driver == 'uru4000'
|
||||
drivers_sources += [ 'drivers/uru4000.c' ]
|
||||
endif
|
||||
if driver == 'aes1610'
|
||||
drivers_sources += [ 'drivers/aes1610.c' ]
|
||||
aeslib = true
|
||||
endif
|
||||
if driver == 'aes1660'
|
||||
drivers_sources += [ 'drivers/aes1660.c' ]
|
||||
aeslib = true
|
||||
aesx660 = true
|
||||
endif
|
||||
if driver == 'aes2501'
|
||||
drivers_sources += [ 'drivers/aes2501.c' ]
|
||||
aeslib = true
|
||||
endif
|
||||
if driver == 'aes2550'
|
||||
drivers_sources += [ 'drivers/aes2550.c' ]
|
||||
aeslib = true
|
||||
endif
|
||||
if driver == 'aes2660'
|
||||
drivers_sources += [ 'drivers/aes2660.c' ]
|
||||
aeslib = true
|
||||
aesx660 = true
|
||||
endif
|
||||
if driver == 'aes3500'
|
||||
drivers_sources += [ 'drivers/aes3500.c' ]
|
||||
aeslib = true
|
||||
aes3k = true
|
||||
endif
|
||||
if driver == 'aes4000'
|
||||
drivers_sources += [ 'drivers/aes4000.c' ]
|
||||
aeslib = true
|
||||
aes3k = true
|
||||
endif
|
||||
if driver == 'vcom5s'
|
||||
drivers_sources += [ 'drivers/vcom5s.c' ]
|
||||
endif
|
||||
if driver == 'vfs101'
|
||||
drivers_sources += [ 'drivers/vfs101.c' ]
|
||||
endif
|
||||
if driver == 'vfs301'
|
||||
drivers_sources += [ 'drivers/vfs301.c', 'drivers/vfs301_proto.c' ]
|
||||
endif
|
||||
if driver == 'vfs5011'
|
||||
drivers_sources += [ 'drivers/vfs5011.c' ]
|
||||
endif
|
||||
if driver == 'vfs7552'
|
||||
drivers_sources += [ 'drivers/vfs7552.c' ]
|
||||
endif
|
||||
if driver == 'upektc_img'
|
||||
drivers_sources += [ 'drivers/upektc_img.c', 'drivers/upek_proto.c' ]
|
||||
endif
|
||||
if driver == 'etes603'
|
||||
drivers_sources += [ 'drivers/etes603.c' ]
|
||||
endif
|
||||
if driver == 'vfs0050'
|
||||
drivers_sources += [ 'drivers/vfs0050.c' ]
|
||||
endif
|
||||
if driver == 'elan'
|
||||
drivers_sources += [ 'drivers/elan.c' ]
|
||||
endif
|
||||
if driver == 'elanspi'
|
||||
drivers_sources += [ 'drivers/elanspi.c' ]
|
||||
endif
|
||||
if driver == 'virtual_image'
|
||||
drivers_sources += [ 'drivers/virtual-image.c' ]
|
||||
endif
|
||||
if driver == 'virtual_device'
|
||||
drivers_sources += [ 'drivers/virtual-device.c' ]
|
||||
endif
|
||||
if driver == 'virtual_device_storage'
|
||||
drivers_sources += [ 'drivers/virtual-device-storage.c' ]
|
||||
endif
|
||||
if driver.startswith('virtual_')
|
||||
drivers_sources += [ 'drivers/virtual-device-listener.c' ]
|
||||
endif
|
||||
if driver == 'synaptics'
|
||||
drivers_sources += [
|
||||
'drivers/synaptics/synaptics.c',
|
||||
'drivers/synaptics/bmkt_message.c',
|
||||
]
|
||||
endif
|
||||
if driver == 'goodixmoc'
|
||||
drivers_sources += [
|
||||
'drivers/goodixmoc/goodix.c',
|
||||
'drivers/goodixmoc/goodix_proto.c',
|
||||
]
|
||||
endif
|
||||
if driver == 'nb1010'
|
||||
drivers_sources += [
|
||||
'drivers/nb1010.c',
|
||||
]
|
||||
endif
|
||||
drivers_sources += driver_sources[driver]
|
||||
endforeach
|
||||
foreach helper : driver_helpers
|
||||
drivers_sources += helper_sources[helper]
|
||||
endforeach
|
||||
|
||||
if aeslib
|
||||
drivers_sources += [ 'drivers/aeslib.c' ]
|
||||
endif
|
||||
if aesx660
|
||||
drivers_sources += ['drivers/aesx660.c' ]
|
||||
endif
|
||||
if aes3k
|
||||
drivers_sources += ['drivers/aes3k.c' ]
|
||||
endif
|
||||
|
||||
other_sources = []
|
||||
|
||||
fp_enums = gnome.mkenums_simple('fp-enums',
|
||||
sources: libfprint_public_headers,
|
||||
@@ -220,6 +183,28 @@ enums_dep = declare_dependency(
|
||||
sources: [ fp_enums_h, fpi_enums_h ]
|
||||
)
|
||||
|
||||
# Export the drivers' types to the core code
|
||||
drivers_type_list = []
|
||||
drivers_type_func = []
|
||||
drivers_type_list += '#include <glib-object.h>'
|
||||
drivers_type_list += '#include "fpi-context.h"'
|
||||
drivers_type_list += ''
|
||||
drivers_type_func += 'GArray *'
|
||||
drivers_type_func += 'fpi_get_driver_types (void)'
|
||||
drivers_type_func += '{'
|
||||
drivers_type_func += ' GArray *drivers = g_array_new (TRUE, FALSE, sizeof (GType));'
|
||||
drivers_type_func += ' GType t;'
|
||||
drivers_type_func += ''
|
||||
foreach driver: supported_drivers
|
||||
drivers_type_list += 'extern GType (fpi_device_' + driver + '_get_type) (void);'
|
||||
drivers_type_func += ' t = fpi_device_' + driver + '_get_type ();'
|
||||
drivers_type_func += ' g_array_append_val (drivers, t);'
|
||||
drivers_type_func += ''
|
||||
endforeach
|
||||
drivers_type_list += ''
|
||||
drivers_type_func += ' return drivers;'
|
||||
drivers_type_func += '}'
|
||||
|
||||
drivers_sources += configure_file(input: 'empty_file',
|
||||
output: 'fpi-drivers.c',
|
||||
capture: true,
|
||||
@@ -234,11 +219,8 @@ deps = [
|
||||
glib_dep,
|
||||
gobject_dep,
|
||||
gusb_dep,
|
||||
gudev_dep,
|
||||
imaging_dep,
|
||||
mathlib_dep,
|
||||
nss_dep,
|
||||
]
|
||||
] + optional_deps
|
||||
|
||||
# These are empty and only exist so that the include directories are created
|
||||
# in the build tree. This silences a build time warning.
|
||||
@@ -285,7 +267,6 @@ libfprint = shared_library(versioned_libname.split('lib')[1],
|
||||
sources: [
|
||||
fp_enums,
|
||||
libfprint_sources,
|
||||
other_sources,
|
||||
],
|
||||
soversion: soversion,
|
||||
version: libversion,
|
||||
|
||||
116
meson.build
116
meson.build
@@ -1,5 +1,5 @@
|
||||
project('libfprint', [ 'c', 'cpp' ],
|
||||
version: '1.92.0',
|
||||
version: '1.94.3',
|
||||
license: 'LGPLv2.1+',
|
||||
default_options: [
|
||||
'buildtype=debugoptimized',
|
||||
@@ -11,6 +11,7 @@ project('libfprint', [ 'c', 'cpp' ],
|
||||
gnome = import('gnome')
|
||||
|
||||
libfprint_conf = configuration_data()
|
||||
libfprint_conf.set_quoted('LIBFPRINT_VERSION', meson.project_version())
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
cpp = meson.get_compiler('cpp')
|
||||
@@ -113,9 +114,11 @@ default_drivers = [
|
||||
'vfs301',
|
||||
'vfs0050',
|
||||
'etes603',
|
||||
'egis0570',
|
||||
'vcom5s',
|
||||
'synaptics',
|
||||
'elan',
|
||||
'elanmoc',
|
||||
'uru4000',
|
||||
'upektc',
|
||||
'upeksonly',
|
||||
@@ -144,10 +147,32 @@ if drivers == [ 'default' ]
|
||||
drivers = default_drivers
|
||||
endif
|
||||
|
||||
# For detection whether udev is needed
|
||||
udev_drivers = [
|
||||
'elanspi'
|
||||
]
|
||||
driver_helper_mapping = {
|
||||
'aes1610' : [ 'aeslib' ],
|
||||
'aes1660' : [ 'aeslib', 'aesx660' ],
|
||||
'aes2501' : [ 'aeslib' ],
|
||||
'aes2550' : [ 'aeslib' ],
|
||||
'aes2660' : [ 'aeslib', 'aesx660' ],
|
||||
'aes3500' : [ 'aeslib', 'aes3k' ],
|
||||
'aes4000' : [ 'aeslib', 'aes3k' ],
|
||||
'uru4000' : [ 'nss' ],
|
||||
'elanspi' : [ 'udev' ],
|
||||
'virtual_image' : [ 'virtual' ],
|
||||
'virtual_device' : [ 'virtual' ],
|
||||
'virtual_device_storage' : [ 'virtual' ],
|
||||
}
|
||||
|
||||
driver_helpers = []
|
||||
foreach driver : drivers
|
||||
if driver in driver_helper_mapping
|
||||
foreach helper : driver_helper_mapping[driver]
|
||||
if helper not in driver_helpers
|
||||
driver_helpers += helper
|
||||
endif
|
||||
endforeach
|
||||
endif
|
||||
endforeach
|
||||
|
||||
|
||||
if drivers.length() == 0 or drivers[0] == ''
|
||||
error('Cannot build libfprint without drivers, please specify a valid value for the drivers option')
|
||||
@@ -165,41 +190,46 @@ else
|
||||
endforeach
|
||||
endif
|
||||
|
||||
nss_dep = dependency('', required: false)
|
||||
imaging_dep = dependency('', required: false)
|
||||
gudev_dep = dependency('', required: false)
|
||||
libfprint_conf.set10('HAVE_PIXMAN', false)
|
||||
|
||||
udev_rules = get_option('udev_rules')
|
||||
install_udev_rules = udev_rules.enabled()
|
||||
|
||||
foreach driver: drivers
|
||||
if driver == 'uru4000'
|
||||
nss_dep = dependency('nss', required: false)
|
||||
if not nss_dep.found()
|
||||
error('NSS is required for the URU4000/URU4500 driver')
|
||||
optional_deps = []
|
||||
|
||||
# Resolve extra dependencies
|
||||
foreach i : driver_helpers
|
||||
foreach d, helpers : driver_helper_mapping
|
||||
if i in helpers
|
||||
driver = d
|
||||
break
|
||||
endif
|
||||
endif
|
||||
if driver == 'aes3500' or driver == 'aes4000' or driver == 'elanspi'
|
||||
endforeach
|
||||
|
||||
if i == 'aes3k'
|
||||
imaging_dep = dependency('pixman-1', required: false)
|
||||
if not imaging_dep.found()
|
||||
error('pixman is required for imaging support')
|
||||
error('pixman is required for @0@ and possibly others'.format(driver))
|
||||
endif
|
||||
|
||||
libfprint_conf.set10('HAVE_PIXMAN', true)
|
||||
endif
|
||||
if udev_drivers.contains(driver)
|
||||
install_udev_rules = true
|
||||
|
||||
gudev_dep = dependency('gudev-1.0', required: false)
|
||||
if not gudev_dep.found()
|
||||
error('udev is required for SPI support')
|
||||
endif
|
||||
|
||||
libfprint_conf.set10('HAVE_UDEV', true)
|
||||
optional_deps += imaging_dep
|
||||
elif i == 'nss'
|
||||
nss_dep = dependency('nss', required: false)
|
||||
if not nss_dep.found()
|
||||
error('nss is required for @0@ and possibly others'.format(driver))
|
||||
endif
|
||||
if not all_drivers.contains(driver)
|
||||
error('Invalid driver \'' + driver + '\'')
|
||||
|
||||
optional_deps += nss_dep
|
||||
elif i == 'udev'
|
||||
install_udev_rules = true
|
||||
|
||||
gudev_dep = dependency('gudev-1.0', required: false)
|
||||
if not gudev_dep.found()
|
||||
error('udev is required for SPI support')
|
||||
endif
|
||||
|
||||
libfprint_conf.set10('HAVE_UDEV', true)
|
||||
|
||||
optional_deps += gudev_dep
|
||||
endif
|
||||
endforeach
|
||||
|
||||
@@ -229,28 +259,6 @@ if default_drivers_are_enabled and supported_drivers != drivers
|
||||
default_drivers_are_enabled = false
|
||||
endif
|
||||
|
||||
# Export the drivers' types to the core code
|
||||
drivers_type_list = []
|
||||
drivers_type_func = []
|
||||
drivers_type_list += '#include <glib-object.h>'
|
||||
drivers_type_list += '#include "fpi-context.h"'
|
||||
drivers_type_list += ''
|
||||
drivers_type_func += 'GArray *'
|
||||
drivers_type_func += 'fpi_get_driver_types (void)'
|
||||
drivers_type_func += '{'
|
||||
drivers_type_func += ' GArray *drivers = g_array_new (TRUE, FALSE, sizeof (GType));'
|
||||
drivers_type_func += ' GType t;'
|
||||
drivers_type_func += ''
|
||||
foreach driver: supported_drivers
|
||||
drivers_type_list += 'extern GType (fpi_device_' + driver + '_get_type) (void);'
|
||||
drivers_type_func += ' t = fpi_device_' + driver + '_get_type ();'
|
||||
drivers_type_func += ' g_array_append_val (drivers, t);'
|
||||
drivers_type_func += ''
|
||||
endforeach
|
||||
drivers_type_list += ''
|
||||
drivers_type_func += ' return drivers;'
|
||||
drivers_type_func += '}'
|
||||
|
||||
root_inc = include_directories('.')
|
||||
|
||||
udev_hwdb = get_option('udev_hwdb')
|
||||
@@ -285,9 +293,11 @@ if get_option('gtk-examples')
|
||||
endif
|
||||
endif
|
||||
|
||||
# Some dependency resolving happens inside here
|
||||
subdir('libfprint')
|
||||
|
||||
configure_file(output: 'config.h', configuration: libfprint_conf)
|
||||
|
||||
subdir('libfprint')
|
||||
subdir('examples')
|
||||
if get_option('doc')
|
||||
gnome = import('gnome')
|
||||
|
||||
@@ -12,8 +12,11 @@ case "$1" in
|
||||
;;
|
||||
esac
|
||||
|
||||
ARGS=4
|
||||
JOBS=4
|
||||
|
||||
pushd "$SRCROOT"
|
||||
uncrustify -c "$CFG" $OPTS `git ls-tree --name-only -r HEAD | grep -E '.*\.[ch]$' | grep -v nbis | grep -v fpi-byte | grep -v build/`
|
||||
git ls-tree --name-only -r HEAD | grep -E '.*\.[ch]$' | grep -v nbis | grep -v fpi-byte | grep -v build/ | xargs -n$ARGS -P $JOBS uncrustify -c "$CFG" $OPTS
|
||||
RES=$?
|
||||
popd
|
||||
exit $RES
|
||||
exit $RES
|
||||
|
||||
@@ -3,72 +3,42 @@
|
||||
`umockdev` tests use fingerprint devices mocked by [`umockdev`
|
||||
toolchain][umockdev].
|
||||
|
||||
This document describes how to create a 'capture' test: a test that
|
||||
captures a picture of a fingerprint from the device (mocked by
|
||||
`umockdev`) and compares it with the standard one.
|
||||
This document describes how to create test cases (for USB devices). Many of
|
||||
these tests are tests for image devices, where a single image is captured
|
||||
and stored.
|
||||
|
||||
Other kinds of `umockdev` tests can be created in a similar manner. For
|
||||
match-on-chip devices you would instead create a test specific `custom.py`
|
||||
script, capture it and store the capture to `custom.pcapng`.
|
||||
|
||||
'Capture' Test Creation
|
||||
-----------------------
|
||||
A new 'capture' test is created by means of `capture.py` script:
|
||||
'capture' and 'custom' Test Creation
|
||||
------------------------------------
|
||||
|
||||
1. Create (if needed) a directory for the driver under `tests`
|
||||
directory:
|
||||
For image devices the `capture.py` script will be used to capture one reference
|
||||
image. If the driver is a non-image driver, then a `custom.py` script should be
|
||||
created in advance, which will be run instead.
|
||||
|
||||
`mkdir DRIVER`
|
||||
1. Make sure that libfprint is built with support for the device driver
|
||||
that you want to create a test case for.
|
||||
|
||||
Note that the name must be the exact name of the libfprint driver,
|
||||
or the exact name of the driver followed by a `-` and a unique identifier
|
||||
of your choosing.
|
||||
2. From the build directory, run tests/create-driver-test.py as root. Note
|
||||
that if you're capturing data for a driver which already has a test case
|
||||
but the hardware is slightly different, you might want to pass a variant
|
||||
name as a command-line options, for example:
|
||||
```sh
|
||||
$ sudo tests/create-driver-test.py driver [variant]
|
||||
```
|
||||
|
||||
2. Prepare your execution environment.
|
||||
3. If the capture is not successful, run the tool again to start another capture.
|
||||
|
||||
In the next step a working and up to date libfprint is needed. This can be
|
||||
achieved by installing it into your system. Alternatively, you can set
|
||||
the following environment variables to run a local build:
|
||||
- `export LD_PRELOAD=<meson-build-dir>/libfprint/libfprint-2.so`
|
||||
- `export GI_TYPELIB_PATH=<meson-build-dir>/libfprint`
|
||||
4. Add driver test name to `drivers_tests` in the `meson.build`, as instructed,
|
||||
and change the ownership of the just-created test directory in the source.
|
||||
|
||||
Also, sometimes the driver must be adapted to the emulated environment
|
||||
(mainly if it uses random numbers, see `synaptics.c` for an example).
|
||||
Set the following environment variable to enable this adaptation:
|
||||
- `export FP_DEVICE_EMULATION=1`
|
||||
5. Check whether `meson test` passes with this new test.
|
||||
|
||||
Run the next steps in the same terminal.
|
||||
|
||||
3. Find the real USB fingerprint device with `lsusb`, e.g.:
|
||||
|
||||
`Bus 001 Device 005: ID 138a:0090 Validity Sensors, Inc. VFS7500 Touch Fingerprint Sensor`
|
||||
|
||||
The following USB device is used in the example above:
|
||||
`/dev/bus/usb/001/005`.
|
||||
|
||||
For the following commands, it is assumed that the user that's
|
||||
running the commands has full access to the device node, whether
|
||||
by running the commands as `root`, or changing the permissions for
|
||||
that device node.
|
||||
|
||||
4. Record information about this device:
|
||||
|
||||
`umockdev-record /dev/bus/usb/001/005 > DRIVER/device`
|
||||
|
||||
5. Record interaction of `capture.py` (or other test) with the device. To do
|
||||
so, start wireshark and record `usbmonX` (where X is the bus number). Then
|
||||
run the test script:
|
||||
|
||||
`python3 ./capture.py DRIVER/capture.png`
|
||||
|
||||
Save the wireshark recording as `capture.pcapng`. The command will create
|
||||
`capture.png`.
|
||||
|
||||
6. Add driver's name to `drivers_tests` in the `meson.build`.
|
||||
7. Check whether everything works as expected.
|
||||
|
||||
**Note.** To avoid submitting a real fingerprint, the side of finger,
|
||||
arm, or anything else producing an image with the device can be used.
|
||||
**Note.** To avoid submitting a real fingerprint when creating a 'capture' test,
|
||||
the side of finger, arm, or anything else producing an image with the device
|
||||
can be used.
|
||||
|
||||
|
||||
Possible Issues
|
||||
|
||||
BIN
tests/aes2501/capture.pcapng
Normal file
BIN
tests/aes2501/capture.pcapng
Normal file
Binary file not shown.
BIN
tests/aes2501/capture.png
Normal file
BIN
tests/aes2501/capture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
223
tests/aes2501/device
Normal file
223
tests/aes2501/device
Normal file
@@ -0,0 +1,223 @@
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1/1-10
|
||||
N: bus/usb/001/044=12011001FFFFFF08FF08802523060001000109022000010100A0320904000002FFFFFF000705810220000007050202080000
|
||||
E: DEVNAME=/dev/bus/usb/001/044
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=8ff/2580/623
|
||||
E: TYPE=255/255/255
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=044
|
||||
E: MAJOR=189
|
||||
E: MINOR=43
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=08ff
|
||||
E: ID_VENDOR_ENC=08ff
|
||||
E: ID_VENDOR_ID=08ff
|
||||
E: ID_MODEL=Fingerprint_Sensor
|
||||
E: ID_MODEL_ENC=Fingerprint\x20Sensor
|
||||
E: ID_MODEL_ID=2580
|
||||
E: ID_REVISION=0623
|
||||
E: ID_SERIAL=08ff_Fingerprint_Sensor
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:ffffff:
|
||||
E: ID_VENDOR_FROM_DATABASE=AuthenTec, Inc.
|
||||
E: ID_AUTOSUSPEND=1
|
||||
E: ID_MODEL_FROM_DATABASE=AES2501 Fingerprint Sensor
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:10
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_10
|
||||
E: LIBFPRINT_DRIVER=AuthenTec AES2501
|
||||
A: authorized=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
A: bDeviceClass=ff\n
|
||||
A: bDeviceProtocol=ff\n
|
||||
A: bDeviceSubClass=ff\n
|
||||
A: bMaxPacketSize0=8\n
|
||||
A: bMaxPower=100mA\n
|
||||
A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=0623\n
|
||||
A: bmAttributes=a0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=12011001FFFFFF08FF08802523060001000109022000010100A0320904000002FFFFFF000705810220000007050202080000
|
||||
A: dev=189:43\n
|
||||
A: devnum=44\n
|
||||
A: devpath=10\n
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4c/device:4d/device:57
|
||||
A: idProduct=2580\n
|
||||
A: idVendor=08ff\n
|
||||
A: ltm_capable=no\n
|
||||
A: maxchild=0\n
|
||||
L: port=../1-0:1.0/usb1-port10
|
||||
A: power/active_duration=10573\n
|
||||
A: power/autosuspend=2\n
|
||||
A: power/autosuspend_delay_ms=2000\n
|
||||
A: power/connected_duration=23441\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/persist=0\n
|
||||
A: power/runtime_active_time=10430\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=12771\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=Fingerprint Sensor\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=removable\n
|
||||
A: rx_lanes=1\n
|
||||
A: speed=12\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=13241\n
|
||||
A: version= 1.10\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1
|
||||
N: bus/usb/001/001=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/513
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.13.12-200.fc34.x86_64_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.13.12-200.fc34.x86_64\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=0513
|
||||
E: ID_SERIAL=Linux_5.13.12-200.fc34.x86_64_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=0513\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
|
||||
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:4c/device:4d
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.13.12-200.fc34.x86_64 xhci-hcd\n
|
||||
A: maxchild=16\n
|
||||
A: power/active_duration=767293591\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=767293591\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_time=767293588\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=1086\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=17AA:312A
|
||||
E: PCI_SLOT_NAME=0000:00:14.0
|
||||
E: MODALIAS=pci:v00008086d0000A36Dsv000017AAsd0000312Abc0Csc03i30
|
||||
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=86806DA3060490021030030C00008000040032B1000000000000000000000000000000000000000000000000AA172A31000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F00000000560BBD0700000000316000000000000000000000000000000180C2C1080000000000000000000000059087009802E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F400200000100006000000008020000010000000400000090000000001800000005000000000000000300000C0000004000000080000000030000000000000000000000000000000000000000000000B50F110112000000
|
||||
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:4c
|
||||
A: index=3\n
|
||||
A: irq=125\n
|
||||
A: label=Onboard - Other\n
|
||||
A: local_cpulist=0-5\n
|
||||
A: local_cpus=3f\n
|
||||
A: modalias=pci:v00008086d0000A36Dsv000017AAsd0000312Abc0Csc03i30\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 15 20 2112 20\nxHCI ring segments 46 76 4096 76\nbuffer-2048 0 32 2048 16\nbuffer-512 0 32 512 4\nbuffer-128 3 32 128 1\nbuffer-32 0 128 32 1\n
|
||||
A: power/control=on\n
|
||||
A: power/runtime_active_time=767293736\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=59\n
|
||||
A: power/wakeup_count=0\n
|
||||
A: power/wakeup_expire_count=59\n
|
||||
A: power/wakeup_last_time_ms=763021754\n
|
||||
A: power/wakeup_max_time_ms=108\n
|
||||
A: power/wakeup_total_time_ms=6149\n
|
||||
A: power_state=D0\n
|
||||
A: resource=0x00000000b1320000 0x00000000b132ffff 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=0x312a\n
|
||||
A: subsystem_vendor=0x17aa\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
174
tests/create-driver-test.py.in
Executable file
174
tests/create-driver-test.py.in
Executable file
@@ -0,0 +1,174 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
BUILDDIR='@BUILDDIR@'
|
||||
SRCDIR='@SRCDIR@'
|
||||
|
||||
import os
|
||||
import sys
|
||||
import signal
|
||||
library_path = BUILDDIR + '/libfprint/'
|
||||
|
||||
# Relaunch ourselves with a changed environment so
|
||||
# that we're loading the development version of libfprint
|
||||
if 'LD_LIBRARY_PATH' not in os.environ or not library_path in os.environ['LD_LIBRARY_PATH']:
|
||||
os.environ['LD_LIBRARY_PATH'] = library_path
|
||||
os.environ['GI_TYPELIB_PATH'] = f'{BUILDDIR}/libfprint/'
|
||||
os.environ['FP_DEVICE_EMULATION'] = '1'
|
||||
try:
|
||||
os.execv(sys.argv[0], sys.argv)
|
||||
except Exception as e:
|
||||
print('Could not run script with new library path')
|
||||
sys.exit(1)
|
||||
|
||||
import gi
|
||||
gi.require_version('FPrint', '2.0')
|
||||
from gi.repository import FPrint
|
||||
|
||||
gi.require_version('GUsb', '1.0')
|
||||
from gi.repository import GUsb
|
||||
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
def print_usage():
|
||||
print(f'Usage: {sys.argv[0]} driver [test-variant-name]')
|
||||
print('A test variant name is optional, and must be all lower case letters, or dashes, with no spaces')
|
||||
print(f'The captured data will be stored in {SRCDIR}/tests/[driver name]-[test variant name]')
|
||||
print(f'Create custom.py prior to execution for non image device tests.')
|
||||
|
||||
if len(sys.argv) > 3:
|
||||
print_usage()
|
||||
sys.exit(1)
|
||||
|
||||
driver_name = sys.argv[1]
|
||||
os.environ['FP_DRIVERS_WHITELIST'] = driver_name
|
||||
|
||||
test_variant = None
|
||||
if len(sys.argv) == 3:
|
||||
valid_re = re.compile('[a-z-]*')
|
||||
test_variant = sys.argv[2]
|
||||
if (not valid_re.match(test_variant) or
|
||||
test_variant.startswith('-') or
|
||||
test_variant.endswith('-')):
|
||||
print(f'Invalid variant name {test_variant}\n')
|
||||
print_usage()
|
||||
sys.exit(1)
|
||||
|
||||
# Check that running as root
|
||||
|
||||
if os.geteuid() != 0:
|
||||
print(f'{sys.argv[0]} is expected to be run as root')
|
||||
sys.exit(1)
|
||||
|
||||
# Check that tshark is available
|
||||
|
||||
tshark = shutil.which('tshark')
|
||||
if not tshark:
|
||||
print("The 'tshark' WireShark command-line tool must be installed to capture USB traffic")
|
||||
sys.exit(1)
|
||||
|
||||
# Find the fingerprint reader
|
||||
ctx = FPrint.Context()
|
||||
ctx.enumerate()
|
||||
devices = ctx.get_devices()
|
||||
if len(devices) == 0:
|
||||
print('Could not find a supported fingerprint reader')
|
||||
sys.exit(1)
|
||||
elif len(devices) > 1:
|
||||
print('Capture requires a single supported fingerprint reader to be plugged in')
|
||||
sys.exit(1)
|
||||
|
||||
test_name = driver_name
|
||||
if test_variant:
|
||||
test_name = driver_name + '-' + test_variant
|
||||
usb_device = devices[0].get_property('fpi-usb-device')
|
||||
bus_num = usb_device.get_bus()
|
||||
device_num = usb_device.get_address()
|
||||
|
||||
print(f'### Detected USB device /dev/bus/usb/{bus_num:03d}/{device_num:03d}')
|
||||
|
||||
# Make directory
|
||||
|
||||
test_dir = SRCDIR + '/tests/' + test_name
|
||||
os.makedirs(test_dir, mode=0o775, exist_ok=True)
|
||||
|
||||
# Capture device info
|
||||
|
||||
args = ['umockdev-record', f'/dev/bus/usb/{bus_num:03d}/{device_num:03d}']
|
||||
device_out = open(test_dir + '/device', 'w')
|
||||
process = subprocess.Popen(args, stdout=device_out)
|
||||
process.wait()
|
||||
|
||||
# Run capture
|
||||
# https://osqa-ask.wireshark.org/questions/53919/how-can-i-precisely-specify-a-usb-device-to-capture-with-tshark/
|
||||
|
||||
print(f'### Reseting USB port (as descriptors could be missing in the dump otherwise)')
|
||||
usb_device.open()
|
||||
usb_device.reset()
|
||||
usb_device.close()
|
||||
|
||||
print(f'### Starting USB capture on usbmon{bus_num}')
|
||||
capture_pid = os.fork()
|
||||
assert(capture_pid >= 0)
|
||||
|
||||
unfiltered_cap_path = os.path.join(tempfile.gettempdir(), 'capture-unfiltered.pcapng')
|
||||
if capture_pid == 0:
|
||||
os.setpgrp()
|
||||
args = ['tshark', '-q', '-i', f'usbmon{bus_num}', '-w', unfiltered_cap_path]
|
||||
os.execv(tshark, args)
|
||||
|
||||
# Wait 1 sec to settle (we can assume setpgrp happened)
|
||||
time.sleep(1)
|
||||
|
||||
print('### Capturing fingerprint, please swipe or press your finger on the reader')
|
||||
cmd = ['python3', SRCDIR + '/tests/capture.py', test_dir + '/capture.png']
|
||||
capture_file = 'capture.pcapng' # capture for "capture" test
|
||||
if os.path.exists(os.path.join(test_dir, "custom.py")):
|
||||
cmd = ['python3', os.path.join(test_dir, "custom.py")]
|
||||
capture_file = "custom.pcapng"
|
||||
|
||||
with subprocess.Popen(cmd) as capture_process:
|
||||
capture_process.wait()
|
||||
if capture_process.returncode != 0:
|
||||
print('Failed to capture fingerprint')
|
||||
os.killpg(capture_pid, signal.SIGKILL)
|
||||
sys.exit(1)
|
||||
|
||||
def t_waitpid(pid, timeout):
|
||||
timeout = time.time() + timeout
|
||||
r = os.waitpid(pid, os.WNOHANG)
|
||||
while timeout > time.time() and r[0] == 0:
|
||||
time.sleep(0.1)
|
||||
r = os.waitpid(pid, os.WNOHANG)
|
||||
|
||||
return r
|
||||
|
||||
os.kill(capture_pid, signal.SIGTERM)
|
||||
try:
|
||||
r = t_waitpid(capture_pid, 2)
|
||||
# Kill if nothing died
|
||||
if r[0] == 0:
|
||||
os.kill(capture_pid, signal.SIGKILL)
|
||||
except ChildProcessError:
|
||||
pass
|
||||
|
||||
try:
|
||||
while True:
|
||||
r = t_waitpid(-capture_pid, timeout=2)
|
||||
# Kill the process group, if nothing died (and there are children)
|
||||
if r[0] == 0:
|
||||
os.killpg(capture_pid, signal.SIGKILL)
|
||||
except ChildProcessError:
|
||||
pass
|
||||
|
||||
# Filter the capture
|
||||
print(f'\n### Saving USB capture as test case {test_name}')
|
||||
args = ['tshark', '-r', unfiltered_cap_path, '-Y', f'usb.bus_id == {bus_num} and usb.device_address == {device_num}',
|
||||
'-w', os.path.join(test_dir, capture_file)]
|
||||
with subprocess.Popen(args, stderr=subprocess.DEVNULL) as filter_process:
|
||||
filter_process.wait()
|
||||
|
||||
print(f"\nDone! Don't forget to add {test_name} to tests/meson.build")
|
||||
BIN
tests/egis0570/capture.pcapng
Executable file
BIN
tests/egis0570/capture.pcapng
Executable file
Binary file not shown.
BIN
tests/egis0570/capture.png
Normal file
BIN
tests/egis0570/capture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 100 KiB |
228
tests/egis0570/device
Normal file
228
tests/egis0570/device
Normal file
@@ -0,0 +1,228 @@
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1/1-9
|
||||
N: bus/usb/001/005=12011001000000087A1C700541100102030109022000010100A0320904000002FF0000000705830240000007050402400003
|
||||
E: DEVNAME=/dev/bus/usb/001/005
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1c7a/570/1041
|
||||
E: TYPE=0/0/0
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=005
|
||||
E: MAJOR=189
|
||||
E: MINOR=4
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=EgisTec
|
||||
E: ID_VENDOR_ENC=EgisTec
|
||||
E: ID_VENDOR_ID=1c7a
|
||||
E: ID_MODEL=EgisTec_Touch_Fingerprint_Sensor
|
||||
E: ID_MODEL_ENC=EgisTec\x20Touch\x20Fingerprint\x20Sensor
|
||||
E: ID_MODEL_ID=0570
|
||||
E: ID_REVISION=1041
|
||||
E: ID_SERIAL=EgisTec_EgisTec_Touch_Fingerprint_Sensor_W700B41B
|
||||
E: ID_SERIAL_SHORT=W700B41B
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:ff0000:
|
||||
E: ID_VENDOR_FROM_DATABASE=LighTuning Technology Inc.
|
||||
E: ID_PATH=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
|
||||
A: authorized=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
A: bDeviceClass=00\n
|
||||
A: bDeviceProtocol=00\n
|
||||
A: bDeviceSubClass=00\n
|
||||
A: bMaxPacketSize0=8\n
|
||||
A: bMaxPower=100mA\n
|
||||
A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=1041\n
|
||||
A: bmAttributes=a0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=\n
|
||||
H: descriptors=12011001000000087A1C700541100102030109022000010100A0320904000002FF0000000705830240000007050402400003
|
||||
A: dev=189:4\n
|
||||
A: devnum=5\n
|
||||
A: devpath=9\n
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0570\n
|
||||
A: idVendor=1c7a\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=EgisTec\n
|
||||
A: maxchild=0\n
|
||||
L: port=../1-0:1.0/usb1-port9
|
||||
A: power/active_duration=362352\n
|
||||
A: power/async=enabled\n
|
||||
A: power/autosuspend=2\n
|
||||
A: power/autosuspend_delay_ms=2000\n
|
||||
A: power/connected_duration=5526124\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/persist=1\n
|
||||
A: power/runtime_active_kids=0\n
|
||||
A: power/runtime_active_time=365097\n
|
||||
A: power/runtime_enabled=enabled\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=5160752\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=EgisTec Touch Fingerprint Sensor\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=fixed\n
|
||||
A: rx_lanes=1\n
|
||||
A: serial=W700B41B\n
|
||||
A: speed=12\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=8040\n
|
||||
A: version= 1.10\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1
|
||||
N: bus/usb/001/001=12010002090001406B1D020008050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/508
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.8.0-59-generic_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.8.0-59-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=0508
|
||||
E: ID_SERIAL=Linux_5.8.0-59-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_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:
|
||||
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=0508\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=\n
|
||||
H: descriptors=12010002090001406B1D020008050302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:0\n
|
||||
A: devnum=1\n
|
||||
A: devpath=0\n
|
||||
L: driver=../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.8.0-59-generic xhci-hcd\n
|
||||
A: maxchild=12\n
|
||||
A: power/active_duration=378024\n
|
||||
A: power/async=enabled\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=5527220\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_kids=1\n
|
||||
A: power/runtime_active_time=377962\n
|
||||
A: power/runtime_enabled=enabled\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=5149253\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=956\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:9D2F
|
||||
E: PCI_SUBSYS_ID=1025:118E
|
||||
E: PCI_SLOT_NAME=0000:00:14.0
|
||||
E: MODALIAS=pci:v00008086d00009D2Fsv00001025sd0000118Ebc0Csc03i30
|
||||
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=Sunrise Point-LP USB 3.0 xHCI Controller
|
||||
A: ari_enabled=0\n
|
||||
A: broken_parity_status=0\n
|
||||
A: class=0x0c0330\n
|
||||
H: config=86802F9D060490022130030C00008000040021A400000000000000000000000000000000000000000000000025108E11000000007000000000000000FF010000
|
||||
A: consistent_dma_mask_bits=64\n
|
||||
A: d3cold_allowed=1\n
|
||||
A: dbc=disabled\n
|
||||
A: device=0x9d2f\n
|
||||
A: dma_mask_bits=64\n
|
||||
L: driver=../../../bus/pci/drivers/xhci_hcd
|
||||
A: driver_override=(null)\n
|
||||
A: enable=1\n
|
||||
A: irq=127\n
|
||||
A: local_cpulist=0-7\n
|
||||
A: local_cpus=ff\n
|
||||
A: modalias=pci:v00008086d00009D2Fsv00001025sd0000118Ebc0Csc03i30\n
|
||||
A: msi_bus=1\n
|
||||
A: msi_irqs/127=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 9 10 2112 10\nxHCI ring segments 32 36 4096 36\nbuffer-2048 1 2 2048 1\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\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=5524703\n
|
||||
A: power/runtime_enabled=forbidden\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=3373\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: resource=0x00000000a4210000 0x00000000a421ffff 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=0x21\n
|
||||
A: subsystem_device=0x118e\n
|
||||
A: subsystem_vendor=0x1025\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
BIN
tests/elan-cobo/capture.pcapng
Normal file
BIN
tests/elan-cobo/capture.pcapng
Normal file
Binary file not shown.
BIN
tests/elan-cobo/capture.png
Normal file
BIN
tests/elan-cobo/capture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
217
tests/elan-cobo/device
Normal file
217
tests/elan-cobo/device
Normal file
@@ -0,0 +1,217 @@
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1/1-10
|
||||
N: bus/usb/001/045=1201000200000008F304260C40010102000109023E0001010080320904000005FF0000000921100100012215000705810240000107050102400001070582024000010705830240000107050302400001
|
||||
E: DEVNAME=/dev/bus/usb/001/045
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=4f3/c26/140
|
||||
E: TYPE=0/0/0
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=045
|
||||
E: MAJOR=189
|
||||
E: MINOR=44
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=ELAN
|
||||
E: ID_VENDOR_ENC=ELAN
|
||||
E: ID_VENDOR_ID=04f3
|
||||
E: ID_MODEL=ELAN:Fingerprint
|
||||
E: ID_MODEL_ENC=ELAN:Fingerprint
|
||||
E: ID_MODEL_ID=0c26
|
||||
E: ID_REVISION=0140
|
||||
E: ID_SERIAL=ELAN_ELAN:Fingerprint
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:ff0000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Elan Microelectronics Corp.
|
||||
E: ID_AUTOSUSPEND=1
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:10
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_10
|
||||
E: LIBFPRINT_DRIVER=ElanTech Fingerprint Sensor
|
||||
E: ID_FOR_SEAT=usb-pci-0000_00_14_0-usb-0_10
|
||||
E: TAGS=:seat:
|
||||
E: CURRENT_TAGS=:seat:
|
||||
A: authorized=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
A: bDeviceClass=00\n
|
||||
A: bDeviceProtocol=00\n
|
||||
A: bDeviceSubClass=00\n
|
||||
A: bMaxPacketSize0=8\n
|
||||
A: bMaxPower=100mA\n
|
||||
A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=0140\n
|
||||
A: bmAttributes=80\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=1201000200000008F304260C40010102000109023E0001010080320904000005FF0000000921100100012215000705810240000107050102400001070582024000010705830240000107050302400001
|
||||
A: dev=189:44\n
|
||||
A: devnum=45\n
|
||||
A: devpath=10\n
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4c/device:4d/device:57
|
||||
A: idProduct=0c26\n
|
||||
A: idVendor=04f3\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=ELAN\n
|
||||
A: maxchild=0\n
|
||||
L: port=../1-0:1.0/usb1-port10
|
||||
A: power/active_duration=21526\n
|
||||
A: power/autosuspend=2\n
|
||||
A: power/autosuspend_delay_ms=2000\n
|
||||
A: power/connected_duration=96442\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/persist=0\n
|
||||
A: power/runtime_active_time=21572\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=74628\n
|
||||
A: product=ELAN:Fingerprint\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=removable\n
|
||||
A: rx_lanes=1\n
|
||||
A: speed=12\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=103\n
|
||||
A: version= 2.00\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1
|
||||
N: bus/usb/001/001=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/513
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.13.12-200.fc34.x86_64_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.13.12-200.fc34.x86_64\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=0513
|
||||
E: ID_SERIAL=Linux_5.13.12-200.fc34.x86_64_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=0513\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
|
||||
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:4c/device:4d
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.13.12-200.fc34.x86_64 xhci-hcd\n
|
||||
A: maxchild=16\n
|
||||
A: power/active_duration=767973436\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=767973436\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_time=767973433\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=1174\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=17AA:312A
|
||||
E: PCI_SLOT_NAME=0000:00:14.0
|
||||
E: MODALIAS=pci:v00008086d0000A36Dsv000017AAsd0000312Abc0Csc03i30
|
||||
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=86806DA3060490021030030C00008000040032B1000000000000000000000000000000000000000000000000AA172A31000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F00000000420DD90700000000316000000000000000000000000000000180C2C1080000000000000000000000059087009802E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F400200000100006000000008020000010000000400000090000000001800000005000000000000000300000C0000004000000080000000030000000000000000000000000000000000000000000000B50F110112000000
|
||||
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:4c
|
||||
A: index=3\n
|
||||
A: irq=125\n
|
||||
A: label=Onboard - Other\n
|
||||
A: local_cpulist=0-5\n
|
||||
A: local_cpus=3f\n
|
||||
A: modalias=pci:v00008086d0000A36Dsv000017AAsd0000312Abc0Csc03i30\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 15 20 2112 20\nxHCI ring segments 52 76 4096 76\nbuffer-2048 0 32 2048 16\nbuffer-512 0 32 512 4\nbuffer-128 3 32 128 1\nbuffer-32 0 128 32 1\n
|
||||
A: power/control=on\n
|
||||
A: power/runtime_active_time=767973582\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=59\n
|
||||
A: power/wakeup_count=0\n
|
||||
A: power/wakeup_expire_count=59\n
|
||||
A: power/wakeup_last_time_ms=763021754\n
|
||||
A: power/wakeup_max_time_ms=108\n
|
||||
A: power/wakeup_total_time_ms=6149\n
|
||||
A: power_state=D0\n
|
||||
A: resource=0x00000000b1320000 0x00000000b132ffff 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=0x312a\n
|
||||
A: subsystem_vendor=0x17aa\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
BIN
tests/elanmoc/custom.pcapng
Normal file
BIN
tests/elanmoc/custom.pcapng
Normal file
Binary file not shown.
83
tests/elanmoc/custom.py
Executable file
83
tests/elanmoc/custom.py
Executable file
@@ -0,0 +1,83 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import gi
|
||||
gi.require_version('FPrint', '2.0')
|
||||
from gi.repository import FPrint, GLib
|
||||
|
||||
ctx = GLib.main_context_default()
|
||||
|
||||
c = FPrint.Context()
|
||||
c.enumerate()
|
||||
devices = c.get_devices()
|
||||
|
||||
d = devices[0]
|
||||
del devices
|
||||
|
||||
assert d.get_driver() == "elanmoc"
|
||||
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
|
||||
225
tests/elanmoc/device
Normal file
225
tests/elanmoc/device
Normal file
@@ -0,0 +1,225 @@
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1/1-1
|
||||
N: bus/usb/001/010=1201000200000040F3047E0C05030102000109025300010103A0320904000008FF0000000921100100012215000705810240000107050102400001070582024000010705020240000107058302400001070503024000010705840240000107050402400001
|
||||
E: DEVNAME=/dev/bus/usb/001/010
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=4f3/c7e/305
|
||||
E: TYPE=0/0/0
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=010
|
||||
E: MAJOR=189
|
||||
E: MINOR=9
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=ELAN
|
||||
E: ID_VENDOR_ENC=ELAN
|
||||
E: ID_VENDOR_ID=04f3
|
||||
E: ID_MODEL=ELAN:ARM-M4
|
||||
E: ID_MODEL_ENC=ELAN:ARM-M4
|
||||
E: ID_MODEL_ID=0c7e
|
||||
E: ID_REVISION=0305
|
||||
E: ID_SERIAL=ELAN_ELAN:ARM-M4
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:ff0000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Elan Microelectronics Corp.
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:1
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_1
|
||||
A: authorized=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
A: bDeviceClass=00\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=0305\n
|
||||
A: bmAttributes=a0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=add909c9-e67e-4126-a6f7-1e31179e27d9\n
|
||||
H: descriptors=1201000200000040F3047E0C05030102000109025300010103A0320904000008FF0000000921100100012215000705810240000107050102400001070582024000010705020240000107058302400001070503024000010705840240000107050402400001
|
||||
A: dev=189:9\n
|
||||
A: devnum=10\n
|
||||
A: devpath=1\n
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0c7e\n
|
||||
A: idVendor=04f3\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=ELAN\n
|
||||
A: maxchild=0\n
|
||||
L: port=../1-0:1.0/usb1-port1
|
||||
A: power/active_duration=94712\n
|
||||
A: power/async=enabled\n
|
||||
A: power/autosuspend=2\n
|
||||
A: power/autosuspend_delay_ms=2000\n
|
||||
A: power/connected_duration=94712\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=94436\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=ELAN:ARM-M4\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=removable\n
|
||||
A: rx_lanes=1\n
|
||||
A: speed=12\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=12\n
|
||||
A: version= 2.00\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1
|
||||
N: bus/usb/001/001=12010002090001406B1D020004050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/504
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.4.0-42-generic_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.4.0-42-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=0504
|
||||
E: ID_SERIAL=Linux_5.4.0-42-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_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:
|
||||
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=0504\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=\n
|
||||
H: descriptors=12010002090001406B1D020004050302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:0\n
|
||||
A: devnum=1\n
|
||||
A: devpath=0\n
|
||||
L: driver=../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.4.0-42-generic xhci-hcd\n
|
||||
A: maxchild=12\n
|
||||
A: power/active_duration=74604360\n
|
||||
A: power/async=enabled\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=74606456\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_kids=4\n
|
||||
A: power/runtime_active_time=74605838\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=490\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:9DED
|
||||
E: PCI_SUBSYS_ID=103C:85EF
|
||||
E: PCI_SLOT_NAME=0000:00:14.0
|
||||
E: MODALIAS=pci:v00008086d00009DEDsv0000103Csd000085EFbc0Csc03i30
|
||||
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 Point-LP USB 3.1 xHCI Controller
|
||||
A: ari_enabled=0\n
|
||||
A: broken_parity_status=0\n
|
||||
A: class=0x0c0330\n
|
||||
H: config=8680ED9D060490023030030C00008000040030A10000000000000000000000000000000000000000000000003C10EF85000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F00000000181C030400000000316000000000000000000000000000000180C2C1080000000000000000000000059087007802E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000B50F300112000000
|
||||
A: consistent_dma_mask_bits=64\n
|
||||
A: d3cold_allowed=1\n
|
||||
A: dbc=disabled\n
|
||||
A: device=0x9ded\n
|
||||
A: dma_mask_bits=64\n
|
||||
L: driver=../../../bus/pci/drivers/xhci_hcd
|
||||
A: driver_override=(null)\n
|
||||
A: enable=1\n
|
||||
A: irq=124\n
|
||||
A: local_cpulist=0-3\n
|
||||
A: local_cpus=f\n
|
||||
A: modalias=pci:v00008086d00009DEDsv0000103Csd000085EFbc0Csc03i30\n
|
||||
A: msi_bus=1\n
|
||||
A: msi_irqs/124=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 32 128 1\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 11 12 2112 12\nxHCI ring segments 54 54 4096 54\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 9 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=74606194\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: resource=0x00000000a1300000 0x00000000a130ffff 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=0x30\n
|
||||
A: subsystem_device=0x85ef\n
|
||||
A: subsystem_vendor=0x103c\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
@@ -24,6 +24,10 @@ TW 8c62
|
||||
TW 805a
|
||||
TW 04
|
||||
TW aa07
|
||||
TW 8100
|
||||
TW 825f
|
||||
TW 8300
|
||||
TW 845f
|
||||
TW 8560
|
||||
TW 86c0
|
||||
TW 8780
|
||||
@@ -38,8 +42,11 @@ TW 9567
|
||||
TW 9804
|
||||
TW a120
|
||||
TW a236
|
||||
TW a902
|
||||
TW aa03
|
||||
TW aa5f
|
||||
TW abc0
|
||||
TW ac10
|
||||
TW aeff
|
||||
TW 01
|
||||
TW 03ff
|
||||
|
||||
@@ -1,217 +0,0 @@
|
||||
@DEV /dev/bus/usb/003/008
|
||||
USBDEVFS_GET_CAPABILITIES 0 FD010000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 D00000000500BA4500611A297F
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00000008009D6200D00000239572F5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 192 0 D0000001850067980002FE4150500000000000303130303032343744454C4C00000000474D3138384230004746353238380000312E30342E30352E31302E3530000000000000000000000000000000000000005553420000000000564253000000000030303030303030330000000000000000000000000000000000000000000000000000000000003B5CB43C000000000000555342000000000056425300000000003030303030303033000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 140 140 0 C001000184008E71000064500F41080A1800002300000101000101010100010105050100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B737316F0558B152
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00000208004BB400C001005F5A6B1C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 C00100030700D12E0014140342C8AE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 12 12 0 E00100020400BE41BBC7BACE
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000004080036C900E00101C26FC596000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 E0010005080054AB00141441240D0ECF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 A6000003050022DD00CA3B9C30
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000060800E01F00A60001BCF2ED17000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A60000070600B64900007A6860130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A20000040700BA45000F41625785F3
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000080800CC3300A20001BA8679AC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000090C00BC430054640027004D0084CD5EED0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 44 44 0 A500000524009F60000000000000000000000000000000000000000000000000000000000000000048D9D8CB
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00000A08001AE500A5000172CD1245000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A500000B050008F703C6DBFA26000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 A100000605003DC200632D10DE
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00000C0800679800A100014526FF87000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A100000D25007F8000D7843025CC713EA1543DF81EBAAF6BE244543EB9F4BC6FA74E8F246A711CD8C3EA54665F00000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A2000007070007F8000F41630A457A
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00000E0800B14E00A2000151C59D69000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200000F0C00C13E003E620027005900101FD1980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A0000008070012ED016450F8E6B5D9
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00001008003FC000A0000187F37724000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000001107008A7500000002FCFB4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B0020009050009F6004270904E
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000120800E91600B00201386F43E6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B002001345007788008A009C009400880008009A0099008B00080008009100850000000000000000008F00A4009B0090008F00A100A000940088009A0097008D000000000000000000BEDDBBB29400880008009A0099008B00080008009100850000000000000000008F00A4009B0090008F00A100A000940088009A0097008D
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200000A07009669000F41D397DA08
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000140800946B00A200014F39330E000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000150C00E41B004E640027004F00755632510000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000000B0700AF50016450F9BB7550
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000016080042BD00A000016CB093E1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A00000170700F708000000BAA9831600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002000C0500C93600FFA00844
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00001808006E9100B0020144AD1E73000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B00200194500F00F008C009C009600080086009D0097008E00810092009100850000000000000000008F00A4009A008F008E00A1009F00920087009A0096008C000000000000000000E3A1F2A19600080086009D0097008E00810092009100850000000000000000008F00A4009A008F008E00A1009F00920087009A0096008C
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200000D0700807F000F41ABF4CD98
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00001A0800B84700A2000195E5AEB2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200001B0C00C8370048640027005A00021B15CE0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000000E07006F9001645040B3CD87
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00001C0800C53A00A000011072CE74000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000001D0700708F003A000B89A2D100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002000F0500748B00E76F715E
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00001E080013EC00B00201AFEEFAB6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B002001F45008D720008009900920086008800960097008D007F0091008D00850000000000000000008F00A4009B0090008F00A100A000930087009A0096008D00000000000000000069C4E77C920086008800960097008D007F0091008D00850000000000000000008F00A4009B0090008F00A100A000930087009A0096008D
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A20000100700B34C000F4148456C7B
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000200800DE2100A2000173C16EC1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000210C00AE510048640027005500DD002B870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000001107008A750164506269C323
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000022080008F700A000015048CE2E000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A00000230700BD420000008C0CEEF100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B0020012050047B8005B407F33
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000240800758A00B0020149CA3AC5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B00200254500EB14008D00A100900087000800980099008C00080008000800080000000000000000008F00A3009A008F008E00A0009F00930087009A0096008C0000000000000000000F8D1061900087000800980099008C00080008000800080000000000000000008F00A3009A008F008E00A0009F00930087009A0096008C
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200001307000EF1000F414918ACF2
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000260800A35C00A2000198828A04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000270C00D32C0057640027004E0017D2351D0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000001407004AB5016450DB617BF4
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00002808008F7000A000012C8A93BB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000002907003AC500000044F2661300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B0020015050051AE00F61A492A
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00002A080059A600B002019316A779000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B002002B4500C7380089009C00920008008A00990098008A007F0093008E00860000000000000000008F00A4009A008F008E00A100A000930087009A0096008D000000000000000000A0269EE8920008008A00990098008A007F0093008E00860000000000000000008F00A4009A008F008E00A100A000930087009A0096008D
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A20000160700CE31000F41F0101425
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00002C080024DB00A20001E440D791000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200002D0C0054AB004A64002700590057B20D220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A00000170700F708016450DA3CBB7D
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00002E0800F20D00A00001C7C9777E000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000002F070047B8004C4C4EAAB86E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B00200180500C03F00B4605C02
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00003008007C8300B002018DEA091E000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B00200314500E21D00080008000800080088009A0096008F00820092009000080000000000000000008F00A3009A008F008E00A000A000930087009A0096008C000000000000000000E0BA753D0800080088009A0096008F00820092009000080000000000000000008F00A3009A008F008E00A000A000930087009A0096008C
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200001907008976000F4181E62410
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000320800AA5500A200015CA2B9DF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000330C00DA25005464002700500088A694DC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000001A070066990164506AA1240F
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000340800D72800A00001D935D919000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A00000350700629D0000006775A83E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002001B05007D8200ACAF2518
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000036080001FE00B0020166A9EDDB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B002003745009F600008000800080008008600970095000800830090008D00880000000000000000008F00A3009A008F008E00A100A000930087009A0096008C000000000000000000F054EC42080008008600970095000800830090008D00880000000000000000008F00A3009A008F008E00A100A000930087009A0096008C
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200001C070049B6000F4138EE9CC7
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00003808002DD200A200012060E44A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000390C005DA2004A640027004F005D569D1A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000001D0700708F01645012C2339F
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00003A0800FB0400A0000103E944A5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000003B07004EB1000000D6B5F7C500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A300001E0700B649000F41F8F75650
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00003C0800867900A30001B114E662000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A300003D0500629D009DDA98C4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 114 114 0 A400001F6A001EE1640043010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E4650312D30303030303030302D302D30303030303030302D6E6F626F647900E6F6BD05
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00003E080050AF00A40001795F8D8B000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A400003F05006B940099962233000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 12 12 0 E0000020040049B6AEA0E8AB
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00004008001BE400E00001D5F1C38E000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 E000004108001BE400000000315A099D000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 A60000210500B74800B39B168D
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000420800CD3200A60001EA5DF016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 A60000436C00EC130001640043010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E4650312D30303030303030302D302D30303030303030302D6E6F626F647900FA60A49A000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 12 12 0 E00100220400FD0253E4FA3B
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000440800B04F00E0010132DE18BE000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 E00100450800D22D000000002B1189D3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A20000230700EF100100238AF5F029
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000460800669900A2000190EB3938000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000470C0016E9004C640027004D005C10F4310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 44 44 0 A50000242400B7480000000000000000000000000000000000000000000000000000000000000000664B5D3F
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00004808004AB500A50001CF21EB81000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 192 0 A50000499200D22D004C642A00000000640043010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E4650312D30303030303030302D302D30303030303030302D6E6F626F647900954F9F36EAEDD0364E04D4A2B430F0D25BF63D97E631EC0F0F86A6A3DCDEF50C82BB7E8C2D30303030303030302D302D30303030303030302D6E6F626F647900954F9F36EAEDD0364E04
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 12 12 0 E000002504008976203A9633
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00004A08009C6300E00001A9339E1B000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 E000004B08009C63004C642A9C8BFEAB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 12 12 0 E0010026040056A9D15D8DC2
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00004C0800E11E00E00101034161C7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 E001004D0800837C004C642ACB9D5A09000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A2000027070044BB010023F3CB2730
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00004E080037C800A20001A1744041000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200004F0C0047B80052640027004D00E19CE96F0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 44 44 0 A500002824004DB200000000000000000000000000000000000000000000000000000000000000003DB8032C
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000500800B94600A500019C80610A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 192 0 A5000051920021DE0052642A00000000640043010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E4650312D30303030303030302D302D30303030303030302D6E6F626F647900954F9F36EAEDD0364E04D4A2B430F0D25BF63D97E631EC0F0F86A6A3DCDEF50CCC7D08E82D30303030303030302D302D30303030303030302D6E6F626F647900954F9F36EAEDD0364E04
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 12 12 0 E00000290400738C14C55D45
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00005208006F9000E00001FA921490000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 E000005308006F900052642AB5A4CC36000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 114 114 0 A700002A6A0044BB640043010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E4650312D30303030303030302D302D30303030303030302D6E6F626F6479001CF66539
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000054080012ED00A70001544A2520000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A7000055050052AD00C5D5FE86000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
BIN
tests/goodixmoc/custom.pcapng
Normal file
BIN
tests/goodixmoc/custom.pcapng
Normal file
Binary file not shown.
@@ -21,7 +21,7 @@ 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 not d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR)
|
||||
assert d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR)
|
||||
|
||||
d.open_sync()
|
||||
|
||||
|
||||
@@ -1,108 +1,105 @@
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb3/3-2
|
||||
N: bus/usb/003/008=12010002EF000040C627405800010102030109022000010103A0320904000002FF0000040705830240000007050102400000
|
||||
E: DEVNAME=/dev/bus/usb/003/008
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1/1-3
|
||||
N: bus/usb/001/053=12010002EF000040C627966400010102030109022000010103A0320904000002FF0000040705830240000007050102400000
|
||||
E: DEVNAME=/dev/bus/usb/001/053
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=27c6/5840/100
|
||||
E: PRODUCT=27c6/6496/100
|
||||
E: TYPE=239/0/0
|
||||
E: BUSNUM=003
|
||||
E: DEVNUM=008
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=053
|
||||
E: MAJOR=189
|
||||
E: MINOR=263
|
||||
E: MINOR=52
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Goodix_Technology_Co.__Ltd.
|
||||
E: ID_VENDOR_ENC=Goodix\x20Technology\x20Co.\x2c\x20Ltd.
|
||||
E: ID_VENDOR_ID=27c6
|
||||
E: ID_MODEL=Goodix_USB2.0_MISC
|
||||
E: ID_MODEL_ENC=Goodix\x20USB2.0\x20MISC
|
||||
E: ID_MODEL_ID=5840
|
||||
E: ID_MODEL_ID=6496
|
||||
E: ID_REVISION=0100
|
||||
E: ID_SERIAL=Goodix_Technology_Co.__Ltd._Goodix_USB2.0_MISC_UIDE1AD5CBA_XXXX_MOC_B0
|
||||
E: ID_SERIAL_SHORT=UIDE1AD5CBA_XXXX_MOC_B0
|
||||
E: ID_SERIAL=Goodix_Technology_Co.__Ltd._Goodix_USB2.0_MISC_XXXX_MOC_B0
|
||||
E: ID_SERIAL_SHORT=XXXX_MOC_B0
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:ff0000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Shenzhen Goodix Technology Co.,Ltd.
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:2
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_2
|
||||
E: LIBFPRINT_DRIVER=Goodix MOC Fingerprint Sensor
|
||||
A: authorized=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=ef
|
||||
A: bDeviceProtocol=00
|
||||
A: bDeviceSubClass=00
|
||||
A: bMaxPacketSize0=64
|
||||
A: bMaxPower=100mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=0100
|
||||
A: bmAttributes=a0
|
||||
A: busnum=3\n
|
||||
A: configuration=UIDE1AD5CBA_XXXX_MOC_B0
|
||||
H: descriptors=12010002EF000040C627405800010102030109022000010103A0320904000002FF0000040705830240000007050102400000
|
||||
A: dev=189:263
|
||||
A: devnum=8\n
|
||||
A: devpath=2
|
||||
E: ID_AUTOSUSPEND=1
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:3
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3
|
||||
A: authorized=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
A: bDeviceClass=ef\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=0100\n
|
||||
A: bmAttributes=a0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=XXXX_MOC_B0\n
|
||||
H: descriptors=12010002EF000040C627966400010102030109022000010103A0320904000002FF0000040705830240000007050102400000
|
||||
A: dev=189:52\n
|
||||
A: devnum=53\n
|
||||
A: devpath=3\n
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
A: idProduct=5840
|
||||
A: idVendor=27c6
|
||||
A: ltm_capable=no
|
||||
A: manufacturer=Goodix Technology Co., Ltd.
|
||||
A: maxchild=0
|
||||
L: port=../3-0:1.0/usb3-port2
|
||||
A: power/active_duration=2684
|
||||
A: power/async=enabled
|
||||
A: power/autosuspend=2
|
||||
A: power/autosuspend_delay_ms=2000
|
||||
A: power/connected_duration=54348
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/persist=1
|
||||
A: power/runtime_active_kids=0
|
||||
A: power/runtime_active_time=2518
|
||||
A: power/runtime_enabled=enabled
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=51550
|
||||
A: power/runtime_usage=0
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: product=Goodix USB2.0 MISC
|
||||
A: quirks=0x0
|
||||
A: removable=removable
|
||||
A: rx_lanes=1
|
||||
A: serial=UIDE1AD5CBA_XXXX_MOC_B0
|
||||
A: speed=12
|
||||
A: tx_lanes=1
|
||||
A: urbnum=15
|
||||
A: version= 2.00
|
||||
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d/device:20
|
||||
A: idProduct=6496\n
|
||||
A: idVendor=27c6\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Goodix Technology Co., Ltd.\n
|
||||
A: maxchild=0\n
|
||||
L: port=../1-0:1.0/usb1-port3
|
||||
A: power/active_duration=29262\n
|
||||
A: power/autosuspend=2\n
|
||||
A: power/autosuspend_delay_ms=2000\n
|
||||
A: power/connected_duration=57399\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/persist=1\n
|
||||
A: power/runtime_active_time=29308\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=27850\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=Goodix USB2.0 MISC\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=removable\n
|
||||
A: rx_lanes=1\n
|
||||
A: serial=XXXX_MOC_B0\n
|
||||
A: speed=12\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=394\n
|
||||
A: version= 2.00\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb3
|
||||
N: bus/usb/003/001=12010002090001406B1D020008050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/003/001
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1
|
||||
N: bus/usb/001/001=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/508
|
||||
E: PRODUCT=1d6b/2/513
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=003
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=256
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.8.0-38-generic_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.8.0-38-generic\x20xhci-hcd
|
||||
E: ID_VENDOR=Linux_5.13.15-200.fc34.x86_64_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.13.15-200.fc34.x86_64\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=0508
|
||||
E: ID_SERIAL=Linux_5.8.0-38-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
|
||||
E: ID_REVISION=0513
|
||||
E: ID_SERIAL=Linux_5.13.15-200.fc34.x86_64_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:
|
||||
@@ -113,62 +110,114 @@ 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:
|
||||
A: authorized=1
|
||||
A: authorized_default=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=09
|
||||
A: bDeviceProtocol=01
|
||||
A: bDeviceSubClass=00
|
||||
A: bMaxPacketSize0=64
|
||||
A: bMaxPower=0mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=0508
|
||||
A: bmAttributes=e0
|
||||
A: busnum=3\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020008050302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:256
|
||||
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=0513\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=\n
|
||||
H: descriptors=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:0\n
|
||||
A: devnum=1\n
|
||||
A: devpath=0
|
||||
A: devpath=0\n
|
||||
L: driver=../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0002
|
||||
A: idVendor=1d6b
|
||||
A: interface_authorized_default=1
|
||||
A: ltm_capable=no
|
||||
A: manufacturer=Linux 5.8.0-38-generic xhci-hcd
|
||||
A: maxchild=4
|
||||
A: power/active_duration=2790916
|
||||
A: power/async=enabled
|
||||
A: power/autosuspend=0
|
||||
A: power/autosuspend_delay_ms=0
|
||||
A: power/connected_duration=15607832
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/runtime_active_kids=1
|
||||
A: power/runtime_active_time=2790874
|
||||
A: power/runtime_enabled=enabled
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=12816956
|
||||
A: power/runtime_usage=0
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: product=xHCI Host Controller
|
||||
A: quirks=0x0
|
||||
A: removable=unknown
|
||||
A: rx_lanes=1
|
||||
A: serial=0000:00:14.0
|
||||
A: speed=480
|
||||
A: tx_lanes=1
|
||||
A: urbnum=584
|
||||
A: version= 2.00
|
||||
L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.13.15-200.fc34.x86_64 xhci-hcd\n
|
||||
A: maxchild=12\n
|
||||
A: power/active_duration=219578717\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=219649620\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_time=219589127\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=4325\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:9DED
|
||||
E: PCI_SUBSYS_ID=17AA:2292\n
|
||||
E: PCI_SLOT_NAME=0000:00:14.0
|
||||
E: MODALIAS=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30
|
||||
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_AUTOSUSPEND=1
|
||||
E: ID_MODEL_FROM_DATABASE=Cannon Point-LP USB 3.1 xHCI Controller
|
||||
A: ari_enabled=0\n
|
||||
A: broken_parity_status=0\n
|
||||
A: class=0x0c0330\n
|
||||
H: config=8680ED9D060490021130030C00008000040022EA000000000000000000000000000000000000000000000000AA179222000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F000000004C084B0100000000316000000000000000000000000000000180C2C1080000000000000000000000059087001803E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000000000000000000008000000040000000000000000000000000000000000000000000000000000000800000004000000000000000000000000000000000000000000000000000000B50F320112000000
|
||||
A: consistent_dma_mask_bits=64\n
|
||||
A: d3cold_allowed=1\n
|
||||
A: dbc=disabled\n
|
||||
A: device=0x9ded\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:1c
|
||||
A: irq=128\n
|
||||
A: local_cpulist=0-7\n
|
||||
A: local_cpus=ff\n
|
||||
A: modalias=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30\n
|
||||
A: msi_bus=1\n
|
||||
A: msi_irqs/128=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 11 12 2112 12\nxHCI ring segments 46 50 4096 50\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 6 32 128 1\nbuffer-32 0 0 32 0\n
|
||||
A: power/control=on\n
|
||||
A: power/runtime_active_time=219589302\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=0x00000000ea220000 0x00000000ea22ffff 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=0x11\n
|
||||
A: subsystem_device=0x2292\n
|
||||
A: subsystem_vendor=0x17aa\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
|
||||
@@ -22,18 +22,34 @@ envs.set('FP_DRIVERS_WHITELIST', ':'.join([
|
||||
envs.set('NO_AT_BRIDGE', '1')
|
||||
|
||||
drivers_tests = [
|
||||
'aes2501',
|
||||
'aes3500',
|
||||
'elan',
|
||||
'elan-cobo',
|
||||
'elanmoc',
|
||||
'elanspi',
|
||||
'synaptics',
|
||||
'upektc_img',
|
||||
'uru4000-msv2',
|
||||
'uru4000-4500',
|
||||
'vfs0050',
|
||||
'vfs301',
|
||||
'vfs5011',
|
||||
'vfs7552',
|
||||
'goodixmoc',
|
||||
'nb1010',
|
||||
'egis0570',
|
||||
]
|
||||
|
||||
if get_option('introspection')
|
||||
conf = configuration_data()
|
||||
conf.set('SRCDIR', meson.source_root())
|
||||
conf.set('BUILDDIR', meson.build_root())
|
||||
configure_file(configuration: conf,
|
||||
input: 'create-driver-test.py.in',
|
||||
output: 'create-driver-test.py')
|
||||
endif
|
||||
|
||||
if get_option('introspection')
|
||||
envs.prepend('GI_TYPELIB_PATH', join_paths(meson.build_root(), 'libfprint'))
|
||||
virtual_devices_tests = [
|
||||
@@ -83,11 +99,7 @@ if get_option('introspection')
|
||||
endforeach
|
||||
|
||||
foreach driver_test: drivers_tests
|
||||
if driver_test.contains('-')
|
||||
driver_name = driver_test.split('-')[0]
|
||||
else
|
||||
driver_name = driver_test
|
||||
endif
|
||||
driver_name = driver_test.split('-')[0]
|
||||
driver_envs = envs
|
||||
driver_envs.set('FP_DRIVERS_WHITELIST', driver_name)
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,10 +1,14 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
import gi
|
||||
gi.require_version('FPrint', '2.0')
|
||||
from gi.repository import FPrint, GLib
|
||||
|
||||
ctx = GLib.main_context_default()
|
||||
import sys
|
||||
import traceback
|
||||
sys.excepthook = lambda *args : (traceback.print_exception(*args), sys.exit(1))
|
||||
|
||||
|
||||
c = FPrint.Context()
|
||||
c.enumerate()
|
||||
@@ -13,6 +17,24 @@ devices = c.get_devices()
|
||||
d = devices[0]
|
||||
del devices
|
||||
|
||||
usb_device = d.get_property('fpi-usb-device')
|
||||
bus_num = usb_device.get_bus()
|
||||
port = []
|
||||
while True:
|
||||
parent = usb_device.get_parent()
|
||||
if parent is None:
|
||||
break
|
||||
port.append(str(usb_device.get_port_number()))
|
||||
usb_device = parent
|
||||
port = '.'.join(port)
|
||||
|
||||
persist = f'/sys/bus/usb/devices/{bus_num}-{port}/power/persist'
|
||||
wakeup = f'/sys/bus/usb/devices/{bus_num}-{port}/power/wakeup'
|
||||
|
||||
# may not have written anything
|
||||
assert open(persist).read().strip() == "0"
|
||||
assert open(wakeup).read().strip() == "disabled"
|
||||
|
||||
assert d.get_driver() == "synaptics"
|
||||
assert not d.has_feature(FPrint.DeviceFeature.CAPTURE)
|
||||
assert d.has_feature(FPrint.DeviceFeature.IDENTIFY)
|
||||
@@ -29,7 +51,7 @@ d.clear_storage_sync()
|
||||
template = FPrint.Print.new(d)
|
||||
|
||||
def enroll_progress(*args):
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NEEDED
|
||||
#assert d.get_finger_status() == FPrint.FingerStatusFlags.NEEDED
|
||||
print('enroll progress: ' + str(args))
|
||||
|
||||
# List, enroll, list, verify, delete, list
|
||||
@@ -41,6 +63,21 @@ print("enroll done")
|
||||
|
||||
print("verifying")
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
|
||||
# Inject a suspend/resume cycle into the verify
|
||||
def suspend_resume():
|
||||
d.suspend_sync()
|
||||
assert open(persist).read().strip() == "0"
|
||||
assert open(wakeup).read().strip() == "enabled"
|
||||
|
||||
assert open(persist, 'w').write('0\n')
|
||||
d.resume_sync()
|
||||
# This tests that libfprint doesn't write if the value is correct
|
||||
# (i.e. the trailing \ would be lost inside umockdev if written)
|
||||
assert open(persist).read() == "0\n"
|
||||
assert open(wakeup).read().strip() == "disabled"
|
||||
|
||||
GLib.idle_add(suspend_resume, priority=GLib.PRIORITY_HIGH)
|
||||
verify_res, verify_print = d.verify_sync(p)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
print("verify done")
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1/1-9
|
||||
N: bus/usb/001/005
|
||||
E: DEVNAME=/dev/bus/usb/001/005
|
||||
N: bus/usb/001/004=12010002FF10FF08CB06BD0000000000010109022700010100A0320904000003FF000000070501024000000705810240000007058303080004
|
||||
E: DEVNAME=/dev/bus/usb/001/004
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=6cb/bd/0
|
||||
E: TYPE=255/16/255
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=005
|
||||
E: DEVNUM=004
|
||||
E: MAJOR=189
|
||||
E: MINOR=4
|
||||
E: MINOR=3
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=06cb
|
||||
E: ID_VENDOR_ENC=06cb
|
||||
@@ -24,82 +24,82 @@ E: ID_USB_INTERFACES=:ff0000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Synaptics, Inc.
|
||||
E: ID_AUTOSUSPEND=1
|
||||
E: ID_MODEL_FROM_DATABASE=Prometheus MIS Touch Fingerprint Reader
|
||||
E: ID_PERSIST=0
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:9
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_9
|
||||
E: LIBFPRINT_DRIVER=Synaptics Sensors
|
||||
A: authorized=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
A: bDeviceClass=ff\n
|
||||
A: bDeviceProtocol=ff\n
|
||||
A: bDeviceSubClass=10\n
|
||||
A: bMaxPacketSize0=8\n
|
||||
A: bMaxPower=100mA\n
|
||||
A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=0000\n
|
||||
A: bmAttributes=a0\n
|
||||
A: busnum=1\n
|
||||
A: authorized=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=ff
|
||||
A: bDeviceProtocol=ff
|
||||
A: bDeviceSubClass=10
|
||||
A: bMaxPacketSize0=8
|
||||
A: bMaxPower=100mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=0000
|
||||
A: bmAttributes=a0
|
||||
A: busnum=1
|
||||
A: configuration=
|
||||
H: descriptors=12010002FF10FF08CB06BD0000000000010109022700010100A0320904000003FF000000070501024000000705810240000007058303080004
|
||||
A: dev=189:4\n
|
||||
A: devnum=5\n
|
||||
A: devpath=9\n
|
||||
A: dev=189:3
|
||||
A: devnum=4
|
||||
A: devpath=9
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d/device:28
|
||||
A: idProduct=00bd\n
|
||||
A: idVendor=06cb\n
|
||||
A: ltm_capable=no\n
|
||||
A: maxchild=0\n
|
||||
A: idProduct=00bd
|
||||
A: idVendor=06cb
|
||||
A: ltm_capable=no
|
||||
A: maxchild=0
|
||||
L: port=../1-0:1.0/usb1-port9
|
||||
A: power/active_duration=82065\n
|
||||
A: power/autosuspend=2\n
|
||||
A: power/autosuspend_delay_ms=2000\n
|
||||
A: power/connected_duration=4271349\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/persist=1\n
|
||||
A: power/runtime_active_time=82975\n
|
||||
A: power/runtime_status=suspended\n
|
||||
A: power/runtime_suspended_time=4186597\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: quirks=0x0\n
|
||||
A: removable=fixed\n
|
||||
A: rx_lanes=1\n
|
||||
A: serial=c087f7d72126\n
|
||||
A: speed=12\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=618\n
|
||||
A: version= 2.00\n
|
||||
A: power/active_duration=9424964
|
||||
A: power/autosuspend=2
|
||||
A: power/autosuspend_delay_ms=2000
|
||||
A: power/connected_duration=866169213
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/persist=0
|
||||
A: power/runtime_active_time=9431408
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=856661633
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: quirks=0x0
|
||||
A: removable=fixed
|
||||
A: rx_lanes=1
|
||||
A: serial=c087f7d72126
|
||||
A: speed=12
|
||||
A: tx_lanes=1
|
||||
A: urbnum=8945
|
||||
A: version= 2.00
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1
|
||||
N: bus/usb/001/001=12010002090001406B1D020012050302010109021900010100E0000904000001090000000705810304000C
|
||||
N: bus/usb/001/001=12010002090001406B1D020016050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/512
|
||||
E: PRODUCT=1d6b/2/516
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.12.9-300.fc34.x86_64_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.12.9-300.fc34.x86_64\x20xhci-hcd
|
||||
E: ID_VENDOR=Linux_5.16.8-200.fc35.x86_64_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.16.8-200.fc35.x86_64\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=0512
|
||||
E: ID_SERIAL=Linux_5.12.9-300.fc34.x86_64_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
|
||||
E: ID_REVISION=0516
|
||||
E: ID_SERIAL=Linux_5.16.8-200.fc35.x86_64_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:
|
||||
@@ -111,60 +111,60 @@ 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=0512\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: authorized=1
|
||||
A: authorized_default=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=09
|
||||
A: bDeviceProtocol=01
|
||||
A: bDeviceSubClass=00
|
||||
A: bMaxPacketSize0=64
|
||||
A: bMaxPower=0mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=0516
|
||||
A: bmAttributes=e0
|
||||
A: busnum=1
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020012050302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:0\n
|
||||
A: devnum=1\n
|
||||
A: devpath=0\n
|
||||
H: descriptors=12010002090001406B1D020016050302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:0
|
||||
A: devnum=1
|
||||
A: devpath=0
|
||||
L: driver=../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.12.9-300.fc34.x86_64 xhci-hcd\n
|
||||
A: maxchild=12\n
|
||||
A: power/active_duration=4270585\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=4272308\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_time=4270770\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=463\n
|
||||
A: version= 2.00\n
|
||||
A: idProduct=0002
|
||||
A: idVendor=1d6b
|
||||
A: interface_authorized_default=1
|
||||
A: ltm_capable=no
|
||||
A: manufacturer=Linux 5.16.8-200.fc35.x86_64 xhci-hcd
|
||||
A: maxchild=12
|
||||
A: power/active_duration=865968060
|
||||
A: power/autosuspend=0
|
||||
A: power/autosuspend_delay_ms=0
|
||||
A: power/connected_duration=866169920
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/runtime_active_time=866093998
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: product=xHCI Host Controller
|
||||
A: quirks=0x0
|
||||
A: removable=unknown
|
||||
A: rx_lanes=1
|
||||
A: serial=0000:00:14.0
|
||||
A: speed=480
|
||||
A: tx_lanes=1
|
||||
A: urbnum=9372
|
||||
A: version= 2.00
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0
|
||||
E: DRIVER=xhci_hcd
|
||||
@@ -180,44 +180,44 @@ E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
|
||||
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
|
||||
E: ID_AUTOSUSPEND=1
|
||||
E: ID_MODEL_FROM_DATABASE=Cannon Point-LP USB 3.1 xHCI Controller
|
||||
A: ari_enabled=0\n
|
||||
A: broken_parity_status=0\n
|
||||
A: class=0x0c0330\n
|
||||
H: config=8680ED9D060490021130030C00008000040022EA000000000000000000000000000000000000000000000000AA179222000000007000000000000000FF010000
|
||||
A: consistent_dma_mask_bits=64\n
|
||||
A: d3cold_allowed=1\n
|
||||
A: dbc=disabled\n
|
||||
A: device=0x9ded\n
|
||||
A: dma_mask_bits=64\n
|
||||
A: ari_enabled=0
|
||||
A: broken_parity_status=0
|
||||
A: class=0x0c0330
|
||||
H: config=8680ED9D060490021130030C00008000040022EA000000000000000000000000000000000000000000000000AA179222000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F0000000060069A2400000000316000000000000000000000000000000180C2C108000000000000000000000005908700D802E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000000000000000000008000000040000000000000000000000000000000000000000000000000000000800000004000000000000000000000000000000000000000000000000000000B50F320112000000
|
||||
A: consistent_dma_mask_bits=64
|
||||
A: d3cold_allowed=1
|
||||
A: dbc=disabled
|
||||
A: device=0x9ded
|
||||
A: dma_mask_bits=64
|
||||
L: driver=../../../bus/pci/drivers/xhci_hcd
|
||||
A: driver_override=(null)\n
|
||||
A: enable=1\n
|
||||
A: driver_override=(null)
|
||||
A: enable=1
|
||||
L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c
|
||||
A: irq=128\n
|
||||
A: local_cpulist=0-7\n
|
||||
A: local_cpus=ff\n
|
||||
A: modalias=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30\n
|
||||
A: msi_bus=1\n
|
||||
A: msi_irqs/128=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 9 12 2112 12\nxHCI ring segments 40 50 4096 50\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 6 32 128 1\nbuffer-32 0 0 32 0\n
|
||||
A: power/control=auto\n
|
||||
A: power/runtime_active_time=4271635\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=0x00000000ea220000 0x00000000ea22ffff 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=0x11\n
|
||||
A: subsystem_device=0x2292\n
|
||||
A: subsystem_vendor=0x17aa\n
|
||||
A: vendor=0x8086\n
|
||||
A: irq=126
|
||||
A: local_cpulist=0-7
|
||||
A: local_cpus=ff
|
||||
A: modalias=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30
|
||||
A: msi_bus=1
|
||||
A: msi_irqs/126=msi
|
||||
A: numa_node=-1
|
||||
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 21 24 2112 24\nxHCI ring segments 68 80 4096 80\nbuffer-2048 0 38 2048 19\nbuffer-512 0 0 512 0\nbuffer-128 18 32 128 1\nbuffer-32 0 128 32 1
|
||||
A: power/control=auto
|
||||
A: power/runtime_active_time=866094158
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/wakeup=enabled
|
||||
A: power/wakeup_abort_count=0
|
||||
A: power/wakeup_active=0
|
||||
A: power/wakeup_active_count=2
|
||||
A: power/wakeup_count=0
|
||||
A: power/wakeup_expire_count=2
|
||||
A: power/wakeup_last_time_ms=476219021
|
||||
A: power/wakeup_max_time_ms=103
|
||||
A: power/wakeup_total_time_ms=207
|
||||
A: power_state=D0
|
||||
A: resource=0x00000000ea220000 0x00000000ea22ffff 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
|
||||
A: revision=0x11
|
||||
A: subsystem_device=0x2292
|
||||
A: subsystem_vendor=0x17aa
|
||||
A: vendor=0x8086
|
||||
|
||||
|
||||
@@ -271,6 +271,26 @@ fpi_device_fake_cancel (FpDevice *device)
|
||||
g_assert_cmpuint (fpi_device_get_current_action (device), !=, FPI_DEVICE_ACTION_NONE);
|
||||
}
|
||||
|
||||
static void
|
||||
fpi_device_fake_suspend (FpDevice *device)
|
||||
{
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
fake_dev->last_called_function = fpi_device_fake_suspend;
|
||||
|
||||
fpi_device_suspend_complete (device, g_steal_pointer (&fake_dev->ret_suspend));
|
||||
}
|
||||
|
||||
static void
|
||||
fpi_device_fake_resume (FpDevice *device)
|
||||
{
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
fake_dev->last_called_function = fpi_device_fake_resume;
|
||||
|
||||
fpi_device_resume_complete (device, g_steal_pointer (&fake_dev->ret_resume));
|
||||
}
|
||||
|
||||
static void
|
||||
fpi_device_fake_init (FpiDeviceFake *self)
|
||||
{
|
||||
@@ -299,6 +319,8 @@ fpi_device_fake_class_init (FpiDeviceFakeClass *klass)
|
||||
dev_class->delete = fpi_device_fake_delete;
|
||||
dev_class->cancel = fpi_device_fake_cancel;
|
||||
dev_class->clear_storage = fpi_device_fake_clear_storage;
|
||||
dev_class->suspend = fpi_device_fake_suspend;
|
||||
dev_class->resume = fpi_device_fake_resume;
|
||||
|
||||
fpi_device_class_auto_initialize_features (dev_class);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ struct _FpiDeviceFake
|
||||
gpointer last_called_function;
|
||||
gboolean return_action_error;
|
||||
|
||||
GCancellable *ext_cancellable;
|
||||
|
||||
GError *ret_error;
|
||||
FpPrint *ret_print;
|
||||
FpPrint *ret_match;
|
||||
@@ -39,6 +41,9 @@ struct _FpiDeviceFake
|
||||
FpImage *ret_image;
|
||||
GPtrArray *ret_list;
|
||||
|
||||
GError *ret_suspend;
|
||||
GError *ret_resume;
|
||||
|
||||
gpointer action_data;
|
||||
gpointer user_data;
|
||||
|
||||
|
||||
@@ -27,6 +27,11 @@
|
||||
#include "fpi-compat.h"
|
||||
#include "fpi-log.h"
|
||||
#include "test-device-fake.h"
|
||||
#include "fp-print-private.h"
|
||||
|
||||
/* gcc 12.0.1 is complaining about dangling pointers in the auto_close* functions */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdangling-pointer"
|
||||
|
||||
/* Utility functions */
|
||||
|
||||
@@ -35,9 +40,11 @@ typedef FpDevice FpAutoCloseDevice;
|
||||
static FpAutoCloseDevice *
|
||||
auto_close_fake_device_new (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
FpAutoCloseDevice *device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
if (!fp_device_open_sync (device, NULL, &error))
|
||||
g_error ("Could not open device: %s", error->message);
|
||||
|
||||
return device;
|
||||
}
|
||||
@@ -45,6 +52,7 @@ auto_close_fake_device_new (void)
|
||||
static void
|
||||
auto_close_fake_device_free (FpAutoCloseDevice *device)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
if (fake_dev->return_action_error)
|
||||
@@ -54,12 +62,15 @@ auto_close_fake_device_free (FpAutoCloseDevice *device)
|
||||
}
|
||||
|
||||
if (fp_device_is_open (device))
|
||||
g_assert_true (fp_device_close_sync (device, NULL, NULL));
|
||||
if (!fp_device_close_sync (device, NULL, &error))
|
||||
g_error ("Could not close device: %s", error->message);
|
||||
|
||||
g_object_unref (device);
|
||||
}
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FpAutoCloseDevice, auto_close_fake_device_free)
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
typedef FpDeviceClass FpAutoResetClass;
|
||||
static FpAutoResetClass default_fake_dev_class = {0};
|
||||
|
||||
@@ -138,6 +149,16 @@ make_fake_print (FpDevice *device,
|
||||
return enrolled_print;
|
||||
}
|
||||
|
||||
static FpPrint *
|
||||
make_fake_nbis_print (FpDevice *device)
|
||||
{
|
||||
FpPrint *enrolled_print = fp_print_new (device);
|
||||
|
||||
fpi_print_set_type (enrolled_print, FPI_PRINT_NBIS);
|
||||
|
||||
return enrolled_print;
|
||||
}
|
||||
|
||||
static FpPrint *
|
||||
make_fake_print_reffed (FpDevice *device,
|
||||
GVariant *print_data)
|
||||
@@ -1041,7 +1062,6 @@ test_driver_enroll_error_no_print (void)
|
||||
out_print =
|
||||
fp_device_enroll_sync (device, fp_print_new (device), NULL, NULL, NULL, &error);
|
||||
|
||||
g_test_assert_expected_messages ();
|
||||
g_assert (fake_dev->last_called_function == dev_class->enroll);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL);
|
||||
g_assert_null (out_print);
|
||||
@@ -1049,6 +1069,111 @@ test_driver_enroll_error_no_print (void)
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_enroll_update_nbis (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(FpPrint) template_print = NULL;
|
||||
FpiDeviceFake *fake_dev = NULL;
|
||||
FpPrint *out_print = NULL;
|
||||
|
||||
dev_class->features |= FP_DEVICE_FEATURE_UPDATE_PRINT;
|
||||
device = auto_close_fake_device_new ();
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
template_print = make_fake_nbis_print (device);
|
||||
fake_dev->ret_print = template_print;
|
||||
|
||||
out_print =
|
||||
fp_device_enroll_sync (device, template_print, NULL, NULL, NULL, &error);
|
||||
|
||||
g_assert (fake_dev->last_called_function == dev_class->enroll);
|
||||
g_assert (fake_dev->action_data == template_print);
|
||||
|
||||
g_assert_no_error (error);
|
||||
g_assert (out_print == template_print);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_enroll_update_nbis_wrong_device (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(FpPrint) template_print = NULL;
|
||||
FpiDeviceFake *fake_dev = NULL;
|
||||
FpPrint *out_print = NULL;
|
||||
|
||||
dev_class->features |= FP_DEVICE_FEATURE_UPDATE_PRINT;
|
||||
|
||||
device = auto_close_fake_device_new ();
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
template_print = make_fake_nbis_print (device);
|
||||
template_print->device_id = g_strdup ("wrong_device");
|
||||
fake_dev->ret_print = template_print;
|
||||
|
||||
out_print =
|
||||
fp_device_enroll_sync (device, template_print, NULL, NULL, NULL, &error);
|
||||
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_INVALID);
|
||||
g_assert (out_print == NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_enroll_update_nbis_wrong_driver (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(FpPrint) template_print = NULL;
|
||||
FpiDeviceFake *fake_dev = NULL;
|
||||
FpPrint *out_print = NULL;
|
||||
|
||||
dev_class->features |= FP_DEVICE_FEATURE_UPDATE_PRINT;
|
||||
|
||||
device = auto_close_fake_device_new ();
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
template_print = make_fake_nbis_print (device);
|
||||
template_print->driver = g_strdup ("wrong_driver");
|
||||
fake_dev->ret_print = template_print;
|
||||
|
||||
out_print =
|
||||
fp_device_enroll_sync (device, template_print, NULL, NULL, NULL, &error);
|
||||
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_INVALID);
|
||||
g_assert (out_print == NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_enroll_update_nbis_missing_feature (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(FpPrint) template_print = NULL;
|
||||
FpiDeviceFake *fake_dev = NULL;
|
||||
FpPrint *out_print = NULL;
|
||||
|
||||
device = auto_close_fake_device_new ();
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
template_print = make_fake_nbis_print (device);
|
||||
fake_dev->ret_print = template_print;
|
||||
|
||||
out_print =
|
||||
fp_device_enroll_sync (device, template_print, NULL, NULL, NULL, &error);
|
||||
|
||||
g_assert (fake_dev->last_called_function == dev_class->open);
|
||||
g_assert (fake_dev->action_data == NULL);
|
||||
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_INVALID);
|
||||
g_assert (out_print == NULL);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gint completed_stages;
|
||||
@@ -1224,6 +1349,11 @@ test_driver_match_cb (FpDevice *device,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fake_device_stub_verify (FpDevice *device)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_verify (void)
|
||||
{
|
||||
@@ -1588,6 +1718,28 @@ fake_device_stub_identify (FpDevice *device)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_identify_cb (FpDevice *device,
|
||||
GAsyncResult *res,
|
||||
gpointer user_data)
|
||||
{
|
||||
MatchCbData *data = user_data;
|
||||
gboolean r;
|
||||
|
||||
g_assert (data->called == FALSE);
|
||||
data->called = TRUE;
|
||||
|
||||
r = fp_device_identify_finish (device, res, &data->match, &data->print, &data->error);
|
||||
|
||||
if (r)
|
||||
g_assert_no_error (data->error);
|
||||
else
|
||||
g_assert_nonnull (data->error);
|
||||
|
||||
if (data->match)
|
||||
g_assert_no_error (data->error);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_supports_identify (void)
|
||||
{
|
||||
@@ -1941,6 +2093,314 @@ test_driver_identify_report_no_callback (void)
|
||||
g_assert_false (match);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_identify_suspend_continues (void)
|
||||
{
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
g_autoptr(MatchCbData) identify_data = g_new0 (MatchCbData, 1);
|
||||
g_autoptr(GPtrArray) prints = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
void (*orig_identify) (FpDevice *device);
|
||||
FpiDeviceFake *fake_dev;
|
||||
FpPrint *expected_matched;
|
||||
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
orig_identify = dev_class->identify;
|
||||
dev_class->identify = fake_device_stub_identify;
|
||||
|
||||
prints = make_fake_prints_gallery (device, 500);
|
||||
expected_matched = g_ptr_array_index (prints, g_random_int_range (0, 499));
|
||||
fp_print_set_description (expected_matched, "fake-verified");
|
||||
|
||||
match_data->gallery = prints;
|
||||
|
||||
fake_dev->ret_print = make_fake_print (device, NULL);
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
|
||||
fp_device_identify (device, prints, NULL,
|
||||
test_driver_match_cb, match_data, NULL,
|
||||
(GAsyncReadyCallback) test_driver_identify_cb, identify_data);
|
||||
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
|
||||
fake_dev->ret_suspend = NULL;
|
||||
fp_device_suspend_sync (device, NULL, &error);
|
||||
g_assert (fake_dev->last_called_function == dev_class->suspend);
|
||||
g_assert_no_error (error);
|
||||
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
|
||||
g_assert_false (match_data->called);
|
||||
g_assert_false (identify_data->called);
|
||||
|
||||
fake_dev->ret_resume = NULL;
|
||||
fp_device_resume_sync (device, NULL, &error);
|
||||
g_assert (fake_dev->last_called_function == dev_class->resume);
|
||||
g_assert_no_error (error);
|
||||
|
||||
orig_identify (device);
|
||||
|
||||
/* This currently happens immediately (not ABI though) */
|
||||
g_assert_true (match_data->called);
|
||||
g_assert (match_data->match == expected_matched);
|
||||
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
|
||||
g_assert_true (identify_data->called);
|
||||
g_assert (identify_data->match == expected_matched);
|
||||
|
||||
g_assert (fake_dev->last_called_function == orig_identify);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_identify_suspend_succeeds (void)
|
||||
{
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
g_autoptr(MatchCbData) identify_data = g_new0 (MatchCbData, 1);
|
||||
g_autoptr(GPtrArray) prints = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
void (*orig_identify) (FpDevice *device);
|
||||
FpiDeviceFake *fake_dev;
|
||||
FpPrint *expected_matched;
|
||||
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
orig_identify = dev_class->identify;
|
||||
dev_class->identify = fake_device_stub_identify;
|
||||
|
||||
prints = make_fake_prints_gallery (device, 500);
|
||||
expected_matched = g_ptr_array_index (prints, g_random_int_range (0, 499));
|
||||
fp_print_set_description (expected_matched, "fake-verified");
|
||||
|
||||
match_data->gallery = prints;
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
|
||||
fake_dev->ret_print = make_fake_print (device, NULL);
|
||||
fp_device_identify (device, prints, NULL,
|
||||
test_driver_match_cb, match_data, NULL,
|
||||
(GAsyncReadyCallback) test_driver_identify_cb, identify_data);
|
||||
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
|
||||
/* suspend_sync hangs until cancellation, so we need to trigger orig_identify
|
||||
* from the mainloop after calling suspend_sync.
|
||||
*/
|
||||
fpi_device_add_timeout (device, 0, (FpTimeoutFunc) orig_identify, NULL, NULL);
|
||||
|
||||
fake_dev->ret_suspend = fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED);
|
||||
fp_device_suspend_sync (device, NULL, &error);
|
||||
|
||||
/* At this point we are done with everything */
|
||||
g_assert (fake_dev->last_called_function == orig_identify);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_NOT_SUPPORTED);
|
||||
g_clear_error (&error);
|
||||
|
||||
/* We suspended, but device reported success and that will be reported. */
|
||||
g_assert_true (match_data->called);
|
||||
g_assert (match_data->match == expected_matched);
|
||||
g_assert_true (identify_data->called);
|
||||
g_assert (identify_data->match == expected_matched);
|
||||
|
||||
/* Resuming the device does not call resume handler, as the action was
|
||||
* cancelled already.
|
||||
*/
|
||||
fake_dev->last_called_function = NULL;
|
||||
fp_device_resume_sync (device, NULL, &error);
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
g_assert_no_error (error);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_identify_suspend_busy_error (void)
|
||||
{
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
g_autoptr(MatchCbData) identify_data = g_new0 (MatchCbData, 1);
|
||||
g_autoptr(GPtrArray) prints = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
void (*orig_identify) (FpDevice *device);
|
||||
FpiDeviceFake *fake_dev;
|
||||
FpPrint *expected_matched;
|
||||
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
orig_identify = dev_class->identify;
|
||||
dev_class->identify = fake_device_stub_identify;
|
||||
|
||||
prints = make_fake_prints_gallery (device, 500);
|
||||
expected_matched = g_ptr_array_index (prints, g_random_int_range (0, 499));
|
||||
fp_print_set_description (expected_matched, "fake-verified");
|
||||
|
||||
match_data->gallery = prints;
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_GENERAL);
|
||||
fake_dev->ret_print = make_fake_print (device, NULL);
|
||||
fp_device_identify (device, prints, NULL,
|
||||
test_driver_match_cb, match_data, NULL,
|
||||
(GAsyncReadyCallback) test_driver_identify_cb, identify_data);
|
||||
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
|
||||
/* suspend_sync hangs until cancellation, so we need to trigger orig_identify
|
||||
* from the mainloop after calling suspend_sync.
|
||||
*/
|
||||
fpi_device_add_timeout (device, 0, (FpTimeoutFunc) orig_identify, NULL, NULL);
|
||||
|
||||
fake_dev->ret_suspend = fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED);
|
||||
fp_device_suspend_sync (device, NULL, &error);
|
||||
fake_dev->ret_error = NULL;
|
||||
|
||||
/* At this point we are done with everything */
|
||||
g_assert (fake_dev->last_called_function == orig_identify);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_NOT_SUPPORTED);
|
||||
g_clear_error (&error);
|
||||
|
||||
/* The device reported an error, an this error will be overwritten.
|
||||
*/
|
||||
g_assert_false (match_data->called);
|
||||
g_assert_true (identify_data->called);
|
||||
g_assert_null (identify_data->match);
|
||||
g_assert_error (identify_data->error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_BUSY);
|
||||
|
||||
fake_dev->last_called_function = NULL;
|
||||
fp_device_resume_sync (device, NULL, &error);
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
g_assert_no_error (error);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_identify_suspend_while_idle (void)
|
||||
{
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
FpiDeviceFake *fake_dev;
|
||||
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
/* Suspending and resuming a closed device works */
|
||||
fp_device_suspend (device, NULL, (GAsyncReadyCallback) fp_device_suspend_finish, &error);
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
g_assert_no_error (error);
|
||||
|
||||
fp_device_resume (device, NULL, (GAsyncReadyCallback) fp_device_resume_finish, NULL);
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
g_assert_no_error (error);
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
|
||||
fake_dev->last_called_function = NULL;
|
||||
fp_device_suspend (device, NULL, (GAsyncReadyCallback) fp_device_suspend_finish, &error);
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
g_assert_no_error (error);
|
||||
|
||||
fp_device_resume (device, NULL, (GAsyncReadyCallback) fp_device_resume_finish, NULL);
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
g_assert_no_error (error);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_identify_warmup_cooldown (void)
|
||||
{
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(MatchCbData) identify_data = g_new0 (MatchCbData, 1);
|
||||
g_autoptr(GPtrArray) prints = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
void (*orig_identify) (FpDevice *device);
|
||||
FpiDeviceFake *fake_dev;
|
||||
gint64 start_time;
|
||||
|
||||
dev_class->temp_hot_seconds = 2;
|
||||
dev_class->temp_cold_seconds = 5;
|
||||
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
orig_identify = dev_class->identify;
|
||||
dev_class->identify = fake_device_stub_identify;
|
||||
|
||||
prints = make_fake_prints_gallery (device, 500);
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
fake_dev->last_called_function = NULL;
|
||||
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_GENERAL);
|
||||
|
||||
/* Undefined: Whether match_cb is called. */
|
||||
fp_device_identify (device, prints, NULL,
|
||||
NULL, NULL, NULL,
|
||||
(GAsyncReadyCallback) test_driver_identify_cb, identify_data);
|
||||
|
||||
/* Identify is running, the temperature will change after only a short time.
|
||||
* Changes are delayed by 100ms and we give 150ms of slack for the test.
|
||||
*/
|
||||
start_time = g_get_monotonic_time ();
|
||||
g_assert_cmpint (fp_device_get_temperature (device), ==, FP_TEMPERATURE_COLD);
|
||||
while (fp_device_get_temperature (device) == FP_TEMPERATURE_COLD)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
g_assert_cmpint (fp_device_get_temperature (device), ==, FP_TEMPERATURE_WARM);
|
||||
g_assert_false (g_cancellable_is_cancelled (fpi_device_get_cancellable (device)));
|
||||
g_assert_cmpint (g_get_monotonic_time () - start_time, <, 0 + 250000);
|
||||
|
||||
/* we reach hot 2 seconds later */
|
||||
while (fp_device_get_temperature (device) == FP_TEMPERATURE_WARM)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
g_assert_cmpint (fp_device_get_temperature (device), ==, FP_TEMPERATURE_HOT);
|
||||
g_assert_true (g_cancellable_is_cancelled (fpi_device_get_cancellable (device)));
|
||||
g_assert_cmpint (g_get_monotonic_time () - start_time, <, 2000000 + 250000);
|
||||
|
||||
/* cancel vfunc will be called now */
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == dev_class->cancel);
|
||||
|
||||
orig_identify (device);
|
||||
fake_dev->ret_error = NULL;
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
g_assert_true (identify_data->called);
|
||||
g_assert_error (identify_data->error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_TOO_HOT);
|
||||
|
||||
/* Now, wait for it to cool down again;
|
||||
* WARM should be reached after about 2s
|
||||
* COLD after 5s but give it some more slack. */
|
||||
start_time = g_get_monotonic_time ();
|
||||
while (fp_device_get_temperature (device) == FP_TEMPERATURE_HOT)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
g_assert_cmpint (fp_device_get_temperature (device), ==, FP_TEMPERATURE_WARM);
|
||||
g_assert_cmpint (g_get_monotonic_time () - start_time, <, 2000000 + 250000);
|
||||
|
||||
while (fp_device_get_temperature (device) == FP_TEMPERATURE_WARM)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
g_assert_cmpint (fp_device_get_temperature (device), ==, FP_TEMPERATURE_COLD);
|
||||
g_assert_cmpint (g_get_monotonic_time () - start_time, <, 5000000 + 500000);
|
||||
}
|
||||
|
||||
static void
|
||||
fake_device_stub_capture (FpDevice *device)
|
||||
{
|
||||
@@ -2284,6 +2744,89 @@ test_driver_cancel_fail (void)
|
||||
g_assert_no_error (error);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_critical (void)
|
||||
{
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(GCancellable) cancellable = g_cancellable_new ();
|
||||
g_autoptr(FpPrint) enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
void (*orig_verify) (FpDevice *device) = dev_class->verify;
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
fake_dev->last_called_function = NULL;
|
||||
|
||||
dev_class->verify = fake_device_stub_verify;
|
||||
fp_device_verify (device, enrolled_print, cancellable,
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL);
|
||||
|
||||
/* We started a verify operation, now emulate a "critical" section */
|
||||
fpi_device_critical_enter (device);
|
||||
|
||||
/* Throw a suspend and external cancellation against it. */
|
||||
fp_device_suspend (device, NULL, NULL, NULL);
|
||||
g_cancellable_cancel (cancellable);
|
||||
|
||||
/* The only thing that happens is that the cancellable is cancelled */
|
||||
g_assert_true (fpi_device_action_is_cancelled (device));
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
|
||||
/* Leaving and entering the critical section in the same mainloop iteration
|
||||
* does not do anything. */
|
||||
fpi_device_critical_leave (device);
|
||||
fpi_device_critical_enter (device);
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
|
||||
/* Leaving it and running the mainloop will first run the cancel handler */
|
||||
fpi_device_critical_leave (device);
|
||||
while (g_main_context_iteration (NULL, FALSE) && !fake_dev->last_called_function)
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == dev_class->cancel);
|
||||
g_assert_true (fpi_device_action_is_cancelled (device));
|
||||
fake_dev->last_called_function = NULL;
|
||||
|
||||
/* Then the suspend handler */
|
||||
while (g_main_context_iteration (NULL, FALSE) && !fake_dev->last_called_function)
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == dev_class->suspend);
|
||||
fake_dev->last_called_function = NULL;
|
||||
|
||||
/* Nothing happens afterwards */
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
|
||||
|
||||
/* Throw a resume at the system */
|
||||
fpi_device_critical_enter (device);
|
||||
fp_device_resume (device, NULL, NULL, NULL);
|
||||
|
||||
/* Nothing will happen, as the resume is delayed */
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
|
||||
/* Finally the resume is called from the mainloop after leaving the critical section */
|
||||
fpi_device_critical_leave (device);
|
||||
g_assert (fake_dev->last_called_function == NULL);
|
||||
while (g_main_context_iteration (NULL, FALSE) && !fake_dev->last_called_function)
|
||||
continue;
|
||||
g_assert (fake_dev->last_called_function == dev_class->resume);
|
||||
fake_dev->last_called_function = NULL;
|
||||
|
||||
|
||||
/* The "verify" operation is still ongoing, finish it. */
|
||||
orig_verify (device);
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
continue;
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_current_action (void)
|
||||
{
|
||||
@@ -2350,32 +2893,32 @@ test_driver_action_get_cancellable_open (void)
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_action_get_cancellable_open_fail_vfunc (FpDevice *device)
|
||||
test_driver_action_get_cancellable_open_internal_vfunc (FpDevice *device)
|
||||
{
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
g_assert_cmpuint (fpi_device_get_current_action (device), ==, FPI_DEVICE_ACTION_OPEN);
|
||||
fake_dev->last_called_function = test_driver_action_get_cancellable_open_fail_vfunc;
|
||||
fake_dev->last_called_function = test_driver_action_get_cancellable_open_internal_vfunc;
|
||||
|
||||
g_assert_false (G_IS_CANCELLABLE (fpi_device_get_cancellable (device)));
|
||||
g_assert_true (G_IS_CANCELLABLE (fpi_device_get_cancellable (device)));
|
||||
|
||||
fpi_device_open_complete (device, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_action_get_cancellable_open_fail (void)
|
||||
test_driver_action_get_cancellable_open_internal (void)
|
||||
{
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
FpiDeviceFake *fake_dev;
|
||||
|
||||
dev_class->open = test_driver_action_get_cancellable_open_fail_vfunc;
|
||||
dev_class->open = test_driver_action_get_cancellable_open_internal_vfunc;
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
|
||||
g_assert (fake_dev->last_called_function == test_driver_action_get_cancellable_open_fail_vfunc);
|
||||
g_assert (fake_dev->last_called_function == test_driver_action_get_cancellable_open_internal_vfunc);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2400,7 +2943,11 @@ test_driver_action_is_cancelled_open_vfunc (FpDevice *device)
|
||||
g_assert_true (G_IS_CANCELLABLE (fpi_device_get_cancellable (device)));
|
||||
g_assert_false (fpi_device_action_is_cancelled (device));
|
||||
|
||||
g_cancellable_cancel (fpi_device_get_cancellable (device));
|
||||
if (fake_dev->ext_cancellable)
|
||||
g_cancellable_cancel (fake_dev->ext_cancellable);
|
||||
else
|
||||
g_cancellable_cancel (fpi_device_get_cancellable (device));
|
||||
|
||||
g_assert_true (fpi_device_action_is_cancelled (device));
|
||||
|
||||
fpi_device_open_complete (device, NULL);
|
||||
@@ -2419,13 +2966,34 @@ test_driver_action_is_cancelled_open (void)
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
cancellable = g_cancellable_new ();
|
||||
cancellable = fake_dev->ext_cancellable = g_cancellable_new ();
|
||||
g_assert_false (fp_device_open_sync (device, cancellable, &error));
|
||||
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
|
||||
|
||||
g_assert (fake_dev->last_called_function == test_driver_action_is_cancelled_open_vfunc);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_action_internally_cancelled_open (void)
|
||||
{
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(GCancellable) cancellable = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
FpiDeviceFake *fake_dev;
|
||||
|
||||
dev_class->open = test_driver_action_is_cancelled_open_vfunc;
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
/* No error, just some internal cancellation but we let nothing happen externally. */
|
||||
cancellable = g_cancellable_new ();
|
||||
g_assert_true (fp_device_open_sync (device, cancellable, &error));
|
||||
g_assert_null (error);
|
||||
|
||||
g_assert (fake_dev->last_called_function == test_driver_action_is_cancelled_open_vfunc);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_action_is_cancelled_error (void)
|
||||
{
|
||||
@@ -2859,6 +3427,13 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/driver/enroll/error", test_driver_enroll_error);
|
||||
g_test_add_func ("/driver/enroll/error/no_print", test_driver_enroll_error_no_print);
|
||||
g_test_add_func ("/driver/enroll/progress", test_driver_enroll_progress);
|
||||
g_test_add_func ("/driver/enroll/update_nbis", test_driver_enroll_update_nbis);
|
||||
g_test_add_func ("/driver/enroll/update_nbis_wrong_device",
|
||||
test_driver_enroll_update_nbis_wrong_device);
|
||||
g_test_add_func ("/driver/enroll/update_nbis_wrong_driver",
|
||||
test_driver_enroll_update_nbis_wrong_driver);
|
||||
g_test_add_func ("/driver/enroll/update_nbis_missing_feature",
|
||||
test_driver_enroll_update_nbis_missing_feature);
|
||||
g_test_add_func ("/driver/verify", test_driver_verify);
|
||||
g_test_add_func ("/driver/verify/fail", test_driver_verify_fail);
|
||||
g_test_add_func ("/driver/verify/retry", test_driver_verify_retry);
|
||||
@@ -2874,6 +3449,14 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/driver/identify/not_reported", test_driver_identify_not_reported);
|
||||
g_test_add_func ("/driver/identify/complete_retry", test_driver_identify_complete_retry);
|
||||
g_test_add_func ("/driver/identify/report_no_cb", test_driver_identify_report_no_callback);
|
||||
|
||||
g_test_add_func ("/driver/identify/suspend_continues", test_driver_identify_suspend_continues);
|
||||
g_test_add_func ("/driver/identify/suspend_succeeds", test_driver_identify_suspend_succeeds);
|
||||
g_test_add_func ("/driver/identify/suspend_busy_error", test_driver_identify_suspend_busy_error);
|
||||
g_test_add_func ("/driver/identify/suspend_while_idle", test_driver_identify_suspend_while_idle);
|
||||
|
||||
g_test_add_func ("/driver/identify/warmup_cooldown", test_driver_identify_warmup_cooldown);
|
||||
|
||||
g_test_add_func ("/driver/capture", test_driver_capture);
|
||||
g_test_add_func ("/driver/capture/not_supported", test_driver_capture_not_supported);
|
||||
g_test_add_func ("/driver/capture/error", test_driver_capture_error);
|
||||
@@ -2887,12 +3470,15 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/driver/cancel", test_driver_cancel);
|
||||
g_test_add_func ("/driver/cancel/fail", test_driver_cancel_fail);
|
||||
|
||||
g_test_add_func ("/driver/critical", test_driver_critical);
|
||||
|
||||
g_test_add_func ("/driver/get_current_action", test_driver_current_action);
|
||||
g_test_add_func ("/driver/get_current_action/open", test_driver_current_action_open);
|
||||
g_test_add_func ("/driver/get_cancellable/error", test_driver_action_get_cancellable_error);
|
||||
g_test_add_func ("/driver/get_cancellable/open", test_driver_action_get_cancellable_open);
|
||||
g_test_add_func ("/driver/get_cancellable/open/fail", test_driver_action_get_cancellable_open_fail);
|
||||
g_test_add_func ("/driver/get_cancellable/open/internal", test_driver_action_get_cancellable_open_internal);
|
||||
g_test_add_func ("/driver/action_is_cancelled/open", test_driver_action_is_cancelled_open);
|
||||
g_test_add_func ("/driver/action_is_cancelled/open/internal", test_driver_action_internally_cancelled_open);
|
||||
g_test_add_func ("/driver/action_is_cancelled/error", test_driver_action_is_cancelled_error);
|
||||
g_test_add_func ("/driver/complete_action/all/error", test_driver_complete_actions_errors);
|
||||
g_test_add_func ("/driver/action_error/error", test_driver_action_error_error);
|
||||
|
||||
@@ -18,7 +18,7 @@ try:
|
||||
if version < (0, 13, 2):
|
||||
print('umockdev is too old for test to be reliable, expect random failures!')
|
||||
print('Please update umockdev to at least 0.13.2.')
|
||||
pcap_supported = version >= (0, 16) or os.getenv('CI_PROJECT_NAME') == "libfprint"
|
||||
pcap_supported = version >= (0, 16, 3) or os.getenv('CI_PROJECT_NAME') == "libfprint"
|
||||
spi_supported = version >= (0, 16) or os.getenv('CI_PROJECT_NAME') == "libfprint"
|
||||
|
||||
except FileNotFoundError:
|
||||
|
||||
BIN
tests/upektc_img/capture.pcapng
Normal file
BIN
tests/upektc_img/capture.pcapng
Normal file
Binary file not shown.
BIN
tests/upektc_img/capture.png
Normal file
BIN
tests/upektc_img/capture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
319
tests/upektc_img/device
Normal file
319
tests/upektc_img/device
Normal file
@@ -0,0 +1,319 @@
|
||||
P: /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3
|
||||
N: bus/usb/001/003=12010101000000087E14162002000102000109022700010100A0320904000003FF000000070581024000000705020240000007058303040014
|
||||
E: DEVNAME=/dev/bus/usb/001/003
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=147e/2016/2
|
||||
E: TYPE=0/0/0
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=003
|
||||
E: MAJOR=189
|
||||
E: MINOR=2
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=UPEK
|
||||
E: ID_VENDOR_ENC=UPEK
|
||||
E: ID_VENDOR_ID=147e
|
||||
E: ID_MODEL=Biometric_Coprocessor
|
||||
E: ID_MODEL_ENC=Biometric\x20Coprocessor
|
||||
E: ID_MODEL_ID=2016
|
||||
E: ID_REVISION=0002
|
||||
E: ID_SERIAL=UPEK_Biometric_Coprocessor
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:ff0000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Upek
|
||||
E: ID_MODEL_FROM_DATABASE=Biometric Touchchip/Touchstrip Fingerprint Sensor
|
||||
E: ID_PATH=pci-0000:00:1a.0-usb-0:1.3
|
||||
E: ID_PATH_TAG=pci-0000_00_1a_0-usb-0_1_3
|
||||
E: LIBFPRINT_DRIVER=Upek TouchChip Fingerprint Coprocessor
|
||||
E: ID_FOR_SEAT=usb-pci-0000_00_1a_0-usb-0_1_3
|
||||
E: TAGS=:seat:
|
||||
E: CURRENT_TAGS=:seat:
|
||||
A: authorized=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
A: bDeviceClass=00\n
|
||||
A: bDeviceProtocol=00\n
|
||||
A: bDeviceSubClass=00\n
|
||||
A: bMaxPacketSize0=8\n
|
||||
A: bMaxPower=100mA\n
|
||||
A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=0002\n
|
||||
A: bmAttributes=a0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=12010101000000087E14162002000102000109022700010100A0320904000003FF000000070581024000000705020240000007058303040014
|
||||
A: dev=189:2\n
|
||||
A: devnum=3\n
|
||||
A: devpath=1.3\n
|
||||
L: driver=../../../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2d/device:2e/device:2f/device:32
|
||||
A: idProduct=2016\n
|
||||
A: idVendor=147e\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=UPEK\n
|
||||
A: maxchild=0\n
|
||||
L: port=../1-1:1.0/1-1-port3
|
||||
A: power/active_duration=757220\n
|
||||
A: power/async=enabled\n
|
||||
A: power/autosuspend=2\n
|
||||
A: power/autosuspend_delay_ms=2000\n
|
||||
A: power/connected_duration=857556\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/persist=1\n
|
||||
A: power/runtime_active_kids=0\n
|
||||
A: power/runtime_active_time=762579\n
|
||||
A: power/runtime_enabled=enabled\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=94791\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=Biometric Coprocessor\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=fixed\n
|
||||
A: rx_lanes=1\n
|
||||
A: speed=12\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=620\n
|
||||
A: version= 1.01\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1a.0/usb1/1-1
|
||||
N: bus/usb/001/002=12010002090001408780200000000000000109021900010100E0000904000001090000000705810301000C
|
||||
E: DEVNAME=/dev/bus/usb/001/002
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=8087/20/0
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=002
|
||||
E: MAJOR=189
|
||||
E: MINOR=1
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=8087
|
||||
E: ID_VENDOR_ENC=8087
|
||||
E: ID_VENDOR_ID=8087
|
||||
E: ID_MODEL=0020
|
||||
E: ID_MODEL_ENC=0020
|
||||
E: ID_MODEL_ID=0020
|
||||
E: ID_REVISION=0000
|
||||
E: ID_SERIAL=8087_0020
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:090000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Intel Corp.
|
||||
E: ID_MODEL_FROM_DATABASE=Integrated Rate Matching Hub
|
||||
E: ID_PATH=pci-0000:00:1a.0-usb-0:1
|
||||
E: ID_PATH_TAG=pci-0000_00_1a_0-usb-0_1
|
||||
E: ID_FOR_SEAT=usb-pci-0000_00_1a_0-usb-0_1
|
||||
E: TAGS=:seat:
|
||||
E: CURRENT_TAGS=:seat:
|
||||
A: authorized=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=0000\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001408780200000000000000109021900010100E0000904000001090000000705810301000C
|
||||
A: dev=189:1\n
|
||||
A: devnum=2\n
|
||||
A: devpath=1\n
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2d/device:2e/device:2f
|
||||
A: idProduct=0020\n
|
||||
A: idVendor=8087\n
|
||||
A: ltm_capable=no\n
|
||||
A: maxchild=6\n
|
||||
L: port=../1-0:1.0/usb1-port1
|
||||
A: power/active_duration=776368\n
|
||||
A: power/async=enabled\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=858060\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_kids=3\n
|
||||
A: power/runtime_active_time=779955\n
|
||||
A: power/runtime_enabled=enabled\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=77820\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: quirks=0x0\n
|
||||
A: removable=fixed\n
|
||||
A: rx_lanes=1\n
|
||||
A: speed=480\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=2620\n
|
||||
A: version= 2.00\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1a.0/usb1
|
||||
N: bus/usb/001/001=12010002090000406B1D020010050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/510
|
||||
E: TYPE=9/0/0
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.10.0-8-amd64_ehci_hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.10.0-8-amd64\x20ehci_hcd
|
||||
E: ID_VENDOR_ID=1d6b
|
||||
E: ID_MODEL=EHCI_Host_Controller
|
||||
E: ID_MODEL_ENC=EHCI\x20Host\x20Controller
|
||||
E: ID_MODEL_ID=0002
|
||||
E: ID_REVISION=0510
|
||||
E: ID_SERIAL=Linux_5.10.0-8-amd64_ehci_hcd_EHCI_Host_Controller_0000:00:1a.0
|
||||
E: ID_SERIAL_SHORT=0000:00:1a.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:1a.0
|
||||
E: ID_PATH_TAG=pci-0000_00_1a_0
|
||||
E: ID_FOR_SEAT=usb-pci-0000_00_1a_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=00\n
|
||||
A: bDeviceSubClass=00\n
|
||||
A: bMaxPacketSize0=64\n
|
||||
A: bMaxPower=0mA\n
|
||||
A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=0510\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002090000406B1D020010050302010109021900010100E0000904000001090000000705810304000C
|
||||
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:2d/device:2e
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.10.0-8-amd64 ehci_hcd\n
|
||||
A: maxchild=3\n
|
||||
A: power/active_duration=780512\n
|
||||
A: power/async=enabled\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=858228\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_kids=1\n
|
||||
A: power/runtime_active_time=780500\n
|
||||
A: power/runtime_enabled=enabled\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=77697\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=EHCI Host Controller\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=unknown\n
|
||||
A: rx_lanes=1\n
|
||||
A: serial=0000:00:1a.0\n
|
||||
A: speed=480\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=1071\n
|
||||
A: version= 2.00\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1a.0
|
||||
E: DRIVER=ehci-pci
|
||||
E: PCI_CLASS=C0320
|
||||
E: PCI_ID=8086:3B3C
|
||||
E: PCI_SUBSYS_ID=17AA:2163
|
||||
E: PCI_SLOT_NAME=0000:00:1a.0
|
||||
E: MODALIAS=pci:v00008086d00003B3Csv000017AAsd00002163bc0Csc03i20
|
||||
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=EHCI
|
||||
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
|
||||
E: ID_MODEL_FROM_DATABASE=5 Series/3400 Series Chipset USB2 Enhanced Host Controller
|
||||
A: ari_enabled=0\n
|
||||
A: broken_parity_status=0\n
|
||||
A: class=0x0c0320\n
|
||||
A: companion=
|
||||
H: config=86803C3B060190020620030C00000000008072F2000000000000000000000000000000000000000000000000AA1763210000000050000000000000000B040000000000000000000000000000000000000158C2C9000000000A98A020000000002020A7070000000001000001000008C00000DF3F0000000000000000000000000000800011890C13A000000000000000000000000000000013000603000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AAFF00000000000000000000000000000000000000000004F340BB0000000088858000870F060828171B30
|
||||
A: consistent_dma_mask_bits=32\n
|
||||
A: d3cold_allowed=1\n
|
||||
A: device=0x3b3c\n
|
||||
A: dma_mask_bits=32\n
|
||||
L: driver=../../../bus/pci/drivers/ehci-pci
|
||||
A: driver_override=(null)\n
|
||||
A: enable=1\n
|
||||
L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2d
|
||||
A: irq=23\n
|
||||
A: local_cpulist=0-3\n
|
||||
A: local_cpus=f\n
|
||||
A: modalias=pci:v00008086d00003B3Csv000017AAsd00002163bc0Csc03i20\n
|
||||
A: msi_bus=1\n
|
||||
A: numa_node=-1\n
|
||||
A: pools=poolinfo - 0.1\nehci_sitd 0 0 96 0\nehci_itd 0 0 192 0\nehci_qh 9 42 96 1\nehci_qtd 13 42 96 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\n
|
||||
A: power/async=enabled\n
|
||||
A: power/control=on\n
|
||||
A: power/runtime_active_kids=1\n
|
||||
A: power/runtime_active_time=859876\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: resource=0x00000000f2728000 0x00000000f27283ff 0x0000000000040200\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=0x06\n
|
||||
A: subsystem_device=0x2163\n
|
||||
A: subsystem_vendor=0x17aa\n
|
||||
A: uframe_periodic_max=100\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
BIN
tests/uru4000-4500/capture.pcapng
Normal file
BIN
tests/uru4000-4500/capture.pcapng
Normal file
Binary file not shown.
BIN
tests/uru4000-4500/capture.png
Normal file
BIN
tests/uru4000-4500/capture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
220
tests/uru4000-4500/device
Normal file
220
tests/uru4000-4500/device
Normal file
@@ -0,0 +1,220 @@
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1/1-10
|
||||
N: bus/usb/001/050=1201000200000040BA050A000301010203010902200001010080640904000002FFFFFF000705810340000807058202400000
|
||||
E: DEVNAME=/dev/bus/usb/001/050
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=5ba/a/103
|
||||
E: TYPE=0/0/0
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=050
|
||||
E: MAJOR=189
|
||||
E: MINOR=49
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=DigitalPersona__Inc.
|
||||
E: ID_VENDOR_ENC=DigitalPersona\x2c\x20Inc.
|
||||
E: ID_VENDOR_ID=05ba
|
||||
E: ID_MODEL=U.are.U®_4500_Fingerprint_Reader
|
||||
E: ID_MODEL_ENC=U.are.U®\x204500\x20Fingerprint\x20Reader
|
||||
E: ID_MODEL_ID=000a
|
||||
E: ID_REVISION=0103
|
||||
E: ID_SERIAL=DigitalPersona__Inc._U.are.U®_4500_Fingerprint_Reader__FB0B9071-2E08-7742-BC16-2FAA247CEF66_
|
||||
E: ID_SERIAL_SHORT=_FB0B9071-2E08-7742-BC16-2FAA247CEF66_
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:ffffff:
|
||||
E: ID_VENDOR_FROM_DATABASE=DigitalPersona, Inc.
|
||||
E: ID_AUTOSUSPEND=1
|
||||
E: ID_MODEL_FROM_DATABASE=Fingerprint Reader
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:10
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_10
|
||||
E: LIBFPRINT_DRIVER=Digital Persona U.are.U 4000/4000B/4500
|
||||
E: ID_FOR_SEAT=usb-pci-0000_00_14_0-usb-0_10
|
||||
E: TAGS=:seat:
|
||||
E: CURRENT_TAGS=:seat:
|
||||
A: authorized=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
A: bDeviceClass=00\n
|
||||
A: bDeviceProtocol=00\n
|
||||
A: bDeviceSubClass=00\n
|
||||
A: bMaxPacketSize0=64\n
|
||||
A: bMaxPower=200mA\n
|
||||
A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=0103\n
|
||||
A: bmAttributes=80\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=1201000200000040BA050A000301010203010902200001010080640904000002FFFFFF000705810340000807058202400000
|
||||
A: dev=189:49\n
|
||||
A: devnum=50\n
|
||||
A: devpath=10\n
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4c/device:4d/device:57
|
||||
A: idProduct=000a\n
|
||||
A: idVendor=05ba\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=DigitalPersona, Inc.\n
|
||||
A: maxchild=0\n
|
||||
L: port=../1-0:1.0/usb1-port10
|
||||
A: power/active_duration=2761\n
|
||||
A: power/autosuspend=2\n
|
||||
A: power/autosuspend_delay_ms=2000\n
|
||||
A: power/connected_duration=118841\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/persist=0\n
|
||||
A: power/runtime_active_time=2616\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=115982\n
|
||||
A: product=U.are.U\302\256 4500 Fingerprint Reader\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=removable\n
|
||||
A: rx_lanes=1\n
|
||||
A: serial={FB0B9071-2E08-7742-BC16-2FAA247CEF66}\n
|
||||
A: speed=12\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=13\n
|
||||
A: version= 2.00\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1
|
||||
N: bus/usb/001/001=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/513
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.13.12-200.fc34.x86_64_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.13.12-200.fc34.x86_64\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=0513
|
||||
E: ID_SERIAL=Linux_5.13.12-200.fc34.x86_64_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=0513\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
|
||||
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:4c/device:4d
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.13.12-200.fc34.x86_64 xhci-hcd\n
|
||||
A: maxchild=16\n
|
||||
A: power/active_duration=837797629\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=837797629\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_time=837797626\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=1498\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=17AA:312A
|
||||
E: PCI_SLOT_NAME=0000:00:14.0
|
||||
E: MODALIAS=pci:v00008086d0000A36Dsv000017AAsd0000312Abc0Csc03i30
|
||||
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=86806DA3060490021030030C00008000040032B1000000000000000000000000000000000000000000000000AA172A31000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F000000009A1CF40100000000316000000000000000000000000000000180C2C1080000000000000000000000059087009802E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F400200000100006000000008020000010000000400000090000000001800000005000000000000000300000C0000004000000080000000030000000000000000000000000000000000000000000000B50F110112000000
|
||||
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:4c
|
||||
A: index=3\n
|
||||
A: irq=125\n
|
||||
A: label=Onboard - Other\n
|
||||
A: local_cpulist=0-5\n
|
||||
A: local_cpus=3f\n
|
||||
A: modalias=pci:v00008086d0000A36Dsv000017AAsd0000312Abc0Csc03i30\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 15 20 2112 20\nxHCI ring segments 46 76 4096 76\nbuffer-2048 0 32 2048 16\nbuffer-512 0 32 512 4\nbuffer-128 3 32 128 1\nbuffer-32 0 128 32 1\n
|
||||
A: power/control=on\n
|
||||
A: power/runtime_active_time=837797789\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=67\n
|
||||
A: power/wakeup_count=0\n
|
||||
A: power/wakeup_expire_count=67\n
|
||||
A: power/wakeup_last_time_ms=835747082\n
|
||||
A: power/wakeup_max_time_ms=108\n
|
||||
A: power/wakeup_total_time_ms=6974\n
|
||||
A: power_state=D0\n
|
||||
A: resource=0x00000000b1320000 0x00000000b132ffff 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=0x312a\n
|
||||
A: subsystem_vendor=0x17aa\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
BIN
tests/uru4000-msv2/capture.pcapng
Normal file
BIN
tests/uru4000-msv2/capture.pcapng
Normal file
Binary file not shown.
BIN
tests/uru4000-msv2/capture.png
Normal file
BIN
tests/uru4000-msv2/capture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 106 KiB |
220
tests/uru4000-msv2/device
Normal file
220
tests/uru4000-msv2/device
Normal file
@@ -0,0 +1,220 @@
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1/1-10
|
||||
N: bus/usb/001/047=12010002000000405E04CA000001010203010902200001010080820904000002FFFFFF000705810340000807058202400000
|
||||
E: DEVNAME=/dev/bus/usb/001/047
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=45e/ca/100
|
||||
E: TYPE=0/0/0
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=047
|
||||
E: MAJOR=189
|
||||
E: MINOR=46
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Microsoft
|
||||
E: ID_VENDOR_ENC=Microsoft
|
||||
E: ID_VENDOR_ID=045e
|
||||
E: ID_MODEL=Microsoft®_Fingerprint_Reader
|
||||
E: ID_MODEL_ENC=Microsoft®\x20Fingerprint\x20Reader
|
||||
E: ID_MODEL_ID=00ca
|
||||
E: ID_REVISION=0100
|
||||
E: ID_SERIAL=Microsoft_Microsoft®_Fingerprint_Reader__BE815DAD-15E4-0745-AA30-41DEBCAC5913_
|
||||
E: ID_SERIAL_SHORT=_BE815DAD-15E4-0745-AA30-41DEBCAC5913_
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:ffffff:
|
||||
E: ID_VENDOR_FROM_DATABASE=Microsoft Corp.
|
||||
E: ID_AUTOSUSPEND=1
|
||||
E: ID_MODEL_FROM_DATABASE=Fingerprint Reader
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:10
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_10
|
||||
E: LIBFPRINT_DRIVER=Digital Persona U.are.U 4000/4000B/4500
|
||||
E: ID_FOR_SEAT=usb-pci-0000_00_14_0-usb-0_10
|
||||
E: TAGS=:seat:
|
||||
E: CURRENT_TAGS=:seat:
|
||||
A: authorized=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
A: bDeviceClass=00\n
|
||||
A: bDeviceProtocol=00\n
|
||||
A: bDeviceSubClass=00\n
|
||||
A: bMaxPacketSize0=64\n
|
||||
A: bMaxPower=260mA\n
|
||||
A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=0100\n
|
||||
A: bmAttributes=80\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002000000405E04CA000001010203010902200001010080820904000002FFFFFF000705810340000807058202400000
|
||||
A: dev=189:46\n
|
||||
A: devnum=47\n
|
||||
A: devpath=10\n
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4c/device:4d/device:57
|
||||
A: idProduct=00ca\n
|
||||
A: idVendor=045e\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Microsoft\n
|
||||
A: maxchild=0\n
|
||||
L: port=../1-0:1.0/usb1-port10
|
||||
A: power/active_duration=31642\n
|
||||
A: power/autosuspend=2\n
|
||||
A: power/autosuspend_delay_ms=2000\n
|
||||
A: power/connected_duration=1177852\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/persist=0\n
|
||||
A: power/runtime_active_time=31877\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=1145731\n
|
||||
A: product=Microsoft\302\256 Fingerprint Reader\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=removable\n
|
||||
A: rx_lanes=1\n
|
||||
A: serial={BE815DAD-15E4-0745-AA30-41DEBCAC5913}\n
|
||||
A: speed=12\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=183\n
|
||||
A: version= 2.00\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1
|
||||
N: bus/usb/001/001=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/513
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.13.12-200.fc34.x86_64_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.13.12-200.fc34.x86_64\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=0513
|
||||
E: ID_SERIAL=Linux_5.13.12-200.fc34.x86_64_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=0513\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
|
||||
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:4c/device:4d
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.13.12-200.fc34.x86_64 xhci-hcd\n
|
||||
A: maxchild=16\n
|
||||
A: power/active_duration=775798957\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=775798957\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_time=775798954\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=1381\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=17AA:312A
|
||||
E: PCI_SLOT_NAME=0000:00:14.0
|
||||
E: MODALIAS=pci:v00008086d0000A36Dsv000017AAsd0000312Abc0Csc03i30
|
||||
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=86806DA3060490021030030C00008000040032B1000000000000000000000000000000000000000000000000AA172A31000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F00000000970B083900000000316000000000000000000000000000000180C2C1080000000000000000000000059087009802E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F400200000100006000000008020000010000000400000090000000001800000005000000000000000300000C0000004000000080000000030000000000000000000000000000000000000000000000B50F110112000000
|
||||
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:4c
|
||||
A: index=3\n
|
||||
A: irq=125\n
|
||||
A: label=Onboard - Other\n
|
||||
A: local_cpulist=0-5\n
|
||||
A: local_cpus=3f\n
|
||||
A: modalias=pci:v00008086d0000A36Dsv000017AAsd0000312Abc0Csc03i30\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 15 20 2112 20\nxHCI ring segments 46 76 4096 76\nbuffer-2048 0 32 2048 16\nbuffer-512 0 32 512 4\nbuffer-128 3 32 128 1\nbuffer-32 0 128 32 1\n
|
||||
A: power/control=on\n
|
||||
A: power/runtime_active_time=775799103\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=61\n
|
||||
A: power/wakeup_count=0\n
|
||||
A: power/wakeup_expire_count=61\n
|
||||
A: power/wakeup_last_time_ms=773160682\n
|
||||
A: power/wakeup_max_time_ms=108\n
|
||||
A: power/wakeup_total_time_ms=6358\n
|
||||
A: power_state=D0\n
|
||||
A: resource=0x00000000b1320000 0x00000000b132ffff 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=0x312a\n
|
||||
A: subsystem_vendor=0x17aa\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
@@ -81,3 +81,145 @@ A: speed=12
|
||||
A: tx_lanes=1
|
||||
A: urbnum=8
|
||||
A: version= 1.10
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1
|
||||
N: bus/usb/001/001=12010002090001406B1D020011050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/511
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.11.2-arch1-1_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.11.2-arch1-1\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=0511
|
||||
E: ID_SERIAL=Linux_5.11.2-arch1-1_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=0511\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020011050302010109021900010100E0000904000001090000000705810304000C
|
||||
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:4c/device:4d
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.11.2-arch1-1 xhci-hcd\n
|
||||
A: maxchild=16\n
|
||||
A: power/active_duration=3289930\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=34389654\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_time=3289845\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=31099805\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=2355\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:A12F
|
||||
E: PCI_SUBSYS_ID=1028:07BE
|
||||
E: PCI_SLOT_NAME=0000:00:14.0
|
||||
E: MODALIAS=pci:v00008086d0000A12Fsv00001028sd000007BEbc0Csc03i30
|
||||
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=100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller
|
||||
A: ari_enabled=0\n
|
||||
A: broken_parity_status=0\n
|
||||
A: class=0x0c0330\n
|
||||
H: config=86802FA1060490023130030C000080000400D1ED0000000000000000000000000000000000000000000000002810BE07000000007000000000000000FF010000
|
||||
A: consistent_dma_mask_bits=64\n
|
||||
A: d3cold_allowed=1\n
|
||||
A: device=0xa12f\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:4c
|
||||
L: iommu=../../virtual/iommu/dmar1
|
||||
L: iommu_group=../../../kernel/iommu_groups/4
|
||||
A: irq=143\n
|
||||
A: local_cpulist=0-7\n
|
||||
A: local_cpus=ff\n
|
||||
A: modalias=pci:v00008086d0000A12Fsv00001028sd000007BEbc0Csc03i30\n
|
||||
A: msi_bus=1\n
|
||||
A: msi_irqs/143=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 7 10 2112 10\nxHCI ring segments 30 38 4096 38\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0\n
|
||||
A: power/control=on\n
|
||||
A: power/runtime_active_time=34390988\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=0x00000000edd10000 0x00000000edd1ffff 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=0x31\n
|
||||
A: subsystem_device=0x07be\n
|
||||
A: subsystem_vendor=0x1028\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
|
||||
@@ -78,3 +78,145 @@ A: speed=12
|
||||
A: tx_lanes=1
|
||||
A: urbnum=7
|
||||
A: version= 1.10
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb2
|
||||
N: bus/usb/002/001=12010002090001406B1D020011050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/002/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/511
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=002
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.11.2-arch1-1_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.11.2-arch1-1\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=0511
|
||||
E: ID_SERIAL=Linux_5.11.2-arch1-1_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=0511\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020011050302010109021900010100E0000904000001090000000705810304000C
|
||||
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:4c/device:4d
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.11.2-arch1-1 xhci-hcd\n
|
||||
A: maxchild=16\n
|
||||
A: power/active_duration=3289930\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=34389654\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_time=3289845\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=31099805\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=2355\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:A12F
|
||||
E: PCI_SUBSYS_ID=1028:07BE
|
||||
E: PCI_SLOT_NAME=0000:00:14.0
|
||||
E: MODALIAS=pci:v00008086d0000A12Fsv00001028sd000007BEbc0Csc03i30
|
||||
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=100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller
|
||||
A: ari_enabled=0\n
|
||||
A: broken_parity_status=0\n
|
||||
A: class=0x0c0330\n
|
||||
H: config=86802FA1060490023130030C000080000400D1ED0000000000000000000000000000000000000000000000002810BE07000000007000000000000000FF010000
|
||||
A: consistent_dma_mask_bits=64\n
|
||||
A: d3cold_allowed=1\n
|
||||
A: device=0xa12f\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:4c
|
||||
L: iommu=../../virtual/iommu/dmar1
|
||||
L: iommu_group=../../../kernel/iommu_groups/4
|
||||
A: irq=143\n
|
||||
A: local_cpulist=0-7\n
|
||||
A: local_cpus=ff\n
|
||||
A: modalias=pci:v00008086d0000A12Fsv00001028sd000007BEbc0Csc03i30\n
|
||||
A: msi_bus=1\n
|
||||
A: msi_irqs/143=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 7 10 2112 10\nxHCI ring segments 30 38 4096 38\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0\n
|
||||
A: power/control=on\n
|
||||
A: power/runtime_active_time=34390988\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=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=0x00000000edd10000 0x00000000edd1ffff 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=0x31\n
|
||||
A: subsystem_device=0x07be\n
|
||||
A: subsystem_vendor=0x1028\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ class VirtualDeviceBase(unittest.TestCase):
|
||||
else:
|
||||
self.assertFalse(match)
|
||||
|
||||
if isinstance(scan_nick, str):
|
||||
if isinstance(scan_nick, str) and not self.dev.has_storage():
|
||||
self.assertEqual(self._verify_fp.props.fpi_data.get_string(), scan_nick)
|
||||
|
||||
|
||||
@@ -470,15 +470,8 @@ class VirtualDevice(VirtualDeviceBase):
|
||||
def test_enroll_verify_no_match(self):
|
||||
matching = self.enroll_print('testprint', FPrint.Finger.LEFT_RING)
|
||||
|
||||
if self.dev.has_storage():
|
||||
with self.assertRaises(GLib.Error) as error:
|
||||
self.check_verify(matching, 'not-testprint', match=False,
|
||||
identify=self.dev.supports_identify())
|
||||
self.assertTrue(error.exception.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.DATA_NOT_FOUND))
|
||||
else:
|
||||
self.check_verify(matching, 'not-testprint', match=False,
|
||||
identify=self.dev.supports_identify())
|
||||
self.check_verify(matching, 'not-testprint', match=False,
|
||||
identify=self.dev.supports_identify())
|
||||
|
||||
def test_enroll_verify_error(self):
|
||||
matching = self.enroll_print('testprint', FPrint.Finger.LEFT_RING)
|
||||
@@ -597,14 +590,11 @@ class VirtualDevice(VirtualDeviceBase):
|
||||
FPrint.DeviceRetry.TOO_SHORT))
|
||||
|
||||
self.send_command('SCAN', 'another-id')
|
||||
verify_match, verify_fp = self.dev.verify_sync(enrolled)
|
||||
self.assertFalse(verify_match)
|
||||
if self.dev.has_storage():
|
||||
with self.assertRaises(GLib.GError) as error:
|
||||
self.dev.verify_sync(enrolled)
|
||||
self.assertTrue(error.exception.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.DATA_NOT_FOUND))
|
||||
self.assertIsNone(verify_fp)
|
||||
else:
|
||||
verify_match, verify_fp = self.dev.verify_sync(enrolled)
|
||||
self.assertFalse(verify_match)
|
||||
self.assertFalse(verify_fp.equal(enrolled))
|
||||
|
||||
self.send_auto(enrolled)
|
||||
@@ -821,13 +811,7 @@ class VirtualDevice(VirtualDeviceBase):
|
||||
self.wait_timeout(10)
|
||||
self.assertFalse(self._verify_completed)
|
||||
|
||||
if self.dev.has_storage():
|
||||
with self.assertRaises(GLib.Error) as error:
|
||||
self.complete_verify()
|
||||
self.assertTrue(error.exception.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.DATA_NOT_FOUND))
|
||||
else:
|
||||
self.complete_verify()
|
||||
self.complete_verify()
|
||||
self.assertTrue(self._verify_reported)
|
||||
|
||||
def test_close_error(self):
|
||||
@@ -1159,18 +1143,12 @@ class VirtualDeviceStorage(VirtualDevice):
|
||||
FPrint.DeviceError.DATA_NOT_FOUND))
|
||||
|
||||
def test_verify_missing_print(self):
|
||||
with self.assertRaises(GLib.Error) as error:
|
||||
self.check_verify(FPrint.Print.new(self.dev),
|
||||
'not-existing-print', False, identify=False)
|
||||
self.assertTrue(error.exception.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.DATA_NOT_FOUND))
|
||||
self.check_verify(FPrint.Print.new(self.dev),
|
||||
'not-existing-print', False, identify=False)
|
||||
|
||||
def test_identify_missing_print(self):
|
||||
with self.assertRaises(GLib.Error) as error:
|
||||
self.check_verify(FPrint.Print.new(self.dev),
|
||||
'not-existing-print', False, identify=True)
|
||||
self.assertTrue(error.exception.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.DATA_NOT_FOUND))
|
||||
self.check_verify(FPrint.Print.new(self.dev),
|
||||
'not-existing-print', False, identify=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -136,6 +136,7 @@ class VirtualImage(unittest.TestCase):
|
||||
self.assertTrue(self.dev.has_feature(FPrint.DeviceFeature.CAPTURE))
|
||||
self.assertTrue(self.dev.has_feature(FPrint.DeviceFeature.IDENTIFY))
|
||||
self.assertTrue(self.dev.has_feature(FPrint.DeviceFeature.VERIFY))
|
||||
self.assertTrue(self.dev.has_feature(FPrint.DeviceFeature.UPDATE_PRINT))
|
||||
self.assertFalse(self.dev.has_feature(FPrint.DeviceFeature.DUPLICATES_CHECK))
|
||||
self.assertFalse(self.dev.has_feature(FPrint.DeviceFeature.STORAGE))
|
||||
self.assertFalse(self.dev.has_feature(FPrint.DeviceFeature.STORAGE_LIST))
|
||||
@@ -144,7 +145,8 @@ class VirtualImage(unittest.TestCase):
|
||||
self.assertEqual(self.dev.get_features(),
|
||||
FPrint.DeviceFeature.CAPTURE |
|
||||
FPrint.DeviceFeature.IDENTIFY |
|
||||
FPrint.DeviceFeature.VERIFY)
|
||||
FPrint.DeviceFeature.VERIFY |
|
||||
FPrint.DeviceFeature.UPDATE_PRINT)
|
||||
|
||||
def test_capture_prevents_close(self):
|
||||
cancel = Gio.Cancellable()
|
||||
@@ -167,7 +169,7 @@ class VirtualImage(unittest.TestCase):
|
||||
while not self._cancelled:
|
||||
ctx.iteration(True)
|
||||
|
||||
def enroll_print(self, image):
|
||||
def enroll_print(self, image, template=None):
|
||||
self._step = 0
|
||||
self._enrolled = None
|
||||
|
||||
@@ -181,14 +183,15 @@ class VirtualImage(unittest.TestCase):
|
||||
self.assertEqual(self.dev.get_finger_status(), FPrint.FingerStatusFlags.NONE)
|
||||
self._enrolled = fp
|
||||
|
||||
template = FPrint.Print.new(self.dev)
|
||||
template.props.finger = FPrint.Finger.LEFT_THUMB
|
||||
template.props.username = "testuser"
|
||||
template.props.description = "test print"
|
||||
datetime = GLib.DateTime.new_now_local()
|
||||
date = GLib.Date()
|
||||
date.set_dmy(*datetime.get_ymd()[::-1])
|
||||
template.props.enroll_date = date
|
||||
if template is None:
|
||||
template = FPrint.Print.new(self.dev)
|
||||
template.props.finger = FPrint.Finger.LEFT_THUMB
|
||||
template.props.username = "testuser"
|
||||
template.props.description = "test print"
|
||||
datetime = GLib.DateTime.new_now_local()
|
||||
date = GLib.Date()
|
||||
date.set_dmy(*datetime.get_ymd()[::-1])
|
||||
template.props.enroll_date = date
|
||||
self.assertEqual(self.dev.get_finger_status(), FPrint.FingerStatusFlags.NONE)
|
||||
self.dev.enroll(template, None, progress_cb, tuple(), done_cb)
|
||||
|
||||
@@ -264,6 +267,28 @@ class VirtualImage(unittest.TestCase):
|
||||
ctx.iteration(True)
|
||||
assert(not self._verify_match)
|
||||
|
||||
# Test fingerprint updates
|
||||
# Enroll a second print
|
||||
fp_whorl_tended_arch = self.enroll_print('tented_arch', fp_whorl)
|
||||
|
||||
# Make sure the first print verifies successfully after the update
|
||||
self._verify_match = None
|
||||
self._verify_fp = None
|
||||
self.dev.verify(fp_whorl_tended_arch, callback=verify_cb)
|
||||
self.send_image('whorl')
|
||||
while self._verify_match is None:
|
||||
ctx.iteration(True)
|
||||
assert(self._verify_match)
|
||||
|
||||
# Make sure the second print verifies successfully after the update
|
||||
self._verify_match = None
|
||||
self._verify_fp = None
|
||||
self.dev.verify(fp_whorl_tended_arch, callback=verify_cb)
|
||||
self.send_image('tented_arch')
|
||||
while self._verify_match is None:
|
||||
ctx.iteration(True)
|
||||
assert(self._verify_match)
|
||||
|
||||
# Test verify error cases
|
||||
self._verify_fp = None
|
||||
self._verify_error = None
|
||||
|
||||
Reference in New Issue
Block a user