USBMSD: implement MODE SENSE (10) command

pull/11814/head
Sandeep Mistry 2019-11-05 11:17:40 -05:00
parent e4164bee51
commit c7d9d0af46
2 changed files with 13 additions and 0 deletions

View File

@ -302,6 +302,7 @@ private:
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);

View File

@ -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;
@ -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;