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)
Thu, Nov 14, 8:00 AM
Unknown Object (File)
Fri, Nov 8, 1:49 AM
Unknown Object (File)
Tue, Oct 29, 12:41 AM
Unknown Object (File)
Sat, Oct 26, 3:05 AM
Unknown Object (File)
Thu, Oct 24, 3:13 PM
Unknown Object (File)
Mon, Oct 21, 5:43 PM
Unknown Object (File)
Mon, Oct 21, 5:43 PM
Unknown Object (File)
Mon, Oct 21, 5:42 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 48191
Build 45078: arc lint + arc unit

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
1855–1856

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