Changeset a312d8f in mainline
- Timestamp:
- 2017-10-30T22:18:28Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 17873ac7
- Parents:
- ef1a3a8
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hc.c
ref1a3a8 ra312d8f 177 177 uhci_transfer_batch_t *batch = 178 178 uhci_transfer_batch_from_link(current); 179 u sb_transfer_batch_finish(&batch->base);179 uhci_transfer_batch_finish(batch); 180 180 } 181 181 } -
uspace/drv/bus/usb/uhci/uhci_batch.c
ref1a3a8 ra312d8f 64 64 } 65 65 66 void uhci_transfer_batch_finish(uhci_transfer_batch_t *batch) 67 { 68 if (batch->base.dir == USB_DIRECTION_IN) { 69 assert(batch->base.transfered_size <= batch->base.buffer_size); 70 memcpy(batch->base.buffer, uhci_transfer_batch_data_buffer(batch), batch->base.transfered_size); 71 } 72 usb_transfer_batch_finish(&batch->base); 73 } 74 66 75 /** Allocate memory and initialize internal data structure. 67 76 * … … 131 140 dest += setup_size; 132 141 /* Copy generic data unless they are provided by the device */ 133 if (usb_batch-> ep->direction!= USB_DIRECTION_IN) {142 if (usb_batch->dir != USB_DIRECTION_IN) { 134 143 memcpy(dest, usb_batch->buffer, usb_batch->buffer_size); 135 144 } -
uspace/drv/bus/usb/uhci/uhci_batch.h
ref1a3a8 ra312d8f 67 67 } uhci_transfer_batch_t; 68 68 69 uhci_transfer_batch_t * uhci_transfer_batch_create(endpoint_t *ep); 70 int uhci_transfer_batch_prepare(uhci_transfer_batch_t *uhci_batch); 71 bool uhci_transfer_batch_check_completed(uhci_transfer_batch_t *uhci_batch); 72 void uhci_transfer_batch_destroy(uhci_transfer_batch_t *uhci_batch); 69 uhci_transfer_batch_t * uhci_transfer_batch_create(endpoint_t *); 70 int uhci_transfer_batch_prepare(uhci_transfer_batch_t *); 71 bool uhci_transfer_batch_check_completed(uhci_transfer_batch_t *); 72 void uhci_transfer_batch_finish(uhci_transfer_batch_t *); 73 void uhci_transfer_batch_destroy(uhci_transfer_batch_t *); 73 74 74 75 /** Get offset to setup buffer accessible to the HC hw. -
uspace/lib/usbhost/src/bus.c
ref1a3a8 ra312d8f 36 36 #include <usb/host/bus.h> 37 37 #include <usb/host/endpoint.h> 38 #include <usb/debug.h> 38 39 #include <ddf/driver.h> 39 40 … … 127 128 int bus_add_endpoint(bus_t *bus, device_t *device, const usb_endpoint_desc_t *desc, endpoint_t **out_ep) 128 129 { 130 assert(bus); 131 assert(device); 132 133 fibril_mutex_lock(&bus->guard); 134 135 if (desc->max_packet_size == 0 || desc->packets == 0) { 136 usb_log_warning("Invalid endpoint description (mps %zu, %u packets)", desc->max_packet_size, desc->packets); 137 return EINVAL; 138 } 139 129 140 int err = ENOMEM; 130 131 assert(bus);132 assert(device);133 134 fibril_mutex_lock(&bus->guard);135 136 141 endpoint_t *ep = bus->ops.create_endpoint(bus); 137 142 if (!ep)
Note:
See TracChangeset
for help on using the changeset viewer.