Changeset 76fbd9a in mainline for uspace/drv/bus/usb/ohci
- Timestamp:
- 2012-02-24T19:07:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a76b01b4
- Parents:
- 5837c7a
- Location:
- uspace/drv/bus/usb/ohci
- Files:
-
- 9 edited
-
endpoint_list.c (modified) (3 diffs)
-
hc.c (modified) (14 diffs)
-
main.c (modified) (1 diff)
-
ohci.c (modified) (4 diffs)
-
ohci_batch.c (modified) (8 diffs)
-
ohci_batch.h (modified) (1 diff)
-
ohci_endpoint.c (modified) (3 diffs)
-
root_hub.c (modified) (12 diffs)
-
utils/malloc32.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/endpoint_list.c
r5837c7a r76fbd9a 65 65 return EOK; 66 66 } 67 /*----------------------------------------------------------------------------*/ 67 68 68 /** Set the next list in transfer list chain. 69 69 * … … 80 80 ed_append_ed(instance->list_head, next->list_head); 81 81 } 82 /*----------------------------------------------------------------------------*/ 82 83 83 /** Add endpoint to the list and queue. 84 84 * … … 132 132 fibril_mutex_unlock(&instance->guard); 133 133 } 134 /*----------------------------------------------------------------------------*/ 134 135 135 /** Remove endpoint from the list and queue. 136 136 * -
uspace/drv/bus/usb/ohci/hc.c
r5837c7a r76fbd9a 68 68 static int interrupt_emulator(hc_t *instance); 69 69 static int hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch); 70 /*----------------------------------------------------------------------------*/ 70 71 71 /** Get number of PIO ranges used in IRQ code. 72 72 * @return Number of ranges. … … 76 76 return sizeof(ohci_pio_ranges) / sizeof(irq_pio_range_t); 77 77 } 78 /*----------------------------------------------------------------------------*/ 79 /*----------------------------------------------------------------------------*/ 78 79 80 80 /** Get number of commands used in IRQ code. 81 81 * @return Number of commands. … … 85 85 return sizeof(ohci_irq_commands) / sizeof(irq_cmd_t); 86 86 } 87 /*----------------------------------------------------------------------------*/ 87 88 88 /** Generate IRQ code. 89 89 * @param[out] ranges PIO ranges buffer. … … 116 116 return EOK; 117 117 } 118 /*----------------------------------------------------------------------------*/ 118 119 119 /** Announce OHCI root hub to the DDF 120 120 * … … 175 175 #undef CHECK_RET_RELEASE 176 176 } 177 /*----------------------------------------------------------------------------*/ 177 178 178 /** Initialize OHCI hc driver structure 179 179 * … … 228 228 return EOK; 229 229 } 230 /*----------------------------------------------------------------------------*/ 230 231 231 void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep) 232 232 { … … 261 261 } 262 262 } 263 /*----------------------------------------------------------------------------*/ 263 264 264 void hc_dequeue_endpoint(hc_t *instance, const endpoint_t *ep) 265 265 { … … 296 296 } 297 297 } 298 /*----------------------------------------------------------------------------*/ 298 299 299 /** Add USB transfer to the schedule. 300 300 * … … 338 338 return EOK; 339 339 } 340 /*----------------------------------------------------------------------------*/ 340 341 341 /** Interrupt handling routine 342 342 * … … 384 384 385 385 } 386 /*----------------------------------------------------------------------------*/ 386 387 387 /** Check status register regularly 388 388 * … … 402 402 return EOK; 403 403 } 404 /*----------------------------------------------------------------------------*/ 404 405 405 /** Turn off any (BIOS)driver that might be in control of the device. 406 406 * … … 465 465 async_usleep(50000); 466 466 } 467 /*----------------------------------------------------------------------------*/ 467 468 468 /** OHCI hw initialization routine. 469 469 * … … 537 537 OHCI_RD(instance->registers->control)); 538 538 } 539 /*----------------------------------------------------------------------------*/ 539 540 540 /** Initialize schedule queues 541 541 * … … 571 571 return EOK; 572 572 } 573 /*----------------------------------------------------------------------------*/ 573 574 574 /** Initialize memory structures used by the OHCI hcd. 575 575 * -
uspace/drv/bus/usb/ohci/main.c
r5837c7a r76fbd9a 63 63 return EOK; 64 64 } 65 /*----------------------------------------------------------------------------*/ 65 66 66 static driver_ops_t ohci_driver_ops = { 67 67 .dev_add = ohci_dev_add, 68 68 }; 69 /*----------------------------------------------------------------------------*/ 69 70 70 static driver_t ohci_driver = { 71 71 .name = NAME, 72 72 .driver_ops = &ohci_driver_ops 73 73 }; 74 /*----------------------------------------------------------------------------*/ 74 75 75 /** Initializes global driver structures (NONE). 76 76 * -
uspace/drv/bus/usb/ohci/ohci.c
r5837c7a r76fbd9a 75 75 hc_interrupt(&ohci->hc, status); 76 76 } 77 /*----------------------------------------------------------------------------*/ 77 78 78 /** Get USB address assigned to root hub. 79 79 * … … 92 92 return EOK; 93 93 } 94 /*----------------------------------------------------------------------------*/ 94 95 95 /** Gets handle of the respective hc (this device, hc function). 96 96 * … … 110 110 return EOK; 111 111 } 112 /*----------------------------------------------------------------------------*/ 112 113 113 /** Root hub USB interface */ 114 114 static usb_iface_t usb_iface = { … … 116 116 .get_my_address = rh_get_my_address, 117 117 }; 118 /*----------------------------------------------------------------------------*/ 118 119 119 /** Standard USB HC options (HC interface) */ 120 120 static ddf_dev_ops_t hc_ops = { 121 121 .interfaces[USBHC_DEV_IFACE] = &hcd_iface, 122 122 }; 123 /*----------------------------------------------------------------------------*/ 123 124 124 /** Standard USB RH options (RH interface) */ 125 125 static ddf_dev_ops_t rh_ops = { 126 126 .interfaces[USB_DEV_IFACE] = &usb_iface, 127 127 }; 128 /*----------------------------------------------------------------------------*/ 128 129 129 /** Initialize hc and rh ddf structures and their respective drivers. 130 130 * -
uspace/drv/bus/usb/ohci/ohci_batch.c
r5837c7a r76fbd9a 44 44 45 45 static void (*const batch_setup[])(ohci_transfer_batch_t*, usb_direction_t); 46 /*----------------------------------------------------------------------------*/ 46 47 47 /** Safely destructs ohci_transfer_batch_t structure 48 48 * … … 67 67 free(ohci_batch); 68 68 } 69 /*----------------------------------------------------------------------------*/ 69 70 70 /** Finishes usb_transfer_batch and destroys the structure. 71 71 * … … 80 80 ohci_transfer_batch_dispose(ohci_batch); 81 81 } 82 /*----------------------------------------------------------------------------*/ 82 83 83 /** Allocate memory and initialize internal data structure. 84 84 * … … 158 158 #undef CHECK_NULL_DISPOSE_RET 159 159 } 160 /*----------------------------------------------------------------------------*/ 160 161 161 /** Check batch TDs' status. 162 162 * … … 261 261 return true; 262 262 } 263 /*----------------------------------------------------------------------------*/ 263 264 264 /** Starts execution of the TD list 265 265 * … … 271 271 ed_set_tail_td(ohci_batch->ed, ohci_batch->tds[ohci_batch->td_count]); 272 272 } 273 /*----------------------------------------------------------------------------*/ 273 274 274 /** Prepare generic control transfer 275 275 * … … 347 347 USB_TRANSFER_BATCH_ARGS(*ohci_batch->usb_batch)); 348 348 } 349 /*----------------------------------------------------------------------------*/ 349 350 350 /** Prepare generic data transfer 351 351 * … … 394 394 USB_TRANSFER_BATCH_ARGS(*ohci_batch->usb_batch)); 395 395 } 396 /*----------------------------------------------------------------------------*/ 396 397 397 /** Transfer setup table. */ 398 398 static void (*const batch_setup[])(ohci_transfer_batch_t*, usb_direction_t) = -
uspace/drv/bus/usb/ohci/ohci_batch.h
r5837c7a r76fbd9a 63 63 void ohci_transfer_batch_commit(const ohci_transfer_batch_t *batch); 64 64 void ohci_transfer_batch_finish_dispose(ohci_transfer_batch_t *batch); 65 /*----------------------------------------------------------------------------*/ 65 66 66 static inline ohci_transfer_batch_t *ohci_transfer_batch_from_link(link_t *l) 67 67 { -
uspace/drv/bus/usb/ohci/ohci_endpoint.c
r5837c7a r76fbd9a 48 48 ed_toggle_set(instance->ed, toggle); 49 49 } 50 /*----------------------------------------------------------------------------*/ 50 51 51 /** Callback to get value of toggle bit. 52 52 * … … 61 61 return ed_toggle_get(instance->ed); 62 62 } 63 /*----------------------------------------------------------------------------*/ 63 64 64 /** Creates new hcd endpoint representation. 65 65 * … … 93 93 return EOK; 94 94 } 95 /*----------------------------------------------------------------------------*/ 95 96 96 /** Disposes hcd endpoint structure 97 97 * -
uspace/drv/bus/usb/ohci/root_hub.c
r5837c7a r76fbd9a 210 210 instance->port_count); 211 211 } 212 /*----------------------------------------------------------------------------*/ 212 213 213 /** 214 214 * Process root hub request. … … 251 251 } 252 252 } 253 /*----------------------------------------------------------------------------*/ 253 254 254 /** 255 255 * Process interrupt on a hub device. … … 272 272 fibril_mutex_unlock(&instance->guard); 273 273 } 274 /*----------------------------------------------------------------------------*/ 274 275 275 /** 276 276 * Create hub descriptor. … … 327 327 } 328 328 } 329 /*----------------------------------------------------------------------------*/ 329 330 330 /** Initialize hub descriptors. 331 331 * … … 353 353 instance->hub_descriptor_size); 354 354 } 355 /*----------------------------------------------------------------------------*/ 355 356 356 /** 357 357 * Create bitmap of changes to answer status interrupt. … … 384 384 return uint16_host2usb(mask); 385 385 } 386 /*----------------------------------------------------------------------------*/ 386 387 387 /** 388 388 * Create answer to status request. … … 475 475 476 476 } 477 /*----------------------------------------------------------------------------*/ 477 478 478 /** 479 479 * Create answer to a descriptor request. … … 549 549 TRANSFER_END(request, ENOTSUP); 550 550 } 551 /*----------------------------------------------------------------------------*/ 551 552 552 /** 553 553 * process feature-enabling request on hub … … 595 595 } 596 596 } 597 /*----------------------------------------------------------------------------*/ 597 598 598 /** 599 599 * Process feature clear request. … … 659 659 } 660 660 } 661 /*----------------------------------------------------------------------------*/ 661 662 662 /** 663 663 * process one of requests that do not request nor carry additional data … … 697 697 } 698 698 } 699 /*----------------------------------------------------------------------------*/ 699 700 700 /** 701 701 * process one of requests that do not request nor carry additional data … … 744 744 } 745 745 } 746 /*----------------------------------------------------------------------------*/ 746 747 747 /** 748 748 * Process hub control request. -
uspace/drv/bus/usb/ohci/utils/malloc32.h
r5837c7a r76fbd9a 62 62 return result; 63 63 } 64 /*----------------------------------------------------------------------------*/ 64 65 65 /** Physical mallocator simulator 66 66 * … … 70 70 static inline void * malloc32(size_t size) 71 71 { return memalign(OHCI_ALIGN, size); } 72 /*----------------------------------------------------------------------------*/ 72 73 73 /** Physical mallocator simulator 74 74 *
Note:
See TracChangeset
for help on using the changeset viewer.
