Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic USB CDROM support via USB MSC #2954

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

i-am-shodan
Copy link

Describe the PR
USB CDROM support requires that the SCSI INQUIRY command returns a different device type and qualifier. The current API for MSC devices doesn't allow the caller to influence these or appear as any other device type. This PR adds a new API function tud_msc_scsi_device_type(uint8_t lun) that enables expandability of SCSI device types as well as two new commands SCSI_CMD_READ_TOC and SCSI_CMD_READ_DISC_INFO.

In order to appear as a CDROM the caller must:

  • Implement tud_msc_scsi_device_type and return MSC_SCSI_DEVICE_CDROM
  • Implement SCSI_CMD_READ_TOC in tud_msc_scsi_cb (this returns the CDROM table of contents)
  • Implement SCSI_CMD_READ_DISC_INFO in tud_msc_scsi_cb which returns disc info - in many cases this can be uint8_t[2] = {0}

This is a breaking change if you are currently using MSC and you're getting a compilation error you'll need to add.

msc_scsi_device_type_t tud_msc_scsi_device_type(uint8_t lun)
{
  (void) lun;
  return MSC_SCSI_DEVICE_BLOCK;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant