Changeset 432a269 in mainline for uspace/drv/bus/usb/uhci/pci.c
- Timestamp:
- 2011-09-16T21:13:57Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a11f17
- Parents:
- c0e53ff (diff), fd07e526 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/pci.c
rc0e53ff r432a269 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 71 int rc = hw_res_get_resource_list(parent_sess, &hw_resources); … … 74 74 return rc; 75 75 } 76 76 77 77 uintptr_t io_address = 0; 78 78 size_t io_size = 0; … … 102 102 } 103 103 } 104 104 105 105 async_hangup(parent_sess); 106 106 107 107 if (!io_found || !irq_found) 108 108 return ENOENT; 109 109 110 110 *io_reg_address = io_address; 111 111 *io_reg_size = io_size; 112 112 *irq_no = irq; 113 113 114 114 return EOK; 115 115 } 116 116 /*----------------------------------------------------------------------------*/ 117 117 /** Call the PCI driver with a request to enable interrupts 118 118 * … … 127 127 if (!parent_sess) 128 128 return ENOMEM; 129 129 130 130 const bool enabled = hw_res_enable_interrupt(parent_sess); 131 131 async_hangup(parent_sess); 132 132 133 133 return enabled ? EOK : EIO; 134 134 } 135 135 /*----------------------------------------------------------------------------*/ 136 136 /** Call the PCI driver with a request to clear legacy support register 137 137 * … … 142 142 { 143 143 assert(device); 144 144 145 145 async_sess_t *parent_sess = 146 146 devman_parent_device_connect(EXCHANGE_SERIALIZE, device->handle, … … 148 148 if (!parent_sess) 149 149 return ENOMEM; 150 150 151 151 /* See UHCI design guide for these values p.45, 152 152 * write all WC bits in USB legacy register */ 153 153 const sysarg_t address = 0xc0; 154 154 const sysarg_t value = 0xaf00; 155 155 156 156 async_exch_t *exch = async_exchange_begin(parent_sess); 157 157 158 158 const int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE), 159 159 IPC_M_CONFIG_SPACE_WRITE_16, address, value); 160 160 161 161 async_exchange_end(exch); 162 162 async_hangup(parent_sess); 163 163 164 164 return rc; 165 165 }
Note:
See TracChangeset
for help on using the changeset viewer.