Changeset e280857 in mainline for uspace/lib/usb/src
- Timestamp:
- 2011-08-18T12:35:59Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 99ac5cf
- Parents:
- 12f9f0d0
- Location:
- uspace/lib/usb/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hc.c
r12f9f0d0 re280857 201 201 /** Get host controller handle by its class index. 202 202 * 203 * @param class_index Class index for the host controller.203 * @param sid Service ID of the HC function. 204 204 * @param hc_handle Where to store the HC handle 205 205 * (can be NULL for existence test only). 206 206 * @return Error code. 207 207 */ 208 int usb_ddf_get_hc_handle_by_class(size_t class_index, 209 devman_handle_t *hc_handle) 210 { 211 char *class_index_str; 212 devman_handle_t hc_handle_tmp; 208 int usb_ddf_get_hc_handle_by_sid(service_id_t sid, devman_handle_t *hc_handle) 209 { 210 devman_handle_t handle; 213 211 int rc; 214 215 rc = asprintf(&class_index_str, "%zu", class_index); 216 if (rc < 0) { 217 return ENOMEM; 218 } 219 rc = devman_device_get_handle_by_class("usbhc", class_index_str, 220 &hc_handle_tmp, 0); 221 free(class_index_str); 222 if (rc != EOK) { 223 return rc; 224 } 225 226 if (hc_handle != NULL) { 227 *hc_handle = hc_handle_tmp; 228 } 229 230 return EOK; 212 213 rc = devman_fun_sid_to_handle(sid, &handle); 214 if (hc_handle != NULL) 215 *hc_handle = handle; 216 217 return rc; 231 218 } 232 219 -
uspace/lib/usb/src/resolve.c
r12f9f0d0 re280857 46 46 devman_handle_t *out_hc_handle, usb_address_t *out_device_address) 47 47 { 48 size_t class_index;48 uint64_t sid; 49 49 size_t address; 50 50 int rc; 51 51 char *ptr; 52 52 53 rc = str_ size_t(path, &ptr, 10, false, &class_index);53 rc = str_uint64(path, &ptr, 10, false, &sid); 54 54 if (rc != EOK) { 55 55 return false; … … 64 64 return false; 65 65 } 66 rc = usb_ddf_get_hc_handle_by_ class(class_index, out_hc_handle);66 rc = usb_ddf_get_hc_handle_by_sid(sid, out_hc_handle); 67 67 if (rc != EOK) { 68 68 return false;
Note:
See TracChangeset
for help on using the changeset viewer.