Changeset 5f5321ee in mainline
- Timestamp:
- 2014-01-24T16:12:32Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 763dbcb
- Parents:
- dc44023
- Location:
- uspace/drv/bus/usb/ehci
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/endpoint_list.c
rdc44023 r5f5321ee 82 82 assert(ep); 83 83 assert(ep->qh); 84 usb_log_debug2("Queue %s: A ddingendpoint(%p).\n", instance->name, ep);84 usb_log_debug2("Queue %s: Append endpoint(%p).\n", instance->name, ep); 85 85 86 86 fibril_mutex_lock(&instance->guard); … … 103 103 write_barrier(); 104 104 105 /* Add edto the hw queue */105 /* Add QH to the hw queue */ 106 106 qh_append_qh(last_qh, ep->qh); 107 /* Make sure EDis updated */107 /* Make sure QH is updated */ 108 108 write_barrier(); 109 109 /* Add to the sw list */ … … 122 122 } 123 123 124 /** Add endpoint to the beginning of the list and queue. 125 * 126 * @param[in] instance List to use. 127 * @param[in] endpoint Endpoint to add. 128 * 129 * The endpoint is added to the end of the list and queue. 130 */ 131 void endpoint_list_prepend_ep(endpoint_list_t *instance, ehci_endpoint_t *ep) 132 { 133 assert(instance); 134 assert(ep); 135 assert(ep->qh); 136 usb_log_debug2("Queue %s: Prepend endpoint(%p).\n", instance->name, ep); 137 138 fibril_mutex_lock(&instance->guard); 139 ep->qh->horizontal = instance->list_head->horizontal; 140 /* Make sure QH is updated */ 141 write_barrier(); 142 /* Add QH to the hw queue */ 143 qh_append_qh(instance->list_head, ep->qh); 144 /* Add to the sw list */ 145 list_prepend(&ep->link, &instance->endpoint_list); 146 fibril_mutex_unlock(&instance->guard); 147 148 } 124 149 /** Remove endpoint from the list and queue. 125 150 * -
uspace/drv/bus/usb/ehci/endpoint_list.h
rdc44023 r5f5321ee 74 74 int endpoint_list_init(endpoint_list_t *instance, const char *name); 75 75 void endpoint_list_append_ep(endpoint_list_t *instance, ehci_endpoint_t *ep); 76 void endpoint_list_prepend_ep(endpoint_list_t *instance, ehci_endpoint_t *ep); 76 77 void endpoint_list_remove_ep(endpoint_list_t *instance, ehci_endpoint_t *ep); 77 78 #endif -
uspace/drv/bus/usb/ehci/hc.c
rdc44023 r5f5321ee 198 198 { 199 199 assert(instance); 200 /* TODO: implement*/ 200 //TODO: stop the hw 201 #if 0 202 endpoint_list_fini(&instance->async_list); 203 endpoint_list_fini(&instance->int_list); 204 return_page(instance->periodic_list_base); 205 #endif 201 206 }; 202 207 203 208 void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep) 204 209 { 210 assert(instance); 211 assert(ep); 212 ehci_endpoint_t *ehci_ep = ehci_endpoint_get(ep); 213 switch (ep->transfer_type) 214 { 215 case USB_TRANSFER_CONTROL: 216 endpoint_list_prepend_ep(&instance->async_list, ehci_ep); 217 break; 218 case USB_TRANSFER_BULK: 219 endpoint_list_append_ep(&instance->async_list, ehci_ep); 220 break; 221 case USB_TRANSFER_INTERRUPT: 222 endpoint_list_append_ep(&instance->int_list, ehci_ep); 223 break; 224 case USB_TRANSFER_ISOCHRONOUS: 225 /* NOT SUPPORTED */ 226 break; 227 } 205 228 } 206 229 … … 343 366 { 344 367 assert(instance); 368 int ret = endpoint_list_init(&instance->async_list, "ASYNC"); 369 if (ret != EOK) { 370 usb_log_error("Failed to setup ASYNC list: %s", str_error(ret)); 371 return ret; 372 } 373 374 ret = endpoint_list_init(&instance->int_list, "INT"); 375 if (ret != EOK) { 376 usb_log_error("Failed to setup INT list: %s", str_error(ret)); 377 endpoint_list_fini(&instance->async_list); 378 return ret; 379 } 345 380 346 381 /* Take 1024 periodic list heads, we ignore low mem options */ 347 382 instance->periodic_list_base = get_page(); 348 if (!instance->periodic_list_base) 383 if (!instance->periodic_list_base) { 384 usb_log_error("Failed to get ISO schedule page."); 385 endpoint_list_fini(&instance->async_list); 386 endpoint_list_fini(&instance->int_list); 349 387 return ENOMEM; 388 } 350 389 for (unsigned i = 0; 351 390 i < PAGE_SIZE/sizeof(instance->periodic_list_base[0]); ++i) 352 391 { 353 392 /* Disable everything for now */ 354 instance->periodic_list_base[i] = LINK_POINTER_TERM; 393 instance->periodic_list_base[i] = 394 LINK_POINTER_QH(instance->int_list.list_head_pa); 355 395 } 356 396 return EOK; -
uspace/drv/bus/usb/ehci/hc.h
rdc44023 r5f5321ee 51 51 #include "ehci_rh.h" 52 52 #include "hw_struct/link_pointer.h" 53 //#include "endpoint_list.h"53 #include "endpoint_list.h" 54 54 55 55 /** Main EHCI driver structure */ … … 63 63 link_pointer_t *periodic_list_base; 64 64 65 /** Transfer schedules */ 66 // endpoint_list_t lists[4]; 65 /** CONTROL and BULK schedules */ 66 endpoint_list_t async_list; 67 68 /** INT schedule */ 69 endpoint_list_t int_list; 70 67 71 /** List of active transfers */ 68 72 list_t pending_batches;
Note:
See TracChangeset
for help on using the changeset viewer.