Changeset 8f198c9 in mainline
- Timestamp:
- 2011-02-11T18:03:34Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1824609b, d321cd7
- Parents:
- 608afb9 (diff), f6309b6 (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. - Location:
- uspace
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
r608afb9 r8f198c9 166 166 usbhc_iface_transfer_out_callback_t callback, void *arg) 167 167 { 168 usb_log_warning("Using deprecated API control write setup.\n");168 usb_log_warning("Using deprecated API %s.\n", __FUNCTION__); 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__); 181 182 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 182 183 size, FULL_SPEED, data, size, NULL, callback, arg); … … 190 191 usbhc_iface_transfer_in_callback_t callback, void *arg) 191 192 { 193 usb_log_warning("Using deprecated API %s.\n", __FUNCTION__); 192 194 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 193 195 0, FULL_SPEED, NULL, 0, callback, NULL, arg); … … 202 204 usbhc_iface_transfer_out_callback_t callback, void *arg) 203 205 { 204 usb_log_warning("Using deprecated API control read setup.\n");206 usb_log_warning("Using deprecated API %s.\n", __FUNCTION__); 205 207 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 206 208 8, FULL_SPEED, data, size, NULL, callback, arg); … … 215 217 usbhc_iface_transfer_in_callback_t callback, void *arg) 216 218 { 219 usb_log_warning("Using deprecated API %s.\n", __FUNCTION__); 217 220 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 218 221 size, FULL_SPEED, data, size, callback, NULL, arg); … … 226 229 usbhc_iface_transfer_out_callback_t callback, void *arg) 227 230 { 231 usb_log_warning("Using deprecated API %s.\n", __FUNCTION__); 228 232 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 229 233 0, FULL_SPEED, NULL, 0, NULL, callback, arg); -
uspace/drv/uhci-hcd/root_hub.c
r608afb9 r8f198c9 35 35 #include <errno.h> 36 36 #include <stdio.h> 37 38 37 #include <usb_iface.h> 39 40 38 #include <usb/debug.h> 41 39 42 40 #include "root_hub.h" 41 42 extern device_ops_t child_ops; 43 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);48 49 device_t *parent = dev->parent;50 51 if (parent->ops && parent->ops->interfaces[USB_DEV_IFACE]) {52 usb_iface_t *usb_iface53 = (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 }63 /*----------------------------------------------------------------------------*/64 static usb_iface_t usb_iface = {65 .get_hc_handle = usb_iface_get_hc_handle66 };67 68 static device_ops_t rh_ops = {69 .interfaces[USB_DEV_IFACE] = &usb_iface70 };71 72 44 int setup_root_hub(device_t **device, device_t *hc) 73 45 { … … 108 80 hub->name = name; 109 81 hub->parent = hc; 110 hub->ops = & rh_ops;82 hub->ops = &child_ops; 111 83 112 84 *device = hub; -
uspace/drv/uhci-hcd/tracker.c
r608afb9 r8f198c9 37 37 38 38 #include "tracker.h" 39 #include "transfer_list.h" 39 40 #include "uhci.h" 40 41 #include "utils/malloc32.h" … … 387 388 assert(instance); 388 389 tracker_call_in(instance); 390 transfer_list_remove_tracker(instance->scheduled_list, instance); 389 391 free32(instance->td); 390 392 free32(instance->packet); … … 396 398 assert(instance); 397 399 tracker_call_out(instance); 400 assert(instance->scheduled_list); 401 transfer_list_remove_tracker(instance->scheduled_list, instance); 398 402 free32(instance->td); 399 403 free32(instance->packet); -
uspace/drv/uhci-hcd/tracker.h
r608afb9 r8f198c9 47 47 } dev_speed_t; 48 48 49 struct transfer_list; 50 49 51 typedef struct tracker 50 52 { … … 68 70 void (*next_step)(struct tracker*); 69 71 unsigned toggle:1; 72 73 struct transfer_list *scheduled_list; 70 74 } tracker_t; 71 75 -
uspace/drv/uhci-hcd/transfer_list.c
r608afb9 r8f198c9 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 } 102 115 /** 103 116 * @} -
uspace/drv/uhci-hcd/transfer_list.h
r608afb9 r8f198c9 36 36 37 37 #include "uhci_struct/queue_head.h" 38 38 39 #include "tracker.h" 39 40 … … 52 53 void transfer_list_set_next(transfer_list_t *instance, transfer_list_t *next); 53 54 55 54 56 static inline void transfer_list_fini(transfer_list_t *instance) 55 57 { … … 58 60 } 59 61 62 void transfer_list_add_tracker(transfer_list_t *instance, tracker_t *tracker); 60 63 61 void transfer_list_ add_tracker(transfer_list_t *instance, tracker_t *tracker);64 void transfer_list_remove_tracker(transfer_list_t *instance, tracker_t *track); 62 65 63 66 #endif -
uspace/drv/uhci-hcd/uhci.c
r608afb9 r8f198c9 178 178 list_append(&tracker->link, &instance->tracker_list); 179 179 180 tracker->scheduled_list = list; 181 180 182 usb_log_debug2("Scheduler(%d) releasing tracker list mutex.\n", 181 183 fibril_get_id()); -
uspace/drv/uhci-hcd/uhci.h
r608afb9 r8f198c9 72 72 73 73 #define UHCI_FRAME_LIST_COUNT 1024 74 #define UHCI_CLEANER_TIMEOUT 1000 074 #define UHCI_CLEANER_TIMEOUT 1000 75 75 #define UHCI_DEBUGER_TIMEOUT 5000000 76 76 -
uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c
r608afb9 r8f198c9 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 }110 82 /*----------------------------------------------------------------------------*/ 111 83 int transfer_descriptor_status(transfer_descriptor_t *instance) 112 84 { 113 85 assert(instance); 114 if (convert_outcome(instance->status)) 115 return EINVAL; //TODO: use sane error value here 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 116 105 return EOK; 117 106 } -
uspace/lib/usb/src/recognise.c
r608afb9 r8f198c9 70 70 }; 71 71 72 staticdevice_ops_t child_ops = {72 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.