Files
libfprint/tests/tod-drivers/base-fpi-usb.h
T
Marco Trevisan (Treviño) 58756ab62e tests: Ensure that we don't break ABI with expected TODv1 structures
We can check whether each relevant structure element has not changed and
that the supported enum and flag values didn't change value.
2021-04-13 22:14:56 +02:00

82 lines
2.2 KiB
C

/*
* FpDevice - A fingerprint reader device
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#pragma once
#include <gusb.h>
#include "base-fpi-device.h"
typedef struct _FpiUsbTransferTODV1 FpiUsbTransferTODV1;
typedef struct _FpiSsm FpiSsm;
typedef void (*FpiUsbTransferCallbackTODV1)(FpiUsbTransferTODV1 *transfer,
FpDevice *dev,
gpointer user_data,
GError *error);
typedef enum {
FP_TRANSFER_TODV1_NONE = -1,
FP_TRANSFER_TODV1_CONTROL = 0,
FP_TRANSFER_TODV1_BULK = 2,
FP_TRANSFER_TODV1_INTERRUPT = 3,
} FpiTransferTypeTODV1;
struct _FpiUsbTransferTODV1
{
/*< public >*/
FpDevice *device;
FpiSsm *ssm;
gssize length;
gssize actual_length;
guchar *buffer;
/*< private >*/
guint ref_count;
/* USB Transfer information */
FpiTransferTypeTODV1 type;
guint8 endpoint;
/* Control Transfer options */
GUsbDeviceDirection direction;
GUsbDeviceRequestType request_type;
GUsbDeviceRecipient recipient;
guint8 request;
guint16 value;
guint16 idx;
/* Flags */
gboolean short_is_error;
/* Callbacks */
gpointer user_data;
FpiUsbTransferCallbackTODV1 callback;
/* Data free function */
GDestroyNotify free_buffer;
/*< private >*/
/* padding for future expansion */
gpointer _padding_dummy[32];
};