Changeset db8b7ca in mainline for uspace/lib/usbdev/src/recognise.c
- Timestamp:
- 2012-12-26T19:02:51Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 34289ea
- Parents:
- d8cdf39e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/recognise.c
rd8cdf39e rdb8b7ca 33 33 * Functions for recognition of attached devices. 34 34 */ 35 36 /** XXX Fix this */37 #define _DDF_DATA_IMPLANT38 35 39 36 #include <sys/types.h> … … 318 315 */ 319 316 int usb_device_register_child_in_devman(usb_pipe_t *ctrl_pipe, 320 ddf_dev_t *parent, ddf_dev_ops_t *dev_ops, void *dev_data, 321 ddf_fun_t **child_fun) 317 ddf_dev_t *parent, ddf_fun_t **child_fun) 322 318 { 323 319 if (child_fun == NULL || ctrl_pipe == NULL) 324 320 return EINVAL; 325 326 if (!dev_ops && dev_data) {327 usb_log_warning("Using standard fun ops with arbitrary "328 "driver data. This does not have to work.\n");329 }330 321 331 322 /** Index to append after device name for uniqueness. */ … … 354 345 } 355 346 356 if (dev_ops != NULL) 357 ddf_fun_set_ops(child, dev_ops); 358 else 359 ddf_fun_set_ops(child, &child_ops); 360 361 ddf_fun_data_implant(child, dev_data); 362 347 ddf_fun_set_ops(child, &child_ops); 363 348 /* 364 349 * Store the attached device in fun 365 350 * driver data if there is no other data 366 351 */ 367 if (!dev_data) { 368 usb_hub_attached_device_t *new_device = ddf_fun_data_alloc( 369 child, sizeof(usb_hub_attached_device_t)); 370 if (!new_device) { 371 rc = ENOMEM; 372 goto failure; 373 } 374 375 new_device->address = ctrl_pipe->wire->address; 376 new_device->fun = child; 377 } 352 usb_hub_attached_device_t *new_device = ddf_fun_data_alloc( 353 child, sizeof(usb_hub_attached_device_t)); 354 if (!new_device) { 355 rc = ENOMEM; 356 goto failure; 357 } 358 359 new_device->address = ctrl_pipe->wire->address; 360 new_device->fun = child; 378 361 379 362 match_id_list_t match_ids;
Note:
See TracChangeset
for help on using the changeset viewer.