aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Host/MassStorage.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-09-17 13:12:21 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-09-17 13:12:21 +0000
commit7c6b2019a302fb064665c1a69e559678c299e9bb (patch)
treef9348ddac5fe0b45fa687df5941d391e91715326 /LUFA/Drivers/USB/Class/Host/MassStorage.c
parenteaa914a4e445c25ffdbee7be7caf85165540c98a (diff)
downloadlufa-7c6b2019a302fb064665c1a69e559678c299e9bb.tar.gz
lufa-7c6b2019a302fb064665c1a69e559678c299e9bb.tar.bz2
lufa-7c6b2019a302fb064665c1a69e559678c299e9bb.zip
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.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host/MassStorage.c')
-rw-r--r--LUFA/Drivers/USB/Class/Host/MassStorage.c16
1 files changed, 7 insertions, 9 deletions
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)