FreeBSD kernel CAM code
scsi_sg.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sg_io_hdr
 
struct  sg_io_hdr32
 
struct  sg_header
 
struct  sg_scsi_id
 
struct  scsi_idlun
 

Macros

#define SGIOC   '"'
 
#define SG_SET_TIMEOUT   _IOW(SGIOC, 0x01, u_int)
 
#define SG_GET_TIMEOUT   _IO(SGIOC, 0x02)
 
#define SG_EMULATED_HOST   _IOR(SGIOC, 0x03, int)
 
#define SG_SET_TRANSFORM   _IO(SGIOC, 0x04)
 
#define SG_GET_TRANSFORM   _IO(SGIOC, 0x05)
 
#define SG_GET_COMMAND_Q   _IOW(SGIOC, 0x70, int)
 
#define SG_SET_COMMAND_Q   _IOR(SGIOC, 0x71, int)
 
#define SG_GET_RESERVED_SIZE   _IOR(SGIOC, 0x72, int)
 
#define SG_SET_RESERVED_SIZE   _IOW(SGIOC, 0x75, int)
 
#define SG_GET_SCSI_ID   _IOR(SGIOC, 0x76, struct sg_scsi_id)
 
#define SG_SET_FORCE_LOW_DMA   _IOW(SGIOC, 0x79, int)
 
#define SG_GET_LOW_DMA   _IOR(SGIOC, 0x7a, int)
 
#define SG_SET_FORCE_PACK_ID   _IOW(SGIOC, 0x7b, int)
 
#define SG_GET_PACK_ID   _IOR(SGIOC, 0x7c, int)
 
#define SG_GET_NUM_WAITING   _IOR(SGIOC, 0x7d, int)
 
#define SG_SET_DEBUG   _IOW(SGIOC, 0x7e, int)
 
#define SG_GET_SG_TABLESIZE   _IOR(SGIOC, 0x7f, int)
 
#define SG_GET_VERSION_NUM   _IOR(SGIOC, 0x82, int)
 
#define SG_NEXT_CMD_LEN   _IOW(SGIOC, 0x83, int)
 
#define SG_SCSI_RESET   _IOW(SGIOC, 0x84, int)
 
#define SG_IO   _IOWR(SGIOC, 0x85, struct sg_io_hdr)
 
#define SG_GET_REQUEST_TABLE   _IO(SGIOC, 0x86)
 
#define SG_SET_KEEP_ORPHAN   _IOW(SGIOC, 0x87, int)
 
#define SG_GET_KEEP_ORPHAN   _IOR(SGIOC, 0x88, int)
 
#define SG_GET_ACCESS_COUNT   _IOR(SGIOC, 0x89, int)
 
#define SG_DXFER_NONE   -1
 
#define SG_DXFER_TO_DEV   -2
 
#define SG_DXFER_FROM_DEV   -3
 
#define SG_DXFER_TO_FROM_DEV   -4
 
#define SG_DXFER_UNKNOWN   -5
 
#define SG_MAX_SENSE   16
 
#define DID_OK   0x00 /* OK */
 
#define DID_NO_CONNECT   0x01 /* timeout during connect */
 
#define DID_BUS_BUSY   0x02 /* timeout during command */
 
#define DID_TIME_OUT   0x03 /* other timeout */
 
#define DID_BAD_TARGET   0x04 /* bad target */
 
#define DID_ABORT   0x05 /* abort */
 
#define DID_PARITY   0x06 /* parity error */
 
#define DID_ERROR   0x07 /* internal error */
 
#define DID_RESET   0x08 /* reset by somebody */
 
#define DID_BAD_INTR   0x09 /* unexpected interrupt */
 
#define DID_PASSTHROUGH   0x0a /* passthrough */
 
#define DID_SOFT_ERROR   0x0b /* low driver wants retry */
 
#define DID_IMM_RETRY   0x0c /* retry without decreasing retrycnt */
 
#define DRIVER_OK   0x00
 
#define DRIVER_BUSY   0x01
 
#define DRIVER_SOFT   0x02
 
#define DRIVER_MEDIA   0x03
 
#define DRIVER_ERROR   0x04
 
#define DRIVER_INVALID   0x05
 
#define DRIVER_TIMEOUT   0x06
 
#define DRIVER_HARD   0x07
 
#define DRIVER_SENSE   0x08
 
#define SUGGEST_RETRY   0x10
 
#define SUGGEST_ABORT   0x20
 
#define SUGGEST_REMAP   0x30
 
#define SUGGEST_DIE   0x40
 
#define SUGGEST_SENSE   0x80
 
#define SUGGEST_IS_OK   0xff
 
#define DRIVER_MASK   0x0f
 
#define SUGGEST_MASK   0xf0
 
#define SG_DEFAULT_HZ   1000
 
#define SG_DEFAULT_TIMEOUT   (60*SG_DEFAULT_HZ)
 

Macro Definition Documentation

◆ DID_ABORT

#define DID_ABORT   0x05 /* abort */

Definition at line 131 of file scsi_sg.h.

◆ DID_BAD_INTR

#define DID_BAD_INTR   0x09 /* unexpected interrupt */

Definition at line 135 of file scsi_sg.h.

◆ DID_BAD_TARGET

#define DID_BAD_TARGET   0x04 /* bad target */

Definition at line 130 of file scsi_sg.h.

◆ DID_BUS_BUSY

#define DID_BUS_BUSY   0x02 /* timeout during command */

Definition at line 128 of file scsi_sg.h.

◆ DID_ERROR

#define DID_ERROR   0x07 /* internal error */

Definition at line 133 of file scsi_sg.h.

◆ DID_IMM_RETRY

#define DID_IMM_RETRY   0x0c /* retry without decreasing retrycnt */

Definition at line 138 of file scsi_sg.h.

◆ DID_NO_CONNECT

#define DID_NO_CONNECT   0x01 /* timeout during connect */

Definition at line 127 of file scsi_sg.h.

◆ DID_OK

#define DID_OK   0x00 /* OK */

Definition at line 126 of file scsi_sg.h.

◆ DID_PARITY

#define DID_PARITY   0x06 /* parity error */

Definition at line 132 of file scsi_sg.h.

◆ DID_PASSTHROUGH

#define DID_PASSTHROUGH   0x0a /* passthrough */

Definition at line 136 of file scsi_sg.h.

◆ DID_RESET

#define DID_RESET   0x08 /* reset by somebody */

Definition at line 134 of file scsi_sg.h.

◆ DID_SOFT_ERROR

#define DID_SOFT_ERROR   0x0b /* low driver wants retry */

Definition at line 137 of file scsi_sg.h.

◆ DID_TIME_OUT

#define DID_TIME_OUT   0x03 /* other timeout */

Definition at line 129 of file scsi_sg.h.

◆ DRIVER_BUSY

#define DRIVER_BUSY   0x01

Definition at line 144 of file scsi_sg.h.

◆ DRIVER_ERROR

#define DRIVER_ERROR   0x04

Definition at line 147 of file scsi_sg.h.

◆ DRIVER_HARD

#define DRIVER_HARD   0x07

Definition at line 151 of file scsi_sg.h.

◆ DRIVER_INVALID

#define DRIVER_INVALID   0x05

Definition at line 149 of file scsi_sg.h.

◆ DRIVER_MASK

#define DRIVER_MASK   0x0f

Definition at line 161 of file scsi_sg.h.

◆ DRIVER_MEDIA

#define DRIVER_MEDIA   0x03

Definition at line 146 of file scsi_sg.h.

◆ DRIVER_OK

#define DRIVER_OK   0x00

Definition at line 143 of file scsi_sg.h.

◆ DRIVER_SENSE

#define DRIVER_SENSE   0x08

Definition at line 152 of file scsi_sg.h.

◆ DRIVER_SOFT

#define DRIVER_SOFT   0x02

Definition at line 145 of file scsi_sg.h.

◆ DRIVER_TIMEOUT

#define DRIVER_TIMEOUT   0x06

Definition at line 150 of file scsi_sg.h.

◆ SG_DEFAULT_HZ

#define SG_DEFAULT_HZ   1000

Definition at line 166 of file scsi_sg.h.

◆ SG_DEFAULT_TIMEOUT

#define SG_DEFAULT_TIMEOUT   (60*SG_DEFAULT_HZ)

Definition at line 167 of file scsi_sg.h.

◆ SG_DXFER_FROM_DEV

#define SG_DXFER_FROM_DEV   -3

Definition at line 89 of file scsi_sg.h.

◆ SG_DXFER_NONE

#define SG_DXFER_NONE   -1

Definition at line 87 of file scsi_sg.h.

◆ SG_DXFER_TO_DEV

#define SG_DXFER_TO_DEV   -2

Definition at line 88 of file scsi_sg.h.

◆ SG_DXFER_TO_FROM_DEV

#define SG_DXFER_TO_FROM_DEV   -4

Definition at line 90 of file scsi_sg.h.

◆ SG_DXFER_UNKNOWN

#define SG_DXFER_UNKNOWN   -5

Definition at line 91 of file scsi_sg.h.

◆ SG_EMULATED_HOST

#define SG_EMULATED_HOST   _IOR(SGIOC, 0x03, int)

Definition at line 13 of file scsi_sg.h.

◆ SG_GET_ACCESS_COUNT

#define SG_GET_ACCESS_COUNT   _IOR(SGIOC, 0x89, int)

Definition at line 35 of file scsi_sg.h.

◆ SG_GET_COMMAND_Q

#define SG_GET_COMMAND_Q   _IOW(SGIOC, 0x70, int)

Definition at line 16 of file scsi_sg.h.

◆ SG_GET_KEEP_ORPHAN

#define SG_GET_KEEP_ORPHAN   _IOR(SGIOC, 0x88, int)

Definition at line 34 of file scsi_sg.h.

◆ SG_GET_LOW_DMA

#define SG_GET_LOW_DMA   _IOR(SGIOC, 0x7a, int)

Definition at line 22 of file scsi_sg.h.

◆ SG_GET_NUM_WAITING

#define SG_GET_NUM_WAITING   _IOR(SGIOC, 0x7d, int)

Definition at line 25 of file scsi_sg.h.

◆ SG_GET_PACK_ID

#define SG_GET_PACK_ID   _IOR(SGIOC, 0x7c, int)

Definition at line 24 of file scsi_sg.h.

◆ SG_GET_REQUEST_TABLE

#define SG_GET_REQUEST_TABLE   _IO(SGIOC, 0x86)

Definition at line 32 of file scsi_sg.h.

◆ SG_GET_RESERVED_SIZE

#define SG_GET_RESERVED_SIZE   _IOR(SGIOC, 0x72, int)

Definition at line 18 of file scsi_sg.h.

◆ SG_GET_SCSI_ID

#define SG_GET_SCSI_ID   _IOR(SGIOC, 0x76, struct sg_scsi_id)

Definition at line 20 of file scsi_sg.h.

◆ SG_GET_SG_TABLESIZE

#define SG_GET_SG_TABLESIZE   _IOR(SGIOC, 0x7f, int)

Definition at line 27 of file scsi_sg.h.

◆ SG_GET_TIMEOUT

#define SG_GET_TIMEOUT   _IO(SGIOC, 0x02)

Definition at line 12 of file scsi_sg.h.

◆ SG_GET_TRANSFORM

#define SG_GET_TRANSFORM   _IO(SGIOC, 0x05)

Definition at line 15 of file scsi_sg.h.

◆ SG_GET_VERSION_NUM

#define SG_GET_VERSION_NUM   _IOR(SGIOC, 0x82, int)

Definition at line 28 of file scsi_sg.h.

◆ SG_IO

#define SG_IO   _IOWR(SGIOC, 0x85, struct sg_io_hdr)

Definition at line 31 of file scsi_sg.h.

◆ SG_MAX_SENSE

#define SG_MAX_SENSE   16

Definition at line 93 of file scsi_sg.h.

◆ SG_NEXT_CMD_LEN

#define SG_NEXT_CMD_LEN   _IOW(SGIOC, 0x83, int)

Definition at line 29 of file scsi_sg.h.

◆ SG_SCSI_RESET

#define SG_SCSI_RESET   _IOW(SGIOC, 0x84, int)

Definition at line 30 of file scsi_sg.h.

◆ SG_SET_COMMAND_Q

#define SG_SET_COMMAND_Q   _IOR(SGIOC, 0x71, int)

Definition at line 17 of file scsi_sg.h.

◆ SG_SET_DEBUG

#define SG_SET_DEBUG   _IOW(SGIOC, 0x7e, int)

Definition at line 26 of file scsi_sg.h.

◆ SG_SET_FORCE_LOW_DMA

#define SG_SET_FORCE_LOW_DMA   _IOW(SGIOC, 0x79, int)

Definition at line 21 of file scsi_sg.h.

◆ SG_SET_FORCE_PACK_ID

#define SG_SET_FORCE_PACK_ID   _IOW(SGIOC, 0x7b, int)

Definition at line 23 of file scsi_sg.h.

◆ SG_SET_KEEP_ORPHAN

#define SG_SET_KEEP_ORPHAN   _IOW(SGIOC, 0x87, int)

Definition at line 33 of file scsi_sg.h.

◆ SG_SET_RESERVED_SIZE

#define SG_SET_RESERVED_SIZE   _IOW(SGIOC, 0x75, int)

Definition at line 19 of file scsi_sg.h.

◆ SG_SET_TIMEOUT

#define SG_SET_TIMEOUT   _IOW(SGIOC, 0x01, u_int)

Definition at line 11 of file scsi_sg.h.

◆ SG_SET_TRANSFORM

#define SG_SET_TRANSFORM   _IO(SGIOC, 0x04)

Definition at line 14 of file scsi_sg.h.

◆ SGIOC

#define SGIOC   '"'

Definition at line 10 of file scsi_sg.h.

◆ SUGGEST_ABORT

#define SUGGEST_ABORT   0x20

Definition at line 155 of file scsi_sg.h.

◆ SUGGEST_DIE

#define SUGGEST_DIE   0x40

Definition at line 157 of file scsi_sg.h.

◆ SUGGEST_IS_OK

#define SUGGEST_IS_OK   0xff

Definition at line 159 of file scsi_sg.h.

◆ SUGGEST_MASK

#define SUGGEST_MASK   0xf0

Definition at line 162 of file scsi_sg.h.

◆ SUGGEST_REMAP

#define SUGGEST_REMAP   0x30

Definition at line 156 of file scsi_sg.h.

◆ SUGGEST_RETRY

#define SUGGEST_RETRY   0x10

Definition at line 154 of file scsi_sg.h.

◆ SUGGEST_SENSE

#define SUGGEST_SENSE   0x80

Definition at line 158 of file scsi_sg.h.