Oops - Bootloader optimizations to GetDescriptor() don't work, as the Configuration...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Common / MassStorage.h
index f7e3119..d641c33 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2010.
+     Copyright (C) Dean Camera, 2011.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2011  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
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -38,7 +38,7 @@
  */
 
 /** \ingroup Group_USBClassMS
  */
 
 /** \ingroup Group_USBClassMS
- *  @defgroup Group_USBClassMSCommon  Common Class Definitions
+ *  \defgroup Group_USBClassMSCommon  Common Class Definitions
  *
  *  \section Sec_ModDescription Module Description
  *  Constants, Types and Enum definitions that are common to both Device and Host modes for the USB
  *
  *  \section Sec_ModDescription Module Description
  *  Constants, Types and Enum definitions that are common to both Device and Host modes for the USB
@@ -51,9 +51,7 @@
 #define _MS_CLASS_COMMON_H_
 
        /* Includes: */
 #define _MS_CLASS_COMMON_H_
 
        /* Includes: */
-               #include "../../HighLevel/StdDescriptors.h"
-
-               #include <string.h>
+               #include "../../Core/StdDescriptors.h"
 
        /* Enable C linkage for C++ Compilers: */
                #if defined(__cplusplus)
 
        /* Enable C linkage for C++ Compilers: */
                #if defined(__cplusplus)
                 *  Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
                typedef struct
                {
                 *  Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
                typedef struct
                {
-                       uint32_t Signature; /**< Command block signature, must be CBW_SIGNATURE to indicate a valid Command Block. */
+                       uint32_t Signature; /**< Command block signature, must be \ref MS_CBW_SIGNATURE to indicate a valid Command Block. */
                        uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper. */
                        uint32_t DataTransferLength; /**< Length of the optional data portion of the issued command, in bytes. */
                        uint8_t  Flags; /**< Command block flags, indicating command data direction. */
                        uint8_t  LUN; /**< Logical Unit number this command is issued to. */
                        uint8_t  SCSICommandLength; /**< Length of the issued SCSI command within the SCSI command data array. */
                        uint8_t  SCSICommandData[16]; /**< Issued SCSI command in the Command Block. */
                        uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper. */
                        uint32_t DataTransferLength; /**< Length of the optional data portion of the issued command, in bytes. */
                        uint8_t  Flags; /**< Command block flags, indicating command data direction. */
                        uint8_t  LUN; /**< Logical Unit number this command is issued to. */
                        uint8_t  SCSICommandLength; /**< Length of the issued SCSI command within the SCSI command data array. */
                        uint8_t  SCSICommandData[16]; /**< Issued SCSI command in the Command Block. */
-               } MS_CommandBlockWrapper_t;
+               } ATTR_PACKED MS_CommandBlockWrapper_t;
 
                /** \brief Mass Storage Class Command Status Wrapper.
                 *
 
                /** \brief Mass Storage Class Command Status Wrapper.
                 *
                 */
                typedef struct
                {
                 */
                typedef struct
                {
-                       uint32_t Signature; /**< Status block signature, must be CSW_SIGNATURE to indicate a valid Command Status. */
+                       uint32_t Signature; /**< Status block signature, must be \ref MS_CSW_SIGNATURE to indicate a valid Command Status. */
                        uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper. */
                        uint32_t DataTransferResidue; /**< Number of bytes of data not processed in the SCSI command. */
                        uint8_t  Status; /**< Status code of the issued command - a value from the \ref MS_CommandStatusCodes_t enum. */
                        uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper. */
                        uint32_t DataTransferResidue; /**< Number of bytes of data not processed in the SCSI command. */
                        uint8_t  Status; /**< Status code of the issued command - a value from the \ref MS_CommandStatusCodes_t enum. */
-               } MS_CommandStatusWrapper_t;
+               } ATTR_PACKED MS_CommandStatusWrapper_t;
 
                /** \brief Mass Storage Class SCSI Sense Structure
                 *
 
                /** \brief Mass Storage Class SCSI Sense Structure
                 *
                        uint8_t       AdditionalSenseQualifier;
                        uint8_t       FieldReplaceableUnitCode;
                        uint8_t       SenseKeySpecific[3];
                        uint8_t       AdditionalSenseQualifier;
                        uint8_t       FieldReplaceableUnitCode;
                        uint8_t       SenseKeySpecific[3];
-               } SCSI_Request_Sense_Response_t;
+               } ATTR_PACKED SCSI_Request_Sense_Response_t;
 
                /** \brief Mass Storage Class SCSI Inquiry Structure.
                 *
 
                /** \brief Mass Storage Class SCSI Inquiry Structure.
                 *
                        uint8_t       VendorID[8];
                        uint8_t       ProductID[16];
                        uint8_t       RevisionID[4];
                        uint8_t       VendorID[8];
                        uint8_t       ProductID[16];
                        uint8_t       RevisionID[4];
-               } SCSI_Inquiry_Response_t;
+               } ATTR_PACKED SCSI_Inquiry_Response_t;
 
        /* Disable C linkage for C++ Compilers: */
                #if defined(__cplusplus)
 
        /* Disable C linkage for C++ Compilers: */
                #if defined(__cplusplus)