Changeset c3d926f in mainline for uspace/drv/bus/usb/xhci/rh.c
- Timestamp:
- 2017-10-25T08:03:13Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a5b3de6
- Parents:
- 0206d35
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/rh.c
r0206d35 rc3d926f 374 374 // ctx is an out parameter as of now 375 375 assert(dev); 376 377 ctx = malloc(sizeof(xhci_port_bandwidth_ctx_t)); 378 if(!ctx) 376 assert(ctx); 377 378 xhci_port_bandwidth_ctx_t *in_ctx = malloc32(sizeof(xhci_port_bandwidth_ctx_t)); 379 if (!in_ctx) { 379 380 return ENOMEM; 381 } 380 382 381 383 xhci_cmd_t cmd; 382 xhci_cmd_init(&cmd); 383 384 xhci_get_port_bandwidth_command(dev->hc, &cmd, ctx, speed); 385 386 int err = xhci_cmd_wait(&cmd, XHCI_DEFAULT_TIMEOUT); 387 if(err != EOK) { 388 free(ctx); 389 ctx = NULL; 390 } 391 384 xhci_cmd_init(&cmd, XHCI_CMD_GET_PORT_BANDWIDTH); 385 386 cmd.bandwidth_ctx = in_ctx; 387 cmd.device_speed = speed; 388 389 int err; 390 if ((err = xhci_cmd_sync(dev->hc, &cmd))) { 391 goto end; 392 } 393 394 memcpy(ctx, in_ctx, sizeof(xhci_port_bandwidth_ctx_t)); 395 396 end: 397 xhci_cmd_fini(&cmd); 392 398 return EOK; 393 399 }
Note:
See TracChangeset
for help on using the changeset viewer.