[fprint] Compiling on OpenBSD, VFS5011 (TP Carbon X1) working

Kristaps Dzonsons kristaps at bsd.lv
Thu Dec 29 17:56:45 UTC 2016


Hi,

Enclosed are two patches required for OpenBSD6.0 and current libfprint.

The first is just for missing errno values.  (FreeBSD is also patched at
least for the ETIME.)  These are directly from the OpenBSD port of the
system: not my work.

The second is to get my TP Carbon X1 3rd generation (VFS5011) working.
The USB reset function was always failing due to not being supported.

With these patches, I'm able to use my Carbon's fingerprint reader using
the example utilities.

Best,

Kristaps
-------------- next part --------------
diff --git a/libfprint/fp_internal.h b/libfprint/fp_internal.h
index e309ea9..7e5184e 100644
--- a/libfprint/fp_internal.h
+++ b/libfprint/fp_internal.h
@@ -99,6 +99,23 @@ enum fp_dev_state {
 
 struct fp_driver **fprint_get_drivers (void);
 
+/*
+ * These errno(3) values aren't defined on OpenBSD, and two aren't on
+ * FreeBSD.
+ */
+
+#if !defined(ENODATA) && defined(ENOENT)
+#define ENODATA ENOENT
+#endif
+
+#if !defined(EPROTO) && defined(ENOPROTOOPT)
+#define EPROTO ENOPROTOOPT
+#endif
+
+#if !defined(ETIME) && defined(ETIMEDOUT)
+#define ETIME ETIMEDOUT
+#endif
+
 struct fp_dev {
 	struct fp_driver *drv;
 	libusb_device_handle *udev;
-------------- next part --------------
diff --git a/libfprint/drivers/vfs5011.c b/libfprint/drivers/vfs5011.c
index 90947d3..725f72f 100644
--- a/libfprint/drivers/vfs5011.c
+++ b/libfprint/drivers/vfs5011.c
@@ -809,10 +809,11 @@ static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
 	dev->priv = data;
 
 	r = libusb_reset_device(dev->udev);
-	if (r != 0) {
+	if (r != 0 && LIBUSB_ERROR_NOT_SUPPORTED != r) {
 		fp_err("Failed to reset the device");
 		return r;
-	}
+	} else if (LIBUSB_ERROR_NOT_SUPPORTED == r)
+		fp_dbg("Resetting of device not supported");
 
 	r = libusb_claim_interface(dev->udev, 0);
 	if (r != 0) {


More information about the fprint mailing list