Changeset f9d0a86 in mainline for uspace/lib/drv
- 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/drv
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/Makefile
r887c9de rf9d0a86 29 29 30 30 USPACE_PREFIX = ../.. 31 EXTRA_CFLAGS = \ 32 -Iinclude \ 33 -Igeneric/private \ 34 -I$(LIBUSB_PREFIX)/include \ 35 -I$(LIBUSBHOST_PREFIX)/include \ 36 -I$(LIBPCM_PREFIX)/include 31 EXTRA_CFLAGS = -Igeneric/private 37 32 LIBRARY = libdrv 33 LIBS = pcm 38 34 39 35 SOURCES = \ -
uspace/lib/drv/generic/logbuf.c
r887c9de rf9d0a86 31 31 */ 32 32 33 #include <libarch/common.h>34 33 #include <stdio.h> 35 34 #include <stddef.h> -
uspace/lib/drv/generic/remote_usb.c
r887c9de rf9d0a86 35 35 36 36 #include <async.h> 37 #include <assert.h> 37 38 #include <macros.h> 38 39 #include <errno.h> 39 40 #include <devman.h> 40 #include <usb/host/usb_transfer_batch.h>41 41 42 42 #include "usb_iface.h" -
uspace/lib/drv/generic/remote_usbhc.c
r887c9de rf9d0a86 39 39 #include <errno.h> 40 40 #include <devman.h> 41 #include <usb/host/usb_transfer_batch.h>42 41 43 42 #include "usbhc_iface.h" … … 445 444 } 446 445 447 static int callback_out( usb_transfer_batch_t *batch)448 { 449 async_transaction_t *trans = batch->on_complete_data;450 451 const int err = async_answer_0(trans->caller, batch->error);446 static int callback_out(void *arg, int error, size_t transfered_size) 447 { 448 async_transaction_t *trans = arg; 449 450 const int err = async_answer_0(trans->caller, error); 452 451 453 452 async_transaction_destroy(trans); … … 456 455 } 457 456 458 static int callback_in( usb_transfer_batch_t *batch)459 { 460 async_transaction_t *trans = batch->on_complete_data;457 static int callback_in(void *arg, int error, size_t transfered_size) 458 { 459 async_transaction_t *trans = arg; 461 460 462 461 if (trans->data_caller) { 463 if ( batch->error == EOK) {464 batch->error = async_data_read_finalize(trans->data_caller,465 trans->buffer, batch->transfered_size);462 if (error == EOK) { 463 error = async_data_read_finalize(trans->data_caller, 464 trans->buffer, transfered_size); 466 465 } else { 467 466 async_answer_0(trans->data_caller, EINTR); … … 469 468 } 470 469 471 const int err = async_answer_0(trans->caller, batch->error);470 const int err = async_answer_0(trans->caller, error); 472 471 async_transaction_destroy(trans); 473 472 return err; -
uspace/lib/drv/include/ddf/interrupt.h
r887c9de rf9d0a86 36 36 #define DDF_INTERRUPT_H_ 37 37 38 #include <libarch/common.h>39 38 #include <types/common.h> 40 39 #include <abi/ddi/irq.h> -
uspace/lib/drv/include/usb_iface.h
r887c9de rf9d0a86 40 40 #include "ddf/driver.h" 41 41 #include <async.h> 42 #include <usb/usb.h>43 42 44 43 typedef async_sess_t usb_dev_session_t; 44 45 /** USB speeds. */ 46 typedef enum { 47 /** USB 1.1 low speed (1.5Mbits/s). */ 48 USB_SPEED_LOW, 49 /** USB 1.1 full speed (12Mbits/s). */ 50 USB_SPEED_FULL, 51 /** USB 2.0 high speed (480Mbits/s). */ 52 USB_SPEED_HIGH, 53 /** USB 3.0 super speed (5Gbits/s). */ 54 USB_SPEED_SUPER, 55 /** Psuedo-speed serving as a boundary. */ 56 USB_SPEED_MAX 57 } usb_speed_t; 58 59 /** USB endpoint number type. 60 * Negative values could be used to indicate error. 61 */ 62 typedef int16_t usb_endpoint_t; 63 64 /** USB address type. 65 * Negative values could be used to indicate error. 66 */ 67 typedef int16_t usb_address_t; 68 69 /** USB address for the purposes of Transaction Translation. 70 */ 71 typedef struct { 72 usb_address_t address; 73 unsigned port; 74 } usb_tt_address_t; 75 76 /** USB transfer type. */ 77 typedef enum { 78 USB_TRANSFER_CONTROL = 0, 79 USB_TRANSFER_ISOCHRONOUS = 1, 80 USB_TRANSFER_BULK = 2, 81 USB_TRANSFER_INTERRUPT = 3 82 } usb_transfer_type_t; 83 84 /** USB data transfer direction. */ 85 typedef enum { 86 USB_DIRECTION_IN, 87 USB_DIRECTION_OUT, 88 USB_DIRECTION_BOTH 89 } usb_direction_t; 90 91 /** USB complete address type. 92 * Pair address + endpoint is identification of transaction recipient. 93 */ 94 typedef union { 95 struct { 96 usb_address_t address; 97 usb_endpoint_t endpoint; 98 } __attribute__((packed)); 99 uint32_t packed; 100 } usb_target_t; 101 102 /** Description of usb endpoint. 103 */ 104 typedef struct { 105 /** Endpoint number. */ 106 usb_endpoint_t endpoint_no; 107 108 /** Endpoint transfer type. */ 109 usb_transfer_type_t transfer_type; 110 111 /** Endpoint direction. */ 112 usb_direction_t direction; 113 114 /** Maximum packet size for the endpoint. */ 115 size_t max_packet_size; 116 117 /** Number of packets per frame/uframe. 118 * Only valid for HS INT and ISO transfers. All others should set to 1*/ 119 unsigned packets; 120 121 struct { 122 unsigned polling_interval; 123 } usb2; 124 125 struct { 126 unsigned max_burst; 127 unsigned max_streams; 128 } usb3; 129 } usb_endpoint_desc_t; 130 45 131 46 132 extern usb_dev_session_t *usb_dev_connect(devman_handle_t); -
uspace/lib/drv/include/usbhc_iface.h
r887c9de rf9d0a86 41 41 42 42 #include "ddf/driver.h" 43 #include "usb_iface.h" 43 44 #include <async.h> 44 #include <usb/usb.h>45 45 46 46 extern int usbhc_reserve_default_address(async_exch_t *, usb_speed_t); … … 57 57 size_t); 58 58 59 /** Defined in usb/host/usb_transfer_batch.h */ 60 typedef struct usb_transfer_batch usb_transfer_batch_t; 61 62 /** Callback for outgoing transfer - clone of usb_transfer_batch_callback_t */ 63 typedef int (*usbhc_iface_transfer_callback_t)(usb_transfer_batch_t *); 59 /** Callback for outgoing transfer */ 60 typedef int (*usbhc_iface_transfer_callback_t)(void *, int, size_t); 64 61 65 62 /** USB device communication interface. */ -
uspace/lib/drv/include/usbhid_iface.h
r887c9de rf9d0a86 38 38 39 39 #include "ddf/driver.h" 40 #include <usb/usb.h>41 40 42 41 extern int usbhid_dev_get_event_length(async_sess_t *, size_t *);
Note:
See TracChangeset
for help on using the changeset viewer.