LUFA Library - Mass Storage Class Bootloader
SCSI.h File Reference
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include "../BootloaderMassStorage.h"
#include "../Descriptors.h"
#include "VirtualFAT.h"

Macros

#define SCSI_SET_SENSE(Key, Acode, Aqual)
 
#define DATA_READ   true
 
#define DATA_WRITE   false
 
#define DEVICE_TYPE_BLOCK   0x00
 

Functions

bool SCSI_DecodeSCSICommand (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) AUX_BOOT_SECTION
 

Detailed Description

Header file for SCSI.c.

Macro Definition Documentation

#define DATA_READ   true

Macro for the SCSI_Command_ReadWrite_10() function, to indicate that data is to be read from the storage medium.

#define DATA_WRITE   false

Macro for the SCSI_Command_ReadWrite_10() function, to indicate that data is to be written to the storage medium.

#define DEVICE_TYPE_BLOCK   0x00

Value for the DeviceType entry in the SCSI_Inquiry_Response_t enum, indicating a Block Media device.

#define SCSI_SET_SENSE (   Key,
  Acode,
  Aqual 
)
Value:
MACROS{ SenseData.SenseKey = (Key); \
SenseData.AdditionalSenseCode = (Acode); \
SenseData.AdditionalSenseQualifier = (Aqual); }MACROE

Macro to set the current SCSI sense data to the given key, additional sense code and additional sense qualifier. This is for convenience, as it allows for all three sense values (returned upon request to the host to give information about the last command failure) in a quick and easy manner.

Parameters
[in]KeyNew SCSI sense key to set the sense code to
[in]AcodeNew SCSI additional sense key to set the additional sense code to
[in]AqualNew SCSI additional sense key qualifier to set the additional sense qualifier code to

Function Documentation

bool SCSI_DecodeSCSICommand ( USB_ClassInfo_MS_Device_t *const  MSInterfaceInfo)

Main routine to process the SCSI command located in the Command Block Wrapper read from the host. This dispatches to the appropriate SCSI command handling routine if the issued command is supported by the device, else it returns a command failure due to a ILLEGAL REQUEST.

Parameters
[in]MSInterfaceInfoPointer to the Mass Storage class interface structure that the command is associated with
Returns
Boolean true if the command completed successfully, false otherwise