Changes in / [f6309b6:608afb9] in mainline
- Location:
- uspace
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
rf6309b6 r608afb9 166 166 usbhc_iface_transfer_out_callback_t callback, void *arg) 167 167 { 168 usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);168 usb_log_warning("Using deprecated API control write setup.\n"); 169 169 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 170 170 8, FULL_SPEED, data, size, NULL, callback, arg); … … 179 179 usbhc_iface_transfer_out_callback_t callback, void *arg) 180 180 { 181 usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);182 181 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 183 182 size, FULL_SPEED, data, size, NULL, callback, arg); … … 191 190 usbhc_iface_transfer_in_callback_t callback, void *arg) 192 191 { 193 usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);194 192 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 195 193 0, FULL_SPEED, NULL, 0, callback, NULL, arg); … … 204 202 usbhc_iface_transfer_out_callback_t callback, void *arg) 205 203 { 206 usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);204 usb_log_warning("Using deprecated API control read setup.\n"); 207 205 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 208 206 8, FULL_SPEED, data, size, NULL, callback, arg); … … 217 215 usbhc_iface_transfer_in_callback_t callback, void *arg) 218 216 { 219 usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);220 217 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 221 218 size, FULL_SPEED, data, size, callback, NULL, arg); … … 229 226 usbhc_iface_transfer_out_callback_t callback, void *arg) 230 227 { 231 usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);232 228 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 233 229 0, FULL_SPEED, NULL, 0, NULL, callback, arg); -
uspace/drv/uhci-hcd/root_hub.c
rf6309b6 r608afb9 35 35 #include <errno.h> 36 36 #include <stdio.h> 37 37 38 #include <usb_iface.h> 39 38 40 #include <usb/debug.h> 39 41 40 42 #include "root_hub.h" 43 /*----------------------------------------------------------------------------*/ 44 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle) 45 { 46 assert(dev); 47 assert(dev->parent != NULL); 41 48 42 extern device_ops_t child_ops; 49 device_t *parent = dev->parent; 50 51 if (parent->ops && parent->ops->interfaces[USB_DEV_IFACE]) { 52 usb_iface_t *usb_iface 53 = (usb_iface_t *) parent->ops->interfaces[USB_DEV_IFACE]; 54 assert(usb_iface != NULL); 55 if (usb_iface->get_hc_handle) { 56 int rc = usb_iface->get_hc_handle(parent, handle); 57 return rc; 58 } 59 } 60 61 return ENOTSUP; 62 } 43 63 /*----------------------------------------------------------------------------*/ 64 static usb_iface_t usb_iface = { 65 .get_hc_handle = usb_iface_get_hc_handle 66 }; 67 68 static device_ops_t rh_ops = { 69 .interfaces[USB_DEV_IFACE] = &usb_iface 70 }; 71 44 72 int setup_root_hub(device_t **device, device_t *hc) 45 73 { … … 80 108 hub->name = name; 81 109 hub->parent = hc; 82 hub->ops = & child_ops;110 hub->ops = &rh_ops; 83 111 84 112 *device = hub; -
uspace/drv/uhci-hcd/tracker.c
rf6309b6 r608afb9 37 37 38 38 #include "tracker.h" 39 #include "transfer_list.h"40 39 #include "uhci.h" 41 40 #include "utils/malloc32.h" … … 388 387 assert(instance); 389 388 tracker_call_in(instance); 390 transfer_list_remove_tracker(instance->scheduled_list, instance);391 389 free32(instance->td); 392 390 free32(instance->packet); … … 398 396 assert(instance); 399 397 tracker_call_out(instance); 400 assert(instance->scheduled_list);401 transfer_list_remove_tracker(instance->scheduled_list, instance);402 398 free32(instance->td); 403 399 free32(instance->packet); -
uspace/drv/uhci-hcd/tracker.h
rf6309b6 r608afb9 47 47 } dev_speed_t; 48 48 49 struct transfer_list;50 51 49 typedef struct tracker 52 50 { … … 70 68 void (*next_step)(struct tracker*); 71 69 unsigned toggle:1; 72 73 struct transfer_list *scheduled_list;74 70 } tracker_t; 75 71 -
uspace/drv/uhci-hcd/transfer_list.c
rf6309b6 r608afb9 100 100 } 101 101 } 102 /*----------------------------------------------------------------------------*/103 void transfer_list_remove_tracker(transfer_list_t *instance, tracker_t *tracker)104 {105 assert(instance);106 assert(tracker);107 assert(instance->queue_head);108 assert(tracker->td);109 110 uint32_t pa = (uintptr_t)addr_to_phys(tracker->td);111 if ((instance->queue_head->element & LINK_POINTER_ADDRESS_MASK) == pa) {112 instance->queue_head->element = tracker->td->next;113 }114 }115 102 /** 116 103 * @} -
uspace/drv/uhci-hcd/transfer_list.h
rf6309b6 r608afb9 36 36 37 37 #include "uhci_struct/queue_head.h" 38 39 38 #include "tracker.h" 40 39 … … 53 52 void transfer_list_set_next(transfer_list_t *instance, transfer_list_t *next); 54 53 55 56 54 static inline void transfer_list_fini(transfer_list_t *instance) 57 55 { … … 60 58 } 61 59 60 62 61 void transfer_list_add_tracker(transfer_list_t *instance, tracker_t *tracker); 63 64 void transfer_list_remove_tracker(transfer_list_t *instance, tracker_t *track);65 62 66 63 #endif -
uspace/drv/uhci-hcd/uhci.c
rf6309b6 r608afb9 178 178 list_append(&tracker->link, &instance->tracker_list); 179 179 180 tracker->scheduled_list = list;181 182 180 usb_log_debug2("Scheduler(%d) releasing tracker list mutex.\n", 183 181 fibril_get_id()); -
uspace/drv/uhci-hcd/uhci.h
rf6309b6 r608afb9 72 72 73 73 #define UHCI_FRAME_LIST_COUNT 1024 74 #define UHCI_CLEANER_TIMEOUT 1000 74 #define UHCI_CLEANER_TIMEOUT 10000 75 75 #define UHCI_DEBUGER_TIMEOUT 5000000 76 76 -
uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c
rf6309b6 r608afb9 80 80 #endif 81 81 } 82 83 static inline usb_transaction_outcome_t convert_outcome(uint32_t status) 84 { 85 /*TODO: refactor into something sane */ 86 /*TODO: add additional usb_errors to usb_outcome_t */ 87 88 if (status & TD_STATUS_ERROR_STALLED) 89 return USB_OUTCOME_CRCERROR; 90 91 if (status & TD_STATUS_ERROR_BUFFER) 92 return USB_OUTCOME_CRCERROR; 93 94 if (status & TD_STATUS_ERROR_BABBLE) 95 return USB_OUTCOME_BABBLE; 96 97 if (status & TD_STATUS_ERROR_NAK) 98 return USB_OUTCOME_CRCERROR; 99 100 if (status & TD_STATUS_ERROR_CRC) 101 return USB_OUTCOME_CRCERROR; 102 103 if (status & TD_STATUS_ERROR_BIT_STUFF) 104 return USB_OUTCOME_CRCERROR; 105 106 // assert((((status >> TD_STATUS_ERROR_POS) & TD_STATUS_ERROR_MASK) 107 // | TD_STATUS_ERROR_RESERVED) == TD_STATUS_ERROR_RESERVED); 108 return USB_OUTCOME_OK; 109 } 82 110 /*----------------------------------------------------------------------------*/ 83 111 int transfer_descriptor_status(transfer_descriptor_t *instance) 84 112 { 85 113 assert(instance); 86 87 if ((instance->status & TD_STATUS_ERROR_STALLED) != 0) 88 return EIO; 89 90 if ((instance->status & TD_STATUS_ERROR_CRC) != 0) 91 return EAGAIN; 92 93 if ((instance->status & TD_STATUS_ERROR_BUFFER) != 0) 94 return EAGAIN; 95 96 if ((instance->status & TD_STATUS_ERROR_BABBLE) != 0) 97 return EIO; 98 99 if ((instance->status & TD_STATUS_ERROR_NAK) != 0) 100 return EAGAIN; 101 102 if ((instance->status & TD_STATUS_ERROR_BIT_STUFF) != 0) 103 return EAGAIN; 104 114 if (convert_outcome(instance->status)) 115 return EINVAL; //TODO: use sane error value here 105 116 return EOK; 106 117 } -
uspace/lib/usb/src/recognise.c
rf6309b6 r608afb9 70 70 }; 71 71 72 device_ops_t child_ops = {72 static device_ops_t child_ops = { 73 73 .interfaces[USB_DEV_IFACE] = &usb_iface 74 74 };
Note:
See TracChangeset
for help on using the changeset viewer.