Changeset c9e954c in mainline
- Timestamp:
- 2014-01-18T22:37:06Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 615abda
- Parents:
- fccf289
- Location:
- uspace/drv/bus/usb/ehci
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/hc.c
rfccf289 rc9e954c 95 95 /** Generate IRQ code. 96 96 * @param[out] ranges PIO ranges buffer. 97 * @param[in] ranges_size Size of the ranges buffer (bytes).98 * @param[out] cmds Commands buffer.99 * @param[in] cmds_size Size of the commands buffer (bytes).100 97 * @param[in] hw_res Device's resources. 101 98 * 102 99 * @return Error code. 103 100 */ 104 int hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res)101 int ehci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res) 105 102 { 106 103 assert(code); … … 215 212 } 216 213 214 int ehci_hc_status(hcd_t *hcd, uint32_t *status) 215 { 216 assert(hcd); 217 hc_t *instance = hcd->driver.data; 218 assert(instance); 219 assert(status); 220 *status = 0; 221 if (instance->registers) { 222 *status = EHCI_RD(instance->registers->usbsts); 223 EHCI_WR(instance->registers->usbsts, *status); 224 } 225 return EOK; 226 } 227 217 228 /** Add USB transfer to the schedule. 218 229 * 219 * @param[in] instance EHCI hcdriver structure.230 * @param[in] hcd HCD driver structure. 220 231 * @param[in] batch Batch representing the transfer. 221 232 * @return Error code. 222 233 */ 223 int hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch)234 int ehci_hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch) 224 235 { 225 236 assert(hcd); … … 237 248 /** Interrupt handling routine 238 249 * 239 * @param[in] instance EHCI hcdriver structure.250 * @param[in] hcd HCD driver structure. 240 251 * @param[in] status Value of the status register at the time of interrupt. 241 252 */ 242 void hc_interrupt(hcd_t *hcd, uint32_t status)253 void ehci_hc_interrupt(hcd_t *hcd, uint32_t status) 243 254 { 244 255 assert(hcd); -
uspace/drv/bus/usb/ehci/hc.h
rfccf289 rc9e954c 71 71 } hc_t; 72 72 73 int hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res);74 int hc_register_hub(hc_t *instance, ddf_fun_t *hub_fun);75 73 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts); 76 74 void hc_fini(hc_t *instance); … … 79 77 void hc_dequeue_endpoint(hc_t *instance, const endpoint_t *ep); 80 78 81 int hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch); 82 void hc_interrupt(hcd_t *hcd, uint32_t status); 79 int ehci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res); 80 81 void ehci_hc_interrupt(hcd_t *hcd, uint32_t status); 82 int ehci_hc_status(hcd_t *hcd, uint32_t *status); 83 int ehci_hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch); 83 84 #endif 84 85 /** -
uspace/drv/bus/usb/ehci/main.c
rfccf289 rc9e954c 59 59 const int ret = hc_init(instance, res, irq); 60 60 if (ret == EOK) 61 hcd_set_implementation(hcd, instance, hc_schedule,62 NULL, NULL, hc_interrupt, NULL);61 hcd_set_implementation(hcd, instance, ehci_hc_schedule, 62 NULL, NULL, ehci_hc_interrupt, ehci_hc_status); 63 63 return ret; 64 64 } … … 98 98 const int ret = ddf_hcd_device_setup_all(device, USB_SPEED_HIGH, 99 99 BANDWIDTH_AVAILABLE_USB20, bandwidth_count_usb11, 100 ddf_hcd_gen_irq_handler, hc_gen_irq_code,100 ddf_hcd_gen_irq_handler, ehci_hc_gen_irq_code, 101 101 ehci_driver_init, ehci_driver_fini); 102 102 if (ret != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.