diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-12-04 09:08:48 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-12-04 09:08:48 +0000 |
| commit | c6a7d1246030da57e9c3aa2ea614fd150c871715 (patch) | |
| tree | 43858ac2a66d50dd0385f1c4de1eea4d685976b5 /LUFA/Drivers/USB | |
| parent | 7920e0f321a695c5d605fafff02ecd9838ff1cd1 (diff) | |
Fixed Mass Storage Host Class driver and Low Level demo not clearing the error condition if an attached device returns a STALL to a GET MAX LUN request (thanks to Martin Luxen).
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@951 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/USB')
| -rw-r--r-- | LUFA/Drivers/USB/Class/Host/MassStorage.c | 7 | ||||
| -rw-r--r-- | LUFA/Drivers/USB/Class/Host/MassStorage.h | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.c b/LUFA/Drivers/USB/Class/Host/MassStorage.c index 75b8ef48..ca071752 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c @@ -305,7 +305,7 @@ uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint8_t* const MaxLUNIndex)
{
- uint8_t ErrorCode;
+ uint8_t ErrorCode = HOST_SENDCONTROL_Successful;
USB_ControlRequest = (USB_Request_Header_t)
{
@@ -319,7 +319,10 @@ uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint8_ Pipe_SelectPipe(PIPE_CONTROLPIPE);
if ((ErrorCode = USB_Host_SendControlRequest(MaxLUNIndex)) != HOST_SENDCONTROL_Successful)
- *MaxLUNIndex = 0;
+ {
+ *MaxLUNIndex = 0;
+ ErrorCode = HOST_SENDCONTROL_Successful;
+ }
return ErrorCode;
}
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.h b/LUFA/Drivers/USB/Class/Host/MassStorage.h index fc3bc667..584172fe 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.h @@ -149,6 +149,10 @@ * UNit, a logical drive) in the device. This value can then be used in the other functions of the Mass Storage
* Host mode Class driver to address a specific LUN within the device.
*
+ * \note Some devices do not support this request, and will STALL it when issued. To get around this,
+ * on unsupported devices the max LUN index will be reported as zero and no error will be returned
+ * if the device STALLs the request.
+ *
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
* \param[out] MaxLUNIndex Pointer to a location where the highest LUN index value should be stored
*
|
