Changeset 79ae36dd in mainline for uspace/lib/usbdev/src/hub.c
- Timestamp:
- 2011-06-08T19:01:55Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0eff68e
- Parents:
- 764d71e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/hub.c
r764d71e r79ae36dd 42 42 #include <usb/debug.h> 43 43 #include <time.h> 44 #include <async.h> 44 45 45 46 /** How much time to wait between attempts to register endpoint 0:0. … … 71 72 { 72 73 CHECK_CONNECTION(connection); 73 74 75 async_exch_t *exch = async_exchange_begin(connection->hc_sess); 76 74 77 sysarg_t address; 75 int rc = async_req_2_1(connection->hc_phone, 76 DEV_IFACE_ID(USBHC_DEV_IFACE), 78 int rc = async_req_2_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 77 79 IPC_M_USBHC_REQUEST_ADDRESS, speed, 78 80 &address); 79 if (rc != EOK) { 81 82 async_exchange_end(exch); 83 84 if (rc != EOK) 80 85 return (usb_address_t) rc; 81 } else { 82 return (usb_address_t) address; 83 } 86 87 return (usb_address_t) address; 84 88 } 85 89 … … 94 98 { 95 99 CHECK_CONNECTION(connection); 96 if (attached_device == NULL) { 100 101 if (attached_device == NULL) 97 102 return EBADMEM; 98 } 99 100 return async_req_3_0(connection->hc_phone, 101 DEV_IFACE_ID(USBHC_DEV_IFACE), 103 104 async_exch_t *exch = async_exchange_begin(connection->hc_sess); 105 int rc = async_req_3_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 102 106 IPC_M_USBHC_BIND_ADDRESS, 103 107 attached_device->address, attached_device->handle); 108 async_exchange_end(exch); 109 110 return rc; 104 111 } 105 112 … … 114 121 { 115 122 CHECK_CONNECTION(connection); 116 117 return async_req_2_0(connection->hc_phone,118 123 124 async_exch_t *exch = async_exchange_begin(connection->hc_sess); 125 int rc = async_req_2_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 119 126 IPC_M_USBHC_RELEASE_ADDRESS, address); 127 async_exchange_end(exch); 128 129 return rc; 120 130 } 121 131 … … 192 202 usb_hc_connection_t hc_conn = { 193 203 .hc_handle = connection->hc_handle, 194 .hc_ phone = -1204 .hc_sess = NULL 195 205 }; 196 206
Note:
See TracChangeset
for help on using the changeset viewer.