Changeset 7aaed09 in mainline for uspace/lib/usb/src/hc.c
- Timestamp:
- 2011-12-18T14:02:30Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c868e2d
- Parents:
- 3b71e84d (diff), 1761268 (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/lib/usb/src/hc.c
r3b71e84d r7aaed09 153 153 if (!usb_hc_connection_is_opened(connection)) 154 154 return ENOENT; 155 155 156 156 async_exch_t *exch = async_exchange_begin(connection->hc_sess); 157 158 sysarg_t tmp; 159 int rc = async_req_2_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 160 IPC_M_USBHC_GET_HANDLE_BY_ADDRESS, 161 address, &tmp); 162 157 if (!exch) 158 return ENOMEM; 159 const int ret = usbhc_get_handle(exch, address, handle); 163 160 async_exchange_end(exch); 164 165 if ((rc == EOK) && (handle != NULL)) 166 *handle = tmp; 167 168 return rc; 161 return ret; 169 162 } 170 163 … … 174 167 * @return USB address or negative error code. 175 168 */ 176 usb_address_t usb_ hc_get_address_by_handle(devman_handle_t dev_handle)169 usb_address_t usb_get_address_by_handle(devman_handle_t dev_handle) 177 170 { 178 171 async_sess_t *parent_sess = … … 181 174 if (!parent_sess) 182 175 return ENOMEM; 183 176 184 177 async_exch_t *exch = async_exchange_begin(parent_sess); 185 186 sysarg_t address; 187 int rc = async_req_2_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 188 IPC_M_USB_GET_ADDRESS, 189 dev_handle, &address); 190 178 if (!exch) { 179 async_hangup(parent_sess); 180 return ENOMEM; 181 } 182 usb_address_t address; 183 const int ret = usb_get_my_address(exch, &address); 184 191 185 async_exchange_end(exch); 192 186 async_hangup(parent_sess); 193 194 if (r c!= EOK)195 return r c;196 197 return (usb_address_t)address;187 188 if (ret != EOK) 189 return ret; 190 191 return address; 198 192 } 199 193 … … 232 226 if (!parent_sess) 233 227 return ENOMEM; 234 228 235 229 async_exch_t *exch = async_exchange_begin(parent_sess); 236 237 devman_handle_t h; 238 int rc = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 239 IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, &h); 240 230 if (!exch) { 231 async_hangup(parent_sess); 232 return ENOMEM; 233 } 234 const int ret = usb_get_hc_handle(exch, hc_handle); 235 241 236 async_exchange_end(exch); 242 237 async_hangup(parent_sess); 243 244 if (rc != EOK) 245 return rc; 246 247 if (hc_handle != NULL) 248 *hc_handle = h; 249 250 return EOK; 238 239 return ret; 251 240 } 252 241
Note:
See TracChangeset
for help on using the changeset viewer.