lib: Typedef fpi_ssm

This commit is contained in:
Bastien Nocera 2018-09-05 13:11:37 +02:00
parent 5ae2ef5407
commit 48b9e6c517
19 changed files with 331 additions and 331 deletions

View file

@ -101,7 +101,7 @@ static void stub_capture_stop_cb(struct fp_img_dev *dev, int result, void *user_
/* check that read succeeded but ignore all data */
static void generic_ignore_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
fpi_ssm_mark_aborted(ssm, -EIO);
@ -117,7 +117,7 @@ static void generic_ignore_data_cb(struct libusb_transfer *transfer)
static void generic_write_regv_cb(struct fp_img_dev *dev, int result,
void *user_data)
{
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
if (result == 0)
fpi_ssm_next_state(ssm);
else
@ -126,7 +126,7 @@ static void generic_write_regv_cb(struct fp_img_dev *dev, int result,
/* read the specified number of bytes from the IN endpoint but throw them
* away, then increment the SSM */
static void generic_read_ignore_data(struct fpi_ssm *ssm, size_t bytes)
static void generic_read_ignore_data(fpi_ssm *ssm, size_t bytes)
{
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *data;
@ -557,7 +557,7 @@ enum capture_states {
static void capture_read_strip_cb(struct libusb_transfer *transfer)
{
unsigned char *stripdata;
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aes1610_dev *aesdev = fpi_imgdev_get_user_data(dev);
unsigned char *data = transfer->buffer;
@ -643,7 +643,7 @@ out:
libusb_free_transfer(transfer);
}
static void capture_run_state(struct fpi_ssm *ssm)
static void capture_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aes1610_dev *aesdev = fpi_imgdev_get_user_data(dev);
@ -690,7 +690,7 @@ static void capture_run_state(struct fpi_ssm *ssm)
};
}
static void capture_sm_complete(struct fpi_ssm *ssm)
static void capture_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aes1610_dev *aesdev = fpi_imgdev_get_user_data(dev);
@ -708,7 +708,7 @@ static void capture_sm_complete(struct fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct aes1610_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm;
fpi_ssm *ssm;
if (aesdev->deactivating) {
complete_deactivation(dev);
@ -738,7 +738,7 @@ enum activate_states {
ACTIVATE_NUM_STATES,
};
static void activate_run_state(struct fpi_ssm *ssm)
static void activate_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -753,7 +753,7 @@ static void activate_run_state(struct fpi_ssm *ssm)
}
/* jump to finger detection */
static void activate_sm_complete(struct fpi_ssm *ssm)
static void activate_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
fp_dbg("status %d", fpi_ssm_get_error(ssm));
@ -767,7 +767,7 @@ static void activate_sm_complete(struct fpi_ssm *ssm)
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct aes1610_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
ACTIVATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
aesdev->read_regs_retry_count = 0;

View file

@ -180,7 +180,7 @@ static int regval_from_dump(unsigned char *data, uint8_t target)
static void generic_write_regv_cb(struct fp_img_dev *dev, int result,
void *user_data)
{
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
if (result == 0)
fpi_ssm_next_state(ssm);
else
@ -190,7 +190,7 @@ static void generic_write_regv_cb(struct fp_img_dev *dev, int result,
/* check that read succeeded but ignore all data */
static void generic_ignore_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
fpi_ssm_mark_aborted(ssm, -EIO);
@ -205,7 +205,7 @@ static void generic_ignore_data_cb(struct libusb_transfer *transfer)
/* read the specified number of bytes from the IN endpoint but throw them
* away, then increment the SSM */
static void generic_read_ignore_data(struct fpi_ssm *ssm, size_t bytes)
static void generic_read_ignore_data(fpi_ssm *ssm, size_t bytes)
{
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *data;
@ -436,7 +436,7 @@ enum capture_states {
static void capture_read_strip_cb(struct libusb_transfer *transfer)
{
unsigned char *stripdata;
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
unsigned char *data = transfer->buffer;
@ -520,7 +520,7 @@ out:
libusb_free_transfer(transfer);
}
static void capture_run_state(struct fpi_ssm *ssm)
static void capture_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
@ -571,7 +571,7 @@ static void capture_run_state(struct fpi_ssm *ssm)
};
}
static void capture_sm_complete(struct fpi_ssm *ssm)
static void capture_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
@ -589,7 +589,7 @@ static void capture_sm_complete(struct fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm;
fpi_ssm *ssm;
if (aesdev->deactivating) {
complete_deactivation(dev);
@ -713,7 +713,7 @@ enum activate_states {
void activate_read_regs_cb(struct fp_img_dev *dev, int status,
unsigned char *regs, void *user_data)
{
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
if (status != 0) {
@ -730,14 +730,14 @@ void activate_read_regs_cb(struct fp_img_dev *dev, int status,
static void activate_init3_cb(struct fp_img_dev *dev, int result,
void *user_data)
{
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
if (result == 0)
fpi_ssm_jump_to_state(ssm, READ_REGS);
else
fpi_ssm_mark_aborted(ssm, result);
}
static void activate_run_state(struct fpi_ssm *ssm)
static void activate_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -791,7 +791,7 @@ static void activate_run_state(struct fpi_ssm *ssm)
}
}
static void activate_sm_complete(struct fpi_ssm *ssm)
static void activate_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
fp_dbg("status %d", fpi_ssm_get_error(ssm));
@ -805,7 +805,7 @@ static void activate_sm_complete(struct fpi_ssm *ssm)
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
ACTIVATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
aesdev->read_regs_retry_count = 0;

View file

@ -200,7 +200,7 @@ enum capture_states {
};
/* Returns number of processed bytes */
static int process_strip_data(struct fpi_ssm *ssm, unsigned char *data)
static int process_strip_data(fpi_ssm *ssm, unsigned char *data)
{
unsigned char *stripdata;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -231,7 +231,7 @@ static int process_strip_data(struct fpi_ssm *ssm, unsigned char *data)
static void capture_reqs_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
(transfer->length == transfer->actual_length)) {
@ -244,7 +244,7 @@ static void capture_reqs_cb(struct libusb_transfer *transfer)
static void capture_set_idle_reqs_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aes2550_dev *aesdev = fpi_imgdev_get_user_data(dev);
@ -272,7 +272,7 @@ static void capture_set_idle_reqs_cb(struct libusb_transfer *transfer)
static void capture_read_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aes2550_dev *aesdev = fpi_imgdev_get_user_data(dev);
unsigned char *data = transfer->buffer;
@ -323,7 +323,7 @@ out:
libusb_free_transfer(transfer);
}
static void capture_run_state(struct fpi_ssm *ssm)
static void capture_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
int r;
@ -386,7 +386,7 @@ static void capture_run_state(struct fpi_ssm *ssm)
};
}
static void capture_sm_complete(struct fpi_ssm *ssm)
static void capture_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aes2550_dev *aesdev = fpi_imgdev_get_user_data(dev);
@ -404,7 +404,7 @@ static void capture_sm_complete(struct fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct aes2550_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm;
fpi_ssm *ssm;
if (aesdev->deactivating) {
complete_deactivation(dev);
@ -444,7 +444,7 @@ enum activate_states {
static void init_reqs_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
(transfer->length == transfer->actual_length)) {
@ -457,7 +457,7 @@ static void init_reqs_cb(struct libusb_transfer *transfer)
static void init_read_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_next_state(ssm);
@ -472,7 +472,7 @@ static void init_read_data_cb(struct libusb_transfer *transfer)
* need more info for implementaion */
static void calibrate_read_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_next_state(ssm);
@ -483,7 +483,7 @@ static void calibrate_read_data_cb(struct libusb_transfer *transfer)
libusb_free_transfer(transfer);
}
static void activate_run_state(struct fpi_ssm *ssm)
static void activate_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
int r;
@ -568,7 +568,7 @@ static void activate_run_state(struct fpi_ssm *ssm)
}
}
static void activate_sm_complete(struct fpi_ssm *ssm)
static void activate_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
fp_dbg("status %d", fpi_ssm_get_error(ssm));
@ -581,7 +581,7 @@ static void activate_sm_complete(struct fpi_ssm *ssm)
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
ACTIVATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
fpi_ssm_start(ssm, activate_sm_complete);

View file

@ -37,7 +37,7 @@ static void complete_deactivation(struct fp_img_dev *dev);
#define min(a, b) (((a) < (b)) ? (a) : (b))
static void aesX660_send_cmd_timeout(struct fpi_ssm *ssm, const unsigned char *cmd,
static void aesX660_send_cmd_timeout(fpi_ssm *ssm, const unsigned char *cmd,
size_t cmd_len, libusb_transfer_cb_fn callback, int timeout)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -60,13 +60,13 @@ static void aesX660_send_cmd_timeout(struct fpi_ssm *ssm, const unsigned char *c
}
}
static void aesX660_send_cmd(struct fpi_ssm *ssm, const unsigned char *cmd,
static void aesX660_send_cmd(fpi_ssm *ssm, const unsigned char *cmd,
size_t cmd_len, libusb_transfer_cb_fn callback)
{
return aesX660_send_cmd_timeout(ssm, cmd, cmd_len, callback, BULK_TIMEOUT);
}
static void aesX660_read_response(struct fpi_ssm *ssm, size_t buf_len,
static void aesX660_read_response(fpi_ssm *ssm, size_t buf_len,
libusb_transfer_cb_fn callback)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -95,7 +95,7 @@ static void aesX660_read_response(struct fpi_ssm *ssm, size_t buf_len,
static void aesX660_send_cmd_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
(transfer->length == transfer->actual_length)) {
@ -110,7 +110,7 @@ static void aesX660_send_cmd_cb(struct libusb_transfer *transfer)
static void aesX660_read_calibrate_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
unsigned char *data = transfer->buffer;
if ((transfer->status != LIBUSB_TRANSFER_COMPLETED) ||
@ -143,7 +143,7 @@ enum finger_det_states {
static void finger_det_read_fd_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
unsigned char *data = transfer->buffer;
@ -184,7 +184,7 @@ out:
static void finger_det_set_idle_cmd_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
(transfer->length == transfer->actual_length)) {
@ -195,7 +195,7 @@ static void finger_det_set_idle_cmd_cb(struct libusb_transfer *transfer)
libusb_free_transfer(transfer);
}
static void finger_det_sm_complete(struct fpi_ssm *ssm)
static void finger_det_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
@ -215,7 +215,7 @@ static void finger_det_sm_complete(struct fpi_ssm *ssm)
}
}
static void finger_det_run_state(struct fpi_ssm *ssm)
static void finger_det_run_state(fpi_ssm *ssm)
{
switch (fpi_ssm_get_cur_state(ssm)) {
case FINGER_DET_SEND_LED_CMD:
@ -239,7 +239,7 @@ static void finger_det_run_state(struct fpi_ssm *ssm)
static void start_finger_detection(struct fp_img_dev *dev)
{
struct fpi_ssm *ssm;
fpi_ssm *ssm;
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
if (aesdev->deactivating) {
@ -263,7 +263,7 @@ enum capture_states {
};
/* Returns number of processed bytes */
static int process_stripe_data(struct fpi_ssm *ssm, unsigned char *data)
static int process_stripe_data(fpi_ssm *ssm, unsigned char *data)
{
struct fpi_frame *stripe;
unsigned char *stripdata;
@ -294,7 +294,7 @@ static int process_stripe_data(struct fpi_ssm *ssm, unsigned char *data)
static void capture_set_idle_cmd_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
@ -320,7 +320,7 @@ static void capture_set_idle_cmd_cb(struct libusb_transfer *transfer)
static void capture_read_stripe_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
unsigned char *data = transfer->buffer;
@ -371,7 +371,7 @@ out:
libusb_free_transfer(transfer);
}
static void capture_run_state(struct fpi_ssm *ssm)
static void capture_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
@ -400,7 +400,7 @@ static void capture_run_state(struct fpi_ssm *ssm)
}
}
static void capture_sm_complete(struct fpi_ssm *ssm)
static void capture_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
@ -420,7 +420,7 @@ static void capture_sm_complete(struct fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm;
fpi_ssm *ssm;
if (aesdev->deactivating) {
complete_deactivation(dev);
@ -448,7 +448,7 @@ enum activate_states {
static void activate_read_id_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
unsigned char *data = transfer->buffer;
@ -499,7 +499,7 @@ out:
static void activate_read_init_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
unsigned char *data = transfer->buffer;
@ -534,7 +534,7 @@ out:
libusb_free_transfer(transfer);
}
static void activate_run_state(struct fpi_ssm *ssm)
static void activate_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
@ -580,7 +580,7 @@ static void activate_run_state(struct fpi_ssm *ssm)
}
}
static void activate_sm_complete(struct fpi_ssm *ssm)
static void activate_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
int err = fpi_ssm_get_error(ssm);
@ -594,7 +594,7 @@ static void activate_sm_complete(struct fpi_ssm *ssm)
int aesX660_dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
ACTIVATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
fpi_ssm_start(ssm, activate_sm_complete);

View file

@ -313,7 +313,7 @@ static void elan_submit_image(struct fp_img_dev *dev)
fpi_imgdev_image_captured(dev, img);
}
static void elan_cmd_done(struct fpi_ssm *ssm)
static void elan_cmd_done(fpi_ssm *ssm)
{
G_DEBUG_HERE();
fpi_ssm_next_state(ssm);
@ -321,7 +321,7 @@ static void elan_cmd_done(struct fpi_ssm *ssm)
static void elan_cmd_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
@ -362,7 +362,7 @@ static void elan_cmd_cb(struct libusb_transfer *transfer)
}
}
static void elan_cmd_read(struct fpi_ssm *ssm)
static void elan_cmd_read(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
@ -401,7 +401,7 @@ static void elan_cmd_read(struct fpi_ssm *ssm)
fpi_ssm_mark_aborted(ssm, r);
}
static void elan_run_cmd(struct fpi_ssm *ssm, const struct elan_cmd *cmd,
static void elan_run_cmd(fpi_ssm *ssm, const struct elan_cmd *cmd,
int cmd_timeout)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -440,7 +440,7 @@ enum stop_capture_states {
STOP_CAPTURE_NUM_STATES,
};
static void stop_capture_run_state(struct fpi_ssm *ssm)
static void stop_capture_run_state(fpi_ssm *ssm)
{
G_DEBUG_HERE();
@ -451,7 +451,7 @@ static void stop_capture_run_state(struct fpi_ssm *ssm)
}
}
static void stop_capture_complete(struct fpi_ssm *ssm)
static void stop_capture_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
@ -485,7 +485,7 @@ static void elan_stop_capture(struct fp_img_dev *dev)
elan_dev_reset(elandev);
struct fpi_ssm *ssm =
fpi_ssm *ssm =
fpi_ssm_new(fpi_imgdev_get_dev(dev), stop_capture_run_state,
STOP_CAPTURE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
@ -500,7 +500,7 @@ enum capture_states {
CAPTURE_NUM_STATES,
};
static void capture_run_state(struct fpi_ssm *ssm)
static void capture_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
@ -538,7 +538,7 @@ static void capture_run_state(struct fpi_ssm *ssm)
}
}
static void capture_complete(struct fpi_ssm *ssm)
static void capture_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
@ -578,7 +578,7 @@ static void elan_capture(struct fp_img_dev *dev)
G_DEBUG_HERE();
elan_dev_reset(elandev);
struct fpi_ssm *ssm =
fpi_ssm *ssm =
fpi_ssm_new(fpi_imgdev_get_dev(dev), capture_run_state, CAPTURE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
fpi_ssm_start(ssm, capture_complete);
@ -586,7 +586,7 @@ static void elan_capture(struct fp_img_dev *dev)
static void fpi_ssm_next_state_async(void *data)
{
fpi_ssm_next_state((struct fpi_ssm *)data);
fpi_ssm_next_state((fpi_ssm *)data);
}
/* this function needs to have elandev->background and elandev->last_read to be
@ -624,7 +624,7 @@ enum calibrate_states {
CALIBRATE_NUM_STATES,
};
static void calibrate_run_state(struct fpi_ssm *ssm)
static void calibrate_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
@ -689,7 +689,7 @@ static void calibrate_run_state(struct fpi_ssm *ssm)
}
}
static void calibrate_complete(struct fpi_ssm *ssm)
static void calibrate_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -711,7 +711,7 @@ static void elan_calibrate(struct fp_img_dev *dev)
elan_dev_reset(elandev);
elandev->calib_atts_left = ELAN_CALIBRATION_ATTEMPTS;
struct fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), calibrate_run_state,
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), calibrate_run_state,
CALIBRATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
fpi_ssm_start(ssm, calibrate_complete);
@ -726,7 +726,7 @@ enum activate_states {
ACTIVATE_NUM_STATES,
};
static void activate_run_state(struct fpi_ssm *ssm)
static void activate_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
@ -770,7 +770,7 @@ static void activate_run_state(struct fpi_ssm *ssm)
}
}
static void activate_complete(struct fpi_ssm *ssm)
static void activate_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -790,7 +790,7 @@ static void elan_activate(struct fp_img_dev *dev)
G_DEBUG_HERE();
elan_dev_reset(elandev);
struct fpi_ssm *ssm =
fpi_ssm *ssm =
fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state, ACTIVATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
fpi_ssm_start(ssm, activate_complete);

View file

@ -210,8 +210,8 @@ static const struct usb_id elan_id_table[] = {
{0, 0, 0,},
};
static void elan_cmd_done(struct fpi_ssm *ssm);
static void elan_cmd_read(struct fpi_ssm *ssm);
static void elan_cmd_done(fpi_ssm *ssm);
static void elan_cmd_read(fpi_ssm *ssm);
static void elan_calibrate(struct fp_img_dev *dev);
static void elan_capture(struct fp_img_dev *dev);

View file

@ -669,7 +669,7 @@ static int async_tx(struct fp_img_dev *idev, unsigned int ep, void *cb,
static void async_tx_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
@ -699,7 +699,7 @@ static void async_tx_cb(struct libusb_transfer *transfer)
}
}
static void m_exit_state(struct fpi_ssm *ssm)
static void m_exit_state(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
@ -727,7 +727,7 @@ err:
fpi_ssm_mark_aborted(ssm, -EIO);
}
static void m_exit_complete(struct fpi_ssm *ssm)
static void m_exit_complete(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
@ -742,14 +742,14 @@ static void m_exit_complete(struct fpi_ssm *ssm)
static void m_exit_start(struct fp_img_dev *idev)
{
struct fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(idev), m_exit_state,
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(idev), m_exit_state,
EXIT_NUM_STATES);
fp_dbg("Switching device to idle mode");
fpi_ssm_set_user_data(ssm, idev);
fpi_ssm_start(ssm, m_exit_complete);
}
static void m_capture_state(struct fpi_ssm *ssm)
static void m_capture_state(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
@ -830,7 +830,7 @@ err:
fpi_ssm_mark_aborted(ssm, -EIO);
}
static void m_capture_complete(struct fpi_ssm *ssm)
static void m_capture_complete(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
@ -852,7 +852,7 @@ static void m_capture_complete(struct fpi_ssm *ssm)
}
}
static void m_finger_state(struct fpi_ssm *ssm)
static void m_finger_state(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
@ -948,13 +948,13 @@ err:
fpi_ssm_mark_aborted(ssm, -EIO);
}
static void m_finger_complete(struct fpi_ssm *ssm)
static void m_finger_complete(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
if (!fpi_ssm_get_error(ssm)) {
struct fpi_ssm *ssm_cap;
fpi_ssm *ssm_cap;
ssm_cap = fpi_ssm_new(fpi_imgdev_get_dev(idev), m_capture_state,
CAP_NUM_STATES);
fpi_ssm_set_user_data(ssm_cap, idev);
@ -973,7 +973,7 @@ static void m_finger_complete(struct fpi_ssm *ssm)
static void m_start_fingerdetect(struct fp_img_dev *idev)
{
struct fpi_ssm *ssmf;
fpi_ssm *ssmf;
ssmf = fpi_ssm_new(fpi_imgdev_get_dev(idev), m_finger_state, FGR_NUM_STATES);
fpi_ssm_set_user_data(ssmf, idev);
fpi_ssm_start(ssmf, m_finger_complete);
@ -982,7 +982,7 @@ static void m_start_fingerdetect(struct fp_img_dev *idev)
/*
* Tune value of VRT and VRB for contrast and brightness.
*/
static void m_tunevrb_state(struct fpi_ssm *ssm)
static void m_tunevrb_state(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
@ -1134,7 +1134,7 @@ err:
fpi_ssm_mark_aborted(ssm, -EIO);
}
static void m_tunevrb_complete(struct fpi_ssm *ssm)
static void m_tunevrb_complete(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
@ -1156,7 +1156,7 @@ static void m_tunevrb_complete(struct fpi_ssm *ssm)
* This function tunes the DCoffset value and adjusts the gain value if
* required.
*/
static void m_tunedc_state(struct fpi_ssm *ssm)
static void m_tunedc_state(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
@ -1259,11 +1259,11 @@ err:
}
static void m_tunedc_complete(struct fpi_ssm *ssm)
static void m_tunedc_complete(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
if (!fpi_ssm_get_error(ssm)) {
struct fpi_ssm *ssm_tune;
fpi_ssm *ssm_tune;
ssm_tune = fpi_ssm_new(fpi_imgdev_get_dev(idev), m_tunevrb_state,
TUNEVRB_NUM_STATES);
fpi_ssm_set_user_data(ssm_tune, idev);
@ -1278,7 +1278,7 @@ static void m_tunedc_complete(struct fpi_ssm *ssm)
fpi_ssm_free(ssm);
}
static void m_init_state(struct fpi_ssm *ssm)
static void m_init_state(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
@ -1379,11 +1379,11 @@ err:
}
static void m_init_complete(struct fpi_ssm *ssm)
static void m_init_complete(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
if (!fpi_ssm_get_error(ssm)) {
struct fpi_ssm *ssm_tune;
fpi_ssm *ssm_tune;
ssm_tune = fpi_ssm_new(fpi_imgdev_get_dev(idev), m_tunedc_state,
TUNEDC_NUM_STATES);
fpi_ssm_set_user_data(ssm_tune, idev);
@ -1401,7 +1401,7 @@ static void m_init_complete(struct fpi_ssm *ssm)
static int dev_activate(struct fp_img_dev *idev, enum fp_imgdev_state state)
{
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
struct fpi_ssm *ssm;
fpi_ssm *ssm;
g_assert(dev);

View file

@ -81,7 +81,7 @@ struct sonly_dev {
int dev_model;
int img_width;
struct fpi_ssm *loopsm;
fpi_ssm *loopsm;
struct libusb_transfer *img_transfer[NUM_BULK_TRANSFERS];
struct img_transfer_data *img_transfer_data;
int num_flying;
@ -100,7 +100,7 @@ struct sonly_dev {
enum sonly_kill_transfers_action killing_transfers;
int kill_status_code;
union {
struct fpi_ssm *kill_ssm;
fpi_ssm *kill_ssm;
void (*kill_cb)(struct fp_img_dev *dev);
};
};
@ -520,7 +520,7 @@ static void img_data_cb(struct libusb_transfer *transfer)
/***** STATE MACHINE HELPERS *****/
struct write_regs_data {
struct fpi_ssm *ssm;
fpi_ssm *ssm;
struct libusb_transfer *transfer;
const struct sonly_regwrite *regs;
size_t num_regs;
@ -574,7 +574,7 @@ static void write_regs_cb(struct libusb_transfer *transfer)
write_regs_iterate(wrdata);
}
static void sm_write_regs(struct fpi_ssm *ssm,
static void sm_write_regs(fpi_ssm *ssm,
const struct sonly_regwrite *regs, size_t num_regs)
{
struct write_regs_data *wrdata = g_malloc(sizeof(*wrdata));
@ -605,7 +605,7 @@ static void sm_write_regs(struct fpi_ssm *ssm,
static void sm_write_reg_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
g_free(transfer->buffer);
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
fpi_ssm_mark_aborted(ssm, -EIO);
@ -614,7 +614,7 @@ static void sm_write_reg_cb(struct libusb_transfer *transfer)
}
static void sm_write_reg(struct fpi_ssm *ssm, uint8_t reg, uint8_t value)
static void sm_write_reg(fpi_ssm *ssm, uint8_t reg, uint8_t value)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
@ -647,7 +647,7 @@ static void sm_write_reg(struct fpi_ssm *ssm, uint8_t reg, uint8_t value)
static void sm_read_reg_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
@ -662,7 +662,7 @@ static void sm_read_reg_cb(struct libusb_transfer *transfer)
g_free(transfer->buffer);
}
static void sm_read_reg(struct fpi_ssm *ssm, uint8_t reg)
static void sm_read_reg(fpi_ssm *ssm, uint8_t reg)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
@ -693,7 +693,7 @@ static void sm_read_reg(struct fpi_ssm *ssm, uint8_t reg)
static void sm_await_intr_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
@ -713,7 +713,7 @@ static void sm_await_intr_cb(struct libusb_transfer *transfer)
fpi_ssm_next_state(ssm);
}
static void sm_await_intr(struct fpi_ssm *ssm)
static void sm_await_intr(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
@ -763,7 +763,7 @@ enum awfsm_1000_states {
AWFSM_1000_NUM_STATES,
};
static void awfsm_2016_run_state(struct fpi_ssm *ssm)
static void awfsm_2016_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
@ -810,7 +810,7 @@ static void awfsm_2016_run_state(struct fpi_ssm *ssm)
}
}
static void awfsm_1000_run_state(struct fpi_ssm *ssm)
static void awfsm_1000_run_state(fpi_ssm *ssm)
{
switch (fpi_ssm_get_cur_state(ssm)) {
case AWFSM_1000_WRITEV_1:
@ -851,7 +851,7 @@ enum capsm_1001_states {
CAPSM_1001_NUM_STATES,
};
static void capsm_fire_bulk(struct fpi_ssm *ssm)
static void capsm_fire_bulk(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
@ -881,7 +881,7 @@ static void capsm_fire_bulk(struct fpi_ssm *ssm)
fpi_ssm_next_state(ssm);
}
static void capsm_2016_run_state(struct fpi_ssm *ssm)
static void capsm_2016_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
@ -913,7 +913,7 @@ static void capsm_2016_run_state(struct fpi_ssm *ssm)
}
}
static void capsm_1000_run_state(struct fpi_ssm *ssm)
static void capsm_1000_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
@ -939,7 +939,7 @@ static void capsm_1000_run_state(struct fpi_ssm *ssm)
}
}
static void capsm_1001_run_state(struct fpi_ssm *ssm)
static void capsm_1001_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
@ -994,7 +994,7 @@ enum deinitsm_1001_states {
DEINITSM_1001_NUM_STATES,
};
static void deinitsm_2016_run_state(struct fpi_ssm *ssm)
static void deinitsm_2016_run_state(fpi_ssm *ssm)
{
switch (fpi_ssm_get_cur_state(ssm)) {
case DEINITSM_2016_WRITEV:
@ -1003,7 +1003,7 @@ static void deinitsm_2016_run_state(struct fpi_ssm *ssm)
}
}
static void deinitsm_1000_run_state(struct fpi_ssm *ssm)
static void deinitsm_1000_run_state(fpi_ssm *ssm)
{
switch (fpi_ssm_get_cur_state(ssm)) {
case DEINITSM_1000_WRITEV:
@ -1012,7 +1012,7 @@ static void deinitsm_1000_run_state(struct fpi_ssm *ssm)
}
}
static void deinitsm_1001_run_state(struct fpi_ssm *ssm)
static void deinitsm_1001_run_state(fpi_ssm *ssm)
{
switch (fpi_ssm_get_cur_state(ssm)) {
case DEINITSM_1001_WRITEV:
@ -1048,7 +1048,7 @@ enum initsm_1001_states {
INITSM_1001_NUM_STATES,
};
static void initsm_2016_run_state(struct fpi_ssm *ssm)
static void initsm_2016_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
@ -1078,7 +1078,7 @@ static void initsm_2016_run_state(struct fpi_ssm *ssm)
}
}
static void initsm_1000_run_state(struct fpi_ssm *ssm)
static void initsm_1000_run_state(fpi_ssm *ssm)
{
switch (fpi_ssm_get_cur_state(ssm)) {
case INITSM_1000_WRITEV_1:
@ -1087,7 +1087,7 @@ static void initsm_1000_run_state(struct fpi_ssm *ssm)
}
}
static void initsm_1001_run_state(struct fpi_ssm *ssm)
static void initsm_1001_run_state(fpi_ssm *ssm)
{
switch (fpi_ssm_get_cur_state(ssm)) {
case INITSM_1001_WRITEV_1:
@ -1120,7 +1120,7 @@ enum loopsm_states {
LOOPSM_NUM_STATES,
};
static void loopsm_run_state(struct fpi_ssm *ssm)
static void loopsm_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
@ -1139,7 +1139,7 @@ static void loopsm_run_state(struct fpi_ssm *ssm)
if (sdev->deactivating) {
fpi_ssm_mark_completed(ssm);
} else {
struct fpi_ssm *awfsm = NULL;
fpi_ssm *awfsm = NULL;
switch (sdev->dev_model) {
case UPEKSONLY_2016:
awfsm = fpi_ssm_new(fpi_imgdev_get_dev(dev), awfsm_2016_run_state,
@ -1167,7 +1167,7 @@ static void loopsm_run_state(struct fpi_ssm *ssm)
}
break;
case LOOPSM_RUN_CAPSM: ;
struct fpi_ssm *capsm = NULL;
fpi_ssm *capsm = NULL;
switch (sdev->dev_model) {
case UPEKSONLY_2016:
capsm = fpi_ssm_new(fpi_imgdev_get_dev(dev), capsm_2016_run_state,
@ -1188,7 +1188,7 @@ static void loopsm_run_state(struct fpi_ssm *ssm)
case LOOPSM_CAPTURE:
break;
case LOOPSM_RUN_DEINITSM: ;
struct fpi_ssm *deinitsm = NULL;
fpi_ssm *deinitsm = NULL;
switch (sdev->dev_model) {
case UPEKSONLY_2016:
deinitsm = fpi_ssm_new(fpi_imgdev_get_dev(dev), deinitsm_2016_run_state,
@ -1248,7 +1248,7 @@ static void dev_deactivate(struct fp_img_dev *dev)
cancel_img_transfers(dev);
}
static void loopsm_complete(struct fpi_ssm *ssm)
static void loopsm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
@ -1267,7 +1267,7 @@ static void loopsm_complete(struct fpi_ssm *ssm)
}
}
static void initsm_complete(struct fpi_ssm *ssm)
static void initsm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
@ -1286,7 +1286,7 @@ static void initsm_complete(struct fpi_ssm *ssm)
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm = NULL;
fpi_ssm *ssm = NULL;
int i;
sdev->deactivating = FALSE;

View file

@ -56,7 +56,7 @@ enum activate_states {
ACTIVATE_NUM_STATES,
};
static void upektc_next_init_cmd(struct fpi_ssm *ssm)
static void upektc_next_init_cmd(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
@ -70,7 +70,7 @@ static void upektc_next_init_cmd(struct fpi_ssm *ssm)
static void write_init_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
@ -88,7 +88,7 @@ static void write_init_cb(struct libusb_transfer *transfer)
static void read_init_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status == LIBUSB_TRANSFER_COMPLETED)
upektc_next_init_cmd(ssm);
@ -98,7 +98,7 @@ static void read_init_data_cb(struct libusb_transfer *transfer)
libusb_free_transfer(transfer);
}
static void activate_run_state(struct fpi_ssm *ssm)
static void activate_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
@ -148,7 +148,7 @@ static void activate_run_state(struct fpi_ssm *ssm)
}
}
static void activate_sm_complete(struct fpi_ssm *ssm)
static void activate_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
fp_dbg("status %d", fpi_ssm_get_error(ssm));
@ -283,7 +283,7 @@ enum capture_states {
static void capture_cmd_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
(transfer->length == transfer->actual_length)) {
@ -296,7 +296,7 @@ static void capture_cmd_cb(struct libusb_transfer *transfer)
static void capture_read_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
unsigned char *data = transfer->buffer;
struct fp_img *img;
@ -321,7 +321,7 @@ out:
libusb_free_transfer(transfer);
}
static void capture_run_state(struct fpi_ssm *ssm)
static void capture_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
@ -370,7 +370,7 @@ static void capture_run_state(struct fpi_ssm *ssm)
};
}
static void capture_sm_complete(struct fpi_ssm *ssm)
static void capture_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
@ -388,7 +388,7 @@ static void capture_sm_complete(struct fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm;
fpi_ssm *ssm;
if (upekdev->deactivating) {
complete_deactivation(dev);
@ -404,7 +404,7 @@ static void start_capture(struct fp_img_dev *dev)
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
ACTIVATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
upekdev->init_idx = 0;

View file

@ -71,7 +71,7 @@ static void upektc_img_cmd_update_crc(unsigned char *cmd_buf, size_t size)
cmd_buf[size - 1] = (crc & 0xff00) >> 8;
}
static void upektc_img_submit_req(struct fpi_ssm *ssm,
static void upektc_img_submit_req(fpi_ssm *ssm,
const unsigned char *buf, size_t buf_size, unsigned char seq,
libusb_transfer_cb_fn cb)
{
@ -103,7 +103,7 @@ static void upektc_img_submit_req(struct fpi_ssm *ssm,
}
}
static void upektc_img_read_data(struct fpi_ssm *ssm, size_t buf_size, size_t buf_offset, libusb_transfer_cb_fn cb)
static void upektc_img_read_data(fpi_ssm *ssm, size_t buf_size, size_t buf_offset, libusb_transfer_cb_fn cb)
{
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -144,7 +144,7 @@ enum capture_states {
static void capture_reqs_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if ((transfer->status != LIBUSB_TRANSFER_COMPLETED) ||
(transfer->length != transfer->actual_length)) {
@ -181,7 +181,7 @@ static int upektc_img_process_image_frame(unsigned char *image_buf, unsigned cha
static void capture_read_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
unsigned char *data = upekdev->response;
@ -304,7 +304,7 @@ static void capture_read_data_cb(struct libusb_transfer *transfer)
}
}
static void capture_run_state(struct fpi_ssm *ssm)
static void capture_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
@ -341,7 +341,7 @@ static void capture_run_state(struct fpi_ssm *ssm)
};
}
static void capture_sm_complete(struct fpi_ssm *ssm)
static void capture_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
@ -361,7 +361,7 @@ static void capture_sm_complete(struct fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm;
fpi_ssm *ssm;
upekdev->image_size = 0;
@ -380,7 +380,7 @@ enum deactivate_states {
static void deactivate_reqs_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
(transfer->length == transfer->actual_length)) {
@ -393,7 +393,7 @@ static void deactivate_reqs_cb(struct libusb_transfer *transfer)
/* TODO: process response properly */
static void deactivate_read_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_mark_completed(ssm);
@ -402,7 +402,7 @@ static void deactivate_read_data_cb(struct libusb_transfer *transfer)
}
}
static void deactivate_run_state(struct fpi_ssm *ssm)
static void deactivate_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
@ -419,7 +419,7 @@ static void deactivate_run_state(struct fpi_ssm *ssm)
};
}
static void deactivate_sm_complete(struct fpi_ssm *ssm)
static void deactivate_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
@ -440,7 +440,7 @@ static void deactivate_sm_complete(struct fpi_ssm *ssm)
static void start_deactivation(struct fp_img_dev *dev)
{
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm;
fpi_ssm *ssm;
upekdev->image_size = 0;
@ -467,7 +467,7 @@ enum activate_states {
static void init_reqs_ctrl_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_next_state(ssm);
@ -478,7 +478,7 @@ static void init_reqs_ctrl_cb(struct libusb_transfer *transfer)
static void init_reqs_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
(transfer->length == transfer->actual_length)) {
@ -491,7 +491,7 @@ static void init_reqs_cb(struct libusb_transfer *transfer)
/* TODO: process response properly */
static void init_read_data_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_next_state(ssm);
@ -500,7 +500,7 @@ static void init_read_data_cb(struct libusb_transfer *transfer)
}
}
static void activate_run_state(struct fpi_ssm *ssm)
static void activate_run_state(fpi_ssm *ssm)
{
struct libusb_transfer *transfer;
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
@ -564,7 +564,7 @@ static void activate_run_state(struct fpi_ssm *ssm)
}
}
static void activate_sm_complete(struct fpi_ssm *ssm)
static void activate_sm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
int err = fpi_ssm_get_error(ssm);
@ -580,7 +580,7 @@ static void activate_sm_complete(struct fpi_ssm *ssm)
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
ACTIVATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
upekdev->seq = 0;

View file

@ -484,7 +484,7 @@ enum initsm_states {
INITSM_NUM_STATES,
};
static void initsm_read_msg_response_cb(struct fpi_ssm *ssm,
static void initsm_read_msg_response_cb(fpi_ssm *ssm,
enum read_msg_status status, uint8_t seq,
unsigned char expect_subcmd, unsigned char subcmd)
{
@ -513,7 +513,7 @@ static void read28_0b_cb(struct fp_dev *dev, enum read_msg_status status,
uint8_t seq, unsigned char subcmd, unsigned char *data, size_t data_len,
void *user_data)
{
initsm_read_msg_response_cb((struct fpi_ssm *) user_data, status, seq,
initsm_read_msg_response_cb((fpi_ssm *) user_data, status, seq,
0x0b, subcmd);
}
@ -521,7 +521,7 @@ static void read28_0c_cb(struct fp_dev *dev, enum read_msg_status status,
uint8_t seq, unsigned char subcmd, unsigned char *data, size_t data_len,
void *user_data)
{
initsm_read_msg_response_cb((struct fpi_ssm *) user_data, status, seq,
initsm_read_msg_response_cb((fpi_ssm *) user_data, status, seq,
0x0c, subcmd);
}
@ -529,7 +529,7 @@ static void read28_08_cb(struct fp_dev *dev, enum read_msg_status status,
uint8_t seq, unsigned char subcmd, unsigned char *data, size_t data_len,
void *user_data)
{
initsm_read_msg_response_cb((struct fpi_ssm *) user_data, status, seq,
initsm_read_msg_response_cb((fpi_ssm *) user_data, status, seq,
0x08, subcmd);
}
@ -537,7 +537,7 @@ static void read28_07_cb(struct fp_dev *dev, enum read_msg_status status,
uint8_t seq, unsigned char subcmd, unsigned char *data, size_t data_len,
void *user_data)
{
initsm_read_msg_response_cb((struct fpi_ssm *) user_data, status, seq,
initsm_read_msg_response_cb((fpi_ssm *) user_data, status, seq,
0x07, subcmd);
}
@ -545,11 +545,11 @@ static void read28_06_cb(struct fp_dev *dev, enum read_msg_status status,
uint8_t seq, unsigned char subcmd, unsigned char *data, size_t data_len,
void *user_data)
{
initsm_read_msg_response_cb((struct fpi_ssm *) user_data, status, seq,
initsm_read_msg_response_cb((fpi_ssm *) user_data, status, seq,
0x06, subcmd);
}
static void initsm_read_msg_cmd_cb(struct fpi_ssm *ssm,
static void initsm_read_msg_cmd_cb(fpi_ssm *ssm,
enum read_msg_status status, uint8_t expect_seq, uint8_t seq)
{
struct fp_dev *dev = fpi_ssm_get_dev(ssm);
@ -579,19 +579,19 @@ static void read_msg05_cb(struct fp_dev *dev, enum read_msg_status status,
uint8_t seq, unsigned char subcmd, unsigned char *data, size_t data_len,
void *user_data)
{
initsm_read_msg_cmd_cb((struct fpi_ssm *) user_data, status, 5, seq);
initsm_read_msg_cmd_cb((fpi_ssm *) user_data, status, 5, seq);
}
static void read_msg03_cb(struct fp_dev *dev, enum read_msg_status status,
uint8_t seq, unsigned char subcmd, unsigned char *data, size_t data_len,
void *user_data)
{
initsm_read_msg_cmd_cb((struct fpi_ssm *) user_data, status, 3, seq);
initsm_read_msg_cmd_cb((fpi_ssm *) user_data, status, 3, seq);
}
static void ctrl400_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
/* FIXME check length? */
if (transfer->status == LIBUSB_TRANSFER_COMPLETED)
fpi_ssm_next_state(ssm);
@ -601,7 +601,7 @@ static void ctrl400_cb(struct libusb_transfer *transfer)
libusb_free_transfer(transfer);
}
static void initsm_read_msg_handler(struct fpi_ssm *ssm,
static void initsm_read_msg_handler(fpi_ssm *ssm,
read_msg_cb_fn callback)
{
int r = read_msg_async(fpi_ssm_get_dev(ssm), callback, ssm);
@ -613,7 +613,7 @@ static void initsm_read_msg_handler(struct fpi_ssm *ssm,
static void initsm_send_msg_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status == LIBUSB_TRANSFER_COMPLETED
&& transfer->length == transfer->actual_length) {
fp_dbg("state %d completed", fpi_ssm_get_cur_state(ssm));
@ -626,7 +626,7 @@ static void initsm_send_msg_cb(struct libusb_transfer *transfer)
libusb_free_transfer(transfer);
}
static void initsm_send_msg28_handler(struct fpi_ssm *ssm,
static void initsm_send_msg28_handler(fpi_ssm *ssm,
unsigned char subcmd, const unsigned char *data, uint16_t innerlen)
{
struct fp_dev *dev = fpi_ssm_get_dev(ssm);
@ -649,7 +649,7 @@ static void initsm_send_msg28_handler(struct fpi_ssm *ssm,
}
}
static void initsm_run_state(struct fpi_ssm *ssm)
static void initsm_run_state(fpi_ssm *ssm)
{
struct fp_dev *dev = fpi_ssm_get_dev(ssm);
struct upekts_dev *upekdev = fpi_dev_get_user_data(dev);
@ -736,7 +736,7 @@ static void initsm_run_state(struct fpi_ssm *ssm)
}
}
static struct fpi_ssm *initsm_new(struct fp_dev *dev)
static fpi_ssm *initsm_new(struct fp_dev *dev)
{
return fpi_ssm_new(dev, initsm_run_state, INITSM_NUM_STATES);
}
@ -749,7 +749,7 @@ enum deinitsm_states {
static void send_resp07_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
fpi_ssm_mark_aborted(ssm, -EIO);
else if (transfer->length != transfer->actual_length)
@ -763,7 +763,7 @@ static void read_msg01_cb(struct fp_dev *dev, enum read_msg_status status,
uint8_t seq, unsigned char subcmd, unsigned char *data, size_t data_len,
void *user_data)
{
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
struct upekts_dev *upekdev = fpi_dev_get_user_data(dev);
if (status == READ_MSG_ERROR) {
@ -784,7 +784,7 @@ static void read_msg01_cb(struct fp_dev *dev, enum read_msg_status status,
fpi_ssm_next_state(ssm);
}
static void deinitsm_state_handler(struct fpi_ssm *ssm)
static void deinitsm_state_handler(fpi_ssm *ssm)
{
struct fp_dev *dev = fpi_ssm_get_dev(ssm);
int r;
@ -816,7 +816,7 @@ static void deinitsm_state_handler(struct fpi_ssm *ssm)
}
}
static struct fpi_ssm *deinitsm_new(struct fp_dev *dev)
static fpi_ssm *deinitsm_new(struct fp_dev *dev)
{
return fpi_ssm_new(dev, deinitsm_state_handler, DEINITSM_NUM_STATES);
}
@ -868,9 +868,9 @@ enum enroll_start_sm_states {
};
/* Called when the device initialization state machine completes */
static void enroll_start_sm_cb_initsm(struct fpi_ssm *initsm)
static void enroll_start_sm_cb_initsm(fpi_ssm *initsm)
{
struct fpi_ssm *enroll_start_ssm = fpi_ssm_get_user_data(initsm);
fpi_ssm *enroll_start_ssm = fpi_ssm_get_user_data(initsm);
int error = fpi_ssm_get_error(initsm);
fpi_ssm_free(initsm);
@ -883,7 +883,7 @@ static void enroll_start_sm_cb_initsm(struct fpi_ssm *initsm)
/* called when enroll init URB has completed */
static void enroll_start_sm_cb_init(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
fpi_ssm_mark_aborted(ssm, -EIO);
else if (transfer->length != transfer->actual_length)
@ -898,7 +898,7 @@ static void enroll_start_sm_cb_msg28(struct fp_dev *dev,
unsigned char *data, size_t data_len, void *user_data)
{
struct upekts_dev *upekdev = fpi_dev_get_user_data(dev);
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
if (status != READ_MSG_RESPONSE) {
fp_err("expected response, got %d seq=%x", status, seq);
@ -916,14 +916,14 @@ static void enroll_start_sm_cb_msg28(struct fp_dev *dev,
}
}
static void enroll_start_sm_run_state(struct fpi_ssm *ssm)
static void enroll_start_sm_run_state(fpi_ssm *ssm)
{
struct fp_dev *dev = fpi_ssm_get_dev(ssm);
int r;
switch (fpi_ssm_get_cur_state(ssm)) {
case RUN_INITSM: ;
struct fpi_ssm *initsm = initsm_new(dev);
fpi_ssm *initsm = initsm_new(dev);
fpi_ssm_set_user_data(initsm, ssm);
fpi_ssm_start(initsm, enroll_start_sm_cb_initsm);
break;
@ -1112,7 +1112,7 @@ static void enroll_iterate(struct fp_dev *dev)
}
}
static void enroll_started(struct fpi_ssm *ssm)
static void enroll_started(fpi_ssm *ssm)
{
struct fp_dev *dev = fpi_ssm_get_dev(ssm);
fpi_drvcb_enroll_started(dev, fpi_ssm_get_error(ssm));
@ -1128,7 +1128,7 @@ static int enroll_start(struct fp_dev *dev)
struct upekts_dev *upekdev = fpi_dev_get_user_data(dev);
/* do_init state machine first */
struct fpi_ssm *ssm = fpi_ssm_new(dev, enroll_start_sm_run_state,
fpi_ssm *ssm = fpi_ssm_new(dev, enroll_start_sm_run_state,
ENROLL_START_NUM_STATES);
upekdev->enroll_passed = FALSE;
@ -1136,7 +1136,7 @@ static int enroll_start(struct fp_dev *dev)
return 0;
}
static void enroll_stop_deinit_cb(struct fpi_ssm *ssm)
static void enroll_stop_deinit_cb(fpi_ssm *ssm)
{
/* don't really care about errors */
fpi_drvcb_enroll_stopped(fpi_ssm_get_dev(ssm));
@ -1145,12 +1145,12 @@ static void enroll_stop_deinit_cb(struct fpi_ssm *ssm)
static int enroll_stop(struct fp_dev *dev)
{
struct fpi_ssm *ssm = deinitsm_new(dev);
fpi_ssm *ssm = deinitsm_new(dev);
fpi_ssm_start(ssm, enroll_stop_deinit_cb);
return 0;
}
static void verify_stop_deinit_cb(struct fpi_ssm *ssm)
static void verify_stop_deinit_cb(fpi_ssm *ssm)
{
/* don't really care about errors */
fpi_drvcb_verify_stopped(fpi_ssm_get_dev(ssm));
@ -1159,7 +1159,7 @@ static void verify_stop_deinit_cb(struct fpi_ssm *ssm)
static void do_verify_stop(struct fp_dev *dev)
{
struct fpi_ssm *ssm = deinitsm_new(dev);
fpi_ssm *ssm = deinitsm_new(dev);
fpi_ssm_start(ssm, verify_stop_deinit_cb);
}
@ -1176,9 +1176,9 @@ enum {
};
/* Called when the device initialization state machine completes */
static void verify_start_sm_cb_initsm(struct fpi_ssm *initsm)
static void verify_start_sm_cb_initsm(fpi_ssm *initsm)
{
struct fpi_ssm *verify_start_ssm = fpi_ssm_get_user_data(initsm);
fpi_ssm *verify_start_ssm = fpi_ssm_get_user_data(initsm);
int err;
err = fpi_ssm_get_error(initsm);
@ -1191,7 +1191,7 @@ static void verify_start_sm_cb_initsm(struct fpi_ssm *initsm)
static void verify_init_2803_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
fpi_ssm_mark_aborted(ssm, -EIO);
else if (transfer->length != transfer->actual_length)
@ -1201,14 +1201,14 @@ static void verify_init_2803_cb(struct libusb_transfer *transfer)
libusb_free_transfer(transfer);
}
static void verify_start_sm_run_state(struct fpi_ssm *ssm)
static void verify_start_sm_run_state(fpi_ssm *ssm)
{
struct fp_dev *dev = fpi_ssm_get_dev(ssm);
int r;
switch (fpi_ssm_get_cur_state(ssm)) {
case VERIFY_RUN_INITSM: ;
struct fpi_ssm *initsm = initsm_new(dev);
fpi_ssm *initsm = initsm_new(dev);
fpi_ssm_set_user_data(initsm, ssm);
fpi_ssm_start(initsm, verify_start_sm_cb_initsm);
break;
@ -1391,7 +1391,7 @@ static void verify_iterate(struct fp_dev *dev)
}
}
static void verify_started(struct fpi_ssm *ssm)
static void verify_started(fpi_ssm *ssm)
{
struct fp_dev *dev = fpi_ssm_get_dev(ssm);
struct upekts_dev *upekdev = fpi_dev_get_user_data(dev);
@ -1408,7 +1408,7 @@ static void verify_started(struct fpi_ssm *ssm)
static int verify_start(struct fp_dev *dev)
{
struct upekts_dev *upekdev = fpi_dev_get_user_data(dev);
struct fpi_ssm *ssm = fpi_ssm_new(dev, verify_start_sm_run_state,
fpi_ssm *ssm = fpi_ssm_new(dev, verify_start_sm_run_state,
VERIFY_NUM_STATES);
upekdev->stop_verify = FALSE;
fpi_ssm_start(ssm, verify_started);

View file

@ -306,7 +306,7 @@ static int read_regs(struct fp_img_dev *dev, uint16_t first_reg,
static void response_cb(struct fp_img_dev *dev, int status, void *user_data)
{
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
if (status == 0)
fpi_ssm_next_state(ssm);
else
@ -316,7 +316,7 @@ static void response_cb(struct fp_img_dev *dev, int status, void *user_data)
static void challenge_cb(struct fp_img_dev *dev, int status,
uint16_t num_regs, unsigned char *data, void *user_data)
{
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
unsigned char *respdata;
PK11Context *ctx;
@ -354,7 +354,7 @@ static void challenge_cb(struct fp_img_dev *dev, int status,
* authentication scheme, where the device challenges the authenticity of the
* driver.
*/
static void sm_do_challenge_response(struct fpi_ssm *ssm)
static void sm_do_challenge_response(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
int r;
@ -508,7 +508,7 @@ static int dev_change_state(struct fp_img_dev *dev, enum fp_imgdev_state state)
static void sm_write_reg_cb(struct fp_img_dev *dev, int result, void *user_data)
{
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
if (result)
fpi_ssm_mark_aborted(ssm, result);
@ -516,7 +516,7 @@ static void sm_write_reg_cb(struct fp_img_dev *dev, int result, void *user_data)
fpi_ssm_next_state(ssm);
}
static void sm_write_regs(struct fpi_ssm *ssm, uint16_t first_reg, uint16_t num_regs,
static void sm_write_regs(fpi_ssm *ssm, uint16_t first_reg, uint16_t num_regs,
void *data)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -525,7 +525,7 @@ static void sm_write_regs(struct fpi_ssm *ssm, uint16_t first_reg, uint16_t num_
fpi_ssm_mark_aborted(ssm, r);
}
static void sm_write_reg(struct fpi_ssm *ssm, uint16_t reg,
static void sm_write_reg(fpi_ssm *ssm, uint16_t reg,
unsigned char value)
{
sm_write_regs(ssm, reg, 1, &value);
@ -534,7 +534,7 @@ static void sm_write_reg(struct fpi_ssm *ssm, uint16_t reg,
static void sm_read_reg_cb(struct fp_img_dev *dev, int result,
uint16_t num_regs, unsigned char *data, void *user_data)
{
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
if (result) {
@ -546,7 +546,7 @@ static void sm_read_reg_cb(struct fp_img_dev *dev, int result,
}
}
static void sm_read_regs(struct fpi_ssm *ssm, uint16_t reg, uint16_t num_regs)
static void sm_read_regs(fpi_ssm *ssm, uint16_t reg, uint16_t num_regs)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
@ -563,12 +563,12 @@ static void sm_read_regs(struct fpi_ssm *ssm, uint16_t reg, uint16_t num_regs)
fpi_ssm_mark_aborted(ssm, r);
}
static void sm_read_reg(struct fpi_ssm *ssm, uint16_t reg)
static void sm_read_reg(fpi_ssm *ssm, uint16_t reg)
{
sm_read_regs(ssm, reg, 1);
}
static void sm_set_hwstat(struct fpi_ssm *ssm, unsigned char value)
static void sm_set_hwstat(fpi_ssm *ssm, unsigned char value)
{
fp_dbg("set %02x", value);
sm_write_reg(ssm, REG_HWSTAT, value);
@ -587,7 +587,7 @@ enum imaging_states {
static void image_transfer_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status == LIBUSB_TRANSFER_CANCELLED) {
fp_dbg("cancelled");
@ -687,7 +687,7 @@ static int calc_dev2(struct uru4k_image *img)
return res / IMAGE_WIDTH;
}
static void imaging_run_state(struct fpi_ssm *ssm)
static void imaging_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
@ -810,7 +810,7 @@ static void imaging_run_state(struct fpi_ssm *ssm)
}
}
static void imaging_complete(struct fpi_ssm *ssm)
static void imaging_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
@ -862,7 +862,7 @@ enum rebootpwr_states {
static void rebootpwr_pause_cb(void *data)
{
struct fpi_ssm *ssm = data;
fpi_ssm *ssm = data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
@ -874,7 +874,7 @@ static void rebootpwr_pause_cb(void *data)
}
}
static void rebootpwr_run_state(struct fpi_ssm *ssm)
static void rebootpwr_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
@ -939,7 +939,7 @@ enum powerup_states {
static void powerup_pause_cb(void *data)
{
struct fpi_ssm *ssm = data;
fpi_ssm *ssm = data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
@ -953,7 +953,7 @@ static void powerup_pause_cb(void *data)
}
}
static void powerup_run_state(struct fpi_ssm *ssm)
static void powerup_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
@ -1024,7 +1024,7 @@ enum init_states {
static void init_scanpwr_irq_cb(struct fp_img_dev *dev, int status,
uint16_t type, void *user_data)
{
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
if (status)
@ -1042,7 +1042,7 @@ static void init_scanpwr_irq_cb(struct fp_img_dev *dev, int status,
static void init_scanpwr_timeout(void *user_data)
{
struct fpi_ssm *ssm = user_data;
fpi_ssm *ssm = user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
@ -1058,7 +1058,7 @@ static void init_scanpwr_timeout(void *user_data)
}
}
static void init_run_state(struct fpi_ssm *ssm)
static void init_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
@ -1075,7 +1075,7 @@ static void init_run_state(struct fpi_ssm *ssm)
fpi_ssm_jump_to_state(ssm, INIT_CHECK_HWSTAT_POWERDOWN);
break;
case INIT_REBOOT_POWER: ;
struct fpi_ssm *rebootsm = fpi_ssm_new(fpi_imgdev_get_dev(dev), rebootpwr_run_state,
fpi_ssm *rebootsm = fpi_ssm_new(fpi_imgdev_get_dev(dev), rebootpwr_run_state,
REBOOTPWR_NUM_STATES);
fpi_ssm_set_user_data(rebootsm, dev);
fpi_ssm_start_subsm(ssm, rebootsm);
@ -1094,7 +1094,7 @@ static void init_run_state(struct fpi_ssm *ssm)
urudev->irq_cb_data = ssm;
urudev->irq_cb = init_scanpwr_irq_cb;
struct fpi_ssm *powerupsm = fpi_ssm_new(fpi_imgdev_get_dev(dev), powerup_run_state,
fpi_ssm *powerupsm = fpi_ssm_new(fpi_imgdev_get_dev(dev), powerup_run_state,
POWERUP_NUM_STATES);
fpi_ssm_set_user_data(powerupsm, dev);
fpi_ssm_start_subsm(ssm, powerupsm);
@ -1138,7 +1138,7 @@ static void init_run_state(struct fpi_ssm *ssm)
}
}
static void activate_initsm_complete(struct fpi_ssm *ssm)
static void activate_initsm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
int r = fpi_ssm_get_error(ssm);
@ -1160,7 +1160,7 @@ static void activate_initsm_complete(struct fpi_ssm *ssm)
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm;
fpi_ssm *ssm;
int r;
r = start_irq_handler(dev);
@ -1196,7 +1196,7 @@ static void dev_deactivate(struct fp_img_dev *dev)
static int execute_state_change(struct fp_img_dev *dev)
{
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm;
fpi_ssm *ssm;
switch (urudev->activate_state) {
case IMGDEV_STATE_INACTIVE:

View file

@ -74,7 +74,7 @@ enum v5s_cmd {
static void sm_write_reg_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
fpi_ssm_mark_aborted(ssm, -EIO);
@ -85,7 +85,7 @@ static void sm_write_reg_cb(struct libusb_transfer *transfer)
libusb_free_transfer(transfer);
}
static void sm_write_reg(struct fpi_ssm *ssm, unsigned char reg,
static void sm_write_reg(fpi_ssm *ssm, unsigned char reg,
unsigned char value)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -113,7 +113,7 @@ static void sm_write_reg(struct fpi_ssm *ssm, unsigned char reg,
static void sm_exec_cmd_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
fpi_ssm_mark_aborted(ssm, -EIO);
@ -124,7 +124,7 @@ static void sm_exec_cmd_cb(struct libusb_transfer *transfer)
libusb_free_transfer(transfer);
}
static void sm_exec_cmd(struct fpi_ssm *ssm, unsigned char cmd,
static void sm_exec_cmd(fpi_ssm *ssm, unsigned char cmd,
unsigned char param)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
@ -187,11 +187,11 @@ static gboolean finger_is_present(unsigned char *data)
/***** IMAGE ACQUISITION *****/
static void capture_iterate(struct fpi_ssm *ssm);
static void capture_iterate(fpi_ssm *ssm);
static void capture_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct v5s_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -218,7 +218,7 @@ out:
libusb_free_transfer(transfer);
}
static void capture_iterate(struct fpi_ssm *ssm)
static void capture_iterate(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct v5s_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -243,7 +243,7 @@ static void capture_iterate(struct fpi_ssm *ssm)
}
static void sm_do_capture(struct fpi_ssm *ssm)
static void sm_do_capture(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct v5s_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -265,7 +265,7 @@ enum loop_states {
LOOP_NUM_STATES,
};
static void loop_run_state(struct fpi_ssm *ssm)
static void loop_run_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct v5s_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -293,7 +293,7 @@ static void loop_run_state(struct fpi_ssm *ssm)
}
}
static void loopsm_complete(struct fpi_ssm *ssm)
static void loopsm_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct v5s_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -314,7 +314,7 @@ static void loopsm_complete(struct fpi_ssm *ssm)
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct v5s_dev *vdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), loop_run_state,
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), loop_run_state,
LOOP_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
vdev->deactivating = FALSE;

View file

@ -27,7 +27,7 @@
/* Callback for async_write */
static void async_write_callback(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
int transferred = transfer->actual_length, error =
@ -51,7 +51,7 @@ static void async_write_callback(struct libusb_transfer *transfer)
}
/* Send data to EP1, the only out endpoint */
static void async_write(struct fpi_ssm *ssm, void *data, int len)
static void async_write(fpi_ssm *ssm, void *data, int len)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct libusb_device_handle *usb_dev = fpi_imgdev_get_usb_dev(idev);
@ -67,7 +67,7 @@ static void async_write(struct fpi_ssm *ssm, void *data, int len)
/* Callback for async_read */
static void async_read_callback(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
int transferred = transfer->actual_length, error =
@ -93,7 +93,7 @@ static void async_read_callback(struct libusb_transfer *transfer)
}
/* Receive data from the given ep and compare with expected */
static void async_read(struct fpi_ssm *ssm, int ep, void *data, int len)
static void async_read(fpi_ssm *ssm, int ep, void *data, int len)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct libusb_device_handle *usb_dev = fpi_imgdev_get_usb_dev(idev);
@ -119,7 +119,7 @@ static void async_read(struct fpi_ssm *ssm, int ep, void *data, int len)
/* Callback for async_read */
static void async_abort_callback(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
int transferred = transfer->actual_length, error = transfer->status;
@ -147,7 +147,7 @@ static void async_abort_callback(struct libusb_transfer *transfer)
}
/* Receive data from the given ep and compare with expected */
static void async_abort(struct fpi_ssm *ssm, int ep)
static void async_abort(fpi_ssm *ssm, int ep)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct libusb_device_handle *usb_dev = fpi_imgdev_get_usb_dev(idev);
@ -279,7 +279,7 @@ static void submit_image(struct fp_img_dev *idev)
/* Proto functions */
/* SSM loop for clear_ep2 */
static void clear_ep2_ssm(struct fpi_ssm *ssm)
static void clear_ep2_ssm(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
@ -307,17 +307,17 @@ static void clear_ep2_ssm(struct fpi_ssm *ssm)
}
/* Send command to clear EP2 */
static void clear_ep2(struct fpi_ssm *ssm)
static void clear_ep2(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct fpi_ssm *subsm =
fpi_ssm *subsm =
fpi_ssm_new(fpi_imgdev_get_dev(idev), clear_ep2_ssm, SUBSM1_STATES);
fpi_ssm_set_user_data(subsm, idev);
fpi_ssm_start_subsm(ssm, subsm);
}
static void send_control_packet_ssm(struct fpi_ssm *ssm)
static void send_control_packet_ssm(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
@ -385,11 +385,11 @@ static void send_control_packet_ssm(struct fpi_ssm *ssm)
}
/* Send device state control packet */
static void send_control_packet(struct fpi_ssm *ssm)
static void send_control_packet(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct fpi_ssm *subsm =
fpi_ssm *subsm =
fpi_ssm_new(fpi_imgdev_get_dev(idev), send_control_packet_ssm, SUBSM2_STATES);
fpi_ssm_set_user_data(subsm, idev);
fpi_ssm_start_subsm(ssm, subsm);
@ -406,7 +406,7 @@ static void clear_data(struct vfs_dev_t *vdev)
/* After receiving interrupt from EP3 */
static void interrupt_callback(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
@ -466,7 +466,7 @@ static void interrupt_callback(struct libusb_transfer *transfer)
static void receive_callback(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
@ -494,7 +494,7 @@ static void receive_callback(struct libusb_transfer *transfer)
/* Stub to keep SSM alive when waiting an interrupt */
static void wait_interrupt(void *data)
{
struct fpi_ssm *ssm = data;
fpi_ssm *ssm = data;
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
@ -506,19 +506,19 @@ static void wait_interrupt(void *data)
/* SSM stub to prepare device to another scan after orange light was on */
static void another_scan(void *data)
{
struct fpi_ssm *ssm = data;
fpi_ssm *ssm = data;
fpi_ssm_jump_to_state(ssm, SSM_TURN_ON);
}
/* Another SSM stub to continue after waiting for probable vdev->active changes */
static void scan_completed(void *data)
{
struct fpi_ssm *ssm = data;
fpi_ssm *ssm = data;
fpi_ssm_next_state(ssm);
}
/* Main SSM loop */
static void activate_ssm(struct fpi_ssm *ssm)
static void activate_ssm(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct libusb_device_handle *usb_dev = fpi_imgdev_get_usb_dev(idev);
@ -671,7 +671,7 @@ static void activate_ssm(struct fpi_ssm *ssm)
/* Driver functions */
/* Callback for dev_activate ssm */
static void dev_activate_callback(struct fpi_ssm *ssm)
static void dev_activate_callback(fpi_ssm *ssm)
{
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
@ -691,7 +691,7 @@ static int dev_activate(struct fp_img_dev *idev, enum fp_imgdev_state state)
vdev->need_report = 1;
vdev->ssm_active = 1;
struct fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(idev), activate_ssm, SSM_STATES);
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(idev), activate_ssm, SSM_STATES);
fpi_ssm_set_user_data(ssm, idev);
fpi_ssm_start(ssm, dev_activate_callback);
return 0;
@ -713,7 +713,7 @@ static void dev_deactivate(struct fp_img_dev *idev)
}
/* Callback for dev_open ssm */
static void dev_open_callback(struct fpi_ssm *ssm)
static void dev_open_callback(fpi_ssm *ssm)
{
/* Notify open complete */
fpi_imgdev_open_complete(fpi_ssm_get_user_data(ssm), 0);
@ -738,7 +738,7 @@ static int dev_open(struct fp_img_dev *idev, unsigned long driver_data)
fpi_imgdev_set_user_data(idev, vdev);
/* Clearing previous device state */
struct fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(idev), activate_ssm, SSM_STATES);
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(idev), activate_ssm, SSM_STATES);
fpi_ssm_set_user_data(ssm, idev);
fpi_ssm_start(ssm, dev_open_callback);
return 0;

View file

@ -199,7 +199,7 @@ static int result_code(struct fp_img_dev *dev, int result)
/* Callback of asynchronous send */
static void async_send_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -242,7 +242,7 @@ out:
}
/* Submit asynchronous send */
static void async_send(struct fpi_ssm *ssm)
static void async_send(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -283,7 +283,7 @@ static void async_send(struct fpi_ssm *ssm)
/* Callback of asynchronous recv */
static void async_recv_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -329,7 +329,7 @@ out:
}
/* Submit asynchronous recv */
static void async_recv(struct fpi_ssm *ssm)
static void async_recv(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -362,12 +362,12 @@ static void async_recv(struct fpi_ssm *ssm)
}
}
static void async_load(struct fpi_ssm *ssm);
static void async_load(fpi_ssm *ssm);
/* Callback of asynchronous load */
static void async_load_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -430,7 +430,7 @@ out:
}
/* Submit asynchronous load */
static void async_load(struct fpi_ssm *ssm)
static void async_load(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -470,7 +470,7 @@ static void async_load(struct fpi_ssm *ssm)
/* Callback of asynchronous sleep */
static void async_sleep_cb(void *data)
{
struct fpi_ssm *ssm = data;
fpi_ssm *ssm = data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -481,7 +481,7 @@ static void async_sleep_cb(void *data)
}
/* Submit asynchronous sleep */
static void async_sleep(unsigned int msec, struct fpi_ssm *ssm)
static void async_sleep(unsigned int msec, fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -507,7 +507,7 @@ enum
};
/* Exec swap sequential state machine */
static void m_swap_state(struct fpi_ssm *ssm)
static void m_swap_state(fpi_ssm *ssm)
{
switch (fpi_ssm_get_cur_state(ssm))
{
@ -524,11 +524,11 @@ static void m_swap_state(struct fpi_ssm *ssm)
}
/* Start swap sequential state machine */
static void m_swap(struct fpi_ssm *ssm, unsigned char *data, size_t length)
static void m_swap(fpi_ssm *ssm, unsigned char *data, size_t length)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *subsm;
fpi_ssm *subsm;
/* Prepare data for sending */
memcpy(vdev->buffer, data, length);
@ -542,7 +542,7 @@ static void m_swap(struct fpi_ssm *ssm, unsigned char *data, size_t length)
}
/* Retrieve fingerprint image */
static void vfs_get_print(struct fpi_ssm *ssm, unsigned int param, int type)
static void vfs_get_print(fpi_ssm *ssm, unsigned int param, int type)
{
unsigned char data[2][0x0e] = {
{ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
@ -562,7 +562,7 @@ static void vfs_get_print(struct fpi_ssm *ssm, unsigned int param, int type)
}
/* Set a parameter value on the device */
static void vfs_set_param(struct fpi_ssm *ssm, unsigned int param, unsigned int value)
static void vfs_set_param(fpi_ssm *ssm, unsigned int param, unsigned int value)
{
unsigned char data[0x0a] = { 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00 };
@ -579,7 +579,7 @@ static void vfs_set_param(struct fpi_ssm *ssm, unsigned int param, unsigned int
}
/* Abort previous print */
static void vfs_abort_print(struct fpi_ssm *ssm)
static void vfs_abort_print(fpi_ssm *ssm)
{
unsigned char data[0x06] = { 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00 };
@ -590,7 +590,7 @@ static void vfs_abort_print(struct fpi_ssm *ssm)
}
/* Poke a value on a region */
static void vfs_poke(struct fpi_ssm *ssm, unsigned int addr, unsigned int value, unsigned int size)
static void vfs_poke(fpi_ssm *ssm, unsigned int addr, unsigned int value, unsigned int size)
{
unsigned char data[0x0f] = { 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
@ -612,7 +612,7 @@ static void vfs_poke(struct fpi_ssm *ssm, unsigned int addr, unsigned int value,
}
/* Get current finger state */
static void vfs_get_finger_state(struct fpi_ssm *ssm)
static void vfs_get_finger_state(fpi_ssm *ssm)
{
unsigned char data[0x06] = { 0x00, 0x00, 0x00, 0x00, 0x16, 0x00 };
@ -623,7 +623,7 @@ static void vfs_get_finger_state(struct fpi_ssm *ssm)
}
/* Load raw image from reader */
static void vfs_img_load(struct fpi_ssm *ssm)
static void vfs_img_load(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -754,7 +754,7 @@ static void img_copy(struct vfs101_dev *vdev, struct fp_img *img)
}
/* Extract fingerpint image from raw data */
static void img_extract(struct fpi_ssm *ssm)
static void img_extract(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -912,7 +912,7 @@ enum
};
/* Exec loop sequential state machine */
static void m_loop_state(struct fpi_ssm *ssm)
static void m_loop_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -1120,7 +1120,7 @@ static void m_loop_state(struct fpi_ssm *ssm)
}
/* Complete loop sequential state machine */
static void m_loop_complete(struct fpi_ssm *ssm)
static void m_loop_complete(fpi_ssm *ssm)
{
/* Free sequential state machine */
fpi_ssm_free(ssm);
@ -1176,7 +1176,7 @@ enum
};
/* Exec init sequential state machine */
static void m_init_state(struct fpi_ssm *ssm)
static void m_init_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
@ -1417,11 +1417,11 @@ static void m_init_state(struct fpi_ssm *ssm)
}
/* Complete init sequential state machine */
static void m_init_complete(struct fpi_ssm *ssm)
static void m_init_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm_loop;
fpi_ssm *ssm_loop;
if (!fpi_ssm_get_error(ssm) && vdev->active)
{
@ -1442,7 +1442,7 @@ static void m_init_complete(struct fpi_ssm *ssm)
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
struct fpi_ssm *ssm;
fpi_ssm *ssm;
/* Check if already active */
if (vdev->active)

View file

@ -29,13 +29,13 @@
/* Callback of asynchronous sleep */
static void async_sleep_cb(void *data)
{
struct fpi_ssm *ssm = data;
fpi_ssm *ssm = data;
fpi_ssm_next_state(ssm);
}
/* Submit asynchronous sleep */
static void async_sleep(unsigned int msec, struct fpi_ssm *ssm)
static void async_sleep(unsigned int msec, fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct fpi_timeout *timeout;
@ -51,7 +51,7 @@ static void async_sleep(unsigned int msec, struct fpi_ssm *ssm)
}
}
static int submit_image(struct fpi_ssm *ssm)
static int submit_image(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
vfs301_dev_t *vdev = fpi_imgdev_get_user_data(dev);
@ -103,7 +103,7 @@ enum
};
/* Exec loop sequential state machine */
static void m_loop_state(struct fpi_ssm *ssm)
static void m_loop_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
vfs301_dev_t *vdev = fpi_imgdev_get_user_data(dev);
@ -161,14 +161,14 @@ static void m_loop_state(struct fpi_ssm *ssm)
}
/* Complete loop sequential state machine */
static void m_loop_complete(struct fpi_ssm *ssm)
static void m_loop_complete(fpi_ssm *ssm)
{
/* Free sequential state machine */
fpi_ssm_free(ssm);
}
/* Exec init sequential state machine */
static void m_init_state(struct fpi_ssm *ssm)
static void m_init_state(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
vfs301_dev_t *vdev = fpi_imgdev_get_user_data(dev);
@ -181,10 +181,10 @@ static void m_init_state(struct fpi_ssm *ssm)
}
/* Complete init sequential state machine */
static void m_init_complete(struct fpi_ssm *ssm)
static void m_init_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct fpi_ssm *ssm_loop;
fpi_ssm *ssm_loop;
if (!fpi_ssm_get_error(ssm)) {
/* Notify activate complete */
@ -203,7 +203,7 @@ static void m_init_complete(struct fpi_ssm *ssm)
/* Activate device */
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct fpi_ssm *ssm;
fpi_ssm *ssm;
/* Start init ssm */
ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), m_init_state, 1);

View file

@ -75,7 +75,7 @@ static void start_scan(struct fp_img_dev *dev);
static void async_send_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct usbexchange_data *data = fpi_ssm_get_user_data(ssm);
struct usb_action *action;
@ -119,7 +119,7 @@ out:
static void async_recv_cb(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = transfer->user_data;
fpi_ssm *ssm = transfer->user_data;
struct usbexchange_data *data = fpi_ssm_get_user_data(ssm);
struct usb_action *action;
@ -171,7 +171,7 @@ out:
libusb_free_transfer(transfer);
}
static void usbexchange_loop(struct fpi_ssm *ssm)
static void usbexchange_loop(fpi_ssm *ssm)
{
struct usbexchange_data *data = fpi_ssm_get_user_data(ssm);
if (fpi_ssm_get_cur_state(ssm) >= data->stepcount) {
@ -233,10 +233,10 @@ static void usbexchange_loop(struct fpi_ssm *ssm)
}
}
static void usb_exchange_async(struct fpi_ssm *ssm,
static void usb_exchange_async(fpi_ssm *ssm,
struct usbexchange_data *data)
{
struct fpi_ssm *subsm = fpi_ssm_new(fpi_imgdev_get_dev(data->device),
fpi_ssm *subsm = fpi_ssm_new(fpi_imgdev_get_dev(data->device),
usbexchange_loop,
data->stepcount);
fpi_ssm_set_user_data(subsm, data);
@ -395,7 +395,7 @@ static int process_chunk(struct vfs5011_data *data, int transferred)
return 0;
}
void submit_image(struct fpi_ssm *ssm, struct vfs5011_data *data)
void submit_image(fpi_ssm *ssm, struct vfs5011_data *data)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct fp_img *img;
@ -422,7 +422,7 @@ void submit_image(struct fpi_ssm *ssm, struct vfs5011_data *data)
static void chunk_capture_callback(struct libusb_transfer *transfer)
{
struct fpi_ssm *ssm = (struct fpi_ssm *)transfer->user_data;
fpi_ssm *ssm = (fpi_ssm *)transfer->user_data;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs5011_data *data;
@ -452,7 +452,7 @@ static void chunk_capture_callback(struct libusb_transfer *transfer)
static int capture_chunk_async(struct vfs5011_data *data,
libusb_device_handle *handle, int nline,
int timeout, struct fpi_ssm *ssm)
int timeout, fpi_ssm *ssm)
{
fp_dbg("capture_chunk_async: capture %d lines, already have %d",
nline, data->lines_recorded);
@ -472,7 +472,7 @@ static int capture_chunk_async(struct vfs5011_data *data,
static void async_sleep_cb(void *data)
{
struct fpi_ssm *ssm = data;
fpi_ssm *ssm = data;
fpi_ssm_next_state(ssm);
}
@ -665,7 +665,7 @@ struct usb_action vfs5011_initiate_capture[] = {
/* ====================== lifprint interface ======================= */
static void activate_loop(struct fpi_ssm *ssm)
static void activate_loop(fpi_ssm *ssm)
{
enum {READ_TIMEOUT = 0};
@ -742,7 +742,7 @@ static void activate_loop(struct fpi_ssm *ssm)
}
}
static void activate_loop_complete(struct fpi_ssm *ssm)
static void activate_loop_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs5011_data *data;
@ -772,7 +772,7 @@ static void activate_loop_complete(struct fpi_ssm *ssm)
}
static void open_loop(struct fpi_ssm *ssm)
static void open_loop(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs5011_data *data;
@ -793,7 +793,7 @@ static void open_loop(struct fpi_ssm *ssm)
};
}
static void open_loop_complete(struct fpi_ssm *ssm)
static void open_loop_complete(fpi_ssm *ssm)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs5011_data *data;
@ -829,7 +829,7 @@ static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
return r;
}
struct fpi_ssm *ssm;
fpi_ssm *ssm;
ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), open_loop, DEV_OPEN_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
fpi_ssm_start(ssm, open_loop_complete);
@ -853,7 +853,7 @@ static void dev_close(struct fp_img_dev *dev)
static void start_scan(struct fp_img_dev *dev)
{
struct vfs5011_data *data;
struct fpi_ssm *ssm;
fpi_ssm *ssm;
data = fpi_imgdev_get_user_data(dev);
data->loop_running = TRUE;

View file

@ -74,7 +74,7 @@
* abortion error conditions. */
struct fpi_ssm {
struct fp_dev *dev;
struct fpi_ssm *parentsm;
fpi_ssm *parentsm;
void *priv;
int nr_states;
int cur_state;
@ -85,10 +85,10 @@ struct fpi_ssm {
};
/* Allocate a new ssm */
struct fpi_ssm *fpi_ssm_new(struct fp_dev *dev, ssm_handler_fn handler,
fpi_ssm *fpi_ssm_new(struct fp_dev *dev, ssm_handler_fn handler,
int nr_states)
{
struct fpi_ssm *machine;
fpi_ssm *machine;
BUG_ON(nr_states < 1);
machine = g_malloc0(sizeof(*machine));
@ -100,26 +100,26 @@ struct fpi_ssm *fpi_ssm_new(struct fp_dev *dev, ssm_handler_fn handler,
}
struct fp_dev *
fpi_ssm_get_dev(struct fpi_ssm *machine)
fpi_ssm_get_dev(fpi_ssm *machine)
{
return machine->dev;
}
void
fpi_ssm_set_user_data(struct fpi_ssm *machine,
fpi_ssm_set_user_data(fpi_ssm *machine,
void *user_data)
{
machine->priv = user_data;
}
void *
fpi_ssm_get_user_data(struct fpi_ssm *machine)
fpi_ssm_get_user_data(fpi_ssm *machine)
{
return machine->priv;
}
/* Free a ssm */
void fpi_ssm_free(struct fpi_ssm *machine)
void fpi_ssm_free(fpi_ssm *machine)
{
if (!machine)
return;
@ -127,14 +127,14 @@ void fpi_ssm_free(struct fpi_ssm *machine)
}
/* Invoke the state handler */
static void __ssm_call_handler(struct fpi_ssm *machine)
static void __ssm_call_handler(fpi_ssm *machine)
{
fp_dbg("%p entering state %d", machine, machine->cur_state);
machine->handler(machine);
}
/* Start a ssm. You can also restart a completed or aborted ssm. */
void fpi_ssm_start(struct fpi_ssm *ssm, ssm_completed_fn callback)
void fpi_ssm_start(fpi_ssm *ssm, ssm_completed_fn callback)
{
BUG_ON(!ssm->completed);
ssm->callback = callback;
@ -144,9 +144,9 @@ void fpi_ssm_start(struct fpi_ssm *ssm, ssm_completed_fn callback)
__ssm_call_handler(ssm);
}
static void __subsm_complete(struct fpi_ssm *ssm)
static void __subsm_complete(fpi_ssm *ssm)
{
struct fpi_ssm *parent = ssm->parentsm;
fpi_ssm *parent = ssm->parentsm;
BUG_ON(!parent);
if (ssm->error)
fpi_ssm_mark_aborted(parent, ssm->error);
@ -159,14 +159,14 @@ static void __subsm_complete(struct fpi_ssm *ssm)
* parent will be advanced to the next state. if the child aborts, the parent
* will be aborted with the same error code. the child will be automatically
* freed upon completion/abortion. */
void fpi_ssm_start_subsm(struct fpi_ssm *parent, struct fpi_ssm *child)
void fpi_ssm_start_subsm(fpi_ssm *parent, fpi_ssm *child)
{
child->parentsm = parent;
fpi_ssm_start(child, __subsm_complete);
}
/* Mark a ssm as completed successfully. */
void fpi_ssm_mark_completed(struct fpi_ssm *machine)
void fpi_ssm_mark_completed(fpi_ssm *machine)
{
BUG_ON(machine->completed);
machine->completed = TRUE;
@ -176,7 +176,7 @@ void fpi_ssm_mark_completed(struct fpi_ssm *machine)
}
/* Mark a ssm as aborted with error. */
void fpi_ssm_mark_aborted(struct fpi_ssm *machine, int error)
void fpi_ssm_mark_aborted(fpi_ssm *machine, int error)
{
fp_dbg("error %d from state %d", error, machine->cur_state);
BUG_ON(error == 0);
@ -185,7 +185,7 @@ void fpi_ssm_mark_aborted(struct fpi_ssm *machine, int error)
}
/* Iterate to next state of a ssm */
void fpi_ssm_next_state(struct fpi_ssm *machine)
void fpi_ssm_next_state(fpi_ssm *machine)
{
BUG_ON(machine->completed);
machine->cur_state++;
@ -196,7 +196,7 @@ void fpi_ssm_next_state(struct fpi_ssm *machine)
}
}
void fpi_ssm_jump_to_state(struct fpi_ssm *machine, int state)
void fpi_ssm_jump_to_state(fpi_ssm *machine, int state)
{
BUG_ON(machine->completed);
BUG_ON(state >= machine->nr_states);
@ -204,12 +204,12 @@ void fpi_ssm_jump_to_state(struct fpi_ssm *machine, int state)
__ssm_call_handler(machine);
}
int fpi_ssm_get_cur_state(struct fpi_ssm *machine)
int fpi_ssm_get_cur_state(fpi_ssm *machine)
{
return machine->cur_state;
}
int fpi_ssm_get_error(struct fpi_ssm *machine)
int fpi_ssm_get_error(fpi_ssm *machine)
{
return machine->error;
}

View file

@ -30,31 +30,31 @@
/* async drv <--> lib comms */
struct fpi_ssm;
typedef void (*ssm_completed_fn)(struct fpi_ssm *ssm);
typedef void (*ssm_handler_fn)(struct fpi_ssm *ssm);
typedef struct fpi_ssm fpi_ssm;
typedef void (*ssm_completed_fn)(fpi_ssm *ssm);
typedef void (*ssm_handler_fn)(fpi_ssm *ssm);
/* sequential state machine: state machine that iterates sequentially over
* a predefined series of states. can be aborted by either completion or
* abortion error conditions. */
/* for library and drivers */
struct fpi_ssm *fpi_ssm_new(struct fp_dev *dev, ssm_handler_fn handler,
fpi_ssm *fpi_ssm_new(struct fp_dev *dev, ssm_handler_fn handler,
int nr_states);
void fpi_ssm_free(struct fpi_ssm *machine);
void fpi_ssm_start(struct fpi_ssm *machine, ssm_completed_fn callback);
void fpi_ssm_start_subsm(struct fpi_ssm *parent, struct fpi_ssm *child);
void fpi_ssm_free(fpi_ssm *machine);
void fpi_ssm_start(fpi_ssm *machine, ssm_completed_fn callback);
void fpi_ssm_start_subsm(fpi_ssm *parent, fpi_ssm *child);
/* for drivers */
void fpi_ssm_next_state(struct fpi_ssm *machine);
void fpi_ssm_jump_to_state(struct fpi_ssm *machine, int state);
void fpi_ssm_mark_completed(struct fpi_ssm *machine);
void fpi_ssm_mark_aborted(struct fpi_ssm *machine, int error);
struct fp_dev *fpi_ssm_get_dev(struct fpi_ssm *machine);
void fpi_ssm_set_user_data(struct fpi_ssm *machine,
void fpi_ssm_next_state(fpi_ssm *machine);
void fpi_ssm_jump_to_state(fpi_ssm *machine, int state);
void fpi_ssm_mark_completed(fpi_ssm *machine);
void fpi_ssm_mark_aborted(fpi_ssm *machine, int error);
struct fp_dev *fpi_ssm_get_dev(fpi_ssm *machine);
void fpi_ssm_set_user_data(fpi_ssm *machine,
void *user_data);
void *fpi_ssm_get_user_data(struct fpi_ssm *machine);
int fpi_ssm_get_error(struct fpi_ssm *machine);
int fpi_ssm_get_cur_state(struct fpi_ssm *machine);
void *fpi_ssm_get_user_data(fpi_ssm *machine);
int fpi_ssm_get_error(fpi_ssm *machine);
int fpi_ssm_get_cur_state(fpi_ssm *machine);
#endif