mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
lib: Split off fpi_ssm functions
Rename drv.c to something more fitting to its contents, and move state machine code to its own header.
This commit is contained in:
@@ -348,40 +348,6 @@ void fpi_poll_exit(void);
|
||||
|
||||
typedef void (*fpi_timeout_fn)(void *data);
|
||||
|
||||
/* 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);
|
||||
|
||||
/* sequential state machine: state machine that iterates sequentially over
|
||||
* a predefined series of states. can be aborted by either completion or
|
||||
* abortion error conditions. */
|
||||
struct fpi_ssm {
|
||||
struct fp_dev *dev;
|
||||
struct fpi_ssm *parentsm;
|
||||
void *priv;
|
||||
int nr_states;
|
||||
int cur_state;
|
||||
gboolean completed;
|
||||
int error;
|
||||
ssm_completed_fn callback;
|
||||
ssm_handler_fn handler;
|
||||
};
|
||||
|
||||
|
||||
/* for library and drivers */
|
||||
struct 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);
|
||||
|
||||
/* 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);
|
||||
|
||||
void fpi_drvcb_open_complete(struct fp_dev *dev, int status);
|
||||
void fpi_drvcb_close_complete(struct fp_dev *dev);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user