Changeset 7d20461 in mainline
- Timestamp:
- 2013-01-27T12:05:00Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 25effe2
- Parents:
- 7363fc1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/usbinfo/info.c
r7363fc1 r7d20461 354 354 { 355 355 int rc; 356 uint16_t device_status = 0; 357 uint16_t ctrl_pipe_status = 0; 356 uint16_t status = 0; 358 357 359 358 /* Device status first. */ 360 359 rc = usb_request_get_status(&dev->ctrl_pipe, 361 USB_REQUEST_RECIPIENT_DEVICE, 0, 362 &device_status); 360 USB_REQUEST_RECIPIENT_DEVICE, 0, &status); 363 361 if (rc != EOK) { 364 362 printf("%sFailed to get device status: %s.\n", 365 363 get_indent(0), str_error(rc)); 366 goto try_ctrl_pipe_status; 367 } 368 369 printf("%sDevice status 0x%04x: power=%s, remote-wakeup=%s.\n", 370 get_indent(0), 371 device_status, 372 device_status & USB_DEVICE_STATUS_SELF_POWERED ? "self" : "bus", 373 device_status & USB_DEVICE_STATUS_REMOTE_WAKEUP ? "yes" : "no"); 364 } else { 365 printf("%sDevice status 0x%04x: power=%s, remote-wakeup=%s.\n", 366 get_indent(0), status, 367 status & USB_DEVICE_STATUS_SELF_POWERED ? "self" : "bus", 368 status & USB_DEVICE_STATUS_REMOTE_WAKEUP ? "yes" : "no"); 369 } 374 370 375 371 /* Interface is not interesting, skipping ;-). */ 376 372 377 373 /* Control endpoint zero. */ 378 try_ctrl_pipe_status: 374 status = 0; 379 375 rc = usb_request_get_status(&dev->ctrl_pipe, 380 USB_REQUEST_RECIPIENT_ENDPOINT, 0, 381 &ctrl_pipe_status); 376 USB_REQUEST_RECIPIENT_ENDPOINT, 0, &status); 382 377 if (rc != EOK) { 383 378 printf("%sFailed to get control endpoint status: %s.\n", 384 379 get_indent(0), str_error(rc)); 385 goto leave; 386 } 387 388 printf("%sControl endpoint zero status %04X: halted=%s.\n", 389 get_indent(0), 390 ctrl_pipe_status, 391 ctrl_pipe_status & USB_ENDPOINT_STATUS_HALTED ? "yes" : "no"); 392 393 leave: 394 return; 380 } else { 381 printf("%sControl endpoint zero status %04X: halted=%s.\n", 382 get_indent(0), status, 383 status & USB_ENDPOINT_STATUS_HALTED ? "yes" : "no"); 384 } 395 385 } 396 386
Note:
See TracChangeset
for help on using the changeset viewer.