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
F86792090: D37287.diff
Tue, Jun 25, 3:38 PM
Unknown Object (File)
Thu, Jun 20, 10:12 AM
Unknown Object (File)
May 8 2024, 10:10 AM
Unknown Object (File)
May 8 2024, 10:08 AM
Unknown Object (File)
May 8 2024, 10:08 AM
Unknown Object (File)
May 8 2024, 10:08 AM
Unknown Object (File)
May 8 2024, 8:08 AM
Unknown Object (File)
Apr 24 2024, 12:09 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