Changeset fc0271a5 in mainline for uspace/drv/bus/usb/uhci
- Timestamp:
- 2017-10-12T16:06:37Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f9d787c
- Parents:
- d0db4a0
- Location:
- uspace/drv/bus/usb/uhci
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hc.c
rd0db4a0 rfc0271a5 442 442 assert(batch); 443 443 444 if (batch->ep-> address == uhci_rh_get_address(&instance->rh))444 if (batch->ep->target.address == uhci_rh_get_address(&instance->rh)) 445 445 return uhci_rh_schedule(&instance->rh, batch); 446 446 -
uspace/drv/bus/usb/uhci/hc.h
rd0db4a0 rfc0271a5 43 43 #include <ddi.h> 44 44 #include <usb/host/hcd.h> 45 #include <usb/host/usb2_bus.h> 45 46 #include <usb/host/usb_transfer_batch.h> 46 47 … … 100 101 typedef struct hc { 101 102 uhci_rh_t rh; 103 usb2_bus_t bus; 102 104 /** Addresses of I/O registers */ 103 105 uhci_regs_t *registers; -
uspace/drv/bus/usb/uhci/main.c
rd0db4a0 rfc0271a5 45 45 #include <usb/debug.h> 46 46 #include <usb/host/ddf_helpers.h> 47 #include <usb/host/bandwidth.h> 47 48 48 49 #include "hc.h" … … 57 58 static const ddf_hc_driver_t uhci_hc_driver = { 58 59 .claim = disable_legacy, 59 .hc_speed = USB_SPEED_FULL,60 60 .irq_code_gen = uhci_hc_gen_irq_code, 61 61 .init = uhci_driver_init, … … 72 72 static int uhci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res) 73 73 { 74 int err; 75 74 76 assert(hcd); 75 77 assert(hcd_get_driver_data(hcd) == NULL); … … 79 81 return ENOMEM; 80 82 81 const int ret = hc_init(instance, res); 82 if (ret == EOK) { 83 hcd_set_implementation(hcd, instance, &uhci_hc_driver.ops); 84 } else { 85 free(instance); 86 } 87 return ret; 83 if ((err = hc_init(instance, res)) != EOK) 84 goto err; 85 86 if ((err = usb2_bus_init(&instance->bus, hcd, BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11))) 87 goto err; 88 89 hcd_set_implementation(hcd, instance, &uhci_hc_driver.ops, &instance->bus.base); 90 91 return EOK; 92 93 err: 94 free(instance); 95 return err; 88 96 } 89 97 … … 105 113 hc_fini(hc); 106 114 107 hcd_set_implementation(hcd, NULL, NULL );115 hcd_set_implementation(hcd, NULL, NULL, NULL); 108 116 free(hc); 109 117 } -
uspace/drv/bus/usb/uhci/uhci_batch.c
rd0db4a0 rfc0271a5 228 228 uhci_batch->usb_batch->ep->speed == USB_SPEED_LOW; 229 229 const size_t mps = uhci_batch->usb_batch->ep->max_packet_size; 230 const usb_target_t target = {{ 231 uhci_batch->usb_batch->ep->address, 232 uhci_batch->usb_batch->ep->endpoint }}; 230 const usb_target_t target = uhci_batch->usb_batch->ep->target; 233 231 234 232 int toggle = endpoint_toggle_get(uhci_batch->usb_batch->ep); … … 293 291 uhci_batch->usb_batch->ep->speed == USB_SPEED_LOW; 294 292 const size_t mps = uhci_batch->usb_batch->ep->max_packet_size; 295 const usb_target_t target = {{ 296 uhci_batch->usb_batch->ep->address, 297 uhci_batch->usb_batch->ep->endpoint }}; 293 const usb_target_t target = uhci_batch->usb_batch->ep->target; 298 294 299 295 /* setup stage */ -
uspace/drv/bus/usb/uhci/uhci_rh.c
rd0db4a0 rfc0271a5 103 103 assert(batch); 104 104 105 const usb_target_t target = {{ 106 .address = batch->ep->address, 107 .endpoint = batch->ep->endpoint 108 }}; 105 const usb_target_t target = batch->ep->target; 109 106 do { 110 107 batch->error = virthub_base_request(&instance->base, target,
Note:
See TracChangeset
for help on using the changeset viewer.
