Changes in uspace/drv/uhci-hcd/pci.c [a7e2f0d:4abc304] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/pci.c
ra7e2f0d r4abc304 40 40 41 41 #include <usb/debug.h> 42 #include <pci_dev_iface.h>43 42 44 43 #include "pci.h" … … 65 64 66 65 int rc; 66 67 67 hw_resource_list_t hw_resources; 68 68 rc = hw_res_get_resource_list(parent_phone, &hw_resources); … … 81 81 for (i = 0; i < hw_resources.count; i++) { 82 82 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; 83 switch (res->type) { 84 case INTERRUPT: 85 irq = res->res.interrupt.irq; 86 irq_found = true; 87 usb_log_debug2("Found interrupt: %d.\n", irq); 88 break; 89 case IO_RANGE: 90 io_address = res->res.io_range.address; 91 io_size = res->res.io_range.size; 92 usb_log_debug2("Found io: %llx %zu.\n", 93 res->res.io_range.address, res->res.io_range.size); 94 io_found = true; 95 break; 96 default: 97 break; 100 98 } 101 99 } 102 100 103 if (!io_found || !irq_found) { 101 if (!io_found) { 102 rc = ENOENT; 103 goto leave; 104 } 105 106 if (!irq_found) { 104 107 rc = ENOENT; 105 108 goto leave; … … 117 120 } 118 121 /*----------------------------------------------------------------------------*/ 119 /** Calls the PCI driver with a request to enable interrupts120 *121 * @param[in] device Device asking for interrupts122 * @return Error code.123 */124 122 int pci_enable_interrupts(ddf_dev_t *device) 125 123 { … … 130 128 return enabled ? EOK : EIO; 131 129 } 132 /*----------------------------------------------------------------------------*/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 int pci_disable_legacy(ddf_dev_t *device)139 {140 assert(device);141 int parent_phone =142 devman_parent_device_connect(device->handle, IPC_FLAG_BLOCKING);143 if (parent_phone < 0) {144 return parent_phone;145 }146 147 /* See UHCI design guide for these values,148 * write all WC bits in USB legacy register */149 sysarg_t address = 0xc0;150 sysarg_t value = 0x8f00;151 152 int rc = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE),153 IPC_M_CONFIG_SPACE_WRITE_16, address, value);154 async_hangup(parent_phone);155 156 return rc;157 }158 /*----------------------------------------------------------------------------*/159 130 /** 160 131 * @}
Note:
See TracChangeset
for help on using the changeset viewer.