FreeBSD kernel CAM code
ctl_ioctl.h File Reference
#include <sys/ioccom.h>
#include <sys/nv.h>
Include dependency graph for ctl_ioctl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ctl_io_delay_info
 
struct  ctl_io_stats
 
struct  ctl_get_io_stats
 
struct  ctl_error_desc_cmd
 
struct  ctl_error_desc
 
struct  ctl_ooa_entry
 
struct  ctl_ooa
 
struct  ctl_lun_create_params
 
struct  ctl_lun_rm_params
 
struct  ctl_lun_modify_params
 
union  ctl_lunreq_data
 
struct  ctl_lun_req
 
struct  ctl_lun_list
 
struct  ctl_req
 
struct  ctl_iscsi_handoff_params
 
struct  ctl_iscsi_list_params
 
struct  ctl_iscsi_logout_params
 
struct  ctl_iscsi_terminate_params
 
struct  ctl_iscsi_limits_params
 
union  ctl_iscsi_data
 
struct  ctl_iscsi
 
struct  ctl_lun_map
 

Macros

#define CTL_DEFAULT_DEV   "/dev/cam/ctl"
 
#define CTL_MAX_TARGETS   1
 
#define CTL_MAX_TARGID   15
 
#define CTL_MAX_INIT_PER_PORT   2048
 
#define CTL_MINOR   225
 
#define CTL_STATS_NUM_TYPES   3
 
#define CTL_ERROR_STR_LEN   160
 
#define CTL_BE_NAME_LEN   32
 
#define CTL_ISCSI_NAME_LEN   224 /* 223 bytes, by RFC 3720, + '\0' */
 
#define CTL_ISCSI_ADDR_LEN   47 /* INET6_ADDRSTRLEN + '\0' */
 
#define CTL_ISCSI_ALIAS_LEN   128 /* Arbitrary. */
 
#define CTL_ISCSI_OFFLOAD_LEN   8 /* Arbitrary. */
 
#define CTL_IO   _IOWR(CTL_MINOR, 0x00, union ctl_io)
 
#define CTL_ENABLE_PORT   _IOW(CTL_MINOR, 0x04, struct ctl_port_entry)
 
#define CTL_DISABLE_PORT   _IOW(CTL_MINOR, 0x05, struct ctl_port_entry)
 
#define CTL_DELAY_IO   _IOWR(CTL_MINOR, 0x10, struct ctl_io_delay_info)
 
#define CTL_ERROR_INJECT   _IOWR(CTL_MINOR, 0x16, struct ctl_error_desc)
 
#define CTL_GET_OOA   _IOWR(CTL_MINOR, 0x18, struct ctl_ooa)
 
#define CTL_DUMP_STRUCTS   _IO(CTL_MINOR, 0x19)
 
#define CTL_LUN_REQ   _IOWR(CTL_MINOR, 0x21, struct ctl_lun_req)
 
#define CTL_LUN_LIST   _IOWR(CTL_MINOR, 0x22, struct ctl_lun_list)
 
#define CTL_ERROR_INJECT_DELETE   _IOW(CTL_MINOR, 0x23, struct ctl_error_desc)
 
#define CTL_SET_PORT_WWNS   _IOW(CTL_MINOR, 0x24, struct ctl_port_entry)
 
#define CTL_ISCSI   _IOWR(CTL_MINOR, 0x25, struct ctl_iscsi)
 
#define CTL_PORT_REQ   _IOWR(CTL_MINOR, 0x26, struct ctl_req)
 
#define CTL_PORT_LIST   _IOWR(CTL_MINOR, 0x27, struct ctl_lun_list)
 
#define CTL_LUN_MAP   _IOW(CTL_MINOR, 0x28, struct ctl_lun_map)
 
#define CTL_GET_LUN_STATS   _IOWR(CTL_MINOR, 0x29, struct ctl_get_io_stats)
 
#define CTL_GET_PORT_STATS   _IOWR(CTL_MINOR, 0x2a, struct ctl_get_io_stats)
 

Enumerations

enum  ctl_delay_type { CTL_DELAY_TYPE_NONE , CTL_DELAY_TYPE_CONT , CTL_DELAY_TYPE_ONESHOT }
 
enum  ctl_delay_location { CTL_DELAY_LOC_NONE , CTL_DELAY_LOC_DATAMOVE , CTL_DELAY_LOC_DONE }
 
enum  ctl_delay_status {
  CTL_DELAY_STATUS_NONE , CTL_DELAY_STATUS_OK , CTL_DELAY_STATUS_INVALID_LUN , CTL_DELAY_STATUS_INVALID_TYPE ,
  CTL_DELAY_STATUS_INVALID_LOC , CTL_DELAY_STATUS_NOT_IMPLEMENTED
}
 
enum  ctl_stat_types { CTL_STATS_NO_IO , CTL_STATS_READ , CTL_STATS_WRITE }
 
enum  ctl_stats_status { CTL_SS_OK , CTL_SS_NEED_MORE_SPACE , CTL_SS_ERROR }
 
enum  ctl_stats_flags { CTL_STATS_FLAG_NONE = 0x00 , CTL_STATS_FLAG_TIME_VALID = 0x01 }
 
enum  ctl_lun_error {
  CTL_LUN_INJ_NONE = 0x000 , CTL_LUN_INJ_ABORTED = 0x001 , CTL_LUN_INJ_MEDIUM_ERR = 0x002 , CTL_LUN_INJ_UA = 0x003 ,
  CTL_LUN_INJ_CUSTOM = 0x004 , CTL_LUN_INJ_TYPE = 0x0ff , CTL_LUN_INJ_CONTINUOUS = 0x100 , CTL_LUN_INJ_DESCRIPTOR = 0x200
}
 
enum  ctl_lun_error_pattern {
  CTL_LUN_PAT_NONE = 0x000 , CTL_LUN_PAT_READ = 0x001 , CTL_LUN_PAT_WRITE = 0x002 , CTL_LUN_PAT_READWRITE = CTL_LUN_PAT_READ | CTL_LUN_PAT_WRITE ,
  CTL_LUN_PAT_READCAP = 0x004 , CTL_LUN_PAT_TUR = 0x008 , CTL_LUN_PAT_ANY = 0x0ff , CTL_LUN_PAT_MASK = 0x0ff ,
  CTL_LUN_PAT_CMD = 0x100 , CTL_LUN_PAT_RANGE = 0x200
}
 
enum  ctl_ooa_flags { CTL_OOA_FLAG_NONE = 0x00 , CTL_OOA_FLAG_ALL_LUNS = 0x01 }
 
enum  ctl_get_ooa_status { CTL_OOA_OK , CTL_OOA_NEED_MORE_SPACE , CTL_OOA_ERROR }
 
enum  ctl_ooa_cmd_flags {
  CTL_OOACMD_FLAG_NONE = 0x00 , CTL_OOACMD_FLAG_DMA = 0x01 , CTL_OOACMD_FLAG_BLOCKED = 0x02 , CTL_OOACMD_FLAG_ABORT = 0x04 ,
  CTL_OOACMD_FLAG_RTR = 0x08 , CTL_OOACMD_FLAG_DMA_QUEUED = 0x10 , CTL_OOACMD_FLAG_STATUS_QUEUED = 0x20 , CTL_OOACMD_FLAG_STATUS_SENT = 0x40
}
 
enum  ctl_lun_status { CTL_LUN_NOSTATUS , CTL_LUN_OK , CTL_LUN_ERROR , CTL_LUN_WARNING }
 
enum  ctl_lunreq_type { CTL_LUNREQ_CREATE , CTL_LUNREQ_RM , CTL_LUNREQ_MODIFY }
 
enum  ctl_backend_lun_flags {
  CTL_LUN_FLAG_ID_REQ = 0x01 , CTL_LUN_FLAG_STOPPED = 0x02 , CTL_LUN_FLAG_NO_MEDIA = 0x04 , CTL_LUN_FLAG_PRIMARY = 0x08 ,
  CTL_LUN_FLAG_SERIAL_NUM = 0x10 , CTL_LUN_FLAG_DEVID = 0x20 , CTL_LUN_FLAG_DEV_TYPE = 0x40 , CTL_LUN_FLAG_UNMAP = 0x80 ,
  CTL_LUN_FLAG_EJECTED = 0x100 , CTL_LUN_FLAG_READONLY = 0x200
}
 
enum  ctl_lun_list_status { CTL_LUN_LIST_NONE , CTL_LUN_LIST_OK , CTL_LUN_LIST_NEED_MORE_SPACE , CTL_LUN_LIST_ERROR }
 
enum  ctl_req_type { CTL_REQ_CREATE , CTL_REQ_REMOVE , CTL_REQ_MODIFY }
 
enum  ctl_iscsi_status { CTL_ISCSI_OK , CTL_ISCSI_ERROR , CTL_ISCSI_LIST_NEED_MORE_SPACE , CTL_ISCSI_SESSION_NOT_FOUND }
 
enum  ctl_iscsi_type {
  CTL_ISCSI_HANDOFF , CTL_ISCSI_LIST , CTL_ISCSI_LOGOUT , CTL_ISCSI_TERMINATE ,
  CTL_ISCSI_LIMITS , CTL_ISCSI_LISTEN , CTL_ISCSI_ACCEPT , CTL_ISCSI_SEND ,
  CTL_ISCSI_RECEIVE
}
 
enum  ctl_iscsi_digest { CTL_ISCSI_DIGEST_NONE , CTL_ISCSI_DIGEST_CRC32C }
 

Macro Definition Documentation

◆ CTL_BE_NAME_LEN

#define CTL_BE_NAME_LEN   32

Definition at line 457 of file ctl_ioctl.h.

◆ CTL_DEFAULT_DEV

#define CTL_DEFAULT_DEV   "/dev/cam/ctl"

Definition at line 53 of file ctl_ioctl.h.

◆ CTL_DELAY_IO

#define CTL_DELAY_IO   _IOWR(CTL_MINOR, 0x10, struct ctl_io_delay_info)

Definition at line 763 of file ctl_ioctl.h.

◆ CTL_DISABLE_PORT

#define CTL_DISABLE_PORT   _IOW(CTL_MINOR, 0x05, struct ctl_port_entry)

Definition at line 762 of file ctl_ioctl.h.

◆ CTL_DUMP_STRUCTS

#define CTL_DUMP_STRUCTS   _IO(CTL_MINOR, 0x19)

Definition at line 766 of file ctl_ioctl.h.

◆ CTL_ENABLE_PORT

#define CTL_ENABLE_PORT   _IOW(CTL_MINOR, 0x04, struct ctl_port_entry)

Definition at line 761 of file ctl_ioctl.h.

◆ CTL_ERROR_INJECT

#define CTL_ERROR_INJECT   _IOWR(CTL_MINOR, 0x16, struct ctl_error_desc)

Definition at line 764 of file ctl_ioctl.h.

◆ CTL_ERROR_INJECT_DELETE

#define CTL_ERROR_INJECT_DELETE   _IOW(CTL_MINOR, 0x23, struct ctl_error_desc)

Definition at line 769 of file ctl_ioctl.h.

◆ CTL_ERROR_STR_LEN

#define CTL_ERROR_STR_LEN   160

Definition at line 284 of file ctl_ioctl.h.

◆ CTL_GET_LUN_STATS

#define CTL_GET_LUN_STATS   _IOWR(CTL_MINOR, 0x29, struct ctl_get_io_stats)

Definition at line 775 of file ctl_ioctl.h.

◆ CTL_GET_OOA

#define CTL_GET_OOA   _IOWR(CTL_MINOR, 0x18, struct ctl_ooa)

Definition at line 765 of file ctl_ioctl.h.

◆ CTL_GET_PORT_STATS

#define CTL_GET_PORT_STATS   _IOWR(CTL_MINOR, 0x2a, struct ctl_get_io_stats)

Definition at line 776 of file ctl_ioctl.h.

◆ CTL_IO

#define CTL_IO   _IOWR(CTL_MINOR, 0x00, union ctl_io)

Definition at line 760 of file ctl_ioctl.h.

◆ CTL_ISCSI

#define CTL_ISCSI   _IOWR(CTL_MINOR, 0x25, struct ctl_iscsi)

Definition at line 771 of file ctl_ioctl.h.

◆ CTL_ISCSI_ADDR_LEN

#define CTL_ISCSI_ADDR_LEN   47 /* INET6_ADDRSTRLEN + '\0' */

Definition at line 609 of file ctl_ioctl.h.

◆ CTL_ISCSI_ALIAS_LEN

#define CTL_ISCSI_ALIAS_LEN   128 /* Arbitrary. */

Definition at line 610 of file ctl_ioctl.h.

◆ CTL_ISCSI_NAME_LEN

#define CTL_ISCSI_NAME_LEN   224 /* 223 bytes, by RFC 3720, + '\0' */

Definition at line 608 of file ctl_ioctl.h.

◆ CTL_ISCSI_OFFLOAD_LEN

#define CTL_ISCSI_OFFLOAD_LEN   8 /* Arbitrary. */

Definition at line 611 of file ctl_ioctl.h.

◆ CTL_LUN_LIST

#define CTL_LUN_LIST   _IOWR(CTL_MINOR, 0x22, struct ctl_lun_list)

Definition at line 768 of file ctl_ioctl.h.

◆ CTL_LUN_MAP

#define CTL_LUN_MAP   _IOW(CTL_MINOR, 0x28, struct ctl_lun_map)

Definition at line 774 of file ctl_ioctl.h.

◆ CTL_LUN_REQ

#define CTL_LUN_REQ   _IOWR(CTL_MINOR, 0x21, struct ctl_lun_req)

Definition at line 767 of file ctl_ioctl.h.

◆ CTL_MAX_INIT_PER_PORT

#define CTL_MAX_INIT_PER_PORT   2048

Definition at line 67 of file ctl_ioctl.h.

◆ CTL_MAX_TARGETS

#define CTL_MAX_TARGETS   1

Definition at line 57 of file ctl_ioctl.h.

◆ CTL_MAX_TARGID

#define CTL_MAX_TARGID   15

Definition at line 62 of file ctl_ioctl.h.

◆ CTL_MINOR

#define CTL_MINOR   225

Definition at line 70 of file ctl_ioctl.h.

◆ CTL_PORT_LIST

#define CTL_PORT_LIST   _IOWR(CTL_MINOR, 0x27, struct ctl_lun_list)

Definition at line 773 of file ctl_ioctl.h.

◆ CTL_PORT_REQ

#define CTL_PORT_REQ   _IOWR(CTL_MINOR, 0x26, struct ctl_req)

Definition at line 772 of file ctl_ioctl.h.

◆ CTL_SET_PORT_WWNS

#define CTL_SET_PORT_WWNS   _IOW(CTL_MINOR, 0x24, struct ctl_port_entry)

Definition at line 770 of file ctl_ioctl.h.

◆ CTL_STATS_NUM_TYPES

#define CTL_STATS_NUM_TYPES   3

Definition at line 106 of file ctl_ioctl.h.

Enumeration Type Documentation

◆ ctl_backend_lun_flags

Enumerator
CTL_LUN_FLAG_ID_REQ 
CTL_LUN_FLAG_STOPPED 
CTL_LUN_FLAG_NO_MEDIA 
CTL_LUN_FLAG_PRIMARY 
CTL_LUN_FLAG_SERIAL_NUM 
CTL_LUN_FLAG_DEVID 
CTL_LUN_FLAG_DEV_TYPE 
CTL_LUN_FLAG_UNMAP 
CTL_LUN_FLAG_EJECTED 
CTL_LUN_FLAG_READONLY 

Definition at line 323 of file ctl_ioctl.h.

◆ ctl_delay_location

Enumerator
CTL_DELAY_LOC_NONE 
CTL_DELAY_LOC_DATAMOVE 
CTL_DELAY_LOC_DONE 

Definition at line 78 of file ctl_ioctl.h.

◆ ctl_delay_status

Enumerator
CTL_DELAY_STATUS_NONE 
CTL_DELAY_STATUS_OK 
CTL_DELAY_STATUS_INVALID_LUN 
CTL_DELAY_STATUS_INVALID_TYPE 
CTL_DELAY_STATUS_INVALID_LOC 
CTL_DELAY_STATUS_NOT_IMPLEMENTED 

Definition at line 84 of file ctl_ioctl.h.

◆ ctl_delay_type

Enumerator
CTL_DELAY_TYPE_NONE 
CTL_DELAY_TYPE_CONT 
CTL_DELAY_TYPE_ONESHOT 

Definition at line 72 of file ctl_ioctl.h.

◆ ctl_get_ooa_status

Enumerator
CTL_OOA_OK 
CTL_OOA_NEED_MORE_SPACE 
CTL_OOA_ERROR 

Definition at line 238 of file ctl_ioctl.h.

◆ ctl_iscsi_digest

Enumerator
CTL_ISCSI_DIGEST_NONE 
CTL_ISCSI_DIGEST_CRC32C 

Definition at line 603 of file ctl_ioctl.h.

◆ ctl_iscsi_status

Enumerator
CTL_ISCSI_OK 
CTL_ISCSI_ERROR 
CTL_ISCSI_LIST_NEED_MORE_SPACE 
CTL_ISCSI_SESSION_NOT_FOUND 

Definition at line 578 of file ctl_ioctl.h.

◆ ctl_iscsi_type

Enumerator
CTL_ISCSI_HANDOFF 
CTL_ISCSI_LIST 
CTL_ISCSI_LOGOUT 
CTL_ISCSI_TERMINATE 
CTL_ISCSI_LIMITS 
CTL_ISCSI_LISTEN 
CTL_ISCSI_ACCEPT 
CTL_ISCSI_SEND 
CTL_ISCSI_RECEIVE 

Definition at line 585 of file ctl_ioctl.h.

◆ ctl_lun_error

Enumerator
CTL_LUN_INJ_NONE 
CTL_LUN_INJ_ABORTED 
CTL_LUN_INJ_MEDIUM_ERR 
CTL_LUN_INJ_UA 
CTL_LUN_INJ_CUSTOM 
CTL_LUN_INJ_TYPE 
CTL_LUN_INJ_CONTINUOUS 
CTL_LUN_INJ_DESCRIPTOR 

Definition at line 153 of file ctl_ioctl.h.

◆ ctl_lun_error_pattern

Enumerator
CTL_LUN_PAT_NONE 
CTL_LUN_PAT_READ 
CTL_LUN_PAT_WRITE 
CTL_LUN_PAT_READWRITE 
CTL_LUN_PAT_READCAP 
CTL_LUN_PAT_TUR 
CTL_LUN_PAT_ANY 
CTL_LUN_PAT_MASK 
CTL_LUN_PAT_CMD 
CTL_LUN_PAT_RANGE 

Definition at line 182 of file ctl_ioctl.h.

◆ ctl_lun_list_status

Enumerator
CTL_LUN_LIST_NONE 
CTL_LUN_LIST_OK 
CTL_LUN_LIST_NEED_MORE_SPACE 
CTL_LUN_LIST_ERROR 

Definition at line 484 of file ctl_ioctl.h.

◆ ctl_lun_status

Enumerator
CTL_LUN_NOSTATUS 
CTL_LUN_OK 
CTL_LUN_ERROR 
CTL_LUN_WARNING 

Definition at line 277 of file ctl_ioctl.h.

◆ ctl_lunreq_type

Enumerator
CTL_LUNREQ_CREATE 
CTL_LUNREQ_RM 
CTL_LUNREQ_MODIFY 

Definition at line 286 of file ctl_ioctl.h.

◆ ctl_ooa_cmd_flags

Enumerator
CTL_OOACMD_FLAG_NONE 
CTL_OOACMD_FLAG_DMA 
CTL_OOACMD_FLAG_BLOCKED 
CTL_OOACMD_FLAG_ABORT 
CTL_OOACMD_FLAG_RTR 
CTL_OOACMD_FLAG_DMA_QUEUED 
CTL_OOACMD_FLAG_STATUS_QUEUED 
CTL_OOACMD_FLAG_STATUS_SENT 

Definition at line 244 of file ctl_ioctl.h.

◆ ctl_ooa_flags

Enumerator
CTL_OOA_FLAG_NONE 
CTL_OOA_FLAG_ALL_LUNS 

Definition at line 233 of file ctl_ioctl.h.

◆ ctl_req_type

Enumerator
CTL_REQ_CREATE 
CTL_REQ_REMOVE 
CTL_REQ_MODIFY 

Definition at line 548 of file ctl_ioctl.h.

◆ ctl_stat_types

Enumerator
CTL_STATS_NO_IO 
CTL_STATS_READ 
CTL_STATS_WRITE 

Definition at line 101 of file ctl_ioctl.h.

◆ ctl_stats_flags

Enumerator
CTL_STATS_FLAG_NONE 
CTL_STATS_FLAG_TIME_VALID 

Definition at line 114 of file ctl_ioctl.h.

◆ ctl_stats_status

Enumerator
CTL_SS_OK 
CTL_SS_NEED_MORE_SPACE 
CTL_SS_ERROR 

Definition at line 108 of file ctl_ioctl.h.