VLSI Solution Oy / MegaLib Documentation

scsi.h File Reference

Common SCSI definitions. More...

Go to the source code of this file.

Data Structures

struct  scsicdb6variant1
struct  scsicdb6variant2
struct  scsicdb6variant3
struct  scsicdb10variant1
struct  scsicdb10variant2

Defines

#define OPERATION_CODE   0
#define SCSI_INQUIRY   0x12
#define SCSI_FORMAT_UNIT   0x04
#define SCSI_READ_6   0x08
#define SCSI_READ_10   0x28
#define SCSI_READ_12   0xa8
#define ATAPI_READ_FORMAT_CAPACITIES   0x23
#define SCSI_READ_CAPACITY_10   0x25
#define SCSI_READ_CAPACITY_16   0x9e
#define SCSI_READ_CAPACITY_16_2   0x10
#define SCSI_RECEIVE_DIAGNOSTIC_RESULTS   0x1c
#define SCSI_REPORT_LUNS   0xA0
#define SCSI_REQUEST_SENSE   0x03
#define SCSI_SEND_DIAGNOSTIC   0x1d
#define SCSI_TEST_UNIT_READY   0x00
#define SCSI_WRITE_6   0x0a
#define SCSI_WRITE_10   0x2a
#define SCSI_WRITE_12   0xaa
#define SCSI_MODE_SENSE_6   0x1a
#define SCSI_MODE_SENSE_10   0x5a
#define SCSI_SYNCHRONIZE_CACHE   0x35
#define SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL   0x1e
#define SCSI_VERIFY   0x2f
#define SCSI_START_STOP_UNIT   0x1b
#define SCSI_MODE_SELECT   0x15
#define SK_NO_SENSE   0
#define SK_RECOVERED_ERROR   1
#define SK_NOT_READY   2
#define SK_MEDIUM_ERROR   3
#define SK_HARDWARE_ERROR   4
#define SK_ILLEGAL_REQUEST   5
#define SK_UNIT_ATTENTION   6
#define SK_DATA_PROTECT   7
#define SK_BLANK_CHECK   8
#define SK_VENDOR_SPECIFIC   9
#define SK_COPY_ABORTED   10
#define SK_ABORTED_COMMAND   11
#define SK_EQUAL   12
#define SK_VOLUME_OVERFLOW   13
#define SK_MISCOMPARE   14

Typedefs

typedef scsicdb6variant1 ScsiInquiryCdb
typedef scsicdb6variant2 ScsiModeSense6Cdb
typedef scsicdb6variant3 ScsiRequestSenseCdb
typedef scsicdb10variant1 ScsiRead10Cdb
typedef scsicdb10variant2 ScsiWrite10Cdb

Enumerations

enum  SCSIStageEnum {
  SCSI_UNINITIALIZED = -1, SCSI_READY_FOR_COMMAND = 0, SCSI_DATA_TO_HOST, SCSI_TRANSMITTING,
  SCSI_DATA_FROM_HOST, SCSI_SEND_STATUS, SCSI_INVALID_CBW
}
enum  SCSIStatusEnum { SCSI_OK = 0, SCSI_REQUEST_ERROR = 1, SCSI_PHASE_ERROR = 2 }

Functions

void ScsiTaskHandler (void)
void RealScsiTaskHandler (void)
void DiskProtocolCommand (u_int16 *cmd)
void ScsiReset ()
void DiskDataReceived (int length, u_int16 *datablock)
enum SCSIStageEnum ScsiState (void)
u_int16 ScsiOrBlock (register __i0 u_int16 *buffer, register __a0 s_int16 size)


Detailed Description

Common SCSI definitions.

Definition in file scsi.h.


Define Documentation

#define ATAPI_READ_FORMAT_CAPACITIES   0x23
 

Definition at line 88 of file scsi.h.

#define OPERATION_CODE   0
 

Definition at line 79 of file scsi.h.

#define SCSI_FORMAT_UNIT   0x04
 

Definition at line 84 of file scsi.h.

#define SCSI_INQUIRY   0x12
 

Definition at line 83 of file scsi.h.

#define SCSI_MODE_SELECT   0x15
 

Definition at line 106 of file scsi.h.

#define SCSI_MODE_SENSE_10   0x5a
 

Definition at line 101 of file scsi.h.

#define SCSI_MODE_SENSE_6   0x1a
 

Definition at line 100 of file scsi.h.

#define SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL   0x1e
 

Definition at line 103 of file scsi.h.

#define SCSI_READ_10   0x28
 

Definition at line 86 of file scsi.h.

#define SCSI_READ_12   0xa8
 

Definition at line 87 of file scsi.h.

#define SCSI_READ_6   0x08
 

Definition at line 85 of file scsi.h.

#define SCSI_READ_CAPACITY_10   0x25
 

Definition at line 89 of file scsi.h.

#define SCSI_READ_CAPACITY_16   0x9e
 

Definition at line 90 of file scsi.h.

#define SCSI_READ_CAPACITY_16_2   0x10
 

Definition at line 91 of file scsi.h.

#define SCSI_RECEIVE_DIAGNOSTIC_RESULTS   0x1c
 

Definition at line 92 of file scsi.h.

#define SCSI_REPORT_LUNS   0xA0
 

Definition at line 93 of file scsi.h.

#define SCSI_REQUEST_SENSE   0x03
 

Definition at line 94 of file scsi.h.

#define SCSI_SEND_DIAGNOSTIC   0x1d
 

Definition at line 95 of file scsi.h.

#define SCSI_START_STOP_UNIT   0x1b
 

Definition at line 105 of file scsi.h.

#define SCSI_SYNCHRONIZE_CACHE   0x35
 

Definition at line 102 of file scsi.h.

#define SCSI_TEST_UNIT_READY   0x00
 

Definition at line 96 of file scsi.h.

#define SCSI_VERIFY   0x2f
 

Definition at line 104 of file scsi.h.

#define SCSI_WRITE_10   0x2a
 

Definition at line 98 of file scsi.h.

#define SCSI_WRITE_12   0xaa
 

Definition at line 99 of file scsi.h.

#define SCSI_WRITE_6   0x0a
 

Definition at line 97 of file scsi.h.

#define SK_ABORTED_COMMAND   11
 

Definition at line 120 of file scsi.h.

#define SK_BLANK_CHECK   8
 

Definition at line 117 of file scsi.h.

#define SK_COPY_ABORTED   10
 

Definition at line 119 of file scsi.h.

#define SK_DATA_PROTECT   7
 

Definition at line 116 of file scsi.h.

#define SK_EQUAL   12
 

Definition at line 121 of file scsi.h.

#define SK_HARDWARE_ERROR   4
 

Definition at line 113 of file scsi.h.

#define SK_ILLEGAL_REQUEST   5
 

Definition at line 114 of file scsi.h.

#define SK_MEDIUM_ERROR   3
 

Definition at line 112 of file scsi.h.

#define SK_MISCOMPARE   14
 

Definition at line 123 of file scsi.h.

#define SK_NO_SENSE   0
 

Definition at line 109 of file scsi.h.

#define SK_NOT_READY   2
 

Definition at line 111 of file scsi.h.

#define SK_RECOVERED_ERROR   1
 

Definition at line 110 of file scsi.h.

#define SK_UNIT_ATTENTION   6
 

Definition at line 115 of file scsi.h.

#define SK_VENDOR_SPECIFIC   9
 

Definition at line 118 of file scsi.h.

#define SK_VOLUME_OVERFLOW   13
 

Definition at line 122 of file scsi.h.


Typedef Documentation

typedef struct scsicdb6variant1 ScsiInquiryCdb
 

typedef struct scsicdb6variant2 ScsiModeSense6Cdb
 

typedef struct scsicdb10variant1 ScsiRead10Cdb
 

typedef struct scsicdb6variant3 ScsiRequestSenseCdb
 

typedef struct scsicdb10variant2 ScsiWrite10Cdb
 


Enumeration Type Documentation

enum SCSIStageEnum
 

Enumerator:
SCSI_UNINITIALIZED 
SCSI_READY_FOR_COMMAND 
SCSI_DATA_TO_HOST 
SCSI_TRANSMITTING 
SCSI_DATA_FROM_HOST 
SCSI_SEND_STATUS 
SCSI_INVALID_CBW 

Definition at line 6 of file scsi.h.

enum SCSIStatusEnum
 

Enumerator:
SCSI_OK 
SCSI_REQUEST_ERROR 
SCSI_PHASE_ERROR 

Definition at line 16 of file scsi.h.

00016              {
00017   SCSI_OK = 0,
00018   SCSI_REQUEST_ERROR = 1,
00019   SCSI_PHASE_ERROR = 2
00020 } SCSIStatusEnum;


Function Documentation

void DiskDataReceived int  length,
u_int16 datablock
 

Process data from host.

void DiskProtocolCommand u_int16 cmd  ) 
 

Process a SCSI command block.

void RealScsiTaskHandler void   ) 
 

RealScsiTaskHandler

u_int16 ScsiOrBlock register __i0 u_int16 buffer,
register __a0 s_int16  size
 

void ScsiReset  ) 
 

Reset SCSI state.

enum SCSIStageEnum ScsiState void   ) 
 

void ScsiTaskHandler void   ) 
 

Handle any pending SCSI operation.

ScsiTaskHandler


All software copyright 2005-2006 VLSI Solution OY. Redistribution of this software is strictly forbidden.