libfprint/SOURCES/0024-drivers-Use-clearer-messages-using-parameters.patch
2021-09-09 20:12:48 +00:00

159 lines
7.8 KiB
Diff

From d830d88463dc9ecdb1943662910692fd4cb7bdf3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Mon, 25 Nov 2019 21:23:31 +0100
Subject: [PATCH 024/181] drivers: Use clearer messages using parameters
---
libfprint/drivers/aesx660.c | 16 +++++++++++-----
libfprint/drivers/synaptics/synaptics.c | 17 ++++++++++++-----
libfprint/drivers/upekts.c | 8 +++++---
3 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/libfprint/drivers/aesx660.c b/libfprint/drivers/aesx660.c
index 8540a06..8ad4c63 100644
--- a/libfprint/drivers/aesx660.c
+++ b/libfprint/drivers/aesx660.c
@@ -131,7 +131,9 @@ aesX660_read_calibrate_data_cb (FpiUsbTransfer *transfer,
fp_dbg ("Bogus calibrate response: %.2x\n", data[0]);
fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
- "Bogus calibrate response"));
+ "Bogus calibrate "
+ "response: %.2x",
+ data[0]));
return;
}
@@ -175,7 +177,8 @@ finger_det_read_fd_data_cb (FpiUsbTransfer *transfer,
fp_dbg ("Bogus FD response: %.2x\n", data[0]);
fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
- "Bogus FD response"));
+ "Bogus FD response %.2x",
+ data[0]));
return;
}
@@ -538,7 +541,8 @@ activate_read_id_cb (FpiUsbTransfer *transfer, FpDevice *device,
fp_dbg ("Bogus read ID response: %.2x\n", data[AESX660_RESPONSE_TYPE_OFFSET]);
fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
- "Bogus read ID response"));
+ "Bogus read ID response %.2x",
+ data[AESX660_RESPONSE_TYPE_OFFSET]));
return;
}
@@ -565,7 +569,8 @@ activate_read_id_cb (FpiUsbTransfer *transfer, FpDevice *device,
fp_dbg ("Failed to init device! init status: %.2x\n", data[7]);
fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
- "Failed to init device"));
+ "Failed to init device %.2x",
+ data[7]));
break;
}
}
@@ -594,7 +599,8 @@ activate_read_init_cb (FpiUsbTransfer *transfer, FpDevice *device,
data[3]);
fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
- "Bogus read init response"));
+ "Bogus read init response: "
+ "%.2x %.2x", data[0], data[3]));
return;
}
priv->init_cmd_idx++;
diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c
index 8eba852..f6faf11 100644
--- a/libfprint/drivers/synaptics/synaptics.c
+++ b/libfprint/drivers/synaptics/synaptics.c
@@ -137,7 +137,8 @@ cmd_recieve_cb (FpiUsbTransfer *transfer,
fp_warn ("Received General Error %d from the sensor", (guint) err);
fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
- "Received general error from device"));
+ "Received general error %u from device",
+ (guint) err));
//fpi_ssm_jump_to_state (transfer->ssm, fpi_ssm_get_cur_state (transfer->ssm));
return;
}
@@ -472,7 +473,8 @@ list_msg_cb (FpiDeviceSynaptics *self,
fpi_device_list_complete (FP_DEVICE (self),
NULL,
fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
- "Failed to query enrolled users"));
+ "Failed to query enrolled users: %d",
+ resp->result));
}
break;
@@ -770,7 +772,8 @@ enroll_msg_cb (FpiDeviceSynaptics *self,
fpi_device_enroll_complete (device,
NULL,
fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
- "Enrollment failed"));
+ "Enrollment failed (%d)",
+ resp->result));
}
break;
}
@@ -1052,7 +1055,11 @@ dev_probe (FpDevice *device)
self->mis_version.build_num);
error = fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
- "Unsupported firmware version");
+ "Unsupported firmware version "
+ "(%d.%d with build number %d)",
+ self->mis_version.version_major,
+ self->mis_version.version_minor,
+ self->mis_version.build_num);
goto err_close;
}
@@ -1120,7 +1127,7 @@ fps_deinit_cb (FpiDeviceSynaptics *self,
case BMKT_RSP_POWER_DOWN_FAIL:
fp_info ("Failed to go to power down mode: %d", resp->result);
error = fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
- "Power down failed");
+ "Power down failed: %d", resp->result);
break;
}
diff --git a/libfprint/drivers/upekts.c b/libfprint/drivers/upekts.c
index 2426907..b3481aa 100644
--- a/libfprint/drivers/upekts.c
+++ b/libfprint/drivers/upekts.c
@@ -288,7 +288,7 @@ __handle_incoming_msg (FpDevice *device,
{
fp_warn ("cmd response too short (%d)", len);
error = fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
- "CMD response too short");
+ "CMD response too short (%d)", len);
goto err;
}
if (innerbuf[0] != 0x28)
@@ -371,7 +371,8 @@ 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");
+ "Packet from device was too short (%lu)",
+ transfer->actual_length);
goto err;
}
@@ -798,7 +799,8 @@ read_msg01_cb (FpDevice *dev, enum read_msg_type type,
{
fp_err ("expected seq=1, got %x", seq);
fpi_ssm_mark_failed (ssm, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
- "Got wrong sequence number"));
+ "Got wrong sequence number (%x)",
+ seq));
return;
}
--
2.24.1