Changeset 1c89f74 in mainline for uspace/drv/usbhub/usbhub.c
- Timestamp:
- 2011-04-07T09:00:00Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9d06563
- Parents:
- d7f3040
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub.c
rd7f3040 r1c89f74 344 344 * these lines allow to reset hub once more, it can be used as 345 345 * brute-force initialization for non-removable devices 346 * 346 */ 347 347 opResult = usb_request_set_configuration(hub_info->control_pipe, 348 348 1); … … 351 351 opResult); 352 352 return opResult; 353 } */353 } 354 354 355 355 356 356 size_t received_size; 357 opResult = usb_request_get_descriptor( &hub_info->usb_device->ctrl_pipe,357 opResult = usb_request_get_descriptor(hub_info->control_pipe, 358 358 USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_DEVICE, 359 359 USB_DESCTYPE_HUB, … … 376 376 usb_log_debug("setting port count to %d\n", descriptor->ports_count); 377 377 hub_info->port_count = descriptor->ports_count; 378 /// \TODO check attached_devices array: this is not semantically correct 378 379 hub_info->attached_devs = (usb_hc_attached_device_t*) 379 380 malloc((hub_info->port_count + 1) * … … 381 382 ); 382 383 int i; 383 for (i = 0; i < hub_info->port_count + 1; ++i) {384 for (i = 1; i <= hub_info->port_count; ++i) { 384 385 hub_info->attached_devs[i].handle = 0; 385 386 hub_info->attached_devs[i].address = 0; 387 usb_log_info("powering port %d\n",i); 388 opResult = usb_hub_set_port_feature( 389 hub_info->control_pipe, 390 i, 391 USB_HUB_FEATURE_PORT_POWER); 392 if(opResult!=EOK) 393 usb_log_warning("could not power port %d\n",i); 394 386 395 } 387 396 //handle non-removable devices
Note:
See TracChangeset
for help on using the changeset viewer.