From 13bfe7a65c3c4f683d093fdc073320416a42e74d Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 28 Sep 2018 13:46:52 +0200 Subject: [PATCH] lib: Move driver definitions to fpi-core.h --- libfprint/drivers_api.h | 57 ----------------------------------------- libfprint/fpi-core.h | 56 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 58 deletions(-) diff --git a/libfprint/drivers_api.h b/libfprint/drivers_api.h index 9dd29fc..84b7a68 100644 --- a/libfprint/drivers_api.h +++ b/libfprint/drivers_api.h @@ -22,11 +22,6 @@ #define __DRIVERS_API_H__ #include -#include -#include -#include -#include -#include #include "fprint.h" #include "fpi-log.h" @@ -41,56 +36,4 @@ #include "fpi-assembling.h" #include "drivers/driver_ids.h" -struct usb_id { - uint16_t vendor; - uint16_t product; - unsigned long driver_data; -}; - -enum fp_driver_type { - DRIVER_PRIMITIVE = 0, - DRIVER_IMAGING = 1, -}; - -struct fp_driver { - const uint16_t id; - const char *name; - const char *full_name; - const struct usb_id * const id_table; - enum fp_driver_type type; - enum fp_scan_type scan_type; - - /* Device operations */ - int (*discover)(struct libusb_device_descriptor *dsc, uint32_t *devtype); - int (*open)(struct fp_dev *dev, unsigned long driver_data); - void (*close)(struct fp_dev *dev); - int (*enroll_start)(struct fp_dev *dev); - int (*enroll_stop)(struct fp_dev *dev); - int (*verify_start)(struct fp_dev *dev); - int (*verify_stop)(struct fp_dev *dev, gboolean iterating); - int (*identify_start)(struct fp_dev *dev); - int (*identify_stop)(struct fp_dev *dev, gboolean iterating); - int (*capture_start)(struct fp_dev *dev); - int (*capture_stop)(struct fp_dev *dev); -}; - -/* flags for fp_img_driver.flags */ -#define FP_IMGDRV_SUPPORTS_UNCONDITIONAL_CAPTURE (1 << 0) - -struct fp_img_driver { - struct fp_driver driver; - uint16_t flags; - int img_width; - int img_height; - int bz3_threshold; - - /* Device operations */ - int (*open)(struct fp_img_dev *dev, unsigned long driver_data); - void (*close)(struct fp_img_dev *dev); - int (*activate)(struct fp_img_dev *dev, enum fp_imgdev_state state); - int (*change_state)(struct fp_img_dev *dev, enum fp_imgdev_state state); - void (*deactivate)(struct fp_img_dev *dev); -}; - #endif - diff --git a/libfprint/fpi-core.h b/libfprint/fpi-core.h index f350d46..cbc2255 100644 --- a/libfprint/fpi-core.h +++ b/libfprint/fpi-core.h @@ -17,6 +17,60 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#ifndef __FPI_CORE_H__ +#define __FPI_CORE_H__ + #include +struct usb_id { + uint16_t vendor; + uint16_t product; + unsigned long driver_data; +}; + +enum fp_driver_type { + DRIVER_PRIMITIVE = 0, + DRIVER_IMAGING = 1, +}; + +struct fp_driver { + const uint16_t id; + const char *name; + const char *full_name; + const struct usb_id * const id_table; + enum fp_driver_type type; + enum fp_scan_type scan_type; + + /* Device operations */ + int (*discover)(struct libusb_device_descriptor *dsc, uint32_t *devtype); + int (*open)(struct fp_dev *dev, unsigned long driver_data); + void (*close)(struct fp_dev *dev); + int (*enroll_start)(struct fp_dev *dev); + int (*enroll_stop)(struct fp_dev *dev); + int (*verify_start)(struct fp_dev *dev); + int (*verify_stop)(struct fp_dev *dev, gboolean iterating); + int (*identify_start)(struct fp_dev *dev); + int (*identify_stop)(struct fp_dev *dev, gboolean iterating); + int (*capture_start)(struct fp_dev *dev); + int (*capture_stop)(struct fp_dev *dev); +}; + +/* flags for fp_img_driver.flags */ +#define FP_IMGDRV_SUPPORTS_UNCONDITIONAL_CAPTURE (1 << 0) + +struct fp_img_driver { + struct fp_driver driver; + uint16_t flags; + int img_width; + int img_height; + int bz3_threshold; + + /* Device operations */ + int (*open)(struct fp_img_dev *dev, unsigned long driver_data); + void (*close)(struct fp_img_dev *dev); + int (*activate)(struct fp_img_dev *dev, enum fp_imgdev_state state); + int (*change_state)(struct fp_img_dev *dev, enum fp_imgdev_state state); + void (*deactivate)(struct fp_img_dev *dev); +}; + +#endif