X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/64e5c4084f862267d96b0947f462de7058f3dc4c..d11ed10c5314c44dc01c06954d1d73d4894cbff8:/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 d1622c17d..7a302632b 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2009. + Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -127,11 +127,6 @@ static uint8_t DComp_NextMSInterfaceEndpoint(void* const CurrentDescriptor) return DESCRIPTOR_SEARCH_NotFound; } -void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) -{ - -} - static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, MS_CommandBlockWrapper_t* const SCSICommandBlock, void* BufferPtr) { @@ -289,9 +284,6 @@ static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* const MSInterf uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) { - if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive)) - return HOST_SENDCONTROL_DeviceDisconnect; - USB_ControlRequest = (USB_Request_Header_t) { .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), @@ -308,10 +300,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) { - if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive)) - return HOST_SENDCONTROL_DeviceDisconnect; - - uint8_t ErrorCode; + uint8_t ErrorCode = HOST_SENDCONTROL_Successful; USB_ControlRequest = (USB_Request_Header_t) { @@ -325,7 +314,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; } @@ -334,7 +326,7 @@ uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, c SCSI_Inquiry_Response_t* const InquiryData) { if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive)) - return HOST_SENDCONTROL_DeviceDisconnect; + return HOST_SENDCONTROL_DeviceDisconnected; uint8_t ErrorCode; @@ -370,7 +362,7 @@ uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, c uint8_t MS_Host_TestUnitReady(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex) { if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive)) - return HOST_SENDCONTROL_DeviceDisconnect; + return HOST_SENDCONTROL_DeviceDisconnected; uint8_t ErrorCode; @@ -407,7 +399,7 @@ uint8_t MS_Host_ReadDeviceCapacity(USB_ClassInfo_MS_Host_t* const MSInterfaceInf SCSI_Capacity_t* const DeviceCapacity) { if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive)) - return HOST_SENDCONTROL_DeviceDisconnect; + return HOST_SENDCONTROL_DeviceDisconnected; uint8_t ErrorCode; @@ -451,7 +443,7 @@ uint8_t MS_Host_RequestSense(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, con SCSI_Request_Sense_Response_t* const SenseData) { if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive)) - return HOST_SENDCONTROL_DeviceDisconnect; + return HOST_SENDCONTROL_DeviceDisconnected; uint8_t ErrorCode; @@ -488,7 +480,7 @@ uint8_t MS_Host_PreventAllowMediumRemoval(USB_ClassInfo_MS_Host_t* const MSInter const bool PreventRemoval) { if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive)) - return HOST_SENDCONTROL_DeviceDisconnect; + return HOST_SENDCONTROL_DeviceDisconnected; uint8_t ErrorCode; @@ -525,7 +517,7 @@ uint8_t MS_Host_ReadDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t Blocks, const uint16_t BlockSize, void* BlockBuffer) { if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive)) - return HOST_SENDCONTROL_DeviceDisconnect; + return HOST_SENDCONTROL_DeviceDisconnected; uint8_t ErrorCode; @@ -566,7 +558,7 @@ uint8_t MS_Host_WriteDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo const uint8_t Blocks, const uint16_t BlockSize, void* BlockBuffer) { if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive)) - return HOST_SENDCONTROL_DeviceDisconnect; + return HOST_SENDCONTROL_DeviceDisconnected; uint8_t ErrorCode;