Changes in uspace/drv/uhci-hcd/pci.c [a7e2f0d:b375bb8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/pci.c
ra7e2f0d rb375bb8 65 65 66 66 int rc; 67 67 68 hw_resource_list_t hw_resources; 68 69 rc = hw_res_get_resource_list(parent_phone, &hw_resources); … … 81 82 for (i = 0; i < hw_resources.count; i++) { 82 83 hw_resource_t *res = &hw_resources.resources[i]; 83 switch (res->type) 84 { 85 case INTERRUPT: 86 irq = res->res.interrupt.irq; 87 irq_found = true; 88 usb_log_debug2("Found interrupt: %d.\n", irq); 89 break; 90 91 case IO_RANGE: 92 io_address = res->res.io_range.address; 93 io_size = res->res.io_range.size; 94 usb_log_debug2("Found io: %llx %zu.\n", 95 res->res.io_range.address, res->res.io_range.size); 96 io_found = true; 97 98 default: 99 break; 84 switch (res->type) { 85 case INTERRUPT: 86 irq = res->res.interrupt.irq; 87 irq_found = true; 88 usb_log_debug2("Found interrupt: %d.\n", irq); 89 break; 90 case IO_RANGE: 91 io_address = res->res.io_range.address; 92 io_size = res->res.io_range.size; 93 usb_log_debug2("Found io: %llx %zu.\n", 94 res->res.io_range.address, res->res.io_range.size); 95 io_found = true; 96 break; 97 default: 98 break; 100 99 } 101 100 } 102 101 103 if (!io_found || !irq_found) { 102 if (!io_found) { 103 rc = ENOENT; 104 goto leave; 105 } 106 107 if (!irq_found) { 104 108 rc = ENOENT; 105 109 goto leave; … … 117 121 } 118 122 /*----------------------------------------------------------------------------*/ 119 /** Calls the PCI driver with a request to enable interrupts120 *121 * @param[in] device Device asking for interrupts122 * @return Error code.123 */124 123 int pci_enable_interrupts(ddf_dev_t *device) 125 124 { … … 131 130 } 132 131 /*----------------------------------------------------------------------------*/ 133 /** Calls the PCI driver with a request to clear legacy support register134 *135 * @param[in] device Device asking to disable interrupts136 * @return Error code.137 */138 132 int pci_disable_legacy(ddf_dev_t *device) 139 133 { 140 134 assert(device); 141 int parent_phone = 142 devman_parent_device_connect(device->handle,IPC_FLAG_BLOCKING);135 int parent_phone = devman_parent_device_connect(device->handle, 136 IPC_FLAG_BLOCKING); 143 137 if (parent_phone < 0) { 144 138 return parent_phone; … … 150 144 sysarg_t value = 0x8f00; 151 145 152 146 int rc = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE), 153 147 IPC_M_CONFIG_SPACE_WRITE_16, address, value); 154 148 async_hangup(parent_phone); 155 149 156 150 return rc; 157 151 } 158 152 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.