} \r
}\r
\r
- MSInterfaceInfo->State.Active = true;\r
+ MSInterfaceInfo->State.IsActive = true;\r
return MS_ENUMERROR_NoError;\r
}\r
\r
\r
uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* MSInterfaceInfo)\r
{\r
- if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.Active))\r
+ if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive))\r
return HOST_SENDCONTROL_DeviceDisconnect;\r
\r
USB_ControlRequest = (USB_Request_Header_t)\r
\r
uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t* MaxLUNIndex)\r
{\r
- if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.Active))\r
+ if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive))\r
return HOST_SENDCONTROL_DeviceDisconnect;\r
\r
uint8_t ErrorCode;\r
*MaxLUNIndex = 0;\r
}\r
\r
- return ErrorCode;\r
+ return HOST_SENDCONTROL_SetupStalled;\r
}\r
\r
uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex, SCSI_Inquiry_Response_t* InquiryData)\r
{\r
- if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.Active))\r
+ if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive))\r
return HOST_SENDCONTROL_DeviceDisconnect;\r
\r
- uint8_t ErrorCode = PIPE_RWSTREAM_NoError;\r
+ uint8_t ErrorCode;\r
\r
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)\r
{\r
MS_CommandStatusWrapper_t SCSICommandStatus;\r
\r
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, InquiryData)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode; \r
- }\r
+ return ErrorCode; \r
\r
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
- return ErrorCode;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
uint8_t MS_Host_TestUnitReady(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex)\r
{\r
- if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.Active))\r
+ if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive))\r
return HOST_SENDCONTROL_DeviceDisconnect;\r
\r
- uint8_t ErrorCode = PIPE_RWSTREAM_NoError; \r
+ uint8_t ErrorCode; \r
\r
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)\r
{\r
MS_CommandStatusWrapper_t SCSICommandStatus;\r
\r
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, NULL)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode; \r
- }\r
+ return ErrorCode; \r
\r
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
- return ErrorCode;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
uint8_t MS_Host_ReadDeviceCapacity(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex,\r
SCSI_Capacity_t* DeviceCapacity)\r
{\r
- if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.Active))\r
+ if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive))\r
return HOST_SENDCONTROL_DeviceDisconnect;\r
\r
- uint8_t ErrorCode = PIPE_RWSTREAM_NoError;\r
+ uint8_t ErrorCode;\r
\r
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)\r
{\r
MS_CommandStatusWrapper_t SCSICommandStatus;\r
\r
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, DeviceCapacity)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
DeviceCapacity->Blocks = SwapEndian_32(DeviceCapacity->Blocks);\r
DeviceCapacity->BlockSize = SwapEndian_32(DeviceCapacity->BlockSize);\r
\r
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
- return ErrorCode;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
uint8_t MS_Host_RequestSense(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex,\r
SCSI_Request_Sense_Response_t* SenseData)\r
{\r
- if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.Active))\r
+ if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive))\r
return HOST_SENDCONTROL_DeviceDisconnect;\r
\r
- uint8_t ErrorCode = PIPE_RWSTREAM_NoError;\r
+ uint8_t ErrorCode;\r
\r
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)\r
{\r
MS_CommandStatusWrapper_t SCSICommandStatus;\r
\r
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, SenseData)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
- return ErrorCode;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
uint8_t MS_Host_PreventAllowMediumRemoval(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex, bool PreventRemoval)\r
{\r
- if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.Active))\r
+ if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive))\r
return HOST_SENDCONTROL_DeviceDisconnect;\r
\r
- uint8_t ErrorCode = PIPE_RWSTREAM_NoError;\r
+ uint8_t ErrorCode;\r
\r
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)\r
{\r
MS_CommandStatusWrapper_t SCSICommandStatus;\r
\r
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, NULL)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
- return ErrorCode;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
uint8_t MS_Host_ReadDeviceBlocks(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex, uint32_t BlockAddress,\r
uint8_t Blocks, uint16_t BlockSize, void* BlockBuffer)\r
{\r
- if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.Active))\r
+ if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive))\r
return HOST_SENDCONTROL_DeviceDisconnect;\r
\r
- uint8_t ErrorCode = PIPE_RWSTREAM_NoError;\r
+ uint8_t ErrorCode;\r
\r
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)\r
{\r
MS_CommandStatusWrapper_t SCSICommandStatus;\r
\r
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, BlockBuffer)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
- return ErrorCode;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
uint8_t MS_Host_WriteDeviceBlocks(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex, uint32_t BlockAddress,\r
uint8_t Blocks, uint16_t BlockSize, void* BlockBuffer)\r
{\r
- if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.Active))\r
+ if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive))\r
return HOST_SENDCONTROL_DeviceDisconnect;\r
\r
- uint8_t ErrorCode = PIPE_RWSTREAM_NoError;\r
+ uint8_t ErrorCode;\r
\r
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)\r
{\r
MS_CommandStatusWrapper_t SCSICommandStatus;\r
\r
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, BlockBuffer)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)\r
- {\r
- Pipe_Freeze();\r
- return ErrorCode;\r
- }\r
+ return ErrorCode;\r
\r
- return ErrorCode;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
#endif\r