Changeset ae3a941 in mainline for uspace/lib/usbhost
- Timestamp:
- 2018-02-26T16:51:40Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e773f58
- Parents:
- 3692678
- Location:
- uspace/lib/usbhost
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/bus.h
r3692678 rae3a941 111 111 int (*device_online)(device_t *); /**< Optional */ 112 112 void (*device_offline)(device_t *); /**< Optional */ 113 endpoint_t *(*endpoint_create)(device_t *, const usb_endpoint_descriptors_t *); 113 endpoint_t *(*endpoint_create)(device_t *, 114 const usb_endpoint_descriptors_t *); 114 115 115 116 /* Operations on endpoint */ -
uspace/lib/usbhost/include/usb/host/endpoint.h
r3692678 rae3a941 102 102 103 103 /* Policies for transfer buffers */ 104 dma_policy_t transfer_buffer_policy; /**< A hint for optimal performance. */ 105 dma_policy_t required_transfer_buffer_policy; /**< Enforced by the library. */ 104 /** A hint for optimal performance. */ 105 dma_policy_t transfer_buffer_policy; 106 /** Enforced by the library. */ 107 dma_policy_t required_transfer_buffer_policy; 106 108 107 109 /** … … 114 116 } endpoint_t; 115 117 116 extern void endpoint_init(endpoint_t *, device_t *, const usb_endpoint_descriptors_t *); 118 extern void endpoint_init(endpoint_t *, device_t *, 119 const usb_endpoint_descriptors_t *); 117 120 118 121 extern void endpoint_add_ref(endpoint_t *); -
uspace/lib/usbhost/include/usb/host/hcd.h
r3692678 rae3a941 78 78 79 79 /** Generate IRQ code to handle interrupts. */ 80 int (*irq_code_gen)(irq_code_t *, hc_device_t *, const hw_res_list_parsed_t *, int *); 80 int (*irq_code_gen)(irq_code_t *, hc_device_t *, 81 const hw_res_list_parsed_t *, int *); 81 82 82 83 /** Claim device from BIOS. */ … … 100 101 101 102 /* Drivers should call this before leaving hc_add */ 102 static inline void hc_device_setup(hc_device_t *hcd, bus_t *bus) { 103 static inline void hc_device_setup(hc_device_t *hcd, bus_t *bus) 104 { 103 105 hcd->bus = bus; 104 106 } -
uspace/lib/usbhost/include/usb/host/usb2_bus.h
r3692678 rae3a941 61 61 } usb2_bus_helper_t; 62 62 63 extern void usb2_bus_helper_init(usb2_bus_helper_t *, const bandwidth_accounting_t *); 63 extern void usb2_bus_helper_init(usb2_bus_helper_t *, 64 const bandwidth_accounting_t *); 64 65 65 66 extern int usb2_bus_device_enumerate(usb2_bus_helper_t *, device_t *); -
uspace/lib/usbhost/src/bandwidth.c
r3692678 rae3a941 73 73 * transaction, but I did not find text in USB spec to confirm this */ 74 74 /* NOTE: All data packets will be considered to be max_packet_size */ 75 switch (ep->device->speed) 76 { 75 switch (ep->device->speed) { 77 76 case USB_SPEED_LOW: 78 77 assert(type == USB_TRANSFER_INTERRUPT); … … 143 142 case USB_SPEED_LOW: 144 143 if (ep->direction == USB_DIRECTION_IN) 145 return 64060 + (2 * hub_ls_setup) + (677 * base_time) + host_delay; 144 return 64060 + (2 * hub_ls_setup) + 145 (677 * base_time) + host_delay; 146 146 else 147 return 64107 + (2 * hub_ls_setup) + (667 * base_time) + host_delay; 147 return 64107 + (2 * hub_ls_setup) + 148 (667 * base_time) + host_delay; 148 149 149 150 case USB_SPEED_FULL: -
uspace/lib/usbhost/src/hcd.c
r3692678 rae3a941 155 155 * @return Negative error code. 156 156 */ 157 static errno_t hcd_ddf_setup_interrupts(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res) 157 static errno_t hcd_ddf_setup_interrupts(hc_device_t *hcd, 158 const hw_res_list_parsed_t *hw_res) 158 159 { 159 160 assert(hcd); 160 irq_code_t irq_code = { 0};161 irq_code_t irq_code = { 0 }; 161 162 162 163 if (!hc_driver->irq_code_gen) … … 174 175 /* Register handler to avoid interrupt lockup */ 175 176 int irq_cap; 176 ret = register_interrupt_handler(hcd->ddf_dev, irq, irq_handler, &irq_code, &irq_cap); 177 ret = register_interrupt_handler(hcd->ddf_dev, irq, irq_handler, 178 &irq_code, &irq_cap); 177 179 irq_code_clean(&irq_code); 178 180 if (ret != EOK) { … … 212 214 213 215 if (!hc_driver->hc_add) { 214 usb_log_error("Driver '%s' does not support adding devices.", hc_driver->name); 216 usb_log_error("Driver '%s' does not support adding devices.", 217 hc_driver->name); 215 218 return ENOTSUP; 216 219 } … … 292 295 293 296 usb_log_info("Controlling new `%s' device `%s'.", 294 hc_driver->name, ddf_dev_get_name(device));297 hc_driver->name, ddf_dev_get_name(device)); 295 298 return EOK; 296 299
Note:
See TracChangeset
for help on using the changeset viewer.