Changeset 7fc092a in mainline for uspace/lib/usb/src/recognise.c
- Timestamp:
- 2011-01-27T22:09:29Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- db7ed07
- Parents:
- 9ee87f6 (diff), 6265a2b (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/recognise.c
r9ee87f6 r7fc092a 27 27 */ 28 28 29 /** @addtogroup libusb usb29 /** @addtogroup libusb 30 30 * @{ 31 31 */ … … 39 39 #include <errno.h> 40 40 41 /** Callback for getting host controller handle. 42 * 43 * @param dev Device in question. 44 * @param[out] handle Devman handle of the host controller. 45 * @return Error code. 46 */ 41 47 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle) 42 48 { … … 203 209 uint8_t cur_descr_len = current_descriptor[0]; 204 210 uint8_t cur_descr_type = current_descriptor[1]; 211 212 if (cur_descr_len == 0) { 213 return ENOENT; 214 } 205 215 206 216 position += cur_descr_len; … … 233 243 * @param matches Match ids list to add matches to. 234 244 * @param address USB address of the attached device. 245 * @param config_count Number of configurations the device has. 235 246 * @return Error code. 236 247 */ … … 338 349 /** Probe for device kind and register it in devman. 339 350 * 340 * @param hc Open phone to the host controller. 341 * @param parent Parent device. 342 * @param address Address of the (unknown) attached device. 351 * @param[in] hc Open phone to the host controller. 352 * @param[in] parent Parent device. 353 * @param[in] address Address of the (unknown) attached device. 354 * @param[out] child_handle Handle of the child device. 343 355 * @return Error code. 344 356 */ … … 346 358 usb_address_t address, devman_handle_t *child_handle) 347 359 { 360 static size_t device_name_index = 0; 361 348 362 device_t *child = NULL; 349 363 char *child_name = NULL; … … 357 371 358 372 /* 359 * TODO: some better child naming 360 */ 361 rc = asprintf(&child_name, "usb%p", child); 373 * TODO: Once the device driver framework support persistent 374 * naming etc., something more descriptive could be created. 375 */ 376 rc = asprintf(&child_name, "usbdev%02zu", device_name_index); 362 377 if (rc < 0) { 363 378 goto failure; … … 381 396 } 382 397 398 device_name_index++; 399 383 400 return EOK; 384 401
Note:
See TracChangeset
for help on using the changeset viewer.