Adapting to latest libusb
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
This commit is contained in:
parent
1ab52617c7
commit
40e7ac195a
7 changed files with 18 additions and 18 deletions
|
@ -70,7 +70,7 @@ static int do_write_regv(struct write_regv_data *wdata, int upper_bound)
|
||||||
unsigned char *data = g_malloc(alloc_size);
|
unsigned char *data = g_malloc(alloc_size);
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
size_t data_offset = 0;
|
size_t data_offset = 0;
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (!transfer) {
|
if (!transfer) {
|
||||||
|
|
|
@ -111,7 +111,7 @@ static void read_regs_rq_cb(struct fp_img_dev *dev, int result, void *user_data)
|
||||||
if (result != 0)
|
if (result != 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
transfer = libusb_alloc_transfer();
|
transfer = libusb_alloc_transfer(0);
|
||||||
if (!transfer) {
|
if (!transfer) {
|
||||||
result = -ENOMEM;
|
result = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -203,7 +203,7 @@ static void generic_ignore_data_cb(struct libusb_transfer *transfer)
|
||||||
* away, then increment the SSM */
|
* away, then increment the SSM */
|
||||||
static void generic_read_ignore_data(struct fpi_ssm *ssm, size_t bytes)
|
static void generic_read_ignore_data(struct fpi_ssm *ssm, size_t bytes)
|
||||||
{
|
{
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
@ -434,7 +434,7 @@ static void finger_det_reqs_cb(struct fp_img_dev *dev, int result,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
transfer = libusb_alloc_transfer();
|
transfer = libusb_alloc_transfer(0);
|
||||||
if (!transfer) {
|
if (!transfer) {
|
||||||
fpi_imgdev_session_error(dev, -ENOMEM);
|
fpi_imgdev_session_error(dev, -ENOMEM);
|
||||||
return;
|
return;
|
||||||
|
@ -630,7 +630,7 @@ static void capture_run_state(struct fpi_ssm *ssm)
|
||||||
generic_write_regv_cb, ssm);
|
generic_write_regv_cb, ssm);
|
||||||
break;
|
break;
|
||||||
case CAPTURE_READ_STRIP: ;
|
case CAPTURE_READ_STRIP: ;
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
|
|
||||||
if (!transfer) {
|
if (!transfer) {
|
||||||
|
|
|
@ -164,7 +164,7 @@ static void do_capture(struct fp_img_dev *dev)
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
aesdev->img_trf = libusb_alloc_transfer();
|
aesdev->img_trf = libusb_alloc_transfer(0);
|
||||||
if (!aesdev->img_trf) {
|
if (!aesdev->img_trf) {
|
||||||
fpi_imgdev_session_error(dev, -EIO);
|
fpi_imgdev_session_error(dev, -EIO);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -137,7 +137,7 @@ static struct libusb_transfer *alloc_send_cmd_transfer(struct fp_dev *dev,
|
||||||
unsigned char seq_a, unsigned char seq_b, const unsigned char *data,
|
unsigned char seq_a, unsigned char seq_b, const unsigned char *data,
|
||||||
uint16_t len, libusb_transfer_cb_fn callback, void *user_data)
|
uint16_t len, libusb_transfer_cb_fn callback, void *user_data)
|
||||||
{
|
{
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
uint16_t crc;
|
uint16_t crc;
|
||||||
|
|
||||||
/* 9 bytes extra for: 4 byte 'Ciao', 1 byte A, 1 byte B | lenHI,
|
/* 9 bytes extra for: 4 byte 'Ciao', 1 byte A, 1 byte B | lenHI,
|
||||||
|
@ -410,7 +410,7 @@ static void read_msg_cb(struct libusb_transfer *transfer)
|
||||||
* to read the remainder. This is handled below. */
|
* to read the remainder. This is handled below. */
|
||||||
if (len > MAX_DATA_IN_READ_BUF) {
|
if (len > MAX_DATA_IN_READ_BUF) {
|
||||||
int needed = len - MAX_DATA_IN_READ_BUF;
|
int needed = len - MAX_DATA_IN_READ_BUF;
|
||||||
struct libusb_transfer *etransfer = libusb_alloc_transfer();
|
struct libusb_transfer *etransfer = libusb_alloc_transfer(0);
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (!transfer)
|
if (!transfer)
|
||||||
|
@ -450,7 +450,7 @@ out:
|
||||||
static int __read_msg_async(struct read_msg_data *udata)
|
static int __read_msg_async(struct read_msg_data *udata)
|
||||||
{
|
{
|
||||||
unsigned char *buf = g_malloc(MSG_READ_BUF_SIZE);
|
unsigned char *buf = g_malloc(MSG_READ_BUF_SIZE);
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (!transfer) {
|
if (!transfer) {
|
||||||
|
@ -703,7 +703,7 @@ static void initsm_run_state(struct fpi_ssm *ssm)
|
||||||
case WRITE_CTRL400: ;
|
case WRITE_CTRL400: ;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
|
|
||||||
transfer = libusb_alloc_transfer();
|
transfer = libusb_alloc_transfer(0);
|
||||||
if (!transfer) {
|
if (!transfer) {
|
||||||
fpi_ssm_mark_aborted(ssm, -ENOMEM);
|
fpi_ssm_mark_aborted(ssm, -ENOMEM);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -187,7 +187,7 @@ static int write_regs(struct fp_img_dev *dev, uint16_t first_reg,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
struct write_regs_data *wrdata;
|
struct write_regs_data *wrdata;
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ static int read_regs(struct fp_img_dev *dev, uint16_t first_reg,
|
||||||
uint16_t num_regs, read_regs_cb_fn callback, void *user_data)
|
uint16_t num_regs, read_regs_cb_fn callback, void *user_data)
|
||||||
{
|
{
|
||||||
struct read_regs_data *rrdata;
|
struct read_regs_data *rrdata;
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ out:
|
||||||
static int start_irq_handler(struct fp_img_dev *dev)
|
static int start_irq_handler(struct fp_img_dev *dev)
|
||||||
{
|
{
|
||||||
struct uru4k_dev *urudev = dev->priv;
|
struct uru4k_dev *urudev = dev->priv;
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
@ -507,7 +507,7 @@ out:
|
||||||
static int start_imaging_loop(struct fp_img_dev *dev)
|
static int start_imaging_loop(struct fp_img_dev *dev)
|
||||||
{
|
{
|
||||||
struct uru4k_dev *urudev = dev->priv;
|
struct uru4k_dev *urudev = dev->priv;
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ static void sm_write_reg(struct fpi_ssm *ssm, unsigned char reg,
|
||||||
unsigned char value)
|
unsigned char value)
|
||||||
{
|
{
|
||||||
struct fp_img_dev *dev = ssm->priv;
|
struct fp_img_dev *dev = ssm->priv;
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ static void sm_exec_cmd(struct fpi_ssm *ssm, unsigned char cmd,
|
||||||
unsigned char param)
|
unsigned char param)
|
||||||
{
|
{
|
||||||
struct fp_img_dev *dev = ssm->priv;
|
struct fp_img_dev *dev = ssm->priv;
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ static void capture_iterate(struct fpi_ssm *ssm)
|
||||||
struct fp_img_dev *dev = ssm->priv;
|
struct fp_img_dev *dev = ssm->priv;
|
||||||
struct v5s_dev *vdev = dev->priv;
|
struct v5s_dev *vdev = dev->priv;
|
||||||
int iteration = vdev->capture_iteration;
|
int iteration = vdev->capture_iteration;
|
||||||
struct libusb_transfer *transfer = libusb_alloc_transfer();
|
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (!transfer) {
|
if (!transfer) {
|
||||||
|
|
|
@ -228,7 +228,7 @@ API_EXPORTED int fp_handle_events_timeout(struct timeval *timeout)
|
||||||
select_timeout = *timeout;
|
select_timeout = *timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = libusb_poll_timeout(&select_timeout);
|
r = libusb_handle_events_timeout(&select_timeout);
|
||||||
*timeout = select_timeout;
|
*timeout = select_timeout;
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Reference in a new issue