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