Changes in uspace/drv/ohci/main.c [e7bc999:ff582d47] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/main.c
re7bc999 rff582d47 45 45 #include "pci.h" 46 46 #include "iface.h" 47 #include " ohci_hc.h"47 #include "hc.h" 48 48 49 49 static int ohci_add_device(ddf_dev_t *device); 50 static int get_hc_handle(ddf_fun_t *fun, devman_handle_t *handle) 51 { 52 assert(handle); 53 assert(fun != NULL); 54 55 *handle = fun->handle; 56 return EOK; 57 } 58 /*----------------------------------------------------------------------------*/ 59 static int get_address( 60 ddf_fun_t *fun, devman_handle_t handle, usb_address_t *address) 61 { 62 assert(fun); 63 device_keeper_t *manager = &fun_to_hc(fun)->manager; 64 usb_address_t addr = device_keeper_find(manager, handle); 65 if (addr < 0) { 66 return addr; 67 } 68 69 if (address != NULL) { 70 *address = addr; 71 } 72 73 return EOK; 74 } 50 75 /*----------------------------------------------------------------------------*/ 51 76 /** IRQ handling callback, identifies device … … 58 83 { 59 84 assert(dev); 60 ohci_hc_t *hc = (ohci_hc_t*)dev->driver_data;85 hc_t *hc = (hc_t*)dev->driver_data; 61 86 assert(hc); 62 ohci_hc_interrupt(hc, 0);87 hc_interrupt(hc, 0); 63 88 } 64 89 /*----------------------------------------------------------------------------*/ … … 71 96 .driver_ops = &ohci_driver_ops 72 97 }; 98 /*----------------------------------------------------------------------------*/ 99 static usb_iface_t hc_usb_iface = { 100 .get_address = get_address, 101 .get_hc_handle = get_hc_handle, 102 }; 103 /*----------------------------------------------------------------------------*/ 73 104 static ddf_dev_ops_t hc_ops = { 74 .interfaces[USB HC_DEV_IFACE] = &ohci_hc_iface,75 }; 76 105 .interfaces[USB_DEV_IFACE] = &hc_usb_iface, 106 .interfaces[USBHC_DEV_IFACE] = &hc_iface, 107 }; 77 108 /*----------------------------------------------------------------------------*/ 78 109 /** Initializes a new ddf driver instance of OHCI hcd. … … 105 136 "Failed(%d) disable legacy USB: %s.\n", ret, str_error(ret)); 106 137 107 ohci_hc_t *hcd = malloc(sizeof(ohci_hc_t));138 hc_t *hcd = malloc(sizeof(hc_t)); 108 139 if (hcd == NULL) { 109 140 usb_log_error("Failed to allocate OHCI driver.\n"); … … 129 160 } 130 161 131 ret = ohci_hc_init(hcd, hc_fun, mem_reg_base, mem_reg_size, interrupts);162 ret = hc_init(hcd, hc_fun, device, mem_reg_base, mem_reg_size, interrupts); 132 163 if (ret != EOK) { 133 164 usb_log_error("Failed to initialize OHCI driver.\n"); … … 148 179 hc_fun->driver_data = hcd; 149 180 150 /* TODO: register interrupt handler */ 181 fid_t later = fibril_create((int(*)(void*))hc_register_hub, hcd); 182 fibril_add_ready(later); 151 183 152 184 usb_log_info("Controlling new OHCI device `%s' (handle %llu).\n",
Note:
See TracChangeset
for help on using the changeset viewer.