LUFA Library - Mass Storage Class Bootloader
|
#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 |
Header file for SCSI.c.
#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 | |||
) |
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.
[in] | Key | New SCSI sense key to set the sense code to |
[in] | Acode | New SCSI additional sense key to set the additional sense code to |
[in] | Aqual | New SCSI additional sense key qualifier to set the additional sense qualifier code to |
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.
[in] | MSInterfaceInfo | Pointer to the Mass Storage class interface structure that the command is associated with |
true
if the command completed successfully, false
otherwise