Skip to content

Added some documentation to the XHCI daemon, clarified the scheme interface with a refactor

Problem: This set of documentation and refactors improves the readability/intelligibility of the XHCI daemon.

Solution: The Scheme implementation for Xhci was updated to remove a lot of syntactic sugar that made it difficult to understand. A lot of documentation of the various scheme endpoints was also added, and helper functions for extracting parameters from a scheme and converting a file descriptor back into the scheme that generated it were created.

Documentation was also added for much of the usb module, and many components of the Xhci module. This documentation includes references to the associated standard.

This is a first pass, and I intend to complete the documentation in a future ticket.

I was going to refactor a lot more, but I learned that @4lDO2 was working on some large changes of his own, and I didnt want those to be too difficult to reconcile with my own.

Changes introduced by this pull request:

  • small refactor of scheme.rs to clean up syntactic sugar in the process of clarifying the schemes.
  • Large amounts of documentation was added to the driver, though it's still not complete.

Drawbacks:

  • I did introduce regular expressions into the driver. I felt that they made it easier to read what the actual structure of each scheme should be, and to extract parameters like port number or endpoint number out of the scheme.

TODOs:

  • Much more documentation is coming in a follow-up MR. I intend to document the XHCI interface thoroughly as I use it to implement usbhubd
  • I would like to do a more comprehensive refactor of the driver with a focus on readability, but I'll wait until conflicting changes make their way in first.

Merge request reports