Changeset f9d0a86 in mainline for uspace/lib/usbhost
- Timestamp:
- 2017-11-14T12:24:42Z (8 years ago)
- 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)
- Location:
- uspace/lib/usbhost
- Files:
-
- 5 edited
-
Makefile (modified) (1 diff)
-
include/usb/host/hcd.h (modified) (2 diffs)
-
include/usb/host/usb_transfer_batch.h (modified) (3 diffs)
-
src/hcd.c (modified) (2 diffs)
-
src/usb_transfer_batch.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/Makefile
r887c9de rf9d0a86 30 30 LIBRARY = libusbhost 31 31 EXTRA_CFLAGS += \ 32 -I$(LIBUSB_PREFIX)/include \ 33 -I$(LIBDRV_PREFIX)/include \ 34 -Iinclude/usb/host \ 35 -Iinclude 32 -Iinclude/usb/host 33 LIBS = usb drv 36 34 37 35 SOURCES = \ -
uspace/lib/usbhost/include/usb/host/hcd.h
r887c9de rf9d0a86 46 46 #include <stddef.h> 47 47 #include <stdint.h> 48 #include <usbhc_iface.h> 48 49 49 50 typedef struct hcd hcd_t; … … 110 111 extern int hcd_send_batch(hcd_t *, device_t *, usb_target_t, 111 112 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 *); 113 114 114 115 extern 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 39 39 #include <usb/usb.h> 40 40 #include <usb/request.h> 41 #include <usbhc_iface.h> 41 42 42 43 #include <atomic.h> … … 49 50 typedef struct endpoint endpoint_t; 50 51 typedef 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 *);55 52 56 53 /** Structure stores additional data needed for communication with EP */ … … 69 66 70 67 /** Function called on completion */ 71 usb _transfer_batch_callback_t on_complete;68 usbhc_iface_transfer_callback_t on_complete; 72 69 /** Arbitrary data for the handler */ 73 70 void *on_complete_data; -
uspace/lib/usbhost/src/hcd.c
r887c9de rf9d0a86 82 82 int hcd_send_batch(hcd_t *hcd, device_t *device, usb_target_t target, 83 83 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) 85 85 { 86 86 assert(hcd); … … 153 153 } sync_data_t; 154 154 155 static int sync_transfer_complete( usb_transfer_batch_t *batch)155 static int sync_transfer_complete(void *arg, int error, size_t transfered_size) 156 156 { 157 sync_data_t *d = batch->on_complete_data;157 sync_data_t *d = arg; 158 158 assert(d); 159 d->transfered_size = batch->transfered_size;160 d->error = batch->error;159 d->transfered_size = transfered_size; 160 d->error = error; 161 161 fibril_mutex_lock(&d->done_mtx); 162 162 d->done = 1; -
uspace/lib/usbhost/src/usb_transfer_batch.c
r887c9de rf9d0a86 124 124 125 125 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); 127 127 if (err) 128 128 usb_log_warning("batch %p failed to complete: %s",
Note:
See TracChangeset
for help on using the changeset viewer.
