lib: Remove fp_img_dev->priv

And use the new instance data helper.
This commit is contained in:
Bastien Nocera 2018-09-15 00:45:42 +02:00
parent 4f75e63e25
commit 058f91909d
23 changed files with 221 additions and 240 deletions

View file

@ -247,7 +247,7 @@ static void finger_det_reqs_cb(struct fp_img_dev *dev, int result, void *user_da
static void start_finger_detection(struct fp_img_dev *dev)
{
struct aes1610_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
if (aesdev->deactivating) {
complete_deactivation(dev);
@ -559,7 +559,7 @@ static void capture_read_strip_cb(struct libusb_transfer *transfer)
unsigned char *stripdata;
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);
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *data = transfer->buffer;
int sum, i;
@ -646,7 +646,7 @@ out:
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);
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
int r;
switch (fpi_ssm_get_cur_state(ssm)) {
@ -693,7 +693,7 @@ static void capture_run_state(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);
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
if (aesdev->deactivating)
@ -707,7 +707,7 @@ static void capture_sm_complete(fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct aes1610_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm;
if (aesdev->deactivating) {
@ -766,7 +766,7 @@ static void activate_sm_complete(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 aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
ACTIVATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
@ -777,7 +777,7 @@ static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
static void dev_deactivate(struct fp_img_dev *dev)
{
struct aes1610_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
/* FIXME: audit cancellation points, probably need more, specifically
* in error handling paths? */
aesdev->deactivating = TRUE;
@ -785,7 +785,7 @@ static void dev_deactivate(struct fp_img_dev *dev)
static void complete_deactivation(struct fp_img_dev *dev)
{
struct aes1610_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
/* FIXME: if we're in the middle of a scan, we should cancel the scan.
@ -812,7 +812,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
aesdev = g_malloc0(sizeof(struct aes1610_dev));
fpi_imgdev_set_user_data(dev, aesdev);
fp_dev_set_instance_data(FP_DEV(dev), aesdev);
fpi_imgdev_open_complete(dev, 0);
return 0;
}
@ -820,7 +820,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
static void dev_deinit(struct fp_img_dev *dev)
{
struct aes1610_dev *aesdev;
aesdev = fpi_imgdev_get_user_data(dev);
aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(aesdev);
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);
fpi_imgdev_close_complete(dev);

View file

@ -47,7 +47,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
aesdev = g_malloc0(sizeof(struct aesX660_dev));
fpi_imgdev_set_user_data(dev, aesdev);
fp_dev_set_instance_data(FP_DEV(dev), aesdev);
aesdev->buffer = g_malloc0(AES1660_FRAME_SIZE + AESX660_HEADER_SIZE);
aesdev->init_seqs[0] = aes1660_init_1;
aesdev->init_seqs_len[0] = G_N_ELEMENTS(aes1660_init_1);
@ -64,7 +64,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
static void dev_deinit(struct fp_img_dev *dev)
{
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(aesdev->buffer);
g_free(aesdev);
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);

View file

@ -346,7 +346,7 @@ static void finger_det_reqs_cb(struct fp_img_dev *dev, int result,
static void start_finger_detection(struct fp_img_dev *dev)
{
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
if (aesdev->deactivating) {
@ -438,7 +438,7 @@ static void capture_read_strip_cb(struct libusb_transfer *transfer)
unsigned char *stripdata;
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);
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *data = transfer->buffer;
int sum;
int threshold;
@ -523,7 +523,7 @@ out:
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);
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
int r;
switch (fpi_ssm_get_cur_state(ssm)) {
@ -574,7 +574,7 @@ static void capture_run_state(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);
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
if (aesdev->deactivating)
@ -588,7 +588,7 @@ static void capture_sm_complete(fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm;
if (aesdev->deactivating) {
@ -714,7 +714,7 @@ void activate_read_regs_cb(struct fp_img_dev *dev, int status,
unsigned char *regs, void *user_data)
{
fpi_ssm *ssm = user_data;
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
if (status != 0) {
fpi_ssm_mark_failed(ssm, status);
@ -804,7 +804,7 @@ static void activate_sm_complete(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 aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
ACTIVATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
@ -815,7 +815,7 @@ static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
static void dev_deactivate(struct fp_img_dev *dev)
{
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
/* FIXME: audit cancellation points, probably need more, specifically
* in error handling paths? */
aesdev->deactivating = TRUE;
@ -823,7 +823,7 @@ static void dev_deactivate(struct fp_img_dev *dev)
static void complete_deactivation(struct fp_img_dev *dev)
{
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
/* FIXME: if we're in the middle of a scan, we should cancel the scan.
@ -849,14 +849,14 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
aesdev = g_malloc0(sizeof(struct aes2501_dev));
fpi_imgdev_set_user_data(dev, aesdev);
fp_dev_set_instance_data(FP_DEV(dev), aesdev);
fpi_imgdev_open_complete(dev, 0);
return 0;
}
static void dev_deinit(struct fp_img_dev *dev)
{
struct aes2501_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(aesdev);
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);
fpi_imgdev_close_complete(dev);

View file

@ -149,7 +149,7 @@ exit_free_transfer:
static void start_finger_detection(struct fp_img_dev *dev)
{
int r;
struct aes2550_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
struct libusb_transfer *transfer;
G_DEBUG_HERE();
@ -204,7 +204,7 @@ 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);
struct aes2550_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
struct fpi_frame *stripe;
int len;
@ -246,7 +246,7 @@ static void capture_set_idle_reqs_cb(struct libusb_transfer *transfer)
{
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);
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
(transfer->length == transfer->actual_length) &&
@ -274,7 +274,7 @@ static void capture_read_data_cb(struct libusb_transfer *transfer)
{
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);
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *data = transfer->buffer;
int r;
@ -389,7 +389,7 @@ static void capture_run_state(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);
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
fp_dbg("Capture completed");
if (aesdev->deactivating)
@ -403,7 +403,7 @@ static void capture_sm_complete(fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct aes2550_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm;
if (aesdev->deactivating) {
@ -590,14 +590,14 @@ static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
static void dev_deactivate(struct fp_img_dev *dev)
{
struct aes2550_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
aesdev->deactivating = TRUE;
}
static void complete_deactivation(struct fp_img_dev *dev)
{
struct aes2550_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
aesdev->deactivating = FALSE;
@ -620,7 +620,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
aes2550_dev = g_malloc0(sizeof(struct aes2550_dev));
fpi_imgdev_set_user_data(dev, aes2550_dev);
fp_dev_set_instance_data(FP_DEV(dev), aes2550_dev);
fpi_imgdev_open_complete(dev, 0);
return 0;
}
@ -628,7 +628,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
static void dev_deinit(struct fp_img_dev *dev)
{
struct aes2550_dev *aesdev;
aesdev = fpi_imgdev_get_user_data(dev);
aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(aesdev);
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);
fpi_imgdev_close_complete(dev);

View file

@ -47,7 +47,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
aesdev = g_malloc0(sizeof(struct aesX660_dev));
fpi_imgdev_set_user_data(dev, aesdev);
fp_dev_set_instance_data(FP_DEV(dev), aesdev);
aesdev->buffer = g_malloc0(AES2660_FRAME_SIZE + AESX660_HEADER_SIZE);
/* No scaling for AES2660 */
aesdev->init_seqs[0] = aes2660_init_1;
@ -66,7 +66,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
static void dev_deinit(struct fp_img_dev *dev)
{
struct aesX660_dev *aesdev;
aesdev = fpi_imgdev_get_user_data(dev);
aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(aesdev->buffer);
g_free(aesdev);
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);

View file

@ -129,7 +129,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
aesdev = g_malloc0(sizeof(struct aes3k_dev));
fpi_imgdev_set_user_data(dev, aesdev);
fp_dev_set_instance_data(FP_DEV(dev), aesdev);
if (!aesdev)
return -ENOMEM;
@ -148,7 +148,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
static void dev_deinit(struct fp_img_dev *dev)
{
struct aes3k_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes3k_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(aesdev);
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);
fpi_imgdev_close_complete(dev);

View file

@ -63,7 +63,7 @@ static void aes3k_assemble_image(unsigned char *input, size_t width, size_t heig
static void img_cb(struct libusb_transfer *transfer)
{
struct fp_img_dev *dev = transfer->user_data;
struct aes3k_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes3k_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *ptr = transfer->buffer;
struct fp_img *tmp;
struct fp_img *img;
@ -112,7 +112,7 @@ err:
static void do_capture(struct fp_img_dev *dev)
{
struct aes3k_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes3k_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *data;
int r;
@ -144,14 +144,14 @@ static void init_reqs_cb(struct fp_img_dev *dev, int result, void *user_data)
int aes3k_dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct aes3k_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes3k_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
aes_write_regv(dev, aesdev->init_reqs, aesdev->init_reqs_len, init_reqs_cb, NULL);
return 0;
}
void aes3k_dev_deactivate(struct fp_img_dev *dev)
{
struct aes3k_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes3k_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
/* FIXME: should wait for cancellation to complete before returning
* from deactivation, otherwise app may legally exit before we've

View file

@ -126,7 +126,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
aesdev = g_malloc0(sizeof(struct aes3k_dev));
fpi_imgdev_set_user_data(dev, aesdev);
fp_dev_set_instance_data(FP_DEV(dev), aesdev);
if (!aesdev)
return -ENOMEM;
@ -145,7 +145,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
static void dev_deinit(struct fp_img_dev *dev)
{
struct aes3k_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aes3k_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(aesdev);
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);
fpi_imgdev_close_complete(dev);

View file

@ -145,7 +145,7 @@ static void finger_det_read_fd_data_cb(struct libusb_transfer *transfer)
{
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);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *data = transfer->buffer;
aesdev->fd_data_transfer = NULL;
@ -198,7 +198,7 @@ static void finger_det_set_idle_cmd_cb(struct libusb_transfer *transfer)
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);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
int err = fpi_ssm_get_error(ssm);
fp_dbg("Finger detection completed");
@ -240,7 +240,7 @@ static void finger_det_run_state(fpi_ssm *ssm)
static void start_finger_detection(struct fp_img_dev *dev)
{
fpi_ssm *ssm;
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
if (aesdev->deactivating) {
complete_deactivation(dev);
@ -268,7 +268,7 @@ static int process_stripe_data(fpi_ssm *ssm, unsigned char *data)
struct fpi_frame *stripe;
unsigned char *stripdata;
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
stripe = g_malloc(aesdev->assembling_ctx->frame_width * FRAME_HEIGHT / 2 + sizeof(struct fpi_frame)); /* 4 bpp */
stripdata = stripe->data;
@ -296,7 +296,7 @@ static void capture_set_idle_cmd_cb(struct libusb_transfer *transfer)
{
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);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
(transfer->length == transfer->actual_length)) {
@ -322,7 +322,7 @@ static void capture_read_stripe_data_cb(struct libusb_transfer *transfer)
{
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);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *data = transfer->buffer;
int finger_missing = 0;
size_t copied, actual_len = transfer->actual_length;
@ -374,7 +374,7 @@ out:
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);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case CAPTURE_SEND_LED_CMD:
@ -403,7 +403,7 @@ static void capture_run_state(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);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
int err = fpi_ssm_get_error(ssm);
fp_dbg("Capture completed");
@ -419,7 +419,7 @@ static void capture_sm_complete(fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm;
if (aesdev->deactivating) {
@ -450,7 +450,7 @@ static void activate_read_id_cb(struct libusb_transfer *transfer)
{
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);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *data = transfer->buffer;
if ((transfer->status != LIBUSB_TRANSFER_COMPLETED) ||
@ -501,7 +501,7 @@ static void activate_read_init_cb(struct libusb_transfer *transfer)
{
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);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *data = transfer->buffer;
fp_dbg("read_init_cb\n");
@ -537,7 +537,7 @@ out:
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);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case ACTIVATE_SET_IDLE:
@ -603,7 +603,7 @@ int aesX660_dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
void aesX660_dev_deactivate(struct fp_img_dev *dev)
{
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
if (aesdev->fd_data_transfer)
libusb_cancel_transfer(aesdev->fd_data_transfer);
@ -613,7 +613,7 @@ void aesX660_dev_deactivate(struct fp_img_dev *dev)
static void complete_deactivation(struct fp_img_dev *dev)
{
struct aesX660_dev *aesdev = fpi_imgdev_get_user_data(dev);
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
aesdev->deactivating = FALSE;

View file

@ -290,7 +290,7 @@ static void elan_process_frame_thirds(unsigned short *raw_frame,
static void elan_submit_image(struct fp_img_dev *dev)
{
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
GSList *frames = NULL;
struct fp_img *img;
@ -323,7 +323,7 @@ static void elan_cmd_cb(struct libusb_transfer *transfer)
{
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);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
@ -365,7 +365,7 @@ static void elan_cmd_cb(struct libusb_transfer *transfer)
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);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
int response_len = elandev->cmd->response_len;
G_DEBUG_HERE();
@ -405,7 +405,7 @@ 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);
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
dbg_buf(cmd->cmd, 2);
@ -454,7 +454,7 @@ static void stop_capture_run_state(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);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
int error = fpi_ssm_get_error(ssm);
G_DEBUG_HERE();
@ -479,7 +479,7 @@ static void stop_capture_complete(fpi_ssm *ssm)
static void elan_stop_capture(struct fp_img_dev *dev)
{
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
@ -503,7 +503,7 @@ enum capture_states {
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);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
int r;
switch (fpi_ssm_get_cur_state(ssm)) {
@ -541,7 +541,7 @@ static void capture_run_state(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);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
@ -573,7 +573,7 @@ static void capture_complete(fpi_ssm *ssm)
static void elan_capture(struct fp_img_dev *dev)
{
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
@ -627,7 +627,7 @@ enum calibrate_states {
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);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
@ -704,7 +704,7 @@ static void calibrate_complete(fpi_ssm *ssm)
static void elan_calibrate(struct fp_img_dev *dev)
{
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
@ -729,7 +729,7 @@ enum activate_states {
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);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
@ -785,7 +785,7 @@ static void activate_complete(fpi_ssm *ssm)
static void elan_activate(struct fp_img_dev *dev)
{
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
elan_dev_reset(elandev);
@ -810,7 +810,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
elandev = g_malloc0(sizeof(struct elan_dev));
fpi_imgdev_set_user_data(dev, elandev);
fp_dev_set_instance_data(FP_DEV(dev), elandev);
/* common params */
elandev->dev_type = driver_data;
@ -836,7 +836,7 @@ static void elan_deactivate(struct fp_img_dev *dev)
static void dev_deinit(struct fp_img_dev *dev)
{
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
@ -856,7 +856,7 @@ static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
static void elan_change_state(struct fp_img_dev *dev)
{
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
enum fp_imgdev_state next_state = elandev->dev_state_next;
if (elandev->dev_state == next_state) {
@ -894,7 +894,7 @@ static void elan_change_state_async(void *data)
static int dev_change_state(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct elan_dev *elandev = fpi_imgdev_get_user_data(dev);
struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();

View file

@ -639,7 +639,7 @@ enum {
static int async_tx(struct fp_img_dev *idev, unsigned int ep, void *cb,
void *cb_arg)
{
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *buffer;
int length;
@ -671,7 +671,7 @@ static void async_tx_cb(struct libusb_transfer *transfer)
{
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);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
fp_warn("transfer is not completed (status=%d)",
@ -702,7 +702,7 @@ static void async_tx_cb(struct libusb_transfer *transfer)
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);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
switch (fpi_ssm_get_cur_state(ssm)) {
case EXIT_SET_REGS_REQ:
@ -752,7 +752,7 @@ static void m_exit_start(struct fp_img_dev *idev)
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);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
if (dev->is_active == FALSE) {
fpi_ssm_mark_completed(ssm);
@ -833,7 +833,7 @@ err:
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);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
if (fpi_ssm_get_error(ssm)) {
if (fpi_imgdev_get_action_state(idev) != IMG_ACQUIRE_STATE_DEACTIVATING) {
@ -855,7 +855,7 @@ static void m_capture_complete(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);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
if (dev->is_active == FALSE) {
fpi_ssm_mark_completed(ssm);
@ -951,7 +951,7 @@ err:
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);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
if (!fpi_ssm_get_error(ssm)) {
fpi_ssm *ssm_cap;
@ -985,7 +985,7 @@ static void m_start_fingerdetect(struct fp_img_dev *idev)
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);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
float hist[5];
if (dev->is_active == FALSE) {
@ -1143,7 +1143,7 @@ static void m_tunevrb_complete(fpi_ssm *ssm)
fp_dbg("Tuning is done. Starting finger detection.");
m_start_fingerdetect(idev);
} else {
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
fp_err("Error while tuning VRT");
dev->is_active = FALSE;
reset_param(dev);
@ -1159,7 +1159,7 @@ static void m_tunevrb_complete(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);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
if (dev->is_active == FALSE) {
fpi_ssm_mark_completed(ssm);
@ -1269,7 +1269,7 @@ static void m_tunedc_complete(fpi_ssm *ssm)
fpi_ssm_set_user_data(ssm_tune, idev);
fpi_ssm_start(ssm_tune, m_tunevrb_complete);
} else {
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
fp_err("Error while tuning DCOFFSET");
dev->is_active = FALSE;
reset_param(dev);
@ -1281,7 +1281,7 @@ static void m_tunedc_complete(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);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
if (dev->is_active == FALSE) {
fpi_ssm_mark_completed(ssm);
@ -1389,7 +1389,7 @@ static void m_init_complete(fpi_ssm *ssm)
fpi_ssm_set_user_data(ssm_tune, idev);
fpi_ssm_start(ssm_tune, m_tunedc_complete);
} else {
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
fp_err("Error initializing the device");
dev->is_active = FALSE;
reset_param(dev);
@ -1400,7 +1400,7 @@ static void m_init_complete(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 etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
fpi_ssm *ssm;
g_assert(dev);
@ -1433,7 +1433,7 @@ static int dev_activate(struct fp_img_dev *idev, enum fp_imgdev_state state)
static void dev_deactivate(struct fp_img_dev *idev)
{
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
fp_dbg("deactivating");
@ -1450,7 +1450,7 @@ static int dev_open(struct fp_img_dev *idev, unsigned long driver_data)
struct etes603_dev *dev;
dev = g_malloc0(sizeof(struct etes603_dev));
fpi_imgdev_set_user_data(idev, dev);
fp_dev_set_instance_data(FP_DEV(idev), dev);
dev->req = g_malloc(sizeof(struct egis_msg));
dev->ans = g_malloc(FE_SIZE);
@ -1468,7 +1468,7 @@ static int dev_open(struct fp_img_dev *idev, unsigned long driver_data)
static void dev_close(struct fp_img_dev *idev)
{
struct etes603_dev *dev = fpi_imgdev_get_user_data(idev);
struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev));
g_free(dev->req);
g_free(dev->ans);

View file

@ -176,7 +176,7 @@ static void free_img_transfers(struct sonly_dev *sdev)
static void last_transfer_killed(struct fp_img_dev *dev)
{
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (sdev->killing_transfers) {
case ABORT_SSM:
fp_dbg("abort ssm error %d", sdev->kill_status_code);
@ -197,7 +197,7 @@ static void last_transfer_killed(struct fp_img_dev *dev)
static void cancel_img_transfers(struct fp_img_dev *dev)
{
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
int i;
if (sdev->num_flying == 0) {
@ -224,7 +224,7 @@ static gboolean is_capturing(struct sonly_dev *sdev)
static void handoff_img(struct fp_img_dev *dev)
{
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
struct fp_img *img;
GSList *elem = sdev->rows;
@ -252,7 +252,7 @@ static void handoff_img(struct fp_img_dev *dev)
static void row_complete(struct fp_img_dev *dev)
{
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
sdev->rowbuf_offset = -1;
if (sdev->num_rows > 0) {
@ -340,7 +340,7 @@ static void row_complete(struct fp_img_dev *dev)
/* add data to row buffer */
static void add_to_rowbuf(struct fp_img_dev *dev, unsigned char *data, int size)
{
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
memcpy(sdev->rowbuf + sdev->rowbuf_offset, data, size);
sdev->rowbuf_offset += size;
@ -374,7 +374,7 @@ static int rowbuf_remaining(struct sonly_dev *sdev)
static void handle_packet(struct fp_img_dev *dev, unsigned char *data)
{
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
uint16_t seqnum = data[0] << 8 | data[1];
int abs_base_addr;
int for_rowbuf;
@ -470,7 +470,7 @@ static void img_data_cb(struct libusb_transfer *transfer)
{
struct img_transfer_data *idata = transfer->user_data;
struct fp_img_dev *dev = idata->dev;
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
int i;
idata->flying = FALSE;
@ -649,7 +649,7 @@ static void sm_read_reg_cb(struct libusb_transfer *transfer)
{
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);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_mark_failed(ssm, -EIO);
@ -695,7 +695,7 @@ static void sm_await_intr_cb(struct libusb_transfer *transfer)
{
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);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
g_free(transfer->buffer);
@ -766,7 +766,7 @@ enum awfsm_1000_states {
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);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case AWFSM_2016_WRITEV_1:
@ -854,7 +854,7 @@ enum capsm_1001_states {
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);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
int i;
for (i = 0; i < NUM_BULK_TRANSFERS; i++) {
int r = libusb_submit_transfer(sdev->img_transfer[i]);
@ -884,7 +884,7 @@ static void capsm_fire_bulk(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);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case CAPSM_2016_INIT:
@ -916,7 +916,7 @@ static void capsm_2016_run_state(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);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case CAPSM_1000_INIT:
@ -942,7 +942,7 @@ static void capsm_1000_run_state(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);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case CAPSM_1001_INIT:
@ -1051,7 +1051,7 @@ enum initsm_1001_states {
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);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case INITSM_2016_WRITEV_1:
@ -1123,7 +1123,7 @@ enum loopsm_states {
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);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case LOOPSM_RUN_AWFSM: ;
@ -1218,7 +1218,7 @@ static void loopsm_run_state(fpi_ssm *ssm)
static void deactivate_done(struct fp_img_dev *dev)
{
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
free_img_transfers(sdev);
@ -1235,7 +1235,7 @@ static void deactivate_done(struct fp_img_dev *dev)
static void dev_deactivate(struct fp_img_dev *dev)
{
struct sonly_dev *sdev = fpi_imgdev_get_user_data(dev);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
if (!sdev->capturing) {
deactivate_done(dev);
@ -1251,7 +1251,7 @@ static void dev_deactivate(struct fp_img_dev *dev)
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);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
int r = fpi_ssm_get_error(ssm);
fpi_ssm_free(ssm);
@ -1270,7 +1270,7 @@ static void loopsm_complete(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);
struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
int r = fpi_ssm_get_error(ssm);
fpi_ssm_free(ssm);
@ -1285,7 +1285,7 @@ static void initsm_complete(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 sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm = NULL;
int i;
@ -1333,7 +1333,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data);
static void dev_deinit(struct fp_img_dev *dev)
{
void *user_data;
user_data = fpi_imgdev_get_user_data(dev);
user_data = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(user_data);
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);
fpi_imgdev_close_complete(dev);
@ -1400,7 +1400,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
sdev = g_malloc0(sizeof(struct sonly_dev));
fpi_imgdev_set_user_data(dev, sdev);
fp_dev_set_instance_data(FP_DEV(dev), sdev);
sdev->dev_model = (int)driver_data;
switch (driver_data) {
case UPEKSONLY_1000:

View file

@ -59,7 +59,7 @@ enum activate_states {
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);
struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
upekdev->init_idx += 1;
if (upekdev->init_idx == upekdev->setup_commands_len)
@ -72,7 +72,7 @@ static void write_init_cb(struct libusb_transfer *transfer)
{
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);
struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
(transfer->length == transfer->actual_length)) {
@ -101,7 +101,7 @@ static void read_init_data_cb(struct libusb_transfer *transfer)
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);
struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
int r;
switch (fpi_ssm_get_cur_state(ssm)) {
@ -181,7 +181,7 @@ static int finger_present(unsigned char *img, size_t len, int sum_threshold)
static void finger_det_data_cb(struct libusb_transfer *transfer)
{
struct fp_img_dev *dev = transfer->user_data;
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *data = transfer->buffer;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
@ -214,7 +214,7 @@ static void finger_det_cmd_cb(struct libusb_transfer *t)
unsigned char *data;
int r;
struct fp_img_dev *dev = t->user_data;
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
if (t->status != LIBUSB_TRANSFER_COMPLETED) {
fp_dbg("req transfer status %d\n", t->status);
@ -249,7 +249,7 @@ exit_free_transfer:
static void start_finger_detection(struct fp_img_dev *dev)
{
int r;
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
struct libusb_transfer *transfer;
G_DEBUG_HERE();
@ -324,7 +324,7 @@ out:
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);
struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
int r;
switch (fpi_ssm_get_cur_state(ssm)) {
@ -373,7 +373,7 @@ static void capture_run_state(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);
struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
fp_dbg("Capture completed");
if (upekdev->deactivating)
@ -387,7 +387,7 @@ static void capture_sm_complete(fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm;
if (upekdev->deactivating) {
@ -403,7 +403,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 upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
ACTIVATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
@ -414,14 +414,14 @@ static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
static void dev_deactivate(struct fp_img_dev *dev)
{
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
upekdev->deactivating = TRUE;
}
static void complete_deactivation(struct fp_img_dev *dev)
{
struct upektc_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
upekdev->deactivating = FALSE;
@ -441,7 +441,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
upekdev = g_malloc0(sizeof(struct upektc_dev));
fpi_imgdev_set_user_data(dev, upekdev);
fp_dev_set_instance_data(FP_DEV(dev), upekdev);
switch (driver_data) {
case UPEKTC_2015:
upekdev->ep_in = UPEKTC_EP_IN;
@ -460,7 +460,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
default:
fp_err("Device variant %lu is not known\n", driver_data);
g_free(upekdev);
fpi_imgdev_set_user_data(dev, NULL);
fp_dev_set_instance_data(FP_DEV(dev), NULL);
return -ENODEV;
break;
}
@ -471,7 +471,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
static void dev_deinit(struct fp_img_dev *dev)
{
void *user_data;
user_data = fpi_imgdev_get_user_data(dev);
user_data = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(user_data);
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);
fpi_imgdev_close_complete(dev);

View file

@ -76,7 +76,7 @@ static void upektc_img_submit_req(fpi_ssm *ssm,
libusb_transfer_cb_fn cb)
{
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
int r;
@ -107,7 +107,7 @@ static void upektc_img_read_data(fpi_ssm *ssm, size_t buf_size, size_t buf_offse
{
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
int r;
if (!transfer) {
@ -183,7 +183,7 @@ static void capture_read_data_cb(struct libusb_transfer *transfer)
{
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);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *data = upekdev->response;
struct fp_img *img;
size_t response_size;
@ -307,7 +307,7 @@ static void capture_read_data_cb(struct libusb_transfer *transfer)
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);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case CAPTURE_INIT_CAPTURE:
@ -344,7 +344,7 @@ static void capture_run_state(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);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
int err = fpi_ssm_get_error(ssm);
fp_dbg("Capture completed, %d", err);
@ -360,7 +360,7 @@ static void capture_sm_complete(fpi_ssm *ssm)
static void start_capture(struct fp_img_dev *dev)
{
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm;
upekdev->image_size = 0;
@ -405,7 +405,7 @@ static void deactivate_read_data_cb(struct libusb_transfer *transfer)
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);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case DEACTIVATE_DEINIT:
@ -422,7 +422,7 @@ static void deactivate_run_state(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);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
int err = fpi_ssm_get_error(ssm);
fp_dbg("Deactivate completed");
@ -439,7 +439,7 @@ static void deactivate_sm_complete(fpi_ssm *ssm)
static void start_deactivation(struct fp_img_dev *dev)
{
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm;
upekdev->image_size = 0;
@ -504,7 +504,7 @@ static void activate_run_state(fpi_ssm *ssm)
{
struct libusb_transfer *transfer;
struct fp_img_dev *idev = fpi_ssm_get_user_data(ssm);
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(idev);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(idev));
struct fp_dev *dev = fpi_ssm_get_dev(ssm);
int r;
@ -579,7 +579,7 @@ static void activate_sm_complete(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 upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_run_state,
ACTIVATE_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
@ -590,7 +590,7 @@ static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
static void dev_deactivate(struct fp_img_dev *dev)
{
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
upekdev->deactivating = TRUE;
}
@ -608,14 +608,14 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
upekdev = g_malloc0(sizeof(struct upektc_img_dev));
fpi_imgdev_set_user_data(dev, upekdev);
fp_dev_set_instance_data(FP_DEV(dev), upekdev);
fpi_imgdev_open_complete(dev, 0);
return 0;
}
static void dev_deinit(struct fp_img_dev *dev)
{
struct upektc_img_dev *upekdev = fpi_imgdev_get_user_data(dev);
struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(upekdev);
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);
fpi_imgdev_close_complete(dev);

View file

@ -317,7 +317,7 @@ static void challenge_cb(struct fp_img_dev *dev, int status,
uint16_t num_regs, unsigned char *data, void *user_data)
{
fpi_ssm *ssm = user_data;
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *respdata;
PK11Context *ctx;
int r, outlen;
@ -374,7 +374,7 @@ static int start_irq_handler(struct fp_img_dev *dev);
static void irq_handler(struct libusb_transfer *transfer)
{
struct fp_img_dev *dev = transfer->user_data;
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *data = transfer->buffer;
uint16_t type;
int r = 0;
@ -426,7 +426,7 @@ out:
static int start_irq_handler(struct fp_img_dev *dev)
{
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *data;
int r;
@ -450,7 +450,7 @@ static int start_irq_handler(struct fp_img_dev *dev)
static void stop_irq_handler(struct fp_img_dev *dev, irqs_stopped_cb_fn cb)
{
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
struct libusb_transfer *transfer = urudev->irq_transfer;
if (transfer) {
libusb_cancel_transfer(transfer);
@ -484,7 +484,7 @@ static void change_state_write_reg_cb(struct fp_img_dev *dev, int status,
static int dev_change_state(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (state) {
case IMGDEV_STATE_INACTIVE:
@ -535,7 +535,7 @@ static void sm_read_reg_cb(struct fp_img_dev *dev, int result,
uint16_t num_regs, unsigned char *data, void *user_data)
{
fpi_ssm *ssm = user_data;
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
if (result) {
fpi_ssm_mark_failed(ssm, result);
@ -549,7 +549,7 @@ static void sm_read_reg_cb(struct fp_img_dev *dev, int result,
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);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
int r;
if (num_regs > sizeof(urudev->last_reg_rd)) {
@ -690,7 +690,7 @@ static int calc_dev2(struct uru4k_image *img)
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);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
struct uru4k_image *img = urudev->img_data;
struct fp_img *fpimg;
uint32_t key;
@ -813,7 +813,7 @@ static void imaging_run_state(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);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
int r = fpi_ssm_get_error(ssm);
fpi_ssm_free(ssm);
@ -864,7 +864,7 @@ static void rebootpwr_pause_cb(void *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);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
if (!--urudev->rebootpwr_ctr) {
fp_err("could not reboot device power");
@ -877,7 +877,7 @@ static void rebootpwr_pause_cb(void *data)
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);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case REBOOTPWR_SET_HWSTAT:
@ -941,7 +941,7 @@ static void powerup_pause_cb(void *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);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
if (!--urudev->powerup_ctr) {
fp_err("could not power device up");
@ -956,7 +956,7 @@ static void powerup_pause_cb(void *data)
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);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case POWERUP_INIT:
@ -1025,7 +1025,7 @@ static void init_scanpwr_irq_cb(struct fp_img_dev *dev, int status,
uint16_t type, void *user_data)
{
fpi_ssm *ssm = user_data;
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
if (status)
fpi_ssm_mark_failed(ssm, status);
@ -1044,7 +1044,7 @@ static void init_scanpwr_timeout(void *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);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
fp_warn("powerup timed out");
urudev->irq_cb = NULL;
@ -1061,7 +1061,7 @@ static void init_scanpwr_timeout(void *user_data)
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);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case INIT_GET_HWSTAT:
@ -1159,7 +1159,7 @@ static void activate_initsm_complete(fpi_ssm *ssm)
* call. */
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 uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm;
int r;
@ -1195,7 +1195,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 uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm;
switch (urudev->activate_state) {
@ -1351,7 +1351,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
}
urudev->param = PK11_ParamFromIV(urudev->cipher, NULL);
fpi_imgdev_set_user_data(dev, urudev);
fp_dev_set_instance_data(FP_DEV(dev), urudev);
fpi_imgdev_open_complete(dev, 0);
out:
@ -1361,7 +1361,7 @@ out:
static void dev_deinit(struct fp_img_dev *dev)
{
struct uru4k_dev *urudev = fpi_imgdev_get_user_data(dev);
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
if (urudev->symkey)
PK11_FreeSymKey (urudev->symkey);
if (urudev->param)

View file

@ -193,7 +193,7 @@ static void capture_cb(struct libusb_transfer *transfer)
{
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);
struct v5s_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
fpi_ssm_mark_failed(ssm, -EIO);
@ -221,7 +221,7 @@ out:
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);
struct v5s_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
int iteration = vdev->capture_iteration;
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
int r;
@ -246,7 +246,7 @@ static void capture_iterate(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);
struct v5s_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
vdev->capture_img = fpi_img_new_for_imgdev(dev);
@ -268,7 +268,7 @@ enum loop_states {
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);
struct v5s_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case LOOP_SET_CONTRAST:
@ -296,7 +296,7 @@ static void loop_run_state(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);
struct v5s_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
int r = fpi_ssm_get_error(ssm);
fpi_ssm_free(ssm);
@ -313,7 +313,7 @@ static void loopsm_complete(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 v5s_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), loop_run_state,
LOOP_NUM_STATES);
fpi_ssm_set_user_data(ssm, dev);
@ -326,7 +326,7 @@ static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
static void dev_deactivate(struct fp_img_dev *dev)
{
struct v5s_dev *vdev = fpi_imgdev_get_user_data(dev);
struct v5s_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
if (vdev->loop_running)
vdev->deactivating = TRUE;
else
@ -339,7 +339,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
struct v5s_dev *v5s_dev;
v5s_dev = g_malloc0(sizeof(struct v5s_dev));
fpi_imgdev_set_user_data(dev, v5s_dev);
fp_dev_set_instance_data(FP_DEV(dev), v5s_dev);
r = libusb_claim_interface(fpi_imgdev_get_usb_dev(dev), 0);
if (r < 0)
@ -354,7 +354,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
static void dev_deinit(struct fp_img_dev *dev)
{
struct v5s_dev *v5s_dev;
v5s_dev = fpi_imgdev_get_user_data(dev);
v5s_dev = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(v5s_dev);
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);
fpi_imgdev_close_complete(dev);

View file

@ -55,7 +55,7 @@ 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);
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
vdev->transfer = libusb_alloc_transfer(0);
vdev->transfer->flags |= LIBUSB_TRANSFER_FREE_TRANSFER;
@ -97,7 +97,7 @@ 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);
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
ep |= LIBUSB_ENDPOINT_IN;
@ -151,7 +151,7 @@ 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);
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
int len = VFS_USB_BUFFER_SIZE;
unsigned char *data = g_malloc(VFS_USB_BUFFER_SIZE);
@ -259,7 +259,7 @@ static struct fp_img *prepare_image(struct vfs_dev_t *vdev)
/* Processes and submits image after fingerprint received */
static void submit_image(struct fp_img_dev *idev)
{
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
/* We were not asked to submit image actually */
if (!vdev->active)
@ -320,7 +320,7 @@ static void clear_ep2(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);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
short result;
unsigned char *commit_result = NULL;
@ -408,7 +408,7 @@ static void interrupt_callback(struct libusb_transfer *transfer)
{
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);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
char *interrupt = vdev->interrupt;
int error = transfer->status, transferred = transfer->actual_length;
@ -468,7 +468,7 @@ static void receive_callback(struct libusb_transfer *transfer)
{
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);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
int transferred = transfer->actual_length, error = transfer->status;
@ -496,7 +496,7 @@ static void wait_interrupt(void *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);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
/* Keep sleeping while this flag is on */
if (vdev->wait_interrupt)
@ -522,7 +522,7 @@ 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);
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
switch (fpi_ssm_get_cur_state(ssm)) {
case SSM_INITIAL_ABORT_1:
@ -674,7 +674,7 @@ static void activate_ssm(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);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
vdev->ssm_active = 0;
@ -684,7 +684,7 @@ static void dev_activate_callback(fpi_ssm *ssm)
/* Activate device */
static int dev_activate(struct fp_img_dev *idev, enum fp_imgdev_state state)
{
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
/* Initialize flags */
vdev->active = 1;
@ -700,7 +700,7 @@ static int dev_activate(struct fp_img_dev *idev, enum fp_imgdev_state state)
/* Deactivate device */
static void dev_deactivate(struct fp_img_dev *idev)
{
struct vfs_dev_t *vdev = fpi_imgdev_get_user_data(idev);
struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev));
if (!vdev->ssm_active) {
fpi_imgdev_deactivate_complete(idev);
@ -735,7 +735,7 @@ static int dev_open(struct fp_img_dev *idev, unsigned long driver_data)
/* Initialize private structure */
vdev = g_malloc0(sizeof(struct vfs_dev_t));
fpi_imgdev_set_user_data(idev, vdev);
fp_dev_set_instance_data(FP_DEV(idev), vdev);
/* Clearing previous device state */
fpi_ssm *ssm = fpi_ssm_new(fpi_imgdev_get_dev(idev), activate_ssm, SSM_STATES);
@ -750,7 +750,7 @@ static void dev_close(struct fp_img_dev *idev)
struct vfs_dev_t *vdev;
/* Release private structure */
vdev = fpi_imgdev_get_user_data(idev);
vdev = FP_INSTANCE_DATA(FP_DEV(idev));
g_free(vdev);
/* Release usb interface */

View file

@ -201,7 +201,7 @@ static void async_send_cb(struct libusb_transfer *transfer)
{
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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
/* Cleanup transfer */
vdev->transfer = NULL;
@ -245,7 +245,7 @@ out:
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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
int r;
/* Allocation of transfer */
@ -285,7 +285,7 @@ static void async_recv_cb(struct libusb_transfer *transfer)
{
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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
/* Cleanup transfer */
vdev->transfer = NULL;
@ -332,7 +332,7 @@ out:
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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
int r;
/* Allocation of transfer */
@ -369,7 +369,7 @@ static void async_load_cb(struct libusb_transfer *transfer)
{
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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
/* Cleanup transfer */
vdev->transfer = NULL;
@ -433,7 +433,7 @@ out:
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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
unsigned char *buffer;
int r;
@ -472,7 +472,7 @@ static void async_sleep_cb(void *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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
/* Cleanup timeout */
vdev->timeout = NULL;
@ -484,7 +484,7 @@ static void async_sleep_cb(void *data)
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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
/* Add timeout */
vdev->timeout = fpi_timeout_add(msec, async_sleep_cb, ssm);
@ -527,7 +527,7 @@ static void m_swap_state(fpi_ssm *ssm)
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 vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *subsm;
/* Prepare data for sending */
@ -626,7 +626,7 @@ static void vfs_get_finger_state(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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
G_DEBUG_HERE();
@ -644,7 +644,7 @@ static void vfs_img_load(fpi_ssm *ssm)
/* Check if action is completed */
static int action_completed(struct fp_img_dev *dev)
{
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
if ((fpi_imgdev_get_action(dev) == IMG_ACTION_ENROLL) &&
(vdev->enroll_stage < fpi_dev_get_nr_enroll_stages(fpi_imgdev_get_dev(dev))))
@ -757,7 +757,7 @@ static void img_copy(struct vfs101_dev *vdev, struct fp_img *img)
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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
struct fp_img *img;
/* Screen image to remove noise and find top and bottom line */
@ -915,7 +915,7 @@ enum
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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
/* Check action state */
if (!vdev->active)
@ -1179,7 +1179,7 @@ enum
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);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
/* Check action state */
if (!vdev->active)
@ -1420,7 +1420,7 @@ static void m_init_state(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 vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm_loop;
if (!fpi_ssm_get_error(ssm) && vdev->active)
@ -1441,7 +1441,7 @@ static void m_init_complete(fpi_ssm *ssm)
/* Activate device */
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 vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
fpi_ssm *ssm;
/* Check if already active */
@ -1474,7 +1474,7 @@ static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
/* Deactivate device */
static void dev_deactivate(struct fp_img_dev *dev)
{
struct vfs101_dev *vdev = fpi_imgdev_get_user_data(dev);
struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
/* Reset active state */
vdev->active = FALSE;
@ -1505,7 +1505,7 @@ static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
/* Initialize private structure */
vdev = g_malloc0(sizeof(struct vfs101_dev));
vdev->seqnum = -1;
fpi_imgdev_set_user_data(dev, vdev);
fp_dev_set_instance_data(FP_DEV(dev), vdev);
/* Notify open complete */
fpi_imgdev_open_complete(dev, 0);
@ -1519,7 +1519,7 @@ static void dev_close(struct fp_img_dev *dev)
struct vfs101_dev *vdev;
/* Release private structure */
vdev = fpi_imgdev_get_user_data(dev);
vdev = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(vdev);
/* Release usb interface */

View file

@ -54,7 +54,7 @@ static void async_sleep(unsigned int msec, 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);
vfs301_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
int height;
struct fp_img *img;
@ -106,7 +106,7 @@ enum
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);
vfs301_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case M_REQUEST_PRINT:
@ -171,7 +171,7 @@ static void m_loop_complete(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);
vfs301_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(dev));
g_assert(fpi_ssm_get_cur_state(ssm) == 0);
@ -218,7 +218,7 @@ static void dev_deactivate(struct fp_img_dev *dev)
{
vfs301_dev_t *vdev;
vdev = fpi_imgdev_get_user_data(dev);
vdev = FP_INSTANCE_DATA(FP_DEV(dev));
vfs301_proto_deinit(fpi_imgdev_get_usb_dev(dev), vdev);
fpi_imgdev_deactivate_complete(dev);
}
@ -238,7 +238,7 @@ static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
/* Initialize private structure */
vdev = g_malloc0(sizeof(vfs301_dev_t));
fpi_imgdev_set_user_data(dev, vdev);
fp_dev_set_instance_data(FP_DEV(dev), vdev);
vdev->scanline_buf = malloc(0);
vdev->scanline_count = 0;
@ -254,7 +254,7 @@ static void dev_close(struct fp_img_dev *dev)
vfs301_dev_t *vdev;
/* Release private structure */
vdev = fpi_imgdev_get_user_data(dev);
vdev = FP_INSTANCE_DATA(FP_DEV(dev));
free(vdev->scanline_buf);
g_free(vdev);

View file

@ -426,7 +426,7 @@ static void chunk_capture_callback(struct libusb_transfer *transfer)
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs5011_data *data;
data = fpi_imgdev_get_user_data(dev);
data = FP_INSTANCE_DATA(FP_DEV(dev));
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) ||
(transfer->status == LIBUSB_TRANSFER_TIMED_OUT)) {
@ -674,7 +674,7 @@ static void activate_loop(fpi_ssm *ssm)
int r;
fpi_timeout *timeout;
data = fpi_imgdev_get_user_data(dev);
data = FP_INSTANCE_DATA(FP_DEV(dev));
fp_dbg("main_loop: state %d", fpi_ssm_get_cur_state(ssm));
@ -748,7 +748,7 @@ static void activate_loop_complete(fpi_ssm *ssm)
struct vfs5011_data *data;
int r = fpi_ssm_get_error(ssm);
data = fpi_imgdev_get_user_data(dev);
data = FP_INSTANCE_DATA(FP_DEV(dev));
fp_dbg("finishing");
if (data->init_sequence.receive_buf != NULL)
@ -777,7 +777,7 @@ static void open_loop(fpi_ssm *ssm)
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs5011_data *data;
data = fpi_imgdev_get_user_data(dev);
data = FP_INSTANCE_DATA(FP_DEV(dev));
switch (fpi_ssm_get_cur_state(ssm)) {
case DEV_OPEN_START:
@ -798,7 +798,7 @@ static void open_loop_complete(fpi_ssm *ssm)
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
struct vfs5011_data *data;
data = fpi_imgdev_get_user_data(dev);
data = FP_INSTANCE_DATA(FP_DEV(dev));
g_free(data->init_sequence.receive_buf);
data->init_sequence.receive_buf = NULL;
@ -815,7 +815,7 @@ static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
data = (struct vfs5011_data *)g_malloc0(sizeof(*data));
data->capture_buffer =
(unsigned char *)g_malloc0(CAPTURE_LINES * VFS5011_LINE_SIZE);
fpi_imgdev_set_user_data(dev, data);
fp_dev_set_instance_data(FP_DEV(dev), data);
r = libusb_reset_device(fpi_imgdev_get_usb_dev(dev));
if (r != 0) {
@ -841,7 +841,7 @@ static void dev_close(struct fp_img_dev *dev)
{
libusb_release_interface(fpi_imgdev_get_usb_dev(dev), 0);
struct vfs5011_data *data;
data = fpi_imgdev_get_user_data(dev);
data = FP_INSTANCE_DATA(FP_DEV(dev));
if (data != NULL) {
g_free(data->capture_buffer);
g_slist_free_full(data->rows, g_free);
@ -855,7 +855,7 @@ static void start_scan(struct fp_img_dev *dev)
struct vfs5011_data *data;
fpi_ssm *ssm;
data = fpi_imgdev_get_user_data(dev);
data = FP_INSTANCE_DATA(FP_DEV(dev));
data->loop_running = TRUE;
fp_dbg("creating ssm");
ssm = fpi_ssm_new(fpi_imgdev_get_dev(dev), activate_loop, DEV_ACTIVATE_NUM_STATES);
@ -869,7 +869,7 @@ static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
struct vfs5011_data *data;
data = fpi_imgdev_get_user_data(dev);
data = FP_INSTANCE_DATA(FP_DEV(dev));
fp_dbg("device initialized");
data->deactivating = FALSE;
@ -883,7 +883,7 @@ static void dev_deactivate(struct fp_img_dev *dev)
int r;
struct vfs5011_data *data;
data = fpi_imgdev_get_user_data(dev);
data = FP_INSTANCE_DATA(FP_DEV(dev));
if (data->loop_running) {
data->deactivating = TRUE;
if (data->flying_transfer) {

View file

@ -68,9 +68,6 @@ enum fp_imgdev_enroll_state {
};
libusb_device_handle *fpi_imgdev_get_usb_dev(struct fp_img_dev *dev);
void fpi_imgdev_set_user_data(struct fp_img_dev *imgdev,
void *user_data);
void *fpi_imgdev_get_user_data(struct fp_img_dev *imgdev);
struct fp_dev *fpi_imgdev_get_dev(struct fp_img_dev *imgdev);
enum fp_imgdev_enroll_state fpi_imgdev_get_action_state(struct fp_img_dev *imgdev);
enum fp_imgdev_action fpi_imgdev_get_action(struct fp_img_dev *imgdev);

View file

@ -155,9 +155,6 @@ struct fp_img_dev {
/* FIXME: better place to put this? */
size_t identify_match_offset;
/* FIXME: Remove */
void *priv;
};
int fpi_imgdev_get_img_width(struct fp_img_dev *imgdev);

View file

@ -539,19 +539,6 @@ fpi_imgdev_get_usb_dev(struct fp_img_dev *dev)
return FP_DEV(dev)->udev;
}
void
fpi_imgdev_set_user_data(struct fp_img_dev *imgdev,
void *user_data)
{
imgdev->priv = user_data;
}
void *
fpi_imgdev_get_user_data(struct fp_img_dev *imgdev)
{
return imgdev->priv;
}
struct fp_dev *
fpi_imgdev_get_dev(struct fp_img_dev *imgdev)
{