summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2021-04-06 23:34:48 +0000
committerCommit Bot <commit-bot@chromium.org>2021-04-07 07:17:04 +0000
commit575d7686274bc97f3b7ddae2e3b5f4171290d6fd (patch)
tree05a58fb6dafa421c46a79597cdc32459f1959609 /include
parent7fba0e12ffa1d48c9f9f6da9d18125adc9aa75b4 (diff)
downloadchrome-ec-575d7686274bc97f3b7ddae2e3b5f4171290d6fd.tar.gz
Revert "fpsensor: Support building firmware that works for both sensors"
This reverts commit ac08c9d1dbc9f587df3ee6b15d58c0203f7e356e. Reason for revert: Breaks public build Original change's description: > fpsensor: Support building firmware that works for both sensors > > This is a refactoring to allow building FPMCU firmware that works for > one FPC sensor and one ELAN sensor. > > 1. When both drivers implement our common functions, e.g. fp_sensor_init(), > rename them to fp_sensor_init_fpc() and fp_sensor_init_elan(). > 2. There are a few functions implemented not in FPC driver but in FPC > private library, e.g. fp_sensor_finger_status(). I kept this as-is for > FPC but renamed the one in ELAN driver to fp_sensor_finger_status_elan() > 3. If building for ELAN, need to hardcode elan=1 in hatch_fp/board.c > because the sensor type GPIO always says FPC. > > BRANCH=none > BUG=b:175158241 > TEST=make run-fpsensor; make run-fpsensor_status; > make run-fpsensor_crypto > TEST=make -j BOARD=dartmonkey > TEST=add CONFIG_FP_SENSOR_ELAN515 to board/hatch_fp/board.h; > make -j BOARD=bloonchipper > Firmware binary fully works on Dragonair (FPC) and Voema (ELAN) > TEST=run device tests with http://crrev/c/2750547 and > http://crrev/i/3654297 on Dragonclaw, all pass > > Change-Id: I789090dbdfe35ac6aefd6a629fa4c7bde89dc437 > Signed-off-by: Yicheng Li <yichengli@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2727971 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> > Commit-Queue: Tom Hughes <tomhughes@chromium.org> Bug: b:175158241, b:184616069 Change-Id: I2a02a6eefc316e7e13aa188f1ae16672dce2babd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809521 Auto-Submit: Tom Hughes <tomhughes@chromium.org> Tested-by: Tom Hughes <tomhughes@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: caveh jalali <caveh@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/fpsensor.h262
-rw-r--r--include/fpsensor_elan.h129
-rw-r--r--include/fpsensor_fpc.h129
-rw-r--r--include/fpsensor_state.h39
-rw-r--r--include/mock/fp_sensor_mock.h2
5 files changed, 122 insertions, 439 deletions
diff --git a/include/fpsensor.h b/include/fpsensor.h
index 3470cb3386..2c5baa2679 100644
--- a/include/fpsensor.h
+++ b/include/fpsensor.h
@@ -11,7 +11,6 @@
#include <stdint.h>
#include "common.h"
#include "ec_commands.h"
-#include "fpsensor_detect.h"
#ifndef SPI_FP_DEVICE
#define SPI_FP_DEVICE (&spi_devices[0])
@@ -24,157 +23,48 @@
/* 8-bit greyscale pixel format as defined by V4L2 headers */
#define V4L2_PIX_FMT_GREY FOURCC('G', 'R', 'E', 'Y')
+/* --- functions provided by the sensor-specific driver --- */
+
+/* Initialize the connected sensor hardware and put it in a low power mode. */
+int fp_sensor_init(void);
+
+/* De-initialize the sensor hardware. */
+int fp_sensor_deinit(void);
+
+/*
+ * Fill the 'ec_response_fp_info' buffer with the sensor information
+ * as required by the EC_CMD_FP_INFO host command.
+ *
+ * Put both the static information and the ones read from the sensor at runtime.
+ */
+int fp_sensor_get_info(struct ec_response_fp_info *resp);
+
+/*
+ * Put the sensor in its lowest power state.
+ *
+ * fp_sensor_configure_detect needs to be called to restore finger detection
+ * functionality.
+ */
+void fp_sensor_low_power(void);
+
+/*
+ * Configure finger detection.
+ *
+ * Send the settings to the sensor, so it is properly configured to detect
+ * the presence of a finger.
+ */
+void fp_sensor_configure_detect(void);
+
+/*
+ * Returns the status of the finger on the sensor.
+ * (assumes fp_sensor_configure_detect was called before)
+ */
enum finger_state {
FINGER_NONE = 0,
FINGER_PARTIAL = 1,
FINGER_PRESENT = 2,
};
-
-/* --- functions provided by the sensor-specific driver --- */
-
-struct fp_sensor_interface {
- /* Whether there is an ELAN fingerprint sensor or FPC sensor. */
- enum fp_sensor_type sensor_type;
-
- /*
- * Initialize the connected sensor hardware and put it in a low power
- * mode.
- */
- int (*fp_sensor_init)(void);
-
- /* De-initialize the sensor hardware. */
- int (*fp_sensor_deinit)(void);
-
- /*
- * Fill the 'ec_response_fp_info' buffer with the sensor information
- * as required by the EC_CMD_FP_INFO host command.
- *
- * Put both the static information and the ones read from the sensor at
- * runtime.
- */
- int (*fp_sensor_get_info)(struct ec_response_fp_info *resp);
-
- /*
- * Put the sensor in its lowest power state.
- *
- * fp_sensor_configure_detect needs to be called to restore finger
- * detection functionality.
- */
- void (*fp_sensor_low_power)(void);
-
- /*
- * Configure finger detection.
- *
- * Send the settings to the sensor, so it is properly configured to
- * detect the presence of a finger.
- */
- /* TODO(b/184101599): Remove "_" suffix. */
- void (*fp_sensor_configure_detect_)(void);
-
- /*
- * Returns the status of the finger on the sensor.
- * (assumes fp_sensor_configure_detect was called before)
- */
- /* TODO(b/184101599): Remove "_" suffix. */
- enum finger_state (*fp_sensor_finger_status_)(void);
-
- /*
- * Acquires a fingerprint image with specific capture mode.
- *
- * Same as the fp_sensor_acquire_image function above,
- * excepted 'mode' can be set to one of the FP_CAPTURE_ constants
- * to get a specific image type (e.g. a pattern) rather than the default
- * one.
- */
- /* TODO(b/184101599): Remove "_" suffix. */
- int (*fp_sensor_acquire_image_with_mode_)(uint8_t *image_data,
- int mode);
-
- /*
- * Adds fingerprint image to the current enrollment session.
- *
- * @return a negative value on error or one of the following codes:
- * - EC_MKBP_FP_ERR_ENROLL_OK when image was successfully enrolled
- * - EC_MKBP_FP_ERR_ENROLL_IMMOBILE when image added, but user should be
- * advised to move finger
- * - EC_MKBP_FP_ERR_ENROLL_LOW_QUALITY when image could not be used due
- * to low image quality
- * - EC_MKBP_FP_ERR_ENROLL_LOW_COVERAGE when image could not be used due
- * to finger covering too little area of the sensor
- */
- int (*fp_finger_enroll)(uint8_t *image, int *completion);
-
- /*
- * Compares given finger image against enrolled templates.
- *
- * The matching algorithm can update the template with additional
- * biometric data from the image, if it chooses to do so.
- *
- * @param templ a pointer to the array of template buffers.
- * @param templ_count the number of buffers in the array of templates.
- * @param image the buffer containing the finger image
- * @param match_index index of the matched finger in the template array
- * if any.
- * @param update_bitmap contains one bit per template, the bit is set if
- * the match has updated the given template.
- * @return negative value on error, else one of the following code :
- * - EC_MKBP_FP_ERR_MATCH_NO on non-match
- * - EC_MKBP_FP_ERR_MATCH_YES for match when template was not updated
- * with new data
- * - EC_MKBP_FP_ERR_MATCH_YES_UPDATED for match when template was
- * updated
- * - EC_MKBP_FP_ERR_MATCH_YES_UPDATE_FAILED match, but update failed
- * (not saved)
- * - EC_MKBP_FP_ERR_MATCH_LOW_QUALITY when matching could not be
- * performed due to low image quality
- * - EC_MKBP_FP_ERR_MATCH_LOW_COVERAGE when matching could not be
- * performed due to finger covering too little area of the sensor
- */
- int (*fp_finger_match)(void *templ, uint32_t templ_count,
- uint8_t *image, int32_t *match_index,
- uint32_t *update_bitmap);
-
- /*
- * Start a finger enrollment session.
- *
- * @return 0 on success or a negative error code.
- */
- int (*fp_enrollment_begin)(void);
-
- /*
- * Generate a template from the finger whose enrollment has just being
- * completed.
- *
- * @param templ the buffer which will receive the template.
- * templ can be set to NULL to abort the current enrollment process.
- *
- * @return 0 on success or a negative error code.
- */
- int (*fp_enrollment_finish)(void *templ);
-
- /**
- * Runs a test for defective pixels.
- *
- * Should be triggered periodically by the client. The maintenance
- * command can take several hundred milliseconds to run.
- *
- * @return EC_ERROR_HW_INTERNAL on error (such as finger on sensor)
- * @return EC_SUCCESS on success
- */
- int (*fp_maintenance)(void);
-
- /* Size of one unencrypted fingerprint template. */
- int algorithm_template_size;
-
- /* Size of one encrypted fingerprint template sent to the AP. */
- int encrypted_template_size;
-
- /* Sensor resolution. */
- int res_x;
- int res_y;
-};
-
-extern struct fp_sensor_interface *fp_driver;
+enum finger_state fp_sensor_finger_status(void);
/*
* Acquires a fingerprint image.
@@ -197,4 +87,82 @@ extern struct fp_sensor_interface *fp_driver;
#define FP_SENSOR_LOW_SENSOR_COVERAGE 3
int fp_sensor_acquire_image(uint8_t *image_data);
+/*
+ * Acquires a fingerprint image with specific capture mode.
+ *
+ * Same as the fp_sensor_acquire_image function above,
+ * excepted 'mode' can be set to one of the FP_CAPTURE_ constants
+ * to get a specific image type (e.g. a pattern) rather than the default one.
+ */
+int fp_sensor_acquire_image_with_mode(uint8_t *image_data, int mode);
+
+/*
+ * Compares given finger image against enrolled templates.
+ *
+ * The matching algorithm can update the template with additional biometric data
+ * from the image, if it chooses to do so.
+ *
+ * @param templ a pointer to the array of template buffers.
+ * @param templ_count the number of buffers in the array of templates.
+ * @param image the buffer containing the finger image
+ * @param match_index index of the matched finger in the template array if any.
+ * @param update_bitmap contains one bit per template, the bit is set if the
+ * match has updated the given template.
+ * @return negative value on error, else one of the following code :
+ * - EC_MKBP_FP_ERR_MATCH_NO on non-match
+ * - EC_MKBP_FP_ERR_MATCH_YES for match when template was not updated with
+ * new data
+ * - EC_MKBP_FP_ERR_MATCH_YES_UPDATED for match when template was updated
+ * - EC_MKBP_FP_ERR_MATCH_YES_UPDATE_FAILED match, but update failed (not saved)
+ * - EC_MKBP_FP_ERR_MATCH_LOW_QUALITY when matching could not be performed due
+ * to low image quality
+ * - EC_MKBP_FP_ERR_MATCH_LOW_COVERAGE when matching could not be performed
+ * due to finger covering too little area of the sensor
+ */
+int fp_finger_match(void *templ, uint32_t templ_count, uint8_t *image,
+ int32_t *match_index, uint32_t *update_bitmap);
+
+/*
+ * Start a finger enrollment session.
+ *
+ * @return 0 on success or a negative error code.
+ */
+int fp_enrollment_begin(void);
+
+/*
+ * Generate a template from the finger whose enrollment has just being
+ * completed.
+ *
+ * @param templ the buffer which will receive the template.
+ * templ can be set to NULL to abort the current enrollment process.
+ *
+ * @return 0 on success or a negative error code.
+ */
+int fp_enrollment_finish(void *templ);
+
+/*
+ * Adds fingerprint image to the current enrollment session.
+ *
+ * @return a negative value on error or one of the following codes:
+ * - EC_MKBP_FP_ERR_ENROLL_OK when image was successfully enrolled
+ * - EC_MKBP_FP_ERR_ENROLL_IMMOBILE when image added, but user should be
+ * advised to move finger
+ * - EC_MKBP_FP_ERR_ENROLL_LOW_QUALITY when image could not be used due to low
+ * image quality
+ * - EC_MKBP_FP_ERR_ENROLL_LOW_COVERAGE when image could not be used due to
+ * finger covering too little area of the sensor
+ */
+int fp_finger_enroll(uint8_t *image, int *completion);
+
+/**
+ * Runs a test for defective pixels.
+ *
+ * Should be triggered periodically by the client. The maintenance command can
+ * take several hundred milliseconds to run.
+ *
+ * @return EC_ERROR_HW_INTERNAL on error (such as finger on sensor)
+ * @return EC_SUCCESS on success
+ */
+int fp_maintenance(void);
+
#endif /* __CROS_EC_FPSENSOR_H */
diff --git a/include/fpsensor_elan.h b/include/fpsensor_elan.h
deleted file mode 100644
index 008d0c3545..0000000000
--- a/include/fpsensor_elan.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* Fingerprint sensor interface */
-
-#ifndef __CROS_EC_FPSENSOR_ELAN_H
-#define __CROS_EC_FPSENSOR_ELAN_H
-
-#include <stdint.h>
-
-extern struct fp_sensor_interface fp_driver_elan;
-
-/* Initialize the connected sensor hardware and put it in a low power mode. */
-int fp_sensor_init_elan(void);
-
-/* De-initialize the sensor hardware. */
-int fp_sensor_deinit_elan(void);
-
-/*
- * Fill the 'ec_response_fp_info' buffer with the sensor information
- * as required by the EC_CMD_FP_INFO host command.
- *
- * Put both the static information and the ones read from the sensor at runtime.
- */
-int fp_sensor_get_info_elan(struct ec_response_fp_info *resp);
-
-/*
- * Put the sensor in its lowest power state.
- *
- * fp_sensor_configure_detect needs to be called to restore finger detection
- * functionality.
- */
-void fp_sensor_low_power_elan(void);
-
-/*
- * Configure finger detection.
- *
- * Send the settings to the sensor, so it is properly configured to detect
- * the presence of a finger.
- */
-void fp_sensor_configure_detect_elan(void);
-
-/*
- * Returns the status of the finger on the sensor.
- * (assumes fp_sensor_configure_detect was called before)
- */
-enum finger_state fp_sensor_finger_status_elan(void);
-
-/*
- * Acquires a fingerprint image with specific capture mode.
- *
- * Same as the fp_sensor_acquire_image function above,
- * excepted 'mode' can be set to one of the FP_CAPTURE_ constants
- * to get a specific image type (e.g. a pattern) rather than the default one.
- */
-int fp_sensor_acquire_image_with_mode_elan(uint8_t *image_data, int mode);
-
-/*
- * Adds fingerprint image to the current enrollment session.
- *
- * @return a negative value on error or one of the following codes:
- * - EC_MKBP_FP_ERR_ENROLL_OK when image was successfully enrolled
- * - EC_MKBP_FP_ERR_ENROLL_IMMOBILE when image added, but user should be
- * advised to move finger
- * - EC_MKBP_FP_ERR_ENROLL_LOW_QUALITY when image could not be used due to low
- * image quality
- * - EC_MKBP_FP_ERR_ENROLL_LOW_COVERAGE when image could not be used due to
- * finger covering too little area of the sensor
- */
-int fp_finger_enroll_elan(uint8_t *image, int *completion);
-
-/*
- * Compares given finger image against enrolled templates.
- *
- * The matching algorithm can update the template with additional biometric data
- * from the image, if it chooses to do so.
- *
- * @param templ a pointer to the array of template buffers.
- * @param templ_count the number of buffers in the array of templates.
- * @param image the buffer containing the finger image
- * @param match_index index of the matched finger in the template array if any.
- * @param update_bitmap contains one bit per template, the bit is set if the
- * match has updated the given template.
- * @return negative value on error, else one of the following code :
- * - EC_MKBP_FP_ERR_MATCH_NO on non-match
- * - EC_MKBP_FP_ERR_MATCH_YES for match when template was not updated with
- * new data
- * - EC_MKBP_FP_ERR_MATCH_YES_UPDATED for match when template was updated
- * - EC_MKBP_FP_ERR_MATCH_YES_UPDATE_FAILED match, but update failed (not saved)
- * - EC_MKBP_FP_ERR_MATCH_LOW_QUALITY when matching could not be performed due
- * to low image quality
- * - EC_MKBP_FP_ERR_MATCH_LOW_COVERAGE when matching could not be performed
- * due to finger covering too little area of the sensor
- */
-int fp_finger_match_elan(void *templ, uint32_t templ_count, uint8_t *image,
- int32_t *match_index, uint32_t *update_bitmap);
-
-/*
- * Start a finger enrollment session.
- *
- * @return 0 on success or a negative error code.
- */
-int fp_enrollment_begin_elan(void);
-
-/*
- * Generate a template from the finger whose enrollment has just being
- * completed.
- *
- * @param templ the buffer which will receive the template.
- * templ can be set to NULL to abort the current enrollment process.
- *
- * @return 0 on success or a negative error code.
- */
-int fp_enrollment_finish_elan(void *templ);
-
-/**
- * Runs a test for defective pixels.
- *
- * Should be triggered periodically by the client. The maintenance command can
- * take several hundred milliseconds to run.
- *
- * @return EC_ERROR_HW_INTERNAL on error (such as finger on sensor)
- * @return EC_SUCCESS on success
- */
-int fp_maintenance_elan(void);
-
-#endif /* __CROS_EC_FPSENSOR_ELAN_H */
diff --git a/include/fpsensor_fpc.h b/include/fpsensor_fpc.h
deleted file mode 100644
index 3cd28d5d45..0000000000
--- a/include/fpsensor_fpc.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* Fingerprint sensor interface */
-
-#ifndef __CROS_EC_FPSENSOR_FPC_H
-#define __CROS_EC_FPSENSOR_FPC_H
-
-#include <stdint.h>
-
-extern struct fp_sensor_interface fp_driver_fpc;
-
-/* Initialize the connected sensor hardware and put it in a low power mode. */
-int fp_sensor_init_fpc(void);
-
-/* De-initialize the sensor hardware. */
-int fp_sensor_deinit_fpc(void);
-
-/*
- * Fill the 'ec_response_fp_info' buffer with the sensor information
- * as required by the EC_CMD_FP_INFO host command.
- *
- * Put both the static information and the ones read from the sensor at runtime.
- */
-int fp_sensor_get_info_fpc(struct ec_response_fp_info *resp);
-
-/*
- * Put the sensor in its lowest power state.
- *
- * fp_sensor_configure_detect needs to be called to restore finger detection
- * functionality.
- */
-void fp_sensor_low_power_fpc(void);
-
-/*
- * Configure finger detection.
- *
- * Send the settings to the sensor, so it is properly configured to detect
- * the presence of a finger.
- */
-void fp_sensor_configure_detect(void);
-
-/*
- * Returns the status of the finger on the sensor.
- * (assumes fp_sensor_configure_detect was called before)
- */
-enum finger_state fp_sensor_finger_status(void);
-
-/*
- * Acquires a fingerprint image with specific capture mode.
- *
- * Same as the fp_sensor_acquire_image function above,
- * excepted 'mode' can be set to one of the FP_CAPTURE_ constants
- * to get a specific image type (e.g. a pattern) rather than the default one.
- */
-int fp_sensor_acquire_image_with_mode(uint8_t *image_data, int mode);
-
-/*
- * Adds fingerprint image to the current enrollment session.
- *
- * @return a negative value on error or one of the following codes:
- * - EC_MKBP_FP_ERR_ENROLL_OK when image was successfully enrolled
- * - EC_MKBP_FP_ERR_ENROLL_IMMOBILE when image added, but user should be
- * advised to move finger
- * - EC_MKBP_FP_ERR_ENROLL_LOW_QUALITY when image could not be used due to low
- * image quality
- * - EC_MKBP_FP_ERR_ENROLL_LOW_COVERAGE when image could not be used due to
- * finger covering too little area of the sensor
- */
-int fp_finger_enroll_fpc(uint8_t *image, int *completion);
-
-/*
- * Compares given finger image against enrolled templates.
- *
- * The matching algorithm can update the template with additional biometric data
- * from the image, if it chooses to do so.
- *
- * @param templ a pointer to the array of template buffers.
- * @param templ_count the number of buffers in the array of templates.
- * @param image the buffer containing the finger image
- * @param match_index index of the matched finger in the template array if any.
- * @param update_bitmap contains one bit per template, the bit is set if the
- * match has updated the given template.
- * @return negative value on error, else one of the following code :
- * - EC_MKBP_FP_ERR_MATCH_NO on non-match
- * - EC_MKBP_FP_ERR_MATCH_YES for match when template was not updated with
- * new data
- * - EC_MKBP_FP_ERR_MATCH_YES_UPDATED for match when template was updated
- * - EC_MKBP_FP_ERR_MATCH_YES_UPDATE_FAILED match, but update failed (not saved)
- * - EC_MKBP_FP_ERR_MATCH_LOW_QUALITY when matching could not be performed due
- * to low image quality
- * - EC_MKBP_FP_ERR_MATCH_LOW_COVERAGE when matching could not be performed
- * due to finger covering too little area of the sensor
- */
-int fp_finger_match_fpc(void *templ, uint32_t templ_count, uint8_t *image,
- int32_t *match_index, uint32_t *update_bitmap);
-
-/*
- * Start a finger enrollment session.
- *
- * @return 0 on success or a negative error code.
- */
-int fp_enrollment_begin_fpc(void);
-
-/*
- * Generate a template from the finger whose enrollment has just being
- * completed.
- *
- * @param templ the buffer which will receive the template.
- * templ can be set to NULL to abort the current enrollment process.
- *
- * @return 0 on success or a negative error code.
- */
-int fp_enrollment_finish_fpc(void *templ);
-
-/**
- * Runs a test for defective pixels.
- *
- * Should be triggered periodically by the client. The maintenance command can
- * take several hundred milliseconds to run.
- *
- * @return EC_ERROR_HW_INTERNAL on error (such as finger on sensor)
- * @return EC_SUCCESS on success
- */
-int fp_maintenance_fpc(void);
-
-#endif /* __CROS_EC_FPSENSOR_FPC_H */
diff --git a/include/fpsensor_state.h b/include/fpsensor_state.h
index 6f61b03d09..6b752bc86d 100644
--- a/include/fpsensor_state.h
+++ b/include/fpsensor_state.h
@@ -14,7 +14,6 @@
#include "ec_commands.h"
#include "link_defs.h"
#include "timer.h"
-#include "util.h"
#include "driver/fingerprint/fpsensor.h"
@@ -27,6 +26,10 @@
#endif
#define SBP_ENC_KEY_LEN 16
+#define FP_ALGORITHM_ENCRYPTED_TEMPLATE_SIZE \
+ (FP_ALGORITHM_TEMPLATE_SIZE + \
+ FP_POSITIVE_MATCH_SALT_BYTES + \
+ sizeof(struct ec_fp_template_encryption_metadata))
/* Events for the FPSENSOR task */
#define TASK_EVENT_SENSOR_IRQ TASK_EVENT_CUSTOM_BIT(0)
@@ -37,44 +40,16 @@
/* --- Global variables defined in fpsensor_state.c --- */
/* Last acquired frame (aligned as it is used by arbitrary binary libraries) */
-#ifndef FP_SENSOR_IMAGE_SIZE_FPC
-#define FP_SENSOR_IMAGE_SIZE_FPC 0
-#endif
-#ifndef FP_SENSOR_IMAGE_SIZE_ELAN
-#define FP_SENSOR_IMAGE_SIZE_ELAN 0
-#endif
-
-#define FP_SENSOR_IMAGE_MAX_SIZE \
- GENERIC_MAX(FP_SENSOR_IMAGE_SIZE_FPC, FP_SENSOR_IMAGE_SIZE_ELAN)
-
-extern uint8_t fp_buffer[FP_SENSOR_IMAGE_MAX_SIZE];
-
+extern uint8_t fp_buffer[FP_SENSOR_IMAGE_SIZE];
/* Fingers templates for the current user */
-#ifndef FP_ALGORITHM_TEMPLATE_SIZE_FPC
-#define FP_ALGORITHM_TEMPLATE_SIZE_FPC 0
-#endif
-#ifndef FP_ALGORITHM_TEMPLATE_SIZE_ELAN
-#define FP_ALGORITHM_TEMPLATE_SIZE_ELAN 0
-#endif
-
-#define FP_ALGORITHM_TEMPLATE_MAX_SIZE \
- GENERIC_MAX(FP_ALGORITHM_TEMPLATE_SIZE_FPC, \
- FP_ALGORITHM_TEMPLATE_SIZE_ELAN)
-extern uint8_t fp_template[FP_ALGORITHM_TEMPLATE_MAX_SIZE *
- FP_MAX_FINGER_COUNT] FP_TEMPLATE_SECTION;
-
+extern uint8_t fp_template[FP_MAX_FINGER_COUNT][FP_ALGORITHM_TEMPLATE_SIZE];
/* Encryption/decryption buffer */
/* TODO: On-the-fly encryption/decryption without a dedicated buffer */
/*
* Store the encryption metadata at the beginning of the buffer containing the
* ciphered data.
*/
-#define FP_ALGORITHM_ENCRYPTED_TEMPLATE_MAX_SIZE \
- (FP_ALGORITHM_TEMPLATE_MAX_SIZE + FP_POSITIVE_MATCH_SALT_BYTES + \
- sizeof(struct ec_fp_template_encryption_metadata))
-
-extern uint8_t fp_enc_buffer[FP_ALGORITHM_ENCRYPTED_TEMPLATE_MAX_SIZE];
-
+extern uint8_t fp_enc_buffer[FP_ALGORITHM_ENCRYPTED_TEMPLATE_SIZE];
/* Salt used in derivation of positive match secret. */
extern uint8_t fp_positive_match_salt
[FP_MAX_FINGER_COUNT][FP_POSITIVE_MATCH_SALT_BYTES];
diff --git a/include/mock/fp_sensor_mock.h b/include/mock/fp_sensor_mock.h
index 7248cde3d3..432802348c 100644
--- a/include/mock/fp_sensor_mock.h
+++ b/include/mock/fp_sensor_mock.h
@@ -45,6 +45,4 @@ struct mock_ctrl_fp_sensor {
extern struct mock_ctrl_fp_sensor mock_ctrl_fp_sensor;
-extern struct fp_sensor_interface fp_driver_mock;
-
#endif /* __MOCK_FP_SENSOR_MOCK_H */