Changeset e26a9d95 in mainline
- Timestamp:
- 2014-01-18T17:14:42Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3e200736
- Parents:
- 19b3cc6
- Location:
- uspace
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/main.c
r19b3cc6 re26a9d95 64 64 return ENOMEM; 65 65 66 const int ret = 66 const int ret = hc_init(instance, res, irq); 67 67 if (ret == EOK) 68 68 hcd_set_implementation(hcd, instance, hc_schedule, 69 NULL, NULL, ehci_interrupt );69 NULL, NULL, ehci_interrupt, NULL); 70 70 return ret; 71 71 } … … 78 78 79 79 free(hcd->driver.data); 80 hcd_set_implementation(hcd, NULL, NULL, NULL, NULL, NULL );80 hcd_set_implementation(hcd, NULL, NULL, NULL, NULL, NULL, NULL); 81 81 } 82 82 -
uspace/drv/bus/usb/ohci/hc.c
r19b3cc6 re26a9d95 273 273 } 274 274 275 int hc_status(hcd_t *hcd, uint32_t *status) 276 { 277 assert(hcd); 278 assert(status); 279 hc_t *instance = hcd->driver.data; 280 assert(instance); 281 282 async_usleep(10000); 283 if (instance->registers){ 284 *status = OHCI_RD(instance->registers->interrupt_status); 285 OHCI_WR(instance->registers->interrupt_status, *status); 286 } 287 return EOK; 288 } 289 275 290 /** Add USB transfer to the schedule. 276 291 * -
uspace/drv/bus/usb/ohci/hc.h
r19b3cc6 re26a9d95 83 83 void hc_dequeue_endpoint(hc_t *instance, const endpoint_t *ep); 84 84 int hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch); 85 int hc_status(hcd_t *hcd, uint32_t *status); 85 86 86 87 void hc_interrupt(hc_t *instance, uint32_t status); -
uspace/drv/bus/usb/ohci/main.c
r19b3cc6 re26a9d95 66 66 if (ret == EOK) 67 67 hcd_set_implementation(hcd, instance, hc_schedule, 68 ohci_endpoint_init, ohci_endpoint_fini, ohci_interrupt); 68 ohci_endpoint_init, ohci_endpoint_fini, ohci_interrupt, 69 hc_status); 69 70 return ret; 70 71 } … … 77 78 78 79 free(hcd->driver.data); 79 hcd_set_implementation(hcd, NULL, NULL, NULL, NULL, NULL );80 hcd_set_implementation(hcd, NULL, NULL, NULL, NULL, NULL, NULL); 80 81 } 81 82 -
uspace/drv/bus/usb/uhci/hc.c
r19b3cc6 re26a9d95 412 412 } 413 413 414 int hc_status(hcd_t *hcd, uint32_t *status) 415 { 416 assert(hcd); 417 assert(status); 418 hc_t *instance = hcd->driver.data; 419 assert(instance); 420 421 *status = 0; 422 if (instance->registers) { 423 uint16_t s = pio_read_16(&instance->registers->usbsts); 424 pio_write_16(&instance->registers->usbsts, s); 425 *status = s; 426 } 427 return EOK; 428 } 429 414 430 /** Schedule batch for execution. 415 431 * -
uspace/drv/bus/usb/uhci/hc.h
r19b3cc6 re26a9d95 127 127 } hc_t; 128 128 129 int hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res);130 void hc_interrupt(hc_t *instance, uint16_t status);131 129 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interupts); 132 130 void hc_fini(hc_t *instance); 131 int hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res); 132 133 void hc_interrupt(hc_t *instance, uint16_t status); 134 int hc_status(hcd_t *hcd, uint32_t *status); 133 135 int hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch); 134 136 -
uspace/drv/bus/usb/uhci/main.c
r19b3cc6 re26a9d95 68 68 if (ret == EOK) 69 69 hcd_set_implementation(hcd, instance, hc_schedule, NULL, NULL, 70 uhci_interrupt );70 uhci_interrupt, hc_status); 71 71 return ret; 72 72 } … … 79 79 80 80 free(hcd->driver.data); 81 hcd_set_implementation(hcd, NULL, NULL, NULL, NULL, NULL );81 hcd_set_implementation(hcd, NULL, NULL, NULL, NULL, NULL, NULL); 82 82 } 83 83 -
uspace/drv/bus/usb/vhc/main.c
r19b3cc6 re26a9d95 95 95 } 96 96 97 hcd_set_implementation(dev_to_hcd(dev), data, vhc_schedule, NULL, NULL, NULL );97 hcd_set_implementation(dev_to_hcd(dev), data, vhc_schedule, NULL, NULL, NULL, NULL); 98 98 99 99 /* Add virtual hub device */ -
uspace/lib/usbhost/include/usb/host/hcd.h
r19b3cc6 re26a9d95 52 52 typedef void (*ep_remove_hook_t)(hcd_t *, endpoint_t *); 53 53 typedef void (*interrupt_hook_t)(hcd_t *, uint32_t); 54 typedef int (*status_hook_t)(hcd_t *, uint32_t *); 54 55 55 56 typedef struct { … … 64 65 /** Hook to be called on device interrupt, passes ARG1 */ 65 66 interrupt_hook_t irq_hook; 67 /** Periodic polling hook */ 68 status_hook_t status_hook; 66 69 } hc_driver_t; 67 70 … … 80 83 static inline void hcd_set_implementation(hcd_t *hcd, void *data, 81 84 schedule_hook_t schedule, ep_add_hook_t add_hook, ep_remove_hook_t rem_hook, 82 interrupt_hook_t irq_hook )85 interrupt_hook_t irq_hook, status_hook_t status_hook) 83 86 { 84 87 assert(hcd); … … 88 91 hcd->driver.ep_remove_hook = rem_hook; 89 92 hcd->driver.irq_hook = irq_hook; 93 hcd->driver.status_hook = status_hook; 90 94 } 91 95
Note:
See TracChangeset
for help on using the changeset viewer.