Changes in uspace/drv/bus/usb/uhci/pci.c [45a9cf4:5203e256] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/pci.c
r45a9cf4 r5203e256 61 61 assert(io_reg_size); 62 62 assert(irq_no); 63 63 64 64 async_sess_t *parent_sess = 65 65 devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle, … … 67 67 if (!parent_sess) 68 68 return ENOMEM; 69 69 70 70 hw_resource_list_t hw_resources; 71 const int rc = hw_res_get_resource_list(parent_sess, &hw_resources); 72 async_hangup(parent_sess); 71 int rc = hw_res_get_resource_list(parent_sess, &hw_resources); 73 72 if (rc != EOK) { 73 async_hangup(parent_sess); 74 74 return rc; 75 75 } 76 76 77 77 uintptr_t io_address = 0; 78 78 size_t io_size = 0; 79 79 bool io_found = false; 80 80 81 81 int irq = 0; 82 82 bool irq_found = false; 83 83 84 84 size_t i; 85 85 for (i = 0; i < hw_resources.count; i++) { … … 102 102 } 103 103 } 104 free(hw_resources.resources); 105 104 105 async_hangup(parent_sess); 106 106 107 if (!io_found || !irq_found) 107 108 return ENOENT; 108 109 109 110 *io_reg_address = io_address; 110 111 *io_reg_size = io_size; 111 112 *irq_no = irq; 112 113 113 114 return EOK; 114 115 } 115 /*----------------------------------------------------------------------------*/ 116 116 117 /** Call the PCI driver with a request to enable interrupts 117 118 * … … 126 127 if (!parent_sess) 127 128 return ENOMEM; 128 129 129 130 const bool enabled = hw_res_enable_interrupt(parent_sess); 130 131 async_hangup(parent_sess); 131 132 132 133 return enabled ? EOK : EIO; 133 134 } 134 /*----------------------------------------------------------------------------*/ 135 135 136 /** Call the PCI driver with a request to clear legacy support register 136 137 * … … 141 142 { 142 143 assert(device); 143 144 144 145 async_sess_t *parent_sess = 145 146 devman_parent_device_connect(EXCHANGE_SERIALIZE, device->handle, … … 147 148 if (!parent_sess) 148 149 return ENOMEM; 149 150 150 151 /* See UHCI design guide for these values p.45, 151 152 * write all WC bits in USB legacy register */ 152 153 const sysarg_t address = 0xc0; 153 154 const sysarg_t value = 0xaf00; 154 155 155 156 async_exch_t *exch = async_exchange_begin(parent_sess); 156 157 157 158 const int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE), 158 159 IPC_M_CONFIG_SPACE_WRITE_16, address, value); 159 160 160 161 async_exchange_end(exch); 161 162 async_hangup(parent_sess); 162 163 163 164 return rc; 164 165 }
Note:
See TracChangeset
for help on using the changeset viewer.