Changeset e3a07bba in mainline for uspace/drv/bus/usb/uhci/main.c
- Timestamp:
- 2013-12-31T22:31:21Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ba4a03a5
- Parents:
- 1bb9833
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/main.c
r1bb9833 re3a07bba 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drvusbuhci hc28 /** @addtogroup drvusbuhci 29 29 * @{ 30 30 */ … … 35 35 #include <assert.h> 36 36 #include <ddf/driver.h> 37 #include <devman.h> 37 38 #include <errno.h> 38 39 #include <io/log.h> 40 #include <pci_dev_iface.h> 39 41 #include <stdio.h> 40 42 #include <str_error.h> … … 56 58 }; 57 59 60 /** Call the PCI driver with a request to clear legacy support register 61 * 62 * @param[in] device Device asking to disable interrupts 63 * @return Error code. 64 */ 65 static int disable_legacy(ddf_dev_t *device) 66 { 67 assert(device); 68 69 async_sess_t *parent_sess = devman_parent_device_connect( 70 EXCHANGE_SERIALIZE, ddf_dev_get_handle(device), IPC_FLAG_BLOCKING); 71 if (!parent_sess) 72 return ENOMEM; 73 74 /* See UHCI design guide page 45 for these values. 75 * Write all WC bits in USB legacy register */ 76 const int rc = pci_config_space_write_16(parent_sess, 0xc0, 0xaf00); 77 78 async_hangup(parent_sess); 79 return rc; 80 } 81 58 82 /** Initialize a new ddf driver instance for uhci hc and hub. 59 83 * … … 66 90 assert(device); 67 91 68 const int ret = device_setup_uhci(device); 92 int ret = disable_legacy(device); 93 if (ret != EOK) { 94 usb_log_error("Failed to disable legacy USB: %s.\n", 95 str_error(ret)); 96 return ret; 97 } 98 99 100 ret = device_setup_uhci(device); 69 101 if (ret != EOK) { 70 102 usb_log_error("Failed to initialize UHCI driver: %s.\n",
Note:
See TracChangeset
for help on using the changeset viewer.