Skip to content

Commit a73c2b1

Browse files
authored
Merge pull request #11814 from sandeepmistry/usb-msd-mode-sense-10
USBMSD: implement MODE SENSE (10) command
2 parents 816689d + c7d9d0a commit a73c2b1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

drivers/USBMSD.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ class USBMSD: public USBDevice {
302302
bool infoTransfer(void);
303303
void memoryRead(void);
304304
bool modeSense6(void);
305+
bool modeSense10(void);
305306
void testUnitReady(void);
306307
bool requestSense(void);
307308
void memoryVerify(uint8_t *buf, uint16_t size);

drivers/source/usb/USBMSD.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,15 @@ bool USBMSD::modeSense6(void)
706706
return true;
707707
}
708708

709+
bool USBMSD::modeSense10(void)
710+
{
711+
uint8_t sense10[] = { 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
712+
if (!write(sense10, sizeof(sense10))) {
713+
return false;
714+
}
715+
return true;
716+
}
717+
709718
void USBMSD::sendCSW()
710719
{
711720
_csw.Signature = CSW_Signature;
@@ -826,6 +835,9 @@ void USBMSD::CBWDecode(uint8_t *buf, uint16_t size)
826835
sendCSW();
827836
_media_removed = true;
828837
break;
838+
case MODE_SENSE10:
839+
modeSense10();
840+
break;
829841
default:
830842
fail();
831843
break;

0 commit comments

Comments
 (0)