FreeBSD kernel CAM code
ctl_io.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  ctl_lba_len
 
struct  ctl_lba_len_flags
 
struct  ctl_ptr_len_flags
 
union  ctl_priv
 
struct  ctl_sg_entry
 
struct  ctl_nexus
 
struct  ctl_io_hdr
 
struct  ctl_scsiio
 
struct  ctl_taskio
 
struct  ctl_ha_msg_login
 
struct  ctl_pr_info
 
struct  ctl_ha_msg_hdr
 
struct  ctl_ha_msg_pr
 
struct  ctl_ha_msg_ua
 
struct  ctl_ha_msg_dt
 
struct  ctl_ha_msg_scsi
 
struct  ctl_ha_msg_task
 
struct  ctl_ha_msg_port
 
struct  ctl_ha_msg_lun
 
struct  ctl_ha_msg_lun_pr_key
 
struct  ctl_ha_msg_iid
 
struct  ctl_ha_msg_mode
 
union  ctl_ha_msg
 
struct  ctl_prio
 
union  ctl_io
 

Macros

#define CTL_MAX_CDBLEN   32
 
#define CTL_TIME_IO
 
#define CTL_TIME_IO_DEFAULT_SECS   90
 
#define CTL_LLF_FUA   0x04000000
 
#define CTL_LLF_DPO   0x08000000
 
#define CTL_LLF_READ   0x10000000
 
#define CTL_LLF_WRITE   0x20000000
 
#define CTL_LLF_VERIFY   0x40000000
 
#define CTL_LLF_COMPARE   0x80000000
 
#define CTL_NUM_PRIV   6
 
#define CTL_PRIV_LUN   0 /* CTL LUN pointer goes here */
 
#define CTL_PRIV_LBA_LEN   1 /* Decoded LBA/len for read/write*/
 
#define CTL_PRIV_MODEPAGE   1 /* Modepage info for config write */
 
#define CTL_PRIV_BACKEND   2 /* Reserved for block, RAIDCore */
 
#define CTL_PRIV_BACKEND_LUN   3 /* Backend LUN pointer */
 
#define CTL_PRIV_FRONTEND   4 /* Frontend storage */
 
#define CTL_PRIV_FRONTEND2   5 /* Another frontend storage */
 
#define CTL_LUN(io)   ((io)->io_hdr.ctl_private[CTL_PRIV_LUN].ptrs[0])
 
#define CTL_SOFTC(io)   ((io)->io_hdr.ctl_private[CTL_PRIV_LUN].ptrs[1])
 
#define CTL_BACKEND_LUN(io)   ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptrs[0])
 
#define CTL_PORT(io)
 
#define CTL_RSGL(io)   ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptrs[0])
 
#define CTL_LSGL(io)   ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptrs[1])
 
#define CTL_RSGLT(io)   ((struct ctl_sg_entry *)CTL_RSGL(io))
 
#define CTL_LSGLT(io)   ((struct ctl_sg_entry *)CTL_LSGL(io))
 
#define CTL_INVALID_PORTNAME   0xFF
 
#define CTL_UNMAPPED_IID   0xFF
 
#define CTL_HA_VERSION   3
 
#define CTL_HA_MAX_SG_ENTRIES   16
 
#define CTL_HA_DATAMOVE_SEGMENT   131072
 

Typedefs

typedef void(* ctl_ref) (void *arg, int diff)
 

Enumerations

enum  ctl_io_status {
  CTL_STATUS_NONE , CTL_SUCCESS , CTL_CMD_TIMEOUT , CTL_SEL_TIMEOUT ,
  CTL_ERROR , CTL_SCSI_ERROR , CTL_CMD_ABORTED , CTL_STATUS_MASK = 0xfff ,
  CTL_AUTOSENSE = 0x1000
}
 
enum  ctl_io_flags {
  CTL_FLAG_NONE = 0x00000000 , CTL_FLAG_DATA_IN = 0x00000001 , CTL_FLAG_DATA_OUT = 0x00000002 , CTL_FLAG_DATA_NONE = 0x00000003 ,
  CTL_FLAG_DATA_MASK = 0x00000003 , CTL_FLAG_DO_AUTOSENSE = 0x00000020 , CTL_FLAG_USER_REQ = 0x00000040 , CTL_FLAG_ALLOCATED = 0x00000100 ,
  CTL_FLAG_ABORT_STATUS = 0x00000400 , CTL_FLAG_ABORT = 0x00000800 , CTL_FLAG_DMA_INPROG = 0x00001000 , CTL_FLAG_DELAY_DONE = 0x00004000 ,
  CTL_FLAG_INT_COPY = 0x00008000 , CTL_FLAG_SENT_2OTHER_SC = 0x00010000 , CTL_FLAG_FROM_OTHER_SC = 0x00020000 , CTL_FLAG_IS_WAS_ON_RTR = 0x00040000 ,
  CTL_FLAG_BUS_ADDR = 0x00080000 , CTL_FLAG_IO_CONT = 0x00100000 , CTL_FLAG_NO_DATAMOVE = 0x00400000 , CTL_FLAG_DMA_QUEUED = 0x00800000 ,
  CTL_FLAG_STATUS_QUEUED = 0x01000000 , CTL_FLAG_FAILOVER = 0x04000000 , CTL_FLAG_IO_ACTIVE = 0x08000000 , CTL_FLAG_STATUS_SENT = 0x10000000 ,
  CTL_FLAG_SERSEQ_DONE = 0x20000000
}
 
enum  ctl_io_type { CTL_IO_NONE , CTL_IO_SCSI , CTL_IO_TASK }
 
enum  ctl_msg_type {
  CTL_MSG_SERIALIZE , CTL_MSG_R2R , CTL_MSG_FINISH_IO , CTL_MSG_BAD_JUJU ,
  CTL_MSG_MANAGE_TASKS , CTL_MSG_PERS_ACTION , CTL_MSG_DATAMOVE , CTL_MSG_DATAMOVE_DONE ,
  CTL_MSG_UA , CTL_MSG_PORT_SYNC , CTL_MSG_LUN_SYNC , CTL_MSG_IID_SYNC ,
  CTL_MSG_LOGIN , CTL_MSG_MODE_SYNC , CTL_MSG_FAILOVER
}
 
enum  ctl_tag_type {
  CTL_TAG_UNTAGGED , CTL_TAG_SIMPLE , CTL_TAG_ORDERED , CTL_TAG_HEAD_OF_QUEUE ,
  CTL_TAG_ACA
}
 
enum  ctl_task_type {
  CTL_TASK_ABORT_TASK , CTL_TASK_ABORT_TASK_SET , CTL_TASK_CLEAR_ACA , CTL_TASK_CLEAR_TASK_SET ,
  CTL_TASK_I_T_NEXUS_RESET , CTL_TASK_LUN_RESET , CTL_TASK_TARGET_RESET , CTL_TASK_BUS_RESET ,
  CTL_TASK_PORT_LOGIN , CTL_TASK_PORT_LOGOUT , CTL_TASK_QUERY_TASK , CTL_TASK_QUERY_TASK_SET ,
  CTL_TASK_QUERY_ASYNC_EVENT
}
 
enum  ctl_task_status {
  CTL_TASK_FUNCTION_COMPLETE , CTL_TASK_FUNCTION_SUCCEEDED , CTL_TASK_FUNCTION_REJECTED , CTL_TASK_LUN_DOES_NOT_EXIST ,
  CTL_TASK_FUNCTION_NOT_SUPPORTED
}
 
enum  ctl_pr_action {
  CTL_PR_REG_KEY , CTL_PR_UNREG_KEY , CTL_PR_PREEMPT , CTL_PR_CLEAR ,
  CTL_PR_RESERVE , CTL_PR_RELEASE
}
 

Functions

union ctl_ioctl_alloc_io (void *pool_ref)
 
union ctl_ioctl_alloc_io_nowait (void *pool_ref)
 
void ctl_free_io (union ctl_io *io)
 
void ctl_zero_io (union ctl_io *io)
 

Macro Definition Documentation

◆ CTL_BACKEND_LUN

#define CTL_BACKEND_LUN (   io)    ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptrs[0])

Definition at line 168 of file ctl_io.h.

◆ CTL_HA_DATAMOVE_SEGMENT

#define CTL_HA_DATAMOVE_SEGMENT   131072

Definition at line 432 of file ctl_io.h.

◆ CTL_HA_MAX_SG_ENTRIES

#define CTL_HA_MAX_SG_ENTRIES   16

Definition at line 431 of file ctl_io.h.

◆ CTL_HA_VERSION

#define CTL_HA_VERSION   3

Definition at line 385 of file ctl_io.h.

◆ CTL_INVALID_PORTNAME

#define CTL_INVALID_PORTNAME   0xFF

Definition at line 181 of file ctl_io.h.

◆ CTL_LLF_COMPARE

#define CTL_LLF_COMPARE   0x80000000

Definition at line 133 of file ctl_io.h.

◆ CTL_LLF_DPO

#define CTL_LLF_DPO   0x08000000

Definition at line 129 of file ctl_io.h.

◆ CTL_LLF_FUA

#define CTL_LLF_FUA   0x04000000

Definition at line 128 of file ctl_io.h.

◆ CTL_LLF_READ

#define CTL_LLF_READ   0x10000000

Definition at line 130 of file ctl_io.h.

◆ CTL_LLF_VERIFY

#define CTL_LLF_VERIFY   0x40000000

Definition at line 132 of file ctl_io.h.

◆ CTL_LLF_WRITE

#define CTL_LLF_WRITE   0x20000000

Definition at line 131 of file ctl_io.h.

◆ CTL_LSGL

#define CTL_LSGL (   io)    ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptrs[1])

Definition at line 177 of file ctl_io.h.

◆ CTL_LSGLT

#define CTL_LSGLT (   io)    ((struct ctl_sg_entry *)CTL_LSGL(io))

Definition at line 179 of file ctl_io.h.

◆ CTL_LUN

#define CTL_LUN (   io)    ((io)->io_hdr.ctl_private[CTL_PRIV_LUN].ptrs[0])

Definition at line 166 of file ctl_io.h.

◆ CTL_MAX_CDBLEN

#define CTL_MAX_CDBLEN   32

Definition at line 49 of file ctl_io.h.

◆ CTL_NUM_PRIV

#define CTL_NUM_PRIV   6

Definition at line 153 of file ctl_io.h.

◆ CTL_PORT

#define CTL_PORT (   io)
Value:
(((struct ctl_softc *)CTL_SOFTC(io))-> \
ctl_ports[(io)->io_hdr.nexus.targ_port])
#define CTL_SOFTC(io)
Definition: ctl_io.h:167
struct ctl_port ** ctl_ports
Definition: ctl_private.h:462

Definition at line 169 of file ctl_io.h.

◆ CTL_PRIV_BACKEND

#define CTL_PRIV_BACKEND   2 /* Reserved for block, RAIDCore */

Definition at line 161 of file ctl_io.h.

◆ CTL_PRIV_BACKEND_LUN

#define CTL_PRIV_BACKEND_LUN   3 /* Backend LUN pointer */

Definition at line 162 of file ctl_io.h.

◆ CTL_PRIV_FRONTEND

#define CTL_PRIV_FRONTEND   4 /* Frontend storage */

Definition at line 163 of file ctl_io.h.

◆ CTL_PRIV_FRONTEND2

#define CTL_PRIV_FRONTEND2   5 /* Another frontend storage */

Definition at line 164 of file ctl_io.h.

◆ CTL_PRIV_LBA_LEN

#define CTL_PRIV_LBA_LEN   1 /* Decoded LBA/len for read/write*/

Definition at line 159 of file ctl_io.h.

◆ CTL_PRIV_LUN

#define CTL_PRIV_LUN   0 /* CTL LUN pointer goes here */

Definition at line 158 of file ctl_io.h.

◆ CTL_PRIV_MODEPAGE

#define CTL_PRIV_MODEPAGE   1 /* Modepage info for config write */

Definition at line 160 of file ctl_io.h.

◆ CTL_RSGL

#define CTL_RSGL (   io)    ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptrs[0])

Definition at line 176 of file ctl_io.h.

◆ CTL_RSGLT

#define CTL_RSGLT (   io)    ((struct ctl_sg_entry *)CTL_RSGL(io))

Definition at line 178 of file ctl_io.h.

◆ CTL_SOFTC

#define CTL_SOFTC (   io)    ((io)->io_hdr.ctl_private[CTL_PRIV_LUN].ptrs[1])

Definition at line 167 of file ctl_io.h.

◆ CTL_TIME_IO

#define CTL_TIME_IO

Definition at line 55 of file ctl_io.h.

◆ CTL_TIME_IO_DEFAULT_SECS

#define CTL_TIME_IO_DEFAULT_SECS   90

Definition at line 57 of file ctl_io.h.

◆ CTL_UNMAPPED_IID

#define CTL_UNMAPPED_IID   0xFF

Definition at line 182 of file ctl_io.h.

Typedef Documentation

◆ ctl_ref

typedef void(* ctl_ref) (void *arg, int diff)

Definition at line 263 of file ctl_io.h.

Enumeration Type Documentation

◆ ctl_io_flags

Enumerator
CTL_FLAG_NONE 
CTL_FLAG_DATA_IN 
CTL_FLAG_DATA_OUT 
CTL_FLAG_DATA_NONE 
CTL_FLAG_DATA_MASK 
CTL_FLAG_DO_AUTOSENSE 
CTL_FLAG_USER_REQ 
CTL_FLAG_ALLOCATED 
CTL_FLAG_ABORT_STATUS 
CTL_FLAG_ABORT 
CTL_FLAG_DMA_INPROG 
CTL_FLAG_DELAY_DONE 
CTL_FLAG_INT_COPY 
CTL_FLAG_SENT_2OTHER_SC 
CTL_FLAG_FROM_OTHER_SC 
CTL_FLAG_IS_WAS_ON_RTR 
CTL_FLAG_BUS_ADDR 
CTL_FLAG_IO_CONT 
CTL_FLAG_NO_DATAMOVE 
CTL_FLAG_DMA_QUEUED 
CTL_FLAG_STATUS_QUEUED 
CTL_FLAG_FAILOVER 
CTL_FLAG_IO_ACTIVE 
CTL_FLAG_STATUS_SENT 
CTL_FLAG_SERSEQ_DONE 

Definition at line 85 of file ctl_io.h.

◆ ctl_io_status

Enumerator
CTL_STATUS_NONE 
CTL_SUCCESS 
CTL_CMD_TIMEOUT 
CTL_SEL_TIMEOUT 
CTL_ERROR 
CTL_SCSI_ERROR 
CTL_CMD_ABORTED 
CTL_STATUS_MASK 
CTL_AUTOSENSE 

Definition at line 68 of file ctl_io.h.

◆ ctl_io_type

Enumerator
CTL_IO_NONE 
CTL_IO_SCSI 
CTL_IO_TASK 

Definition at line 189 of file ctl_io.h.

◆ ctl_msg_type

Enumerator
CTL_MSG_SERIALIZE 
CTL_MSG_R2R 
CTL_MSG_FINISH_IO 
CTL_MSG_BAD_JUJU 
CTL_MSG_MANAGE_TASKS 
CTL_MSG_PERS_ACTION 
CTL_MSG_DATAMOVE 
CTL_MSG_DATAMOVE_DONE 
CTL_MSG_UA 
CTL_MSG_PORT_SYNC 
CTL_MSG_LUN_SYNC 
CTL_MSG_IID_SYNC 
CTL_MSG_LOGIN 
CTL_MSG_MODE_SYNC 
CTL_MSG_FAILOVER 

Definition at line 202 of file ctl_io.h.

◆ ctl_pr_action

Enumerator
CTL_PR_REG_KEY 
CTL_PR_UNREG_KEY 
CTL_PR_PREEMPT 
CTL_PR_CLEAR 
CTL_PR_RESERVE 
CTL_PR_RELEASE 

Definition at line 400 of file ctl_io.h.

◆ ctl_tag_type

Enumerator
CTL_TAG_UNTAGGED 
CTL_TAG_SIMPLE 
CTL_TAG_ORDERED 
CTL_TAG_HEAD_OF_QUEUE 
CTL_TAG_ACA 

Definition at line 253 of file ctl_io.h.

◆ ctl_task_status

Enumerator
CTL_TASK_FUNCTION_COMPLETE 
CTL_TASK_FUNCTION_SUCCEEDED 
CTL_TASK_FUNCTION_REJECTED 
CTL_TASK_LUN_DOES_NOT_EXIST 
CTL_TASK_FUNCTION_NOT_SUPPORTED 

Definition at line 358 of file ctl_io.h.

◆ ctl_task_type

Enumerator
CTL_TASK_ABORT_TASK 
CTL_TASK_ABORT_TASK_SET 
CTL_TASK_CLEAR_ACA 
CTL_TASK_CLEAR_TASK_SET 
CTL_TASK_I_T_NEXUS_RESET 
CTL_TASK_LUN_RESET 
CTL_TASK_TARGET_RESET 
CTL_TASK_BUS_RESET 
CTL_TASK_PORT_LOGIN 
CTL_TASK_PORT_LOGOUT 
CTL_TASK_QUERY_TASK 
CTL_TASK_QUERY_TASK_SET 
CTL_TASK_QUERY_ASYNC_EVENT 

Definition at line 342 of file ctl_io.h.

Function Documentation

◆ ctl_alloc_io()

◆ ctl_alloc_io_nowait()

union ctl_io * ctl_alloc_io_nowait ( void *  pool_ref)

Definition at line 3976 of file ctl.c.

References CTL_SOFTC, ctl_io_pool::ctl_softc, ctl_io::io_hdr, ctl_io_hdr::pool, and ctl_io_pool::zone.

Referenced by cfcs_action(), ctlfedone(), and ctlferegister().

Here is the caller graph for this function:

◆ ctl_free_io()

◆ ctl_zero_io()

void ctl_zero_io ( union ctl_io io)