Merge pull request #11814 from sandeepmistry/usb-msd-mode-sense-10

USBMSD: implement MODE SENSE (10) command
pull/11844/head
Martin Kojtal 2019-11-11 15:51:51 +01:00 committed by GitHub
commit a73c2b1429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -302,6 +302,7 @@ private:
bool infoTransfer(void); bool infoTransfer(void);
void memoryRead(void); void memoryRead(void);
bool modeSense6(void); bool modeSense6(void);
bool modeSense10(void);
void testUnitReady(void); void testUnitReady(void);
bool requestSense(void); bool requestSense(void);
void memoryVerify(uint8_t *buf, uint16_t size); void memoryVerify(uint8_t *buf, uint16_t size);

View File

@ -706,6 +706,15 @@ bool USBMSD::modeSense6(void)
return true; 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() void USBMSD::sendCSW()
{ {
_csw.Signature = CSW_Signature; _csw.Signature = CSW_Signature;
@ -826,6 +835,9 @@ void USBMSD::CBWDecode(uint8_t *buf, uint16_t size)
sendCSW(); sendCSW();
_media_removed = true; _media_removed = true;
break; break;
case MODE_SENSE10:
modeSense10();
break;
default: default:
fail(); fail();
break; break;