Skip to content

USBMSD: implement MODE SENSE (10) command #11814

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

Merged
merged 1 commit into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/USBMSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ class USBMSD: public USBDevice {
bool infoTransfer(void);
void memoryRead(void);
bool modeSense6(void);
bool modeSense10(void);
void testUnitReady(void);
bool requestSense(void);
void memoryVerify(uint8_t *buf, uint16_t size);
Expand Down
12 changes: 12 additions & 0 deletions drivers/source/usb/USBMSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,15 @@ bool USBMSD::modeSense6(void)
return true;
}

bool USBMSD::modeSense10(void)
{
uint8_t sense10[] = { 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
if (!write(sense10, sizeof(sense10))) {
return false;
}
return true;
}

void USBMSD::sendCSW()
{
_csw.Signature = CSW_Signature;
Expand Down Expand Up @@ -826,6 +835,9 @@ void USBMSD::CBWDecode(uint8_t *buf, uint16_t size)
sendCSW();
_media_removed = true;
break;
case MODE_SENSE10:
modeSense10();
break;
default:
fail();
break;
Expand Down