LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SCSI.c File Reference
#include "SCSI.h"

Go to the source code of this file.

Macros

#define INCLUDE_FROM_SCSI_C
 

Functions

bool SCSI_DecodeSCSICommand (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo)
 SCSI Command processing function.
 
static bool SCSI_Command_Inquiry (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo)
 
static bool SCSI_Command_Request_Sense (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo)
 
static bool SCSI_Command_Read_Capacity_10 (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo)
 
static bool SCSI_Command_Send_Diagnostic (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo)
 
static bool SCSI_Command_ReadWrite_10 (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo, const bool IsDataRead)
 
static bool SCSI_Command_ModeSense_6 (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo)
 

Variables

static const
SCSI_Inquiry_Response_t 
InquiryData
 
static
SCSI_Request_Sense_Response_t 
SenseData
 

Macro Definition Documentation

#define INCLUDE_FROM_SCSI_C

Definition at line 33 of file SCSI.c.

Function Documentation

static bool SCSI_Command_Inquiry ( USB_ClassInfo_MS_Device_t *const  MSInterfaceInfo)
static

Command processing for an issued SCSI INQUIRY command. This command returns information about the device's features and capabilities to the host.

Definition at line 158 of file SCSI.c.

static bool SCSI_Command_ModeSense_6 ( USB_ClassInfo_MS_Device_t *const  MSInterfaceInfo)
static

Command processing for an issued SCSI MODE SENSE (6) command. This command returns various informational pages about the SCSI device, as well as the device's Write Protect status.

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.

Definition at line 347 of file SCSI.c.

static bool SCSI_Command_Read_Capacity_10 ( USB_ClassInfo_MS_Device_t *const  MSInterfaceInfo)
static

Command processing for an issued SCSI READ CAPACITY (10) command. This command returns information about the device's capacity on the selected Logical Unit (drive), as a number of OS-sized blocks.

Under development, not working yet.

Definition at line 209 of file SCSI.c.

static bool SCSI_Command_ReadWrite_10 ( USB_ClassInfo_MS_Device_t *const  MSInterfaceInfo,
const bool  IsDataRead 
)
static

Command processing for an issued SCSI READ (10) or WRITE (10) command. This command reads in the block start address and total number of blocks to process, then calls the appropriate low-level Dataflash routine to handle the actual reading and writing of the data.

Under development, not working yet.

Under development, not working yet.

Definition at line 254 of file SCSI.c.

static bool SCSI_Command_Request_Sense ( USB_ClassInfo_MS_Device_t *const  MSInterfaceInfo)
static

Command processing for an issued SCSI REQUEST SENSE command. This command returns information about the last issued command, including the error code and additional error information so that the host can determine why a command failed to complete.

Definition at line 191 of file SCSI.c.

static bool SCSI_Command_Send_Diagnostic ( USB_ClassInfo_MS_Device_t *const  MSInterfaceInfo)
static

Command processing for an issued SCSI SEND DIAGNOSTIC command. This command performs a quick check of the Dataflash ICs on the board, and indicates if they are present and functioning correctly. Only the Self-Test portion of the diagnostic command is supported.

Definition at line 233 of file SCSI.c.

Variable Documentation

const SCSI_Inquiry_Response_t InquiryData
static
Initial value:
= {
.DeviceType = DEVICE_TYPE_BLOCK,
.PeripheralQualifier = 0,
.Removable = true,
.Version = 0,
.ResponseDataFormat = 2,
.NormACA = false,
.TrmTsk = false,
.AERC = false,
.AdditionalLength = 0x1F,
.SoftReset = false,
.CmdQue = false,
.Linked = false,
.Sync = false,
.WideBus16Bit = false,
.WideBus32Bit = false,
.RelAddr = false,
.VendorID = "NXP",
.ProductID = "Dataflash Disk",
.RevisionID = {'0', '.', '0', '0'},
}

Structure to hold the SCSI response data to a SCSI INQUIRY command. This gives information about the device's features and capabilities.

Definition at line 39 of file SCSI.c.

Initial value:
= {
.ResponseCode = 0x70,
.AdditionalLength = 0x0A,
}

Structure to hold the sense data for the last issued SCSI command, which is returned to the host after a SCSI REQUEST SENSE command is issued. This gives information on exactly why the last command failed to complete.

Definition at line 70 of file SCSI.c.