Page MenuHomeFreeBSD

bhyve: Simplify control flow in the xhci device model
ClosedPublic

Authored by markj on Nov 6 2022, 7:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 4:49 AM
Unknown Object (File)
Nov 14 2024, 8:00 AM
Unknown Object (File)
Nov 8 2024, 1:49 AM
Unknown Object (File)
Oct 29 2024, 12:41 AM
Unknown Object (File)
Oct 26 2024, 3:05 AM
Unknown Object (File)
Oct 24 2024, 3:13 PM
Unknown Object (File)
Oct 21 2024, 5:43 PM
Unknown Object (File)
Oct 21 2024, 5:43 PM
Subscribers

Details

Summary

We only need to call pci_xhci_xfer_complete() when handling a transfer
to the control endpoint, so move that code into the epid == 1 block and
eliminate a goto. Remove an unneeded reinitialization of setup_trb. No
functional change intended.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Nov 6 2022, 7:35 PM
This revision is now accepted and ready to land.Nov 7 2022, 8:05 AM
jhb added inline comments.
usr.sbin/bhyve/pci_xhci.c
1856–1857

I understand why it's there, but having back-to-back assignments of err like this is potentially a bit confusing. One option might be using separate variables for USB errors vs XHCI errors (either something verbose like usb_error and xhci_error or maybe something shorter like uerror and xerror)?

markj marked an inline comment as done.

Use different variables for different error classes.

This revision now requires review to proceed.Nov 11 2022, 2:58 PM
This revision is now accepted and ready to land.Nov 14 2022, 6:28 AM