Changeset 76fbd9a in mainline
- Timestamp:
- 2012-02-24T19:07:44Z (13 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
- Files:
-
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/main.c
r5837c7a r76fbd9a 49 49 50 50 static int ehci_dev_add(ddf_dev_t *device); 51 /*----------------------------------------------------------------------------*/ 51 52 52 static driver_ops_t ehci_driver_ops = { 53 53 .dev_add = ehci_dev_add, 54 54 }; 55 /*----------------------------------------------------------------------------*/ 55 56 56 static driver_t ehci_driver = { 57 57 .name = NAME, … … 62 62 }; 63 63 64 /*----------------------------------------------------------------------------*/ 64 65 65 /** Initializes a new ddf driver instance of EHCI hcd. 66 66 * … … 121 121 #undef CHECK_RET_RETURN 122 122 } 123 /*----------------------------------------------------------------------------*/ 123 124 124 /** Initializes global driver structures (NONE). 125 125 * -
uspace/drv/bus/usb/ehci/pci.c
r5837c7a r76fbd9a 219 219 return rc; 220 220 } 221 /*----------------------------------------------------------------------------*/ 221 222 222 /** Calls the PCI driver with a request to enable interrupts 223 223 * … … 238 238 return enabled ? EOK : EIO; 239 239 } 240 /*----------------------------------------------------------------------------*/ 240 241 241 /** Implements BIOS handoff routine as decribed in EHCI spec 242 242 * -
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 * -
uspace/drv/bus/usb/uhci/hc.c
r5837c7a r76fbd9a 72 72 static int hc_debug_checker(void *arg); 73 73 74 /*----------------------------------------------------------------------------*/ 74 75 75 /** Get number of PIO ranges used in IRQ code. 76 76 * @return Number of ranges. … … 80 80 return sizeof(uhci_irq_pio_ranges) / sizeof(irq_pio_range_t); 81 81 } 82 /*----------------------------------------------------------------------------*/ 82 83 83 /** Get number of commands used in IRQ code. 84 84 * @return Number of commands. … … 88 88 return sizeof(uhci_irq_commands) / sizeof(irq_cmd_t); 89 89 } 90 /*----------------------------------------------------------------------------*/ 90 91 91 /** Generate IRQ code. 92 92 * @param[out] ranges PIO ranges buffer. … … 118 118 return EOK; 119 119 } 120 /*----------------------------------------------------------------------------*/ 120 121 121 /** Take action based on the interrupt cause. 122 122 * … … 175 175 } 176 176 } 177 /*----------------------------------------------------------------------------*/ 177 178 178 /** Initialize UHCI hc driver structure 179 179 * … … 235 235 return EOK; 236 236 } 237 /*----------------------------------------------------------------------------*/ 237 238 238 /** Initialize UHCI hc hw resources. 239 239 * … … 277 277 UHCI_CMD_RUN_STOP | UHCI_CMD_MAX_PACKET | UHCI_CMD_CONFIGURE); 278 278 } 279 /*----------------------------------------------------------------------------*/ 279 280 280 /** Initialize UHCI hc memory structures. 281 281 * … … 319 319 return EOK; 320 320 } 321 /*----------------------------------------------------------------------------*/ 321 322 322 /** Initialize UHCI hc transfer lists. 323 323 * … … 381 381 #undef CHECK_RET_CLEAR_RETURN 382 382 } 383 /*----------------------------------------------------------------------------*/ 383 384 384 /** Schedule batch for execution. 385 385 * … … 409 409 return EOK; 410 410 } 411 /*----------------------------------------------------------------------------*/ 411 412 412 /** Polling function, emulates interrupts. 413 413 * … … 432 432 return EOK; 433 433 } 434 /*----------------------------------------------------------------------------*/ 434 435 435 /** Debug function, checks consistency of memory structures. 436 436 * -
uspace/drv/bus/usb/uhci/hw_struct/queue_head.h
r5837c7a r76fbd9a 47 47 volatile link_pointer_t element; 48 48 } __attribute__((packed)) qh_t; 49 /*----------------------------------------------------------------------------*/ 49 50 50 /** Initialize queue head structure 51 51 * … … 61 61 instance->next = LINK_POINTER_TERM; 62 62 } 63 /*----------------------------------------------------------------------------*/ 63 64 64 /** Set queue head next pointer 65 65 * … … 81 81 } 82 82 } 83 /*----------------------------------------------------------------------------*/ 83 84 84 /** Set queue head element pointer 85 85 * -
uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.c
r5837c7a r76fbd9a 107 107 } 108 108 } 109 /*----------------------------------------------------------------------------*/ 109 110 110 /** Convert TD status into standard error code 111 111 * … … 145 145 return EOK; 146 146 } 147 /*----------------------------------------------------------------------------*/ 147 148 148 /** Print values in status field (dw1) in a human readable way. 149 149 * -
uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.h
r5837c7a r76fbd9a 100 100 101 101 void td_print_status(const td_t *instance); 102 /*----------------------------------------------------------------------------*/ 102 103 103 /** Helper function for parsing actual size out of TD. 104 104 * … … 113 113 return ((s >> TD_STATUS_ACTLEN_POS) + 1) & TD_STATUS_ACTLEN_MASK; 114 114 } 115 /*----------------------------------------------------------------------------*/ 115 116 116 /** Check whether less than max data were received on SPD marked transfer. 117 117 * … … 129 129 (instance->status | TD_STATUS_SPD_FLAG) && act_size < max_size; 130 130 } 131 /*----------------------------------------------------------------------------*/ 131 132 132 /** Helper function for parsing value of toggle bit. 133 133 * … … 140 140 return (instance->device & TD_DEVICE_DATA_TOGGLE_ONE_FLAG) ? 1 : 0; 141 141 } 142 /*----------------------------------------------------------------------------*/ 142 143 143 /** Helper function for parsing value of active bit 144 144 * … … 151 151 return (instance->status & TD_STATUS_ERROR_ACTIVE) != 0; 152 152 } 153 /*----------------------------------------------------------------------------*/ 153 154 154 /** Helper function for setting IOC bit. 155 155 * … … 161 161 instance->status |= TD_STATUS_IOC_FLAG; 162 162 } 163 /*----------------------------------------------------------------------------*/ 163 164 164 #endif 165 165 /** -
uspace/drv/bus/usb/uhci/main.c
r5837c7a r76fbd9a 44 44 45 45 static int uhci_dev_add(ddf_dev_t *device); 46 /*----------------------------------------------------------------------------*/ 46 47 47 static driver_ops_t uhci_driver_ops = { 48 48 .dev_add = uhci_dev_add, 49 49 }; 50 /*----------------------------------------------------------------------------*/ 50 51 51 static driver_t uhci_driver = { 52 52 .name = NAME, 53 53 .driver_ops = &uhci_driver_ops 54 54 }; 55 /*----------------------------------------------------------------------------*/ 55 56 56 /** Initialize a new ddf driver instance for uhci hc and hub. 57 57 * … … 75 75 return ret; 76 76 } 77 /*----------------------------------------------------------------------------*/ 77 78 78 /** Initialize global driver structures (NONE). 79 79 * -
uspace/drv/bus/usb/uhci/pci.c
r5837c7a r76fbd9a 91 91 return EOK; 92 92 } 93 /*----------------------------------------------------------------------------*/ 93 94 94 /** Call the PCI driver with a request to enable interrupts 95 95 * … … 110 110 return enabled ? EOK : EIO; 111 111 } 112 /*----------------------------------------------------------------------------*/ 112 113 113 /** Call the PCI driver with a request to clear legacy support register 114 114 * -
uspace/drv/bus/usb/uhci/transfer_list.c
r5837c7a r76fbd9a 42 42 static void transfer_list_remove_batch( 43 43 transfer_list_t *instance, uhci_transfer_batch_t *uhci_batch); 44 /*----------------------------------------------------------------------------*/ 44 45 45 /** Initialize transfer list structures. 46 46 * … … 69 69 return EOK; 70 70 } 71 /*----------------------------------------------------------------------------*/ 71 72 72 /** Dispose transfer list structures. 73 73 * … … 97 97 qh_set_next_qh(instance->queue_head, next->queue_head); 98 98 } 99 /*----------------------------------------------------------------------------*/ 99 100 100 /** Add transfer batch to the list and queue. 101 101 * … … 144 144 fibril_mutex_unlock(&instance->guard); 145 145 } 146 /*----------------------------------------------------------------------------*/ 146 147 147 /** Add completed batches to the provided list. 148 148 * … … 171 171 fibril_mutex_unlock(&instance->guard); 172 172 } 173 /*----------------------------------------------------------------------------*/ 173 174 174 /** Walk the list and finish all batches with EINTR. 175 175 * … … 188 188 fibril_mutex_unlock(&instance->guard); 189 189 } 190 /*----------------------------------------------------------------------------*/ 190 191 191 /** Remove a transfer batch from the list and queue. 192 192 * -
uspace/drv/bus/usb/uhci/uhci.c
r5837c7a r76fbd9a 65 65 return dev->driver_data; 66 66 } 67 /*----------------------------------------------------------------------------*/ 67 68 68 /** IRQ handling callback, forward status from call to diver structure. 69 69 * … … 83 83 hc_interrupt(&uhci->hc, status); 84 84 } 85 /*----------------------------------------------------------------------------*/ 85 86 86 /** Operations supported by the HC driver */ 87 87 static ddf_dev_ops_t hc_ops = { 88 88 .interfaces[USBHC_DEV_IFACE] = &hcd_iface, /* see iface.h/c */ 89 89 }; 90 /*----------------------------------------------------------------------------*/ 90 91 91 /** Gets handle of the respective hc. 92 92 * … … 105 105 return EOK; 106 106 } 107 /*----------------------------------------------------------------------------*/ 107 108 108 /** USB interface implementation used by RH */ 109 109 static usb_iface_t usb_iface = { 110 110 .get_hc_handle = usb_iface_get_hc_handle, 111 111 }; 112 /*----------------------------------------------------------------------------*/ 112 113 113 /** Get root hub hw resources (I/O registers). 114 114 * … … 123 123 return &rh->resource_list; 124 124 } 125 /*----------------------------------------------------------------------------*/ 125 126 126 /** Interface to provide the root hub driver with hw info */ 127 127 static hw_res_ops_t hw_res_iface = { … … 129 129 .enable_interrupt = NULL, 130 130 }; 131 /*----------------------------------------------------------------------------*/ 131 132 132 /** RH function support for uhci_rhd */ 133 133 static ddf_dev_ops_t rh_ops = { … … 135 135 .interfaces[HW_RES_DEV_IFACE] = &hw_res_iface 136 136 }; 137 /*----------------------------------------------------------------------------*/ 137 138 138 /** Initialize hc and rh DDF structures and their respective drivers. 139 139 * -
uspace/drv/bus/usb/uhci/uhci_batch.c
r5837c7a r76fbd9a 58 58 } 59 59 } 60 /*----------------------------------------------------------------------------*/ 60 61 61 /** Finishes usb_transfer_batch and destroys the structure. 62 62 * … … 71 71 uhci_transfer_batch_dispose(uhci_batch); 72 72 } 73 /*----------------------------------------------------------------------------*/ 73 74 74 /** Transfer batch setup table. */ 75 75 static void (*const batch_setup[])(uhci_transfer_batch_t*, usb_direction_t); 76 /*----------------------------------------------------------------------------*/ 76 77 77 /** Allocate memory and initialize internal data structure. 78 78 * … … 143 143 return uhci_batch; 144 144 } 145 /*----------------------------------------------------------------------------*/ 145 146 146 /** Check batch TDs for activity. 147 147 * … … 196 196 return true; 197 197 } 198 /*----------------------------------------------------------------------------*/ 198 199 199 /** Direction to pid conversion table */ 200 200 static const usb_packet_id direction_pids[] = { … … 202 202 [USB_DIRECTION_OUT] = USB_PID_OUT, 203 203 }; 204 /*----------------------------------------------------------------------------*/ 204 205 205 /** Prepare generic data transfer 206 206 * … … 259 259 USB_TRANSFER_BATCH_ARGS(*uhci_batch->usb_batch)); 260 260 } 261 /*----------------------------------------------------------------------------*/ 261 262 262 /** Prepare generic control transfer 263 263 * … … 331 331 uhci_batch->tds[td].status); 332 332 } 333 /*----------------------------------------------------------------------------*/ 333 334 334 static void (*const batch_setup[])(uhci_transfer_batch_t*, usb_direction_t) = 335 335 { -
uspace/drv/bus/usb/uhci/uhci_batch.h
r5837c7a r76fbd9a 76 76 uhci_batch->td_count * sizeof(td_t); 77 77 } 78 /*----------------------------------------------------------------------------*/ 78 79 79 /** Get offset to data buffer accessible to the HC hw. 80 80 * @param uhci_batch UHCI batch structure. … … 89 89 uhci_batch->usb_batch->setup_size; 90 90 } 91 /*----------------------------------------------------------------------------*/ 91 92 92 /** Aborts the batch. 93 93 * Sets error to EINTR and size off transferd data to 0, before finishing the … … 103 103 uhci_transfer_batch_finish_dispose(uhci_batch); 104 104 } 105 /*----------------------------------------------------------------------------*/ 105 106 106 /** Linked list conversion wrapper. 107 107 * @param l Linked list link. -
uspace/drv/bus/usb/uhci/utils/malloc32.h
r5837c7a r76fbd9a 62 62 return result; 63 63 } 64 /*----------------------------------------------------------------------------*/ 64 65 65 /** DMA malloc simulator 66 66 * … … 84 84 return memalign(alignment, size); 85 85 } 86 /*----------------------------------------------------------------------------*/ 86 87 87 /** DMA malloc simulator 88 88 * … … 91 91 static inline void free32(void *addr) 92 92 { free(addr); } 93 /*----------------------------------------------------------------------------*/ 93 94 94 /** Create 4KB page mapping 95 95 * … … 105 105 return address; 106 106 } 107 /*----------------------------------------------------------------------------*/ 107 108 108 static inline void return_page(void *page) 109 109 { -
uspace/drv/bus/usb/uhcirh/port.c
r5837c7a r76fbd9a 64 64 return pio_read_16(port->address); 65 65 } 66 /*----------------------------------------------------------------------------*/ 66 67 67 /** Register writing helper function. 68 68 * … … 76 76 pio_write_16(port->address, val); 77 77 } 78 /*----------------------------------------------------------------------------*/ 78 79 79 /** Initialize UHCI root hub port instance. 80 80 * … … 128 128 return EOK; 129 129 } 130 /*----------------------------------------------------------------------------*/ 130 131 131 /** Cleanup UHCI root hub port instance. 132 132 * … … 142 142 return; 143 143 } 144 /*----------------------------------------------------------------------------*/ 144 145 145 /** Periodically checks port status and reports new devices. 146 146 * … … 211 211 return EOK; 212 212 } 213 /*----------------------------------------------------------------------------*/ 213 214 214 /** Callback for enabling port during adding a new device. 215 215 * … … 248 248 return EOK; 249 249 } 250 /*----------------------------------------------------------------------------*/ 250 251 251 /** Initialize and report connected device. 252 252 * … … 283 283 return EOK; 284 284 } 285 /*----------------------------------------------------------------------------*/ 285 286 286 /** Remove device. 287 287 * … … 325 325 return EOK; 326 326 } 327 /*----------------------------------------------------------------------------*/ 327 328 328 /** Enable or disable root hub port. 329 329 * … … 359 359 return EOK; 360 360 } 361 /*----------------------------------------------------------------------------*/ 361 362 362 /** Print the port status value in a human friendly way 363 363 * -
uspace/drv/bus/usb/uhcirh/root_hub.c
r5837c7a r76fbd9a 79 79 return EOK; 80 80 } 81 /*----------------------------------------------------------------------------*/ 81 82 82 /** Cleanup UHCI root hub instance. 83 83 * … … 92 92 } 93 93 } 94 /*----------------------------------------------------------------------------*/ 94 95 95 /** 96 96 * @} -
uspace/drv/bus/usb/usbhid/generic/hiddev.c
r5837c7a r76fbd9a 46 46 #include "usbhid.h" 47 47 48 /*----------------------------------------------------------------------------*/ 48 49 49 50 50 const usb_endpoint_description_t usb_hid_generic_poll_endpoint_description = { … … 60 60 const char *HID_GENERIC_CLASS_NAME = "hid"; 61 61 62 /*----------------------------------------------------------------------------*/ 62 63 63 static size_t usb_generic_hid_get_event_length(ddf_fun_t *fun); 64 64 static int usb_generic_hid_get_event(ddf_fun_t *fun, uint8_t *buffer, … … 68 68 static int usb_generic_get_report_descriptor(ddf_fun_t *fun, uint8_t *desc, 69 69 size_t size, size_t *actual_size); 70 /*----------------------------------------------------------------------------*/ 70 71 71 static usbhid_iface_t usb_generic_iface = { 72 72 .get_event = usb_generic_hid_get_event, … … 75 75 .get_report_descriptor = usb_generic_get_report_descriptor 76 76 }; 77 /*----------------------------------------------------------------------------*/ 77 78 78 static ddf_dev_ops_t usb_generic_hid_ops = { 79 79 .interfaces[USBHID_DEV_IFACE] = &usb_generic_iface, 80 80 .open = usb_generic_hid_client_connected 81 81 }; 82 /*----------------------------------------------------------------------------*/ 82 83 83 static size_t usb_generic_hid_get_event_length(ddf_fun_t *fun) 84 84 { … … 97 97 return hid_dev->max_input_report_size; 98 98 } 99 /*----------------------------------------------------------------------------*/ 99 100 100 static int usb_generic_hid_get_event(ddf_fun_t *fun, uint8_t *buffer, 101 101 size_t size, size_t *act_size, int *event_nr, unsigned int flags) … … 127 127 return EOK; 128 128 } 129 /*----------------------------------------------------------------------------*/ 129 130 130 static size_t usb_generic_get_report_descriptor_length(ddf_fun_t *fun) 131 131 { … … 144 144 return hid_dev->report_desc_size; 145 145 } 146 /*----------------------------------------------------------------------------*/ 146 147 147 static int usb_generic_get_report_descriptor(ddf_fun_t *fun, uint8_t *desc, 148 148 size_t size, size_t *actual_size) … … 166 166 return EOK; 167 167 } 168 /*----------------------------------------------------------------------------*/ 168 169 169 static int usb_generic_hid_client_connected(ddf_fun_t *fun) 170 170 { … … 172 172 return EOK; 173 173 } 174 /*----------------------------------------------------------------------------*/ 174 175 175 void usb_generic_hid_deinit(usb_hid_dev_t *hid_dev, void *data) 176 176 { … … 189 189 ddf_fun_destroy(fun); 190 190 } 191 /*----------------------------------------------------------------------------*/ 191 192 192 int usb_generic_hid_init(usb_hid_dev_t *hid_dev, void **data) 193 193 { … … 224 224 return EOK; 225 225 } 226 /*----------------------------------------------------------------------------*/ 226 227 227 bool usb_generic_hid_polling_callback(usb_hid_dev_t *hid_dev, void *data) 228 228 { -
uspace/drv/bus/usb/usbhid/generic/hiddev.h
r5837c7a r76fbd9a 47 47 const char *HID_GENERIC_CLASS_NAME; 48 48 49 /*----------------------------------------------------------------------------*/ 49 50 50 51 51 int usb_generic_hid_init(struct usb_hid_dev *hid_dev, void **data); -
uspace/drv/bus/usb/usbhid/kbd/kbddev.c
r5837c7a r76fbd9a 73 73 static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *); 74 74 static ddf_dev_ops_t kbdops = { .default_handler = default_connection_handler }; 75 /*----------------------------------------------------------------------------*/ 75 76 76 77 77 static const unsigned DEFAULT_ACTIVE_MODS = KM_NUM_LOCK; … … 88 88 static const unsigned int DEFAULT_REPEAT_DELAY = 50 * 1000; 89 89 90 /*----------------------------------------------------------------------------*/ 90 91 91 /** Keyboard polling endpoint description for boot protocol class. */ 92 92 const usb_endpoint_description_t usb_hid_kbd_poll_endpoint_description = { … … 103 103 104 104 static void usb_kbd_set_led(usb_hid_dev_t *hid_dev, usb_kbd_t *kbd_dev); 105 /*----------------------------------------------------------------------------*/ 105 106 106 static const uint8_t USB_KBD_BOOT_REPORT_DESCRIPTOR[] = { 107 107 0x05, 0x01, /* Usage Page (Generic Desktop), */ … … 138 138 0xC0 /* End Collection */ 139 139 }; 140 /*----------------------------------------------------------------------------*/ 140 141 141 typedef enum usb_kbd_flags { 142 142 USB_KBD_STATUS_UNINITIALIZED = 0, … … 144 144 USB_KBD_STATUS_TO_DESTROY = -1 145 145 } usb_kbd_flags; 146 /*----------------------------------------------------------------------------*/ 146 147 147 /* IPC method handler */ 148 /*----------------------------------------------------------------------------*/ 148 149 149 /** 150 150 * Default handler for IPC methods not handled by DDF. … … 208 208 209 209 } 210 /*----------------------------------------------------------------------------*/ 210 211 211 /* Key processing functions */ 212 /*----------------------------------------------------------------------------*/ 212 213 213 /** 214 214 * Handles turning of LED lights on and off. … … 283 283 } 284 284 } 285 /*----------------------------------------------------------------------------*/ 285 286 286 /** Send key event. 287 287 * … … 308 308 } 309 309 } 310 /*----------------------------------------------------------------------------*/ 310 311 311 static inline int usb_kbd_is_lock(unsigned int key_code) 312 312 { … … 315 315 || key_code == KC_CAPS_LOCK); 316 316 } 317 /*----------------------------------------------------------------------------*/ 317 318 318 static size_t find_in_array_int32(int32_t val, int32_t *arr, size_t arr_size) 319 319 { … … 326 326 return (size_t) -1; 327 327 } 328 /*----------------------------------------------------------------------------*/ 328 329 329 /** 330 330 * Checks if some keys were pressed or released and generates key events. … … 409 409 usb_log_debug2("Stored keys %s.\n", key_buffer); 410 410 } 411 /*----------------------------------------------------------------------------*/ 411 412 412 /* General kbd functions */ 413 /*----------------------------------------------------------------------------*/ 413 414 414 /** 415 415 * Processes data received from the device in form of report. … … 481 481 usb_kbd_check_key_changes(hid_dev, kbd_dev); 482 482 } 483 /*----------------------------------------------------------------------------*/ 483 484 484 /* HID/KBD structure manipulation */ 485 /*----------------------------------------------------------------------------*/ 485 486 486 static int usb_kbd_create_function(usb_kbd_t *kbd_dev) 487 487 { … … 537 537 return EOK; 538 538 } 539 /*----------------------------------------------------------------------------*/ 539 540 540 /* API functions */ 541 /*----------------------------------------------------------------------------*/ 541 542 542 /** 543 543 * Initialization of the USB/HID keyboard structure. … … 701 701 return EOK; 702 702 } 703 /*----------------------------------------------------------------------------*/ 703 704 704 bool usb_kbd_polling_callback(usb_hid_dev_t *hid_dev, void *data) 705 705 { … … 715 715 return true; 716 716 } 717 /*----------------------------------------------------------------------------*/ 717 718 718 int usb_kbd_is_initialized(const usb_kbd_t *kbd_dev) 719 719 { 720 720 return (kbd_dev->initialized == USB_KBD_STATUS_INITIALIZED); 721 721 } 722 /*----------------------------------------------------------------------------*/ 722 723 723 int usb_kbd_is_ready_to_destroy(const usb_kbd_t *kbd_dev) 724 724 { 725 725 return (kbd_dev->initialized == USB_KBD_STATUS_TO_DESTROY); 726 726 } 727 /*----------------------------------------------------------------------------*/ 727 728 728 /** 729 729 * Properly destroys the USB/HID keyboard structure. … … 766 766 free(kbd_dev); 767 767 } 768 /*----------------------------------------------------------------------------*/ 768 769 769 void usb_kbd_deinit(usb_hid_dev_t *hid_dev, void *data) 770 770 { … … 779 779 } 780 780 } 781 /*----------------------------------------------------------------------------*/ 781 782 782 int usb_kbd_set_boot_protocol(usb_hid_dev_t *hid_dev) 783 783 { -
uspace/drv/bus/usb/usbhid/kbd/kbddev.h
r5837c7a r76fbd9a 50 50 struct usb_hid_dev; 51 51 52 /*----------------------------------------------------------------------------*/ 52 53 53 /** 54 54 * USB/HID keyboard device type. … … 113 113 } usb_kbd_t; 114 114 115 /*----------------------------------------------------------------------------*/ 115 116 116 117 117 extern const usb_endpoint_description_t usb_hid_kbd_poll_endpoint_description; … … 120 120 const char *HID_KBD_CLASS_NAME; 121 121 122 /*----------------------------------------------------------------------------*/ 122 123 123 124 124 int usb_kbd_init(struct usb_hid_dev *hid_dev, void **data); -
uspace/drv/bus/usb/usbhid/kbd/kbdrepeat.c
r5837c7a r76fbd9a 105 105 } 106 106 } 107 /*----------------------------------------------------------------------------*/ 107 108 108 /** 109 109 * Main routine to be executed by a fibril for handling auto-repeat. … … 132 132 return EOK; 133 133 } 134 /*----------------------------------------------------------------------------*/ 134 135 135 /** 136 136 * Start repeating particular key. … … 149 149 fibril_mutex_unlock(&kbd->repeat_mtx); 150 150 } 151 /*----------------------------------------------------------------------------*/ 151 152 152 /** 153 153 * Stop repeating particular key. -
uspace/drv/bus/usb/usbhid/kbd/kbdrepeat.h
r5837c7a r76fbd9a 42 42 struct usb_kbd_t; 43 43 44 /*----------------------------------------------------------------------------*/ 44 45 45 /** 46 46 * Structure for keeping information needed for auto-repeat of keys. … … 57 57 } usb_kbd_repeat_t; 58 58 59 /*----------------------------------------------------------------------------*/ 59 60 60 61 61 int usb_kbd_repeat_fibril(void *arg); -
uspace/drv/bus/usb/usbhid/main.c
r5837c7a r76fbd9a 113 113 return EOK; 114 114 } 115 /*----------------------------------------------------------------------------*/ 115 116 116 /** 117 117 * Callback for a device about to be removed from the driver. … … 126 126 return ENOTSUP; 127 127 } 128 /*----------------------------------------------------------------------------*/ 128 129 129 /** 130 130 * Callback for removing a device from the driver. … … 152 152 return EOK; 153 153 } 154 /*----------------------------------------------------------------------------*/ 154 155 155 /** USB generic driver callbacks */ 156 156 static const usb_driver_ops_t usb_hid_driver_ops = { … … 159 159 .device_gone = usb_hid_device_gone, 160 160 }; 161 /*----------------------------------------------------------------------------*/ 161 162 162 /** The driver itself. */ 163 163 static const usb_driver_t usb_hid_driver = { … … 166 166 .endpoints = usb_hid_endpoints 167 167 }; 168 /*----------------------------------------------------------------------------*/ 168 169 169 int main(int argc, char *argv[]) 170 170 { -
uspace/drv/bus/usb/usbhid/mouse/mousedev.c
r5837c7a r76fbd9a 58 58 static ddf_dev_ops_t ops = { .default_handler = default_connection_handler }; 59 59 60 /*----------------------------------------------------------------------------*/ 60 61 61 const usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description = { 62 62 .transfer_type = USB_TRANSFER_INTERRUPT, … … 74 74 static const uint8_t IDLE_RATE = 0; 75 75 76 /*----------------------------------------------------------------------------*/ 76 77 77 static const uint8_t USB_MOUSE_BOOT_REPORT_DESCRIPTOR[] = { 78 78 0x05, 0x01, // USAGE_PAGE (Generic Desktop) … … 104 104 }; 105 105 106 /*----------------------------------------------------------------------------*/ 106 107 107 108 108 /** Default handler for IPC methods not handled by DDF. … … 146 146 } 147 147 } 148 /*----------------------------------------------------------------------------*/ 148 149 149 static int get_mouse_axis_move_value(uint8_t rid, usb_hid_report_t *report, 150 150 int32_t usage) … … 245 245 return true; 246 246 } 247 /*----------------------------------------------------------------------------*/ 247 248 248 #define FUN_UNBIND_DESTROY(fun) \ 249 249 if (fun) { \ … … 256 256 } \ 257 257 } else (void)0 258 /*----------------------------------------------------------------------------*/ 258 259 259 static int usb_mouse_create_function(usb_hid_dev_t *hid_dev, usb_mouse_t *mouse) 260 260 { … … 337 337 return highest_button; 338 338 } 339 /*----------------------------------------------------------------------------*/ 339 340 340 int usb_mouse_init(usb_hid_dev_t *hid_dev, void **data) 341 341 { … … 387 387 return EOK; 388 388 } 389 /*----------------------------------------------------------------------------*/ 389 390 390 bool usb_mouse_polling_callback(usb_hid_dev_t *hid_dev, void *data) 391 391 { … … 400 400 return usb_mouse_process_report(hid_dev, mouse_dev); 401 401 } 402 /*----------------------------------------------------------------------------*/ 402 403 403 void usb_mouse_deinit(usb_hid_dev_t *hid_dev, void *data) 404 404 { … … 421 421 free(mouse_dev); 422 422 } 423 /*----------------------------------------------------------------------------*/ 423 424 424 int usb_mouse_set_boot_protocol(usb_hid_dev_t *hid_dev) 425 425 { -
uspace/drv/bus/usb/usbhid/mouse/mousedev.h
r5837c7a r76fbd9a 42 42 struct usb_hid_dev; 43 43 44 /*----------------------------------------------------------------------------*/ 44 45 45 46 46 /** Container for USB mouse device. */ … … 57 57 } usb_mouse_t; 58 58 59 /*----------------------------------------------------------------------------*/ 59 60 60 61 61 extern const usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description; … … 64 64 const char *HID_MOUSE_CATEGORY; 65 65 66 /*----------------------------------------------------------------------------*/ 66 67 67 68 68 int usb_mouse_init(struct usb_hid_dev *hid_dev, void **data); … … 74 74 int usb_mouse_set_boot_protocol(struct usb_hid_dev *hid_dev); 75 75 76 /*----------------------------------------------------------------------------*/ 76 77 77 78 78 #endif // USB_HID_MOUSEDEV_H_ -
uspace/drv/bus/usb/usbhid/multimedia/multimedia.c
r5837c7a r76fbd9a 54 54 #define NAME "multimedia-keys" 55 55 56 /*----------------------------------------------------------------------------*/ 56 57 57 /** 58 58 * Logitech UltraX device type. … … 70 70 71 71 72 /*----------------------------------------------------------------------------*/ 72 73 73 /** 74 74 * Default handler for IPC methods not handled by DDF. … … 106 106 async_answer_0(icallid, EINVAL); 107 107 } 108 /*----------------------------------------------------------------------------*/ 108 109 109 static ddf_dev_ops_t multimedia_ops = { 110 110 .default_handler = default_connection_handler 111 111 }; 112 /*----------------------------------------------------------------------------*/ 112 113 113 /** 114 114 * Processes key events. … … 155 155 } 156 156 } 157 /*----------------------------------------------------------------------------*/ 157 158 158 int usb_multimedia_init(struct usb_hid_dev *hid_dev, void **data) 159 159 { … … 216 216 return EOK; 217 217 } 218 /*----------------------------------------------------------------------------*/ 218 219 219 void usb_multimedia_deinit(struct usb_hid_dev *hid_dev, void *data) 220 220 { … … 239 239 } 240 240 } 241 /*----------------------------------------------------------------------------*/ 241 242 242 bool usb_multimedia_polling_callback(struct usb_hid_dev *hid_dev, void *data) 243 243 { -
uspace/drv/bus/usb/usbhid/multimedia/multimedia.h
r5837c7a r76fbd9a 41 41 struct usb_hid_dev; 42 42 43 /*----------------------------------------------------------------------------*/ 43 44 44 45 45 int usb_multimedia_init(struct usb_hid_dev *hid_dev, void **data); … … 49 49 bool usb_multimedia_polling_callback(struct usb_hid_dev *hid_dev, void *data); 50 50 51 /*----------------------------------------------------------------------------*/ 51 52 52 53 53 #endif // USB_HID_MULTIMEDIA_H_ -
uspace/drv/bus/usb/usbhid/subdrivers.h
r5837c7a r76fbd9a 40 40 #include "kbd/kbddev.h" 41 41 42 /*----------------------------------------------------------------------------*/ 42 43 43 44 44 typedef struct usb_hid_subdriver_usage { … … 47 47 } usb_hid_subdriver_usage_t; 48 48 49 /*----------------------------------------------------------------------------*/ 49 50 50 51 51 /** Structure representing the mapping between device requirements and the … … 81 81 } usb_hid_subdriver_mapping_t; 82 82 83 /*----------------------------------------------------------------------------*/ 83 84 84 85 85 extern const usb_hid_subdriver_mapping_t usb_hid_subdrivers[]; 86 86 extern const size_t USB_HID_MAX_SUBDRIVERS; 87 87 88 /*----------------------------------------------------------------------------*/ 88 89 89 90 90 #endif /* USB_HID_SUBDRIVERS_H_ */ -
uspace/drv/bus/usb/usbhid/usbhid.c
r5837c7a r76fbd9a 58 58 NULL 59 59 }; 60 /*----------------------------------------------------------------------------*/ 60 61 61 static int usb_hid_set_boot_kbd_subdriver(usb_hid_dev_t *hid_dev) 62 62 { … … 74 74 return EOK; 75 75 } 76 /*----------------------------------------------------------------------------*/ 76 77 77 static int usb_hid_set_boot_mouse_subdriver(usb_hid_dev_t *hid_dev) 78 78 { … … 90 90 return EOK; 91 91 } 92 /*----------------------------------------------------------------------------*/ 92 93 93 static int usb_hid_set_generic_hid_subdriver(usb_hid_dev_t *hid_dev) 94 94 { … … 110 110 return EOK; 111 111 } 112 /*----------------------------------------------------------------------------*/ 112 113 113 static bool usb_hid_ids_match(const usb_hid_dev_t *hid_dev, 114 114 const usb_hid_subdriver_mapping_t *mapping) … … 122 122 == mapping->product_id); 123 123 } 124 /*----------------------------------------------------------------------------*/ 124 125 125 static bool usb_hid_path_matches(usb_hid_dev_t *hid_dev, 126 126 const usb_hid_subdriver_mapping_t *mapping) … … 178 178 return matches; 179 179 } 180 /*----------------------------------------------------------------------------*/ 180 181 181 static int usb_hid_save_subdrivers(usb_hid_dev_t *hid_dev, 182 182 const usb_hid_subdriver_t **subdrivers, unsigned count) … … 211 211 return EOK; 212 212 } 213 /*----------------------------------------------------------------------------*/ 213 214 214 static int usb_hid_find_subdrivers(usb_hid_dev_t *hid_dev) 215 215 { … … 263 263 return usb_hid_save_subdrivers(hid_dev, subdrivers, count); 264 264 } 265 /*----------------------------------------------------------------------------*/ 265 266 266 static int usb_hid_check_pipes(usb_hid_dev_t *hid_dev, const usb_device_t *dev) 267 267 { … … 290 290 return ENOTSUP; 291 291 } 292 /*----------------------------------------------------------------------------*/ 292 293 293 static int usb_hid_init_report(usb_hid_dev_t *hid_dev) 294 294 { … … 322 322 return EOK; 323 323 } 324 /*----------------------------------------------------------------------------*/ 324 325 325 /* 326 326 * This functions initializes required structures from the device's descriptors … … 458 458 return rc; 459 459 } 460 /*----------------------------------------------------------------------------*/ 460 461 461 bool usb_hid_polling_callback(usb_device_t *dev, uint8_t *buffer, 462 462 size_t buffer_size, void *arg) … … 500 500 return cont; 501 501 } 502 /*----------------------------------------------------------------------------*/ 502 503 503 void usb_hid_polling_ended_callback(usb_device_t *dev, bool reason, void *arg) 504 504 { … … 517 517 hid_dev->running = false; 518 518 } 519 /*----------------------------------------------------------------------------*/ 519 520 520 void usb_hid_new_report(usb_hid_dev_t *hid_dev) 521 521 { 522 522 ++hid_dev->report_nr; 523 523 } 524 /*----------------------------------------------------------------------------*/ 524 525 525 int usb_hid_report_number(const usb_hid_dev_t *hid_dev) 526 526 { 527 527 return hid_dev->report_nr; 528 528 } 529 /*----------------------------------------------------------------------------*/ 529 530 530 void usb_hid_deinit(usb_hid_dev_t *hid_dev) 531 531 { -
uspace/drv/bus/usb/usbhid/usbhid.h
r5837c7a r76fbd9a 95 95 }; 96 96 97 /*----------------------------------------------------------------------------*/ 97 98 98 /** 99 99 * Structure for holding general HID device data. … … 132 132 }; 133 133 134 /*----------------------------------------------------------------------------*/ 134 135 135 136 136 enum { … … 143 143 extern const usb_endpoint_description_t *usb_hid_endpoints[]; 144 144 145 /*----------------------------------------------------------------------------*/ 145 146 146 147 147 int usb_hid_init(usb_hid_dev_t *hid_dev, usb_device_t *dev); -
uspace/drv/bus/usb/usbhub/port.c
r5837c7a r76fbd9a 71 71 return EOK; 72 72 } 73 /*----------------------------------------------------------------------------*/ 73 74 74 /** 75 75 * Clear feature on hub port. … … 93 93 sizeof(clear_request), NULL, 0); 94 94 } 95 /*----------------------------------------------------------------------------*/ 95 96 96 /** 97 97 * Set feature on hub port. … … 115 115 sizeof(clear_request), NULL, 0); 116 116 } 117 /*----------------------------------------------------------------------------*/ 117 118 118 /** 119 119 * Mark reset process as failed due to external reasons … … 130 130 fibril_mutex_unlock(&port->mutex); 131 131 } 132 /*----------------------------------------------------------------------------*/ 132 133 133 /** 134 134 * Process interrupts on given port … … 246 246 port->port_number, status); 247 247 } 248 /*----------------------------------------------------------------------------*/ 248 249 249 /** 250 250 * routine called when a device on port has been removed … … 300 300 return EOK; 301 301 } 302 /*----------------------------------------------------------------------------*/ 302 303 303 /** 304 304 * Process port reset change … … 336 336 } 337 337 } 338 /*----------------------------------------------------------------------------*/ 338 339 339 /** Retrieve port status. 340 340 * … … 376 376 return EOK; 377 377 } 378 /*----------------------------------------------------------------------------*/ 378 379 379 /** Callback for enabling a specific port. 380 380 * … … 408 408 return port->reset_okay ? EOK : ESTALL; 409 409 } 410 /*----------------------------------------------------------------------------*/ 410 411 411 /** Fibril for adding a new device. 412 412 * … … 455 455 return rc; 456 456 } 457 /*----------------------------------------------------------------------------*/ 457 458 458 /** Start device adding when connection change is detected. 459 459 * -
uspace/drv/bus/usb/usbhub/usbhub.c
r5837c7a r76fbd9a 165 165 return EOK; 166 166 } 167 /*----------------------------------------------------------------------------*/ 167 168 168 /** 169 169 * Turn off power to all ports. … … 176 176 return ENOTSUP; 177 177 } 178 /*----------------------------------------------------------------------------*/ 178 179 179 /** 180 180 * Remove all attached devices … … 219 219 return EOK; 220 220 } 221 /*----------------------------------------------------------------------------*/ 221 222 222 /** Callback for polling hub for changes. 223 223 * … … 256 256 return true; 257 257 } 258 /*----------------------------------------------------------------------------*/ 258 259 259 /** 260 260 * Load hub-specific information into hub_dev structure and process if needed … … 331 331 return EOK; 332 332 } 333 /*----------------------------------------------------------------------------*/ 333 334 334 /** 335 335 * Set configuration of and USB device … … 378 378 return opResult; 379 379 } 380 /*----------------------------------------------------------------------------*/ 380 381 381 /** 382 382 * Process hub over current change … … 416 416 417 417 } 418 /*----------------------------------------------------------------------------*/ 418 419 419 /** 420 420 * Process hub interrupts. … … 485 485 } 486 486 } 487 /*----------------------------------------------------------------------------*/ 487 488 488 /** 489 489 * callback called from hub polling fibril when the fibril terminates -
uspace/drv/bus/usb/usbmid/main.c
r5837c7a r76fbd9a 61 61 return EOK; 62 62 } 63 /*----------------------------------------------------------------------------*/ 63 64 64 /** Callback when a MID device is about to be removed from the host. 65 65 * … … 115 115 return ret; 116 116 } 117 /*----------------------------------------------------------------------------*/ 117 118 118 /** Callback when a MID device was removed from the host. 119 119 *
Note:
See TracChangeset
for help on using the changeset viewer.