SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations
scsi.h File Reference
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
Include dependency graph for scsi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  scsi_cmd
 
struct  scsi_plat
 struct scsi_plat - stores information about SCSI controller More...
 

Macros

#define SCSI_MAX_DEVICE   (128)
 
#define M_COMPLETE   (0x00)
 
#define M_EXTENDED   (0x01)
 
#define M_SAVE_DP   (0x02)
 
#define M_RESTORE_DP   (0x03)
 
#define M_DISCONNECT   (0x04)
 
#define M_ID_ERROR   (0x05)
 
#define M_ABORT   (0x06)
 
#define M_REJECT   (0x07)
 
#define M_NOOP   (0x08)
 
#define M_PARITY   (0x09)
 
#define M_LCOMPLETE   (0x0a)
 
#define M_FCOMPLETE   (0x0b)
 
#define M_RESET   (0x0c)
 
#define M_ABORT_TAG   (0x0d)
 
#define M_CLEAR_QUEUE   (0x0e)
 
#define M_INIT_REC   (0x0f)
 
#define M_REL_REC   (0x10)
 
#define M_TERMINATE   (0x11)
 
#define M_SIMPLE_TAG   (0x20)
 
#define M_HEAD_TAG   (0x21)
 
#define M_ORDERED_TAG   (0x22)
 
#define M_IGN_RESIDUE   (0x23)
 
#define M_IDENTIFY   (0x80)
 
#define M_X_MODIFY_DP   (0x00)
 
#define M_X_SYNC_REQ   (0x01)
 
#define M_X_WIDE_REQ   (0x03)
 
#define M_X_PPR_REQ   (0x04)
 
#define S_GOOD   (0x00)
 
#define S_CHECK_COND   (0x02)
 
#define S_COND_MET   (0x04)
 
#define S_BUSY   (0x08)
 
#define S_INT   (0x10)
 
#define S_INT_COND_MET   (0x14)
 
#define S_CONFLICT   (0x18)
 
#define S_TERMINATED   (0x20)
 
#define S_QUEUE_FULL   (0x28)
 
#define S_ILLEGAL   (0xff)
 
#define S_SENSE   (0x80)
 
#define SENSE_NO_SENSE   0x0
 
#define SENSE_RECOVERED_ERROR   0x1
 
#define SENSE_NOT_READY   0x2
 
#define SENSE_MEDIUM_ERROR   0x3
 
#define SENSE_HARDWARE_ERROR   0x4
 
#define SENSE_ILLEGAL_REQUEST   0x5
 
#define SENSE_UNIT_ATTENTION   0x6
 
#define SENSE_DATA_PROTECT   0x7
 
#define SENSE_BLANK_CHECK   0x8
 
#define SENSE_VENDOR_SPECIFIC   0x9
 
#define SENSE_COPY_ABORTED   0xA
 
#define SENSE_ABORTED_COMMAND   0xB
 
#define SENSE_VOLUME_OVERFLOW   0xD
 
#define SENSE_MISCOMPARE   0xE
 
#define SCSI_CHANGE_DEF   0x40 /* Change Definition (Optional) */
 
#define SCSI_COMPARE   0x39 /* Compare (O) */
 
#define SCSI_COPY   0x18 /* Copy (O) */
 
#define SCSI_COP_VERIFY   0x3A /* Copy and Verify (O) */
 
#define SCSI_INQUIRY   0x12 /* Inquiry (MANDATORY) */
 
#define SCSI_LOG_SELECT   0x4C /* Log Select (O) */
 
#define SCSI_LOG_SENSE   0x4D /* Log Sense (O) */
 
#define SCSI_MODE_SEL6   0x15 /* Mode Select 6-byte (Device Specific) */
 
#define SCSI_MODE_SEL10   0x55 /* Mode Select 10-byte (Device Specific) */
 
#define SCSI_MODE_SEN6   0x1A /* Mode Sense 6-byte (Device Specific) */
 
#define SCSI_MODE_SEN10   0x5A /* Mode Sense 10-byte (Device Specific) */
 
#define SCSI_READ_BUFF   0x3C /* Read Buffer (O) */
 
#define SCSI_REQ_SENSE   0x03 /* Request Sense (MANDATORY) */
 
#define SCSI_START_STOP   0x1b /*start stop unit command */
 
#define SCSI_SEND_DIAG   0x1D /* Send Diagnostic (O) */
 
#define SCSI_TST_U_RDY   0x00 /* Test Unit Ready (MANDATORY) */
 
#define SCSI_WRITE_BUFF   0x3B /* Write Buffer (O) */
 
#define SCSI_COMPARE   0x39 /* Compare (O) */
 
#define SCSI_FORMAT   0x04 /* Format Unit (MANDATORY) */
 
#define SCSI_LCK_UN_CAC   0x36 /* Lock Unlock Cache (O) */
 
#define SCSI_PREFETCH   0x34 /* Prefetch (O) */
 
#define SCSI_MED_REMOVL   0x1E /* Prevent/Allow medium Removal (O) */
 
#define SCSI_READ6   0x08 /* Read 6-byte (MANDATORY) */
 
#define SCSI_READ10   0x28 /* Read 10-byte (MANDATORY) */
 
#define SCSI_READ16   0x48
 
#define SCSI_RD_CAPAC   0x25 /* Read Capacity (MANDATORY) */
 
#define SCSI_RD_CAPAC10   SCSI_RD_CAPAC /* Read Capacity (10) */
 
#define SCSI_RD_CAPAC16   0x9e /* Read Capacity (16) */
 
#define SCSI_RD_DEFECT   0x37 /* Read Defect Data (O) */
 
#define SCSI_READ_LONG   0x3E /* Read Long (O) */
 
#define SCSI_REASS_BLK   0x07 /* Reassign Blocks (O) */
 
#define SCSI_RCV_DIAG   0x1C /* Receive Diagnostic Results (O) */
 
#define SCSI_RELEASE   0x17 /* Release Unit (MANDATORY) */
 
#define SCSI_REZERO   0x01 /* Rezero Unit (O) */
 
#define SCSI_SRCH_DAT_E   0x31 /* Search Data Equal (O) */
 
#define SCSI_SRCH_DAT_H   0x30 /* Search Data High (O) */
 
#define SCSI_SRCH_DAT_L   0x32 /* Search Data Low (O) */
 
#define SCSI_SEEK6   0x0B /* Seek 6-Byte (O) */
 
#define SCSI_SEEK10   0x2B /* Seek 10-Byte (O) */
 
#define SCSI_SEND_DIAG   0x1D /* Send Diagnostics (MANDATORY) */
 
#define SCSI_SET_LIMIT   0x33 /* Set Limits (O) */
 
#define SCSI_START_STP   0x1B /* Start/Stop Unit (O) */
 
#define SCSI_SYNC_CACHE   0x35 /* Synchronize Cache (O) */
 
#define SCSI_VERIFY   0x2F /* Verify (O) */
 
#define SCSI_WRITE6   0x0A /* Write 6-Byte (MANDATORY) */
 
#define SCSI_WRITE10   0x2A /* Write 10-Byte (MANDATORY) */
 
#define SCSI_WRT_VERIFY   0x2E /* Write and Verify (O) */
 
#define SCSI_WRITE_LONG   0x3F /* Write Long (O) */
 
#define SCSI_WRITE_SAME   0x41 /* Write Same (O) */
 
#define SCSI_IDENTIFY   0xC0 /* not used */
 
#define SCSI_SEL_TIME_OUT   0x00000101 /* Selection time out */
 
#define SCSI_HNS_TIME_OUT   0x00000102 /* Handshake */
 
#define SCSI_MA_TIME_OUT   0x00000103 /* Phase error */
 
#define SCSI_UNEXP_DIS   0x00000104 /* unexpected disconnect */
 
#define SCSI_INT_STATE   0x00010000 /* unknown Interrupt number is stored in 16 LSB */
 

Typedefs

typedef struct scsi_cmd scsi_cmd_t
 
typedef struct scsi_plat scsi_plat_t
 struct scsi_plat - stores information about SCSI controller
 

Enumerations

enum  dma_data_direction { DMA_BIDIRECTIONAL = 0 , DMA_TO_DEVICE = 1 , DMA_FROM_DEVICE = 2 , DMA_NONE = 3 }
 

Macro Definition Documentation

◆ M_ABORT

#define M_ABORT   (0x06)

◆ M_ABORT_TAG

#define M_ABORT_TAG   (0x0d)

◆ M_CLEAR_QUEUE

#define M_CLEAR_QUEUE   (0x0e)

◆ M_COMPLETE

#define M_COMPLETE   (0x00)

◆ M_DISCONNECT

#define M_DISCONNECT   (0x04)

◆ M_EXTENDED

#define M_EXTENDED   (0x01)

◆ M_FCOMPLETE

#define M_FCOMPLETE   (0x0b)

◆ M_HEAD_TAG

#define M_HEAD_TAG   (0x21)

◆ M_ID_ERROR

#define M_ID_ERROR   (0x05)

◆ M_IDENTIFY

#define M_IDENTIFY   (0x80)

◆ M_IGN_RESIDUE

#define M_IGN_RESIDUE   (0x23)

◆ M_INIT_REC

#define M_INIT_REC   (0x0f)

◆ M_LCOMPLETE

#define M_LCOMPLETE   (0x0a)

◆ M_NOOP

#define M_NOOP   (0x08)

◆ M_ORDERED_TAG

#define M_ORDERED_TAG   (0x22)

◆ M_PARITY

#define M_PARITY   (0x09)

◆ M_REJECT

#define M_REJECT   (0x07)

◆ M_REL_REC

#define M_REL_REC   (0x10)

◆ M_RESET

#define M_RESET   (0x0c)

◆ M_RESTORE_DP

#define M_RESTORE_DP   (0x03)

◆ M_SAVE_DP

#define M_SAVE_DP   (0x02)

◆ M_SIMPLE_TAG

#define M_SIMPLE_TAG   (0x20)

◆ M_TERMINATE

#define M_TERMINATE   (0x11)

◆ M_X_MODIFY_DP

#define M_X_MODIFY_DP   (0x00)

◆ M_X_PPR_REQ

#define M_X_PPR_REQ   (0x04)

◆ M_X_SYNC_REQ

#define M_X_SYNC_REQ   (0x01)

◆ M_X_WIDE_REQ

#define M_X_WIDE_REQ   (0x03)

◆ S_BUSY

#define S_BUSY   (0x08)

◆ S_CHECK_COND

#define S_CHECK_COND   (0x02)

◆ S_COND_MET

#define S_COND_MET   (0x04)

◆ S_CONFLICT

#define S_CONFLICT   (0x18)

◆ S_GOOD

#define S_GOOD   (0x00)

◆ S_ILLEGAL

#define S_ILLEGAL   (0xff)

◆ S_INT

#define S_INT   (0x10)

◆ S_INT_COND_MET

#define S_INT_COND_MET   (0x14)

◆ S_QUEUE_FULL

#define S_QUEUE_FULL   (0x28)

◆ S_SENSE

#define S_SENSE   (0x80)

◆ S_TERMINATED

#define S_TERMINATED   (0x20)

◆ SCSI_CHANGE_DEF

#define SCSI_CHANGE_DEF   0x40 /* Change Definition (Optional) */

◆ SCSI_COMPARE [1/2]

#define SCSI_COMPARE   0x39 /* Compare (O) */

◆ SCSI_COMPARE [2/2]

#define SCSI_COMPARE   0x39 /* Compare (O) */

◆ SCSI_COP_VERIFY

#define SCSI_COP_VERIFY   0x3A /* Copy and Verify (O) */

◆ SCSI_COPY

#define SCSI_COPY   0x18 /* Copy (O) */

◆ SCSI_FORMAT

#define SCSI_FORMAT   0x04 /* Format Unit (MANDATORY) */

◆ SCSI_HNS_TIME_OUT

#define SCSI_HNS_TIME_OUT   0x00000102 /* Handshake */

◆ SCSI_IDENTIFY

#define SCSI_IDENTIFY   0xC0 /* not used */

◆ SCSI_INQUIRY

#define SCSI_INQUIRY   0x12 /* Inquiry (MANDATORY) */

◆ SCSI_INT_STATE

#define SCSI_INT_STATE   0x00010000 /* unknown Interrupt number is stored in 16 LSB */

◆ SCSI_LCK_UN_CAC

#define SCSI_LCK_UN_CAC   0x36 /* Lock Unlock Cache (O) */

◆ SCSI_LOG_SELECT

#define SCSI_LOG_SELECT   0x4C /* Log Select (O) */

◆ SCSI_LOG_SENSE

#define SCSI_LOG_SENSE   0x4D /* Log Sense (O) */

◆ SCSI_MA_TIME_OUT

#define SCSI_MA_TIME_OUT   0x00000103 /* Phase error */

◆ SCSI_MAX_DEVICE

#define SCSI_MAX_DEVICE   (128)

◆ SCSI_MED_REMOVL

#define SCSI_MED_REMOVL   0x1E /* Prevent/Allow medium Removal (O) */

◆ SCSI_MODE_SEL10

#define SCSI_MODE_SEL10   0x55 /* Mode Select 10-byte (Device Specific) */

◆ SCSI_MODE_SEL6

#define SCSI_MODE_SEL6   0x15 /* Mode Select 6-byte (Device Specific) */

◆ SCSI_MODE_SEN10

#define SCSI_MODE_SEN10   0x5A /* Mode Sense 10-byte (Device Specific) */

◆ SCSI_MODE_SEN6

#define SCSI_MODE_SEN6   0x1A /* Mode Sense 6-byte (Device Specific) */

◆ SCSI_PREFETCH

#define SCSI_PREFETCH   0x34 /* Prefetch (O) */

◆ SCSI_RCV_DIAG

#define SCSI_RCV_DIAG   0x1C /* Receive Diagnostic Results (O) */

◆ SCSI_RD_CAPAC

#define SCSI_RD_CAPAC   0x25 /* Read Capacity (MANDATORY) */

◆ SCSI_RD_CAPAC10

#define SCSI_RD_CAPAC10   SCSI_RD_CAPAC /* Read Capacity (10) */

◆ SCSI_RD_CAPAC16

#define SCSI_RD_CAPAC16   0x9e /* Read Capacity (16) */

◆ SCSI_RD_DEFECT

#define SCSI_RD_DEFECT   0x37 /* Read Defect Data (O) */

◆ SCSI_READ10

#define SCSI_READ10   0x28 /* Read 10-byte (MANDATORY) */

◆ SCSI_READ16

#define SCSI_READ16   0x48

◆ SCSI_READ6

#define SCSI_READ6   0x08 /* Read 6-byte (MANDATORY) */

◆ SCSI_READ_BUFF

#define SCSI_READ_BUFF   0x3C /* Read Buffer (O) */

◆ SCSI_READ_LONG

#define SCSI_READ_LONG   0x3E /* Read Long (O) */

◆ SCSI_REASS_BLK

#define SCSI_REASS_BLK   0x07 /* Reassign Blocks (O) */

◆ SCSI_RELEASE

#define SCSI_RELEASE   0x17 /* Release Unit (MANDATORY) */

◆ SCSI_REQ_SENSE

#define SCSI_REQ_SENSE   0x03 /* Request Sense (MANDATORY) */

◆ SCSI_REZERO

#define SCSI_REZERO   0x01 /* Rezero Unit (O) */

◆ SCSI_SEEK10

#define SCSI_SEEK10   0x2B /* Seek 10-Byte (O) */

◆ SCSI_SEEK6

#define SCSI_SEEK6   0x0B /* Seek 6-Byte (O) */

◆ SCSI_SEL_TIME_OUT

#define SCSI_SEL_TIME_OUT   0x00000101 /* Selection time out */

◆ SCSI_SEND_DIAG [1/2]

#define SCSI_SEND_DIAG   0x1D /* Send Diagnostic (O) */

◆ SCSI_SEND_DIAG [2/2]

#define SCSI_SEND_DIAG   0x1D /* Send Diagnostics (MANDATORY) */

◆ SCSI_SET_LIMIT

#define SCSI_SET_LIMIT   0x33 /* Set Limits (O) */

◆ SCSI_SRCH_DAT_E

#define SCSI_SRCH_DAT_E   0x31 /* Search Data Equal (O) */

◆ SCSI_SRCH_DAT_H

#define SCSI_SRCH_DAT_H   0x30 /* Search Data High (O) */

◆ SCSI_SRCH_DAT_L

#define SCSI_SRCH_DAT_L   0x32 /* Search Data Low (O) */

◆ SCSI_START_STOP

#define SCSI_START_STOP   0x1b /*start stop unit command */

◆ SCSI_START_STP

#define SCSI_START_STP   0x1B /* Start/Stop Unit (O) */

◆ SCSI_SYNC_CACHE

#define SCSI_SYNC_CACHE   0x35 /* Synchronize Cache (O) */

◆ SCSI_TST_U_RDY

#define SCSI_TST_U_RDY   0x00 /* Test Unit Ready (MANDATORY) */

◆ SCSI_UNEXP_DIS

#define SCSI_UNEXP_DIS   0x00000104 /* unexpected disconnect */

◆ SCSI_VERIFY

#define SCSI_VERIFY   0x2F /* Verify (O) */

◆ SCSI_WRITE10

#define SCSI_WRITE10   0x2A /* Write 10-Byte (MANDATORY) */

◆ SCSI_WRITE6

#define SCSI_WRITE6   0x0A /* Write 6-Byte (MANDATORY) */

◆ SCSI_WRITE_BUFF

#define SCSI_WRITE_BUFF   0x3B /* Write Buffer (O) */

◆ SCSI_WRITE_LONG

#define SCSI_WRITE_LONG   0x3F /* Write Long (O) */

◆ SCSI_WRITE_SAME

#define SCSI_WRITE_SAME   0x41 /* Write Same (O) */

◆ SCSI_WRT_VERIFY

#define SCSI_WRT_VERIFY   0x2E /* Write and Verify (O) */

◆ SENSE_ABORTED_COMMAND

#define SENSE_ABORTED_COMMAND   0xB

◆ SENSE_BLANK_CHECK

#define SENSE_BLANK_CHECK   0x8

◆ SENSE_COPY_ABORTED

#define SENSE_COPY_ABORTED   0xA

◆ SENSE_DATA_PROTECT

#define SENSE_DATA_PROTECT   0x7

◆ SENSE_HARDWARE_ERROR

#define SENSE_HARDWARE_ERROR   0x4

◆ SENSE_ILLEGAL_REQUEST

#define SENSE_ILLEGAL_REQUEST   0x5

◆ SENSE_MEDIUM_ERROR

#define SENSE_MEDIUM_ERROR   0x3

◆ SENSE_MISCOMPARE

#define SENSE_MISCOMPARE   0xE

◆ SENSE_NO_SENSE

#define SENSE_NO_SENSE   0x0

◆ SENSE_NOT_READY

#define SENSE_NOT_READY   0x2

◆ SENSE_RECOVERED_ERROR

#define SENSE_RECOVERED_ERROR   0x1

◆ SENSE_UNIT_ATTENTION

#define SENSE_UNIT_ATTENTION   0x6

◆ SENSE_VENDOR_SPECIFIC

#define SENSE_VENDOR_SPECIFIC   0x9

◆ SENSE_VOLUME_OVERFLOW

#define SENSE_VOLUME_OVERFLOW   0xD

Typedef Documentation

◆ scsi_cmd_t

typedef struct scsi_cmd scsi_cmd_t

◆ scsi_plat_t

typedef struct scsi_plat scsi_plat_t

struct scsi_plat - stores information about SCSI controller

@base: Controller base address @max_lun: Maximum number of logical units @max_id: Maximum number of target ids @max_bytes_per_req: Maximum number of bytes per read/write request

Enumeration Type Documentation

◆ dma_data_direction

Enumerator
DMA_BIDIRECTIONAL 
DMA_TO_DEVICE 
DMA_FROM_DEVICE 
DMA_NONE