Changeset f9d0a86 in mainline for uspace/lib/usbhost


Ignore:
Timestamp:
2017-11-14T12:24:42Z (8 years ago)
Author:
Aearsis <Hlavaty.Ondrej@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6cad776
Parents:
887c9de (diff), d2d142a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Aearsis <Hlavaty.Ondrej@…> (2017-11-14 01:04:19)
git-committer:
Aearsis <Hlavaty.Ondrej@…> (2017-11-14 12:24:42)
Message:

Merge tag '0.7.1'

The merge wasn't clean, because of changes in build system. The most
significant change was partial revert of usbhc callback refactoring,
which now does not take usb transfer batch, but few named fields again.

Location:
uspace/lib/usbhost
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/Makefile

    r887c9de rf9d0a86  
    3030LIBRARY = libusbhost
    3131EXTRA_CFLAGS += \
    32         -I$(LIBUSB_PREFIX)/include \
    33         -I$(LIBDRV_PREFIX)/include \
    34         -Iinclude/usb/host \
    35         -Iinclude
     32        -Iinclude/usb/host
     33LIBS = usb drv
    3634
    3735SOURCES = \
  • uspace/lib/usbhost/include/usb/host/hcd.h

    r887c9de rf9d0a86  
    4646#include <stddef.h>
    4747#include <stdint.h>
     48#include <usbhc_iface.h>
    4849
    4950typedef struct hcd hcd_t;
     
    110111extern int hcd_send_batch(hcd_t *, device_t *, usb_target_t,
    111112    usb_direction_t direction, char *, size_t, uint64_t,
    112     usb_transfer_batch_callback_t, void *, const char *);
     113    usbhc_iface_transfer_callback_t, void *, const char *);
    113114
    114115extern ssize_t hcd_send_batch_sync(hcd_t *, device_t *, usb_target_t,
  • uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h

    r887c9de rf9d0a86  
    3939#include <usb/usb.h>
    4040#include <usb/request.h>
     41#include <usbhc_iface.h>
    4142
    4243#include <atomic.h>
     
    4950typedef struct endpoint endpoint_t;
    5051typedef struct bus bus_t;
    51 typedef struct usb_transfer_batch usb_transfer_batch_t;
    52 
    53 /** Callback to be called on transfer. */
    54 typedef int (*usb_transfer_batch_callback_t)(usb_transfer_batch_t *);
    5552
    5653/** Structure stores additional data needed for communication with EP */
     
    6966
    7067        /** Function called on completion */
    71         usb_transfer_batch_callback_t on_complete;
     68        usbhc_iface_transfer_callback_t on_complete;
    7269        /** Arbitrary data for the handler */
    7370        void *on_complete_data;
  • uspace/lib/usbhost/src/hcd.c

    r887c9de rf9d0a86  
    8282int hcd_send_batch(hcd_t *hcd, device_t *device, usb_target_t target,
    8383    usb_direction_t direction, char *data, size_t size, uint64_t setup_data,
    84     usb_transfer_batch_callback_t on_complete, void *arg, const char *name)
     84    usbhc_iface_transfer_callback_t on_complete, void *arg, const char *name)
    8585{
    8686        assert(hcd);
     
    153153} sync_data_t;
    154154
    155 static int sync_transfer_complete(usb_transfer_batch_t *batch)
     155static int sync_transfer_complete(void *arg, int error, size_t transfered_size)
    156156{
    157         sync_data_t *d = batch->on_complete_data;
     157        sync_data_t *d = arg;
    158158        assert(d);
    159         d->transfered_size = batch->transfered_size;
    160         d->error = batch->error;
     159        d->transfered_size = transfered_size;
     160        d->error = error;
    161161        fibril_mutex_lock(&d->done_mtx);
    162162        d->done = 1;
  • uspace/lib/usbhost/src/usb_transfer_batch.c

    r887c9de rf9d0a86  
    124124
    125125        if (batch->on_complete) {
    126                 const int err = batch->on_complete(batch);
     126                const int err = batch->on_complete(batch->on_complete_data, batch->error, batch->transfered_size);
    127127                if (err)
    128128                        usb_log_warning("batch %p failed to complete: %s",
Note: See TracChangeset for help on using the changeset viewer.