Commit 603aab0a authored by Bastien Nocera's avatar Bastien Nocera

lib: Rename fpi_ssm_mark_aborted to fpi_ssm_mark_failed

parent 10e934e2
Pipeline #4103 passed with stage
in 3 minutes and 33 seconds
......@@ -156,7 +156,7 @@ fpi_ssm_start_subsm
fpi_ssm_next_state
fpi_ssm_jump_to_state
fpi_ssm_mark_completed
fpi_ssm_mark_aborted
fpi_ssm_mark_failed
fpi_ssm_set_user_data
fpi_ssm_get_user_data
fpi_ssm_get_error
......
......@@ -104,9 +104,9 @@ static void generic_ignore_data_cb(struct libusb_transfer *transfer)
fpi_ssm *ssm = transfer->user_data;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
else if (transfer->length != transfer->actual_length)
fpi_ssm_mark_aborted(ssm, -EPROTO);
fpi_ssm_mark_failed(ssm, -EPROTO);
else
fpi_ssm_next_state(ssm);
......@@ -121,7 +121,7 @@ static void generic_write_regv_cb(struct fp_img_dev *dev, int result,
if (result == 0)
fpi_ssm_next_state(ssm);
else
fpi_ssm_mark_aborted(ssm, result);
fpi_ssm_mark_failed(ssm, result);
}
/* read the specified number of bytes from the IN endpoint but throw them
......@@ -134,7 +134,7 @@ static void generic_read_ignore_data(fpi_ssm *ssm, size_t bytes)
int r;
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
return;
}
......@@ -147,7 +147,7 @@ static void generic_read_ignore_data(fpi_ssm *ssm, size_t bytes)
if (r < 0) {
g_free(data);
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, r);
fpi_ssm_mark_failed(ssm, r);
}
}
......@@ -564,10 +564,10 @@ static void capture_read_strip_cb(struct libusb_transfer *transfer)
int sum, i;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
goto out;
} else if (transfer->length != transfer->actual_length) {
fpi_ssm_mark_aborted(ssm, -EPROTO);
fpi_ssm_mark_failed(ssm, -EPROTO);
goto out;
}
......@@ -594,7 +594,7 @@ static void capture_read_strip_cb(struct libusb_transfer *transfer)
}
if (sum < 0) {
fpi_ssm_mark_aborted(ssm, sum);
fpi_ssm_mark_failed(ssm, sum);
goto out;
}
fp_dbg("sum=%d", sum);
......@@ -672,7 +672,7 @@ static void capture_run_state(fpi_ssm *ssm)
unsigned char *data;
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
break;
}
......@@ -684,7 +684,7 @@ static void capture_run_state(fpi_ssm *ssm)
if (r < 0) {
g_free(data);
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, r);
fpi_ssm_mark_failed(ssm, r);
}
break;
};
......
......@@ -184,7 +184,7 @@ static void generic_write_regv_cb(struct fp_img_dev *dev, int result,
if (result == 0)
fpi_ssm_next_state(ssm);
else
fpi_ssm_mark_aborted(ssm, result);
fpi_ssm_mark_failed(ssm, result);
}
/* check that read succeeded but ignore all data */
......@@ -193,9 +193,9 @@ static void generic_ignore_data_cb(struct libusb_transfer *transfer)
fpi_ssm *ssm = transfer->user_data;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
else if (transfer->length != transfer->actual_length)
fpi_ssm_mark_aborted(ssm, -EPROTO);
fpi_ssm_mark_failed(ssm, -EPROTO);
else
fpi_ssm_next_state(ssm);
......@@ -213,7 +213,7 @@ static void generic_read_ignore_data(fpi_ssm *ssm, size_t bytes)
int r;
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
return;
}
......@@ -225,7 +225,7 @@ static void generic_read_ignore_data(fpi_ssm *ssm, size_t bytes)
if (r < 0) {
g_free(data);
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, r);
fpi_ssm_mark_failed(ssm, r);
}
}
......@@ -444,23 +444,23 @@ static void capture_read_strip_cb(struct libusb_transfer *transfer)
int threshold;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
goto out;
} else if (transfer->length != transfer->actual_length) {
fpi_ssm_mark_aborted(ssm, -EPROTO);
fpi_ssm_mark_failed(ssm, -EPROTO);
goto out;
}
threshold = regval_from_dump(data + 1 + 192*8 + 1 + 16*2 + 1 + 8,
AES2501_REG_DATFMT);
if (threshold < 0) {
fpi_ssm_mark_aborted(ssm, threshold);
fpi_ssm_mark_failed(ssm, threshold);
goto out;
}
sum = sum_histogram_values(data + 1 + 192*8, threshold & 0x0f);
if (sum < 0) {
fpi_ssm_mark_aborted(ssm, sum);
fpi_ssm_mark_failed(ssm, sum);
goto out;
}
fp_dbg("sum=%d", sum);
......@@ -553,7 +553,7 @@ static void capture_run_state(fpi_ssm *ssm)
unsigned char *data;
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
break;
}
......@@ -565,7 +565,7 @@ static void capture_run_state(fpi_ssm *ssm)
if (r < 0) {
g_free(data);
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, r);
fpi_ssm_mark_failed(ssm, r);
}
break;
};
......@@ -717,7 +717,7 @@ void activate_read_regs_cb(struct fp_img_dev *dev, int status,
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
if (status != 0) {
fpi_ssm_mark_aborted(ssm, status);
fpi_ssm_mark_failed(ssm, status);
} else {
fp_dbg("reg 0xaf = %x", regs[0x5f]);
if (regs[0x5f] != 0x6b || ++aesdev->read_regs_retry_count == 13)
......@@ -734,7 +734,7 @@ static void activate_init3_cb(struct fp_img_dev *dev, int result,
if (result == 0)
fpi_ssm_jump_to_state(ssm, READ_REGS);
else
fpi_ssm_mark_aborted(ssm, result);
fpi_ssm_mark_failed(ssm, result);
}
static void activate_run_state(fpi_ssm *ssm)
......
......@@ -237,7 +237,7 @@ static void capture_reqs_cb(struct libusb_transfer *transfer)
(transfer->length == transfer->actual_length)) {
fpi_ssm_next_state(ssm);
} else {
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
libusb_free_transfer(transfer);
}
......@@ -265,7 +265,7 @@ static void capture_set_idle_reqs_cb(struct libusb_transfer *transfer)
/* marking machine complete will re-trigger finger detection loop */
fpi_ssm_mark_completed(ssm);
} else {
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
libusb_free_transfer(transfer);
}
......@@ -280,7 +280,7 @@ static void capture_read_data_cb(struct libusb_transfer *transfer)
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
fp_dbg("request is not completed, %d", transfer->status);
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
goto out;
}
......@@ -293,7 +293,7 @@ static void capture_read_data_cb(struct libusb_transfer *transfer)
r = process_strip_data(ssm, data);
if (r < 0) {
fp_dbg("Processing strip data failed: %d", r);
fpi_ssm_mark_aborted(ssm, -EPROTO);
fpi_ssm_mark_failed(ssm, -EPROTO);
goto out;
}
aesdev->heartbeat_cnt = 0;
......@@ -333,7 +333,7 @@ static void capture_run_state(fpi_ssm *ssm)
{
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
return;
}
libusb_fill_bulk_transfer(transfer, fpi_imgdev_get_usb_dev(dev), EP_OUT, capture_reqs,
......@@ -341,7 +341,7 @@ static void capture_run_state(fpi_ssm *ssm)
r = libusb_submit_transfer(transfer);
if (r < 0) {
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
}
}
break;
......@@ -351,7 +351,7 @@ static void capture_run_state(fpi_ssm *ssm)
unsigned char *data;
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
break;
}
......@@ -363,7 +363,7 @@ static void capture_run_state(fpi_ssm *ssm)
if (r < 0) {
g_free(data);
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, r);
fpi_ssm_mark_failed(ssm, r);
}
}
break;
......@@ -371,7 +371,7 @@ static void capture_run_state(fpi_ssm *ssm)
{
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
return;
}
libusb_fill_bulk_transfer(transfer, fpi_imgdev_get_usb_dev(dev), EP_OUT, capture_set_idle_reqs,
......@@ -379,7 +379,7 @@ static void capture_run_state(fpi_ssm *ssm)
r = libusb_submit_transfer(transfer);
if (r < 0) {
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
}
}
break;
......@@ -450,7 +450,7 @@ static void init_reqs_cb(struct libusb_transfer *transfer)
(transfer->length == transfer->actual_length)) {
fpi_ssm_next_state(ssm);
} else {
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
libusb_free_transfer(transfer);
}
......@@ -462,7 +462,7 @@ static void init_read_data_cb(struct libusb_transfer *transfer)
if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_next_state(ssm);
} else {
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
g_free(transfer->buffer);
libusb_free_transfer(transfer);
......@@ -477,7 +477,7 @@ static void calibrate_read_data_cb(struct libusb_transfer *transfer)
if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_next_state(ssm);
} else {
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
g_free(transfer->buffer);
libusb_free_transfer(transfer);
......@@ -493,7 +493,7 @@ static void activate_run_state(fpi_ssm *ssm)
{
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
return;
}
libusb_fill_bulk_transfer(transfer, fpi_imgdev_get_usb_dev(dev), EP_OUT, init_reqs,
......@@ -501,7 +501,7 @@ static void activate_run_state(fpi_ssm *ssm)
r = libusb_submit_transfer(transfer);
if (r < 0) {
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
}
}
break;
......@@ -511,7 +511,7 @@ static void activate_run_state(fpi_ssm *ssm)
unsigned char *data;
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
break;
}
......@@ -523,7 +523,7 @@ static void activate_run_state(fpi_ssm *ssm)
if (r < 0) {
g_free(data);
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, r);
fpi_ssm_mark_failed(ssm, r);
}
}
break;
......@@ -531,7 +531,7 @@ static void activate_run_state(fpi_ssm *ssm)
{
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
return;
}
libusb_fill_bulk_transfer(transfer, fpi_imgdev_get_usb_dev(dev), EP_OUT, calibrate_reqs,
......@@ -539,7 +539,7 @@ static void activate_run_state(fpi_ssm *ssm)
r = libusb_submit_transfer(transfer);
if (r < 0) {
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
}
}
break;
......@@ -549,7 +549,7 @@ static void activate_run_state(fpi_ssm *ssm)
unsigned char *data;
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
break;
}
......@@ -561,7 +561,7 @@ static void activate_run_state(fpi_ssm *ssm)
if (r < 0) {
g_free(data);
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, r);
fpi_ssm_mark_failed(ssm, r);
}
}
break;
......
......@@ -45,7 +45,7 @@ static void aesX660_send_cmd_timeout(fpi_ssm *ssm, const unsigned char *cmd,
int r;
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
return;
}
......@@ -56,7 +56,7 @@ static void aesX660_send_cmd_timeout(fpi_ssm *ssm, const unsigned char *cmd,
if (r < 0) {
fp_dbg("failed to submit transfer\n");
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
}
}
......@@ -75,7 +75,7 @@ static void aesX660_read_response(fpi_ssm *ssm, size_t buf_len,
int r;
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
return;
}
......@@ -89,7 +89,7 @@ static void aesX660_read_response(fpi_ssm *ssm, size_t buf_len,
fp_dbg("Failed to submit rx transfer: %d\n", r);
g_free(data);
libusb_free_transfer(transfer);
fpi_ssm_mark_aborted(ssm, r);
fpi_ssm_mark_failed(ssm, r);
}
}
......@@ -103,7 +103,7 @@ static void aesX660_send_cmd_cb(struct libusb_transfer *transfer)
} else {
fp_dbg("tx transfer status: %d, actual_len: %.4x\n",
transfer->status, transfer->actual_length);
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
libusb_free_transfer(transfer);
}
......@@ -115,13 +115,13 @@ static void aesX660_read_calibrate_data_cb(struct libusb_transfer *transfer)
if ((transfer->status != LIBUSB_TRANSFER_COMPLETED) ||
(transfer->length != transfer->actual_length)) {
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
goto out;
}
/* Calibrate response was read correctly? */
if (data[AESX660_RESPONSE_TYPE_OFFSET] != AESX660_CALIBRATE_RESPONSE) {
fp_dbg("Bogus calibrate response: %.2x\n", data[0]);
fpi_ssm_mark_aborted(ssm, -EPROTO);
fpi_ssm_mark_failed(ssm, -EPROTO);
goto out;
}
......@@ -159,13 +159,13 @@ static void finger_det_read_fd_data_cb(struct libusb_transfer *transfer)
if ((transfer->status != LIBUSB_TRANSFER_COMPLETED) ||
(transfer->length != transfer->actual_length)) {
fp_dbg("Failed to read FD data\n");
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
goto out;
}
if (data[AESX660_RESPONSE_TYPE_OFFSET] != AESX660_FINGER_DET_RESPONSE) {
fp_dbg("Bogus FD response: %.2x\n", data[0]);
fpi_ssm_mark_aborted(ssm, -EPROTO);
fpi_ssm_mark_failed(ssm, -EPROTO);
goto out;
}
......@@ -190,7 +190,7 @@ static void finger_det_set_idle_cmd_cb(struct libusb_transfer *transfer)
(transfer->length == transfer->actual_length)) {
fpi_ssm_mark_completed(ssm);
} else {
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
libusb_free_transfer(transfer);
}
......@@ -313,7 +313,7 @@ static void capture_set_idle_cmd_cb(struct libusb_transfer *transfer)
fpi_imgdev_report_finger_status(dev, FALSE);
fpi_ssm_mark_completed(ssm);
} else {
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
libusb_free_transfer(transfer);
}
......@@ -328,7 +328,7 @@ static void capture_read_stripe_data_cb(struct libusb_transfer *transfer)
size_t copied, actual_len = transfer->actual_length;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
goto out;
}
......@@ -456,7 +456,7 @@ static void activate_read_id_cb(struct libusb_transfer *transfer)
if ((transfer->status != LIBUSB_TRANSFER_COMPLETED) ||
(transfer->length != transfer->actual_length)) {
fp_dbg("read_id cmd failed\n");
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
goto out;
}
/* ID was read correctly */
......@@ -465,7 +465,7 @@ static void activate_read_id_cb(struct libusb_transfer *transfer)
data[4], data[3], data[5], data[6], data[7]);
} else {
fp_dbg("Bogus read ID response: %.2x\n", data[AESX660_RESPONSE_TYPE_OFFSET]);
fpi_ssm_mark_aborted(ssm, -EPROTO);
fpi_ssm_mark_failed(ssm, -EPROTO);
goto out;
}
......@@ -487,7 +487,7 @@ static void activate_read_id_cb(struct libusb_transfer *transfer)
break;
default:
fp_dbg("Failed to init device! init status: %.2x\n", data[7]);
fpi_ssm_mark_aborted(ssm, -EPROTO);
fpi_ssm_mark_failed(ssm, -EPROTO);
break;
}
......@@ -509,14 +509,14 @@ static void activate_read_init_cb(struct libusb_transfer *transfer)
if ((transfer->status != LIBUSB_TRANSFER_COMPLETED) ||
(transfer->length != transfer->actual_length)) {
fp_dbg("read_init transfer status: %d, actual_len: %d\n", transfer->status, transfer->actual_length);
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
goto out;
}
/* ID was read correctly */
if (data[0] != 0x42 || data[3] != 0x01) {
fp_dbg("Bogus read init response: %.2x %.2x\n", data[0],
data[3]);
fpi_ssm_mark_aborted(ssm, -EPROTO);
fpi_ssm_mark_failed(ssm, -EPROTO);
goto out;
}
aesdev->init_cmd_idx++;
......
......@@ -335,7 +335,7 @@ static void elan_cmd_cb(struct libusb_transfer *transfer)
fp_dbg("transfer length error: expected %d, got %d",
transfer->length, transfer->actual_length);
elan_dev_reset(elandev);
fpi_ssm_mark_aborted(ssm, -EPROTO);
fpi_ssm_mark_failed(ssm, -EPROTO);
} else if (transfer->endpoint & LIBUSB_ENDPOINT_IN) {
/* just finished receiving */
dbg_buf(elandev->last_read, transfer->actual_length);
......@@ -348,17 +348,17 @@ static void elan_cmd_cb(struct libusb_transfer *transfer)
break;
case LIBUSB_TRANSFER_CANCELLED:
fp_dbg("transfer cancelled");
fpi_ssm_mark_aborted(ssm, -ECANCELED);
fpi_ssm_mark_failed(ssm, -ECANCELED);
elan_deactivate(dev);
break;
case LIBUSB_TRANSFER_TIMED_OUT:
fp_dbg("transfer timed out");
fpi_ssm_mark_aborted(ssm, -ETIMEDOUT);
fpi_ssm_mark_failed(ssm, -ETIMEDOUT);
break;
default:
fp_dbg("transfer failed: %d", transfer->status);
elan_dev_reset(elandev);
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
}
......@@ -383,7 +383,7 @@ static void elan_cmd_read(fpi_ssm *ssm)
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
return;
}
elandev->cur_transfer = transfer;
......@@ -398,7 +398,7 @@ static void elan_cmd_read(fpi_ssm *ssm)
transfer->flags = LIBUSB_TRANSFER_FREE_TRANSFER;
int r = libusb_submit_transfer(transfer);
if (r < 0)
fpi_ssm_mark_aborted(ssm, r);
fpi_ssm_mark_failed(ssm, r);
}
static void elan_run_cmd(fpi_ssm *ssm, const struct elan_cmd *cmd,
......@@ -421,7 +421,7 @@ static void elan_run_cmd(fpi_ssm *ssm, const struct elan_cmd *cmd,
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
return;
}
elandev->cur_transfer = transfer;
......@@ -432,7 +432,7 @@ static void elan_run_cmd(fpi_ssm *ssm, const struct elan_cmd *cmd,
transfer->flags = LIBUSB_TRANSFER_FREE_TRANSFER;
int r = libusb_submit_transfer(transfer);
if (r < 0)
fpi_ssm_mark_aborted(ssm, r);
fpi_ssm_mark_failed(ssm, r);
}
enum stop_capture_states {
......@@ -521,12 +521,12 @@ static void capture_run_state(fpi_ssm *ssm)
fpi_imgdev_report_finger_status(dev, TRUE);
elan_run_cmd(ssm, &get_image_cmd, ELAN_CMD_TIMEOUT);
} else
fpi_ssm_mark_aborted(ssm, -EBADMSG);
fpi_ssm_mark_failed(ssm, -EBADMSG);
break;
case CAPTURE_CHECK_ENOUGH_FRAMES:
r = elan_save_img_frame(elandev);
if (r < 0)
fpi_ssm_mark_aborted(ssm, r);
fpi_ssm_mark_failed(ssm, r);
else if (elandev->num_frames < ELAN_MAX_FRAMES) {
/* quickly stop if finger is removed */
elandev->cmd_timeout = ELAN_FINGER_TIMEOUT;
......@@ -660,7 +660,7 @@ static void calibrate_run_state(fpi_ssm *ssm)
ELAN_CMD_TIMEOUT);
else {
fp_dbg("calibration failed");
fpi_ssm_mark_aborted(ssm, -1);
fpi_ssm_mark_failed(ssm, -1);
}
break;
case CALIBRATE_CHECK_STATUS:
......@@ -680,7 +680,7 @@ static void calibrate_run_state(fpi_ssm *ssm)
&& elandev->last_read[0] == 0x01)
elandev->calib_status = 0x01;
if (!fpi_timeout_add(50, fpi_ssm_next_state_async, ssm))
fpi_ssm_mark_aborted(ssm, -ETIME);
fpi_ssm_mark_failed(ssm, -ETIME);
}
break;
case CALIBRATE_REPEAT_STATUS:
......
......@@ -676,7 +676,7 @@ static void async_tx_cb(struct libusb_transfer *transfer)
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
fp_warn("transfer is not completed (status=%d)",
transfer->status);
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
libusb_free_transfer(transfer);
} else {
unsigned char endpoint = transfer->endpoint;
......@@ -691,7 +691,7 @@ static void async_tx_cb(struct libusb_transfer *transfer)
length, actual_length);
/* Chained with the answer */
if (async_tx(idev, EP_IN, async_tx_cb, ssm))
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
} else if (endpoint == EP_IN) {
dev->ans_len = actual_length;
fpi_ssm_next_state(ssm);
......@@ -724,7 +724,7 @@ static void m_exit_state(fpi_ssm *ssm)
return;
err:
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
static void m_exit_complete(fpi_ssm *ssm)
......@@ -827,7 +827,7 @@ static void m_capture_state(fpi_ssm *ssm)
return;
err:
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
static void m_capture_complete(fpi_ssm *ssm)
......@@ -945,7 +945,7 @@ static void m_finger_state(fpi_ssm *ssm)
return;
err:
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
static void m_finger_complete(fpi_ssm *ssm)
......@@ -1131,7 +1131,7 @@ static void m_tunevrb_state(fpi_ssm *ssm)
return;
err:
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
static void m_tunevrb_complete(fpi_ssm *ssm)
......@@ -1255,7 +1255,7 @@ static void m_tunedc_state(fpi_ssm *ssm)
return;
err:
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
......@@ -1375,7 +1375,7 @@ static void m_init_state(fpi_ssm *ssm)
return;
err:
fpi_ssm_mark_aborted(ssm, -EIO);
fpi_ssm_mark_failed(ssm, -EIO);
}
......
......@@ -180,7 +180,7 @@ static void last_transfer_killed(struct fp_img_dev *dev)
switch (sdev->killing_transfers) {
case ABORT_SSM:
fp_dbg("abort ssm error %d", sdev->kill_status_code);
fpi_ssm_mark_aborted(sdev->kill_ssm, sdev->kill_status_code);
fpi_ssm_mark_failed(sdev->kill_ssm, sdev->kill_status_code);
return;
case ITERATE_SSM:
fp_dbg("iterate ssm");
......@@ -534,7 +534,7 @@ static void write_regs_finished(struct write_regs_data *wrdata, int result)
if (result == 0)
fpi_ssm_next_state(wrdata->ssm);
else
fpi_ssm_mark_aborted(wrdata->ssm, result);
fpi_ssm_mark_failed(wrdata->ssm, result);
g_free(wrdata);
}
......@@ -584,7 +584,7 @@ static void sm_write_regs(fpi_ssm *ssm,
wrdata->transfer = libusb_alloc_transfer(0);
if (!wrdata->transfer) {
g_free(wrdata);
fpi_ssm_mark_aborted(ssm, -ENOMEM);
fpi_ssm_mark_failed(ssm, -ENOMEM);
return;
}
......@@ -608,7 +608,7 @@ static void sm_write_reg_cb(struct libusb_transfer *transfer)