34 #define __INCLUDE_FROM_USB_DRIVER
35 #include "../../Core/USBMode.h"
37 #if defined(USB_CAN_BE_HOST)
39 #define __INCLUDE_FROM_MS_DRIVER
40 #define __INCLUDE_FROM_MASSSTORAGE_HOST_C
44 uint16_t ConfigDescriptorSize,
45 void* ConfigDescriptorData)
52 memset(&MSInterfaceInfo->
State, 0x00,
sizeof(MSInterfaceInfo->
State));
57 while (!(DataINEndpoint) || !(DataOUTEndpoint))
59 if (!(MassStorageInterface) ||
71 DataINEndpoint =
NULL;
72 DataOUTEndpoint =
NULL;
80 DataINEndpoint = EndpointData;
82 DataOUTEndpoint = EndpointData;
96 EndpointAddress = DataINEndpoint->EndpointAddress;
106 EndpointAddress = DataOUTEndpoint->EndpointAddress;
158 uint8_t EndpointType = (Endpoint->Attributes &
EP_TYPE_MASK);
175 const void*
const BufferPtr)
200 if (BufferPtr !=
NULL)
217 uint16_t TimeoutMSRem = MS_COMMAND_DATA_TIMEOUT_MS;
228 if (CurrentFrameNumber != PreviousFrameNumber)
230 PreviousFrameNumber = CurrentFrameNumber;
232 if (!(TimeoutMSRem--))
276 uint16_t BytesRem =
le32_to_cpu(SCSICommandBlock->DataTransferLength);
376 uint8_t*
const MaxLUNIndex)
401 const uint8_t LUNIndex,
414 .SCSICommandLength = 6,
433 const uint8_t LUNIndex)
445 .SCSICommandLength = 6,
464 const uint8_t LUNIndex,
477 .SCSICommandLength = 10,
503 const uint8_t LUNIndex,
516 .SCSICommandLength = 6,
535 const uint8_t LUNIndex,
536 const bool PreventRemoval)
548 .SCSICommandLength = 6,
567 const uint8_t LUNIndex,
569 const uint8_t Blocks,
570 const uint16_t BlockSize,
583 .SCSICommandLength = 10,
588 (BlockAddress >> 24),
589 (BlockAddress >> 16),
591 (BlockAddress & 0xFF),
606 const uint8_t LUNIndex,
608 const uint8_t Blocks,
609 const uint16_t BlockSize,
610 const void* BlockBuffer)
622 .SCSICommandLength = 10,
627 (BlockAddress >> 24),
628 (BlockAddress >> 16),
630 (BlockAddress & 0xFF),