lib: add AES1660 driver

https://bugs.freedesktop.org/show_bug.cgi?id=57426
This commit is contained in:
Vasily Khoruzhick 2012-11-25 20:50:11 +03:00 committed by Bastien Nocera
parent c1da647aed
commit 313bfede77
7 changed files with 2143 additions and 1 deletions

View file

@ -23,7 +23,7 @@ AC_SUBST(lt_major)
AC_SUBST(lt_revision) AC_SUBST(lt_revision)
AC_SUBST(lt_age) AC_SUBST(lt_age)
all_drivers="upeke2 upekts upektc upeksonly vcom5s uru4000 fdu2000 aes1610 aes2501 aes2550 aes4000 vfs101 vfs301" all_drivers="upeke2 upekts upektc upeksonly vcom5s uru4000 fdu2000 aes1610 aes1660 aes2501 aes2550 aes4000 vfs101 vfs301"
require_imaging='no' require_imaging='no'
require_aeslib='no' require_aeslib='no'
@ -35,6 +35,7 @@ enable_vcom5s='no'
enable_uru4000='no' enable_uru4000='no'
enable_fdu2000='no' enable_fdu2000='no'
enable_aes1610='no' enable_aes1610='no'
enable_aes1660='no'
enable_aes2501='no' enable_aes2501='no'
enable_aes2550='no' enable_aes2550='no'
enable_aes4000='no' enable_aes4000='no'
@ -92,6 +93,12 @@ for driver in `echo ${drivers} | sed -e 's/,/ /g' -e 's/,$//g'`; do
require_aeslib="yes" require_aeslib="yes"
enable_aes1610="yes" enable_aes1610="yes"
;; ;;
aes1660)
AC_DEFINE([ENABLE_AES1660], [], [Build AuthenTec AES1660 driver])
require_aeslib="yes"
require_aesX660="yes"
enable_aes1660="yes"
;;
aes4000) aes4000)
AC_DEFINE([ENABLE_AES4000], [], [Build AuthenTec AES4000 driver]) AC_DEFINE([ENABLE_AES4000], [], [Build AuthenTec AES4000 driver])
require_aeslib="yes" require_aeslib="yes"
@ -117,6 +124,7 @@ AM_CONDITIONAL([ENABLE_VCOM5S], [test "$enable_vcom5s" = "yes"])
AM_CONDITIONAL([ENABLE_URU4000], [test "$enable_uru4000" = "yes"]) AM_CONDITIONAL([ENABLE_URU4000], [test "$enable_uru4000" = "yes"])
AM_CONDITIONAL([ENABLE_FDU2000], [test "$enable_fdu2000" = "yes"]) AM_CONDITIONAL([ENABLE_FDU2000], [test "$enable_fdu2000" = "yes"])
AM_CONDITIONAL([ENABLE_AES1610], [test "$enable_aes1610" = "yes"]) AM_CONDITIONAL([ENABLE_AES1610], [test "$enable_aes1610" = "yes"])
AM_CONDITIONAL([ENABLE_AES1660], [test "$enable_aes1660" = "yes"])
AM_CONDITIONAL([ENABLE_AES2501], [test "$enable_aes2501" = "yes"]) AM_CONDITIONAL([ENABLE_AES2501], [test "$enable_aes2501" = "yes"])
AM_CONDITIONAL([ENABLE_AES2550], [test "$enable_aes2550" = "yes"]) AM_CONDITIONAL([ENABLE_AES2550], [test "$enable_aes2550" = "yes"])
AM_CONDITIONAL([ENABLE_AES4000], [test "$enable_aes4000" = "yes"]) AM_CONDITIONAL([ENABLE_AES4000], [test "$enable_aes4000" = "yes"])
@ -296,6 +304,11 @@ if test x$enable_aes1610 != xno ; then
else else
AC_MSG_NOTICE([ aes1610 driver disabled]) AC_MSG_NOTICE([ aes1610 driver disabled])
fi fi
if test x$enable_aes1660 != xno ; then
AC_MSG_NOTICE([** aes1660 driver enabled])
else
AC_MSG_NOTICE([ aes1660 driver disabled])
fi
if test x$enable_aes2501 != xno ; then if test x$enable_aes2501 != xno ; then
AC_MSG_NOTICE([** aes2501 driver enabled]) AC_MSG_NOTICE([** aes2501 driver enabled])
else else

View file

@ -8,6 +8,7 @@ UPEKTC_SRC = drivers/upektc.c
UPEKSONLY_SRC = drivers/upeksonly.c UPEKSONLY_SRC = drivers/upeksonly.c
URU4000_SRC = drivers/uru4000.c URU4000_SRC = drivers/uru4000.c
AES1610_SRC = drivers/aes1610.c AES1610_SRC = drivers/aes1610.c
AES1660_SRC = drivers/aes1660.c drivers/aes1660.h
AES2501_SRC = drivers/aes2501.c drivers/aes2501.h AES2501_SRC = drivers/aes2501.c drivers/aes2501.h
AES2550_SRC = drivers/aes2550.c drivers/aes2550.h AES2550_SRC = drivers/aes2550.c drivers/aes2550.h
AES4000_SRC = drivers/aes4000.c AES4000_SRC = drivers/aes4000.c
@ -23,6 +24,7 @@ EXTRA_DIST = \
$(UPEKSONLY_SRC) \ $(UPEKSONLY_SRC) \
$(URU4000_SRC) \ $(URU4000_SRC) \
$(AES1610_SRC) \ $(AES1610_SRC) \
$(AES1660_SRC) \
$(AES2501_SRC) \ $(AES2501_SRC) \
$(AES2550_SRC) \ $(AES2550_SRC) \
$(AES4000_SRC) \ $(AES4000_SRC) \
@ -123,6 +125,10 @@ if ENABLE_AES1610
DRIVER_SRC += $(AES1610_SRC) DRIVER_SRC += $(AES1610_SRC)
endif endif
if ENABLE_AES1660
DRIVER_SRC += $(AES1660_SRC)
endif
if ENABLE_AES2501 if ENABLE_AES2501
DRIVER_SRC += $(AES2501_SRC) DRIVER_SRC += $(AES2501_SRC)
endif endif

View file

@ -371,6 +371,9 @@ static struct fp_img_driver * const img_drivers[] = {
#ifdef ENABLE_AES1610 #ifdef ENABLE_AES1610
&aes1610_driver, &aes1610_driver,
#endif #endif
#ifdef ENABLE_AES1660
&aes1660_driver,
#endif
#ifdef ENABLE_VFS101 #ifdef ENABLE_VFS101
&vfs101_driver, &vfs101_driver,
#endif #endif

126
libfprint/drivers/aes1660.c Normal file
View file

@ -0,0 +1,126 @@
/*
* AuthenTec AES1660 driver for libfprint
* Copyright (C) 2012 Vasily Khoruzhick
*
* 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 "aes1660"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <libusb.h>
#include <fp_internal.h>
#include "aesx660.h"
#include "aes1660.h"
#include "driver_ids.h"
#define FRAME_WIDTH 128
#define SCALE_FACTOR 2
static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
{
/* TODO check that device has endpoints we're using */
int r;
struct aesX660_dev *aesdev;
r = libusb_claim_interface(dev->udev, 0);
if (r < 0) {
fp_err("could not claim interface 0");
return r;
}
dev->priv = aesdev = g_malloc0(sizeof(struct aesX660_dev));
if (!aesdev)
return -ENOMEM;
aesdev->buffer = g_malloc0(AES1660_FRAME_SIZE + AESX660_HEADER_SIZE);
if (!aesdev->buffer) {
g_free(aesdev);
dev->priv = NULL;
return -ENOMEM;
}
aesdev->h_scale_factor = SCALE_FACTOR;
aesdev->init_seqs[0] = aes1660_init_1;
aesdev->init_seqs_len[0] = array_n_elements(aes1660_init_1);
aesdev->init_seqs[1] = aes1660_init_2;
aesdev->init_seqs_len[1] = array_n_elements(aes1660_init_2);
aesdev->start_imaging_cmd = (unsigned char *)aes1660_start_imaging_cmd;
aesdev->start_imaging_cmd_len = sizeof(aes1660_start_imaging_cmd);
aesdev->frame_width = FRAME_WIDTH;
fpi_imgdev_open_complete(dev, 0);
return 0;
}
static void dev_deinit(struct fp_img_dev *dev)
{
struct aesX660_dev *aesdev = dev->priv;
g_free(aesdev->buffer);
g_free(aesdev);
libusb_release_interface(dev->udev, 0);
fpi_imgdev_close_complete(dev);
}
static const struct usb_id id_table[] = {
{ .vendor = 0x08ff, .product = 0x1660 },
{ .vendor = 0x08ff, .product = 0x1680 },
{ .vendor = 0x08ff, .product = 0x1681 },
{ .vendor = 0x08ff, .product = 0x1682 },
{ .vendor = 0x08ff, .product = 0x1683 },
{ .vendor = 0x08ff, .product = 0x1684 },
{ .vendor = 0x08ff, .product = 0x1685 },
{ .vendor = 0x08ff, .product = 0x1686 },
{ .vendor = 0x08ff, .product = 0x1687 },
{ .vendor = 0x08ff, .product = 0x1688 },
{ .vendor = 0x08ff, .product = 0x1689 },
{ .vendor = 0x08ff, .product = 0x168a },
{ .vendor = 0x08ff, .product = 0x168b },
{ .vendor = 0x08ff, .product = 0x168c },
{ .vendor = 0x08ff, .product = 0x168d },
{ .vendor = 0x08ff, .product = 0x168e },
{ .vendor = 0x08ff, .product = 0x168f },
{ 0, 0, 0, },
};
struct fp_img_driver aes1660_driver = {
.driver = {
.id = AES1660_ID,
.name = FP_COMPONENT,
.full_name = "AuthenTec AES1660",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_SWIPE,
},
.flags = 0,
.img_height = -1,
.img_width = FRAME_WIDTH * SCALE_FACTOR,
/* temporarily lowered until we sort out image processing code
* binarized scan quality is good, minutiae detection is accurate,
* it's just that we get fewer minutiae than other scanners (less scanning
* area) */
.bz3_threshold = 25,
.open = dev_init,
.close = dev_deinit,
.activate = aesX660_dev_activate,
.deactivate = aesX660_dev_deactivate,
};

1990
libfprint/drivers/aes1660.h Normal file

File diff suppressed because it is too large Load diff

View file

@ -34,6 +34,7 @@ enum {
VFS301_ID = 11, VFS301_ID = 11,
AES2550_ID = 12, AES2550_ID = 12,
UPEKE2_ID = 13, UPEKE2_ID = 13,
AES1660_ID = 14,
}; };
#endif #endif

View file

@ -255,6 +255,9 @@ extern struct fp_img_driver uru4000_driver;
#ifdef ENABLE_AES1610 #ifdef ENABLE_AES1610
extern struct fp_img_driver aes1610_driver; extern struct fp_img_driver aes1610_driver;
#endif #endif
#ifdef ENABLE_AES1660
extern struct fp_img_driver aes1660_driver;
#endif
#ifdef ENABLE_AES2501 #ifdef ENABLE_AES2501
extern struct fp_img_driver aes2501_driver; extern struct fp_img_driver aes2501_driver;
#endif #endif