Changeset 79ae36dd in mainline for uspace/lib/usb/src/ddfiface.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/usb/src/ddfiface.c
r764d71e r79ae36dd 78 78 { 79 79 assert(fun != NULL); 80 81 int parent_phone = devman_parent_device_connect(fun->handle, 80 81 async_sess_t *parent_sess = 82 devman_parent_device_connect(EXCHANGE_SERIALIZE, fun->handle, 82 83 IPC_FLAG_BLOCKING); 83 if (parent_phone < 0) { 84 return parent_phone; 85 } 86 84 if (!parent_sess) 85 return ENOMEM; 86 87 async_exch_t *exch = async_exchange_begin(parent_sess); 88 87 89 sysarg_t hc_handle; 88 int rc = async_req_1_1( parent_phone, DEV_IFACE_ID(USB_DEV_IFACE),90 int rc = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 89 91 IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, &hc_handle); 90 91 async_hangup(parent_phone); 92 93 if (rc != EOK) { 92 93 async_exchange_end(exch); 94 async_hangup(parent_sess); 95 96 if (rc != EOK) 94 97 return rc; 95 } 96 98 97 99 *handle = hc_handle; 98 99 100 return EOK; 100 101 } … … 128 129 { 129 130 assert(fun); 130 int parent_phone = devman_parent_device_connect(fun->handle, 131 132 async_sess_t *parent_sess = 133 devman_parent_device_connect(EXCHANGE_SERIALIZE, fun->handle, 131 134 IPC_FLAG_BLOCKING); 132 if (parent_phone < 0) { 133 return parent_phone; 134 } 135 135 if (!parent_sess) 136 return ENOMEM; 137 138 async_exch_t *exch = async_exchange_begin(parent_sess); 139 136 140 sysarg_t addr; 137 int rc = async_req_2_1( parent_phone, DEV_IFACE_ID(USB_DEV_IFACE),141 int rc = async_req_2_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 138 142 IPC_M_USB_GET_ADDRESS, handle, &addr); 139 140 async_hangup(parent_phone); 141 142 if (rc != EOK) { 143 144 async_exchange_end(exch); 145 async_hangup(parent_sess); 146 147 if (rc != EOK) 143 148 return rc; 144 } 145 146 if (address != NULL) { 149 150 if (address != NULL) 147 151 *address = (usb_address_t) addr; 148 } 149 152 150 153 return EOK; 151 154 }
Note:
See TracChangeset
for help on using the changeset viewer.