Skip to content

Introduce basic USB related header files.#975

Merged
cahirwpz merged 3 commits intocahirwpz:masterfrom
MichalBlk:usb-headers
Mar 14, 2021
Merged

Introduce basic USB related header files.#975
cahirwpz merged 3 commits intocahirwpz:masterfrom
MichalBlk:usb-headers

Conversation

@MichalBlk
Copy link
Copy Markdown
Collaborator

@MichalBlk MichalBlk commented Jan 31, 2021

The presented header files are required by #935.
Presented changes (regarding original files):

  • scsi.h:
    • length and addr fields aren't expressed in byte units (i.e. instead of uint8_t addr[4] we have uint32_t addr). This simplifies little endian <-> big endian conversions.
    • I've added the SID_FORMAT() macro (used in drive identification).
  • uhci.h: this is simply a subset of the original file (with a few stylistic changes).
  • uhcireg.h:
    • I've added PCI_USB_CLASSCODE and PCI_USB_SUBCLASSCODE.
    • I've added UHCI_PORTSC() instead of UHCI_PORTSC{1,2} (The UHCI specification allows more than two root hub ports).
    • I've added UHCI_PORTSC_ONE which is used in root hub port detection (I don't assume any specific number of root hub ports).
  • umass.h: this file doesn't have a strict counterpart in the FreeBSD source tree. Contained definitions were extracted form the FreeBSD's sys/dev/usb/storage/umass.c file. This is in order to make the umass.c driver thinner and to contain some definitions required by the USB module (UR_BBB_RESET and UR_BBB_GET_MAX_LUN).
  • usbhid.h: this is simply a subset of the original file (without the HID descriptor parsing definitions (we assume the boot protocol is supported)).
  • usb.h:
    • I've added the UV_MAKE() macro (they use some counterpart defined elsewhere).
    • I've added the US_DATASIZE constant (they use a magic number).
    • I've added the US_ENG_LID and US_ENG_STR constants.
    • I've added the US_TRANSFER_TYPE() macro.

@MichalBlk MichalBlk added the review please review this PR label Jan 31, 2021
Copy link
Copy Markdown
Owner

@cahirwpz cahirwpz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All remarks for scsi.h file apply to other header files as well.

Comment thread include/dev/scsi.h
Comment thread include/dev/scsi.h Outdated
Comment thread include/dev/scsi.h Outdated
@MichalBlk
Copy link
Copy Markdown
Collaborator Author

I've described the presented changes to the original files (see the PR's description).

@MichalBlk MichalBlk requested a review from cahirwpz February 19, 2021 10:53
@cahirwpz cahirwpz requested a review from pj1031999 March 5, 2021 09:53
Comment thread include/dev/scsi.h
Comment thread include/dev/uhci.h
Comment thread include/dev/umass.h
@MichalBlk MichalBlk requested a review from pj1031999 March 10, 2021 16:01
@cahirwpz cahirwpz added accepted accepted by the maintainer for code review and removed review please review this PR labels Mar 14, 2021
@cahirwpz cahirwpz merged commit 96b81dd into cahirwpz:master Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted accepted by the maintainer for code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants