From 7c6b2019a302fb064665c1a69e559678c299e9bb Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 17 Sep 2009 13:12:21 +0000 Subject: Fix Mass Storage Host Class driver GetMaxLUN command - incorrect function return codes used in comparison to check for success. Add HID Host Class driver functions to set the report protocol, add more class driver documentation. --- LUFA/Drivers/USB/Class/Host/MassStorage.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'LUFA/Drivers/USB/Class/Host/MassStorage.c') diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.c b/LUFA/Drivers/USB/Class/Host/MassStorage.c index 2d2f042b7..ead7768d6 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c @@ -274,8 +274,10 @@ static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* MSInterfaceInf if ((ErrorCode = Pipe_Read_Stream_LE(SCSICommandStatus, sizeof(MS_CommandStatusWrapper_t), NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError) - return ErrorCode; - + { + return ErrorCode; + } + Pipe_ClearIN(); Pipe_Freeze(); @@ -322,14 +324,10 @@ uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t* Max Pipe_SelectPipe(PIPE_CONTROLPIPE); - if ((ErrorCode = USB_Host_SendControlRequest(MaxLUNIndex)) == HOST_SENDCONTROL_SetupStalled) - { - Pipe_ClearStall(); - - *MaxLUNIndex = 0; - } + if ((ErrorCode = USB_Host_SendControlRequest(MaxLUNIndex)) != HOST_SENDCONTROL_Successful) + *MaxLUNIndex = 0; - return HOST_SENDCONTROL_SetupStalled; + return ErrorCode; } uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex, SCSI_Inquiry_Response_t* InquiryData) -- cgit v1.2.3