Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/ctl/ctl_ioctl.h
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
#ifndef _CTL_IOCTL_H_ | #ifndef _CTL_IOCTL_H_ | ||||
#define _CTL_IOCTL_H_ | #define _CTL_IOCTL_H_ | ||||
#ifdef ICL_KERNEL_PROXY | #ifdef ICL_KERNEL_PROXY | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#endif | #endif | ||||
#include <sys/ioccom.h> | #include <sys/ioccom.h> | ||||
#include <sys/nv.h> | |||||
#define CTL_DEFAULT_DEV "/dev/cam/ctl" | #define CTL_DEFAULT_DEV "/dev/cam/ctl" | ||||
/* | /* | ||||
* Maximum number of targets we support. | * Maximum number of targets we support. | ||||
*/ | */ | ||||
#define CTL_MAX_TARGETS 1 | #define CTL_MAX_TARGETS 1 | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | typedef enum { | ||||
CTL_LUN_NOSTATUS, | CTL_LUN_NOSTATUS, | ||||
CTL_LUN_OK, | CTL_LUN_OK, | ||||
CTL_LUN_ERROR, | CTL_LUN_ERROR, | ||||
CTL_LUN_WARNING | CTL_LUN_WARNING | ||||
} ctl_lun_status; | } ctl_lun_status; | ||||
#define CTL_ERROR_STR_LEN 160 | #define CTL_ERROR_STR_LEN 160 | ||||
#define CTL_BEARG_RD 0x01 | |||||
#define CTL_BEARG_WR 0x02 | |||||
#define CTL_BEARG_RW (CTL_BEARG_RD|CTL_BEARG_WR) | |||||
#define CTL_BEARG_ASCII 0x04 | |||||
/* | |||||
* Backend Argument: | |||||
* | |||||
* namelen: Length of the name field, including the terminating NUL. | |||||
* | |||||
* name: Name of the parameter. This must be NUL-terminated. | |||||
* | |||||
* flags: Flags for the parameter, see above for values. | |||||
* | |||||
* vallen: Length of the value in bytes, including the terminating NUL. | |||||
* | |||||
* value: Value to be set/fetched. This must be NUL-terminated. | |||||
* | |||||
* kname: For kernel use only. | |||||
* | |||||
* kvalue: For kernel use only. | |||||
*/ | |||||
struct ctl_be_arg { | |||||
unsigned int namelen; | |||||
char *name; | |||||
int flags; | |||||
unsigned int vallen; | |||||
void *value; | |||||
char *kname; | |||||
void *kvalue; | |||||
}; | |||||
typedef enum { | typedef enum { | ||||
CTL_LUNREQ_CREATE, | CTL_LUNREQ_CREATE, | ||||
CTL_LUNREQ_RM, | CTL_LUNREQ_RM, | ||||
CTL_LUNREQ_MODIFY, | CTL_LUNREQ_MODIFY, | ||||
} ctl_lunreq_type; | } ctl_lunreq_type; | ||||
/* | /* | ||||
* The ID_REQ flag is used to say that the caller has requested a | * The ID_REQ flag is used to say that the caller has requested a | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* kern_be_args: For kernel use only. | * kern_be_args: For kernel use only. | ||||
*/ | */ | ||||
struct ctl_lun_req { | struct ctl_lun_req { | ||||
#define CTL_BE_NAME_LEN 32 | #define CTL_BE_NAME_LEN 32 | ||||
char backend[CTL_BE_NAME_LEN]; | char backend[CTL_BE_NAME_LEN]; | ||||
ctl_lunreq_type reqtype; | ctl_lunreq_type reqtype; | ||||
union ctl_lunreq_data reqdata; | union ctl_lunreq_data reqdata; | ||||
int num_be_args; | void * args; | ||||
struct ctl_be_arg *be_args; | nvlist_t * args_nvl; | ||||
size_t args_len; | |||||
void * result; | |||||
nvlist_t * result_nvl; | |||||
size_t result_len; | |||||
ctl_lun_status status; | ctl_lun_status status; | ||||
char error_str[CTL_ERROR_STR_LEN]; | char error_str[CTL_ERROR_STR_LEN]; | ||||
struct ctl_be_arg *kern_be_args; | |||||
}; | }; | ||||
/* | /* | ||||
* LUN list status: | * LUN list status: | ||||
* | * | ||||
* NONE: No status. | * NONE: No status. | ||||
* | * | ||||
* OK: Request completed successfully. | * OK: Request completed successfully. | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | typedef enum { | ||||
CTL_REQ_CREATE, | CTL_REQ_CREATE, | ||||
CTL_REQ_REMOVE, | CTL_REQ_REMOVE, | ||||
CTL_REQ_MODIFY, | CTL_REQ_MODIFY, | ||||
} ctl_req_type; | } ctl_req_type; | ||||
struct ctl_req { | struct ctl_req { | ||||
char driver[CTL_DRIVER_NAME_LEN]; | char driver[CTL_DRIVER_NAME_LEN]; | ||||
ctl_req_type reqtype; | ctl_req_type reqtype; | ||||
int num_args; | void * args; | ||||
struct ctl_be_arg *args; | nvlist_t * args_nvl; | ||||
size_t args_len; | |||||
void * result; | |||||
nvlist_t * result_nvl; | |||||
size_t result_len; | |||||
ctl_lun_status status; | ctl_lun_status status; | ||||
char error_str[CTL_ERROR_STR_LEN]; | char error_str[CTL_ERROR_STR_LEN]; | ||||
struct ctl_be_arg *kern_args; | |||||
}; | }; | ||||
/* | /* | ||||
* iSCSI status | * iSCSI status | ||||
* | * | ||||
* OK: Request completed successfully. | * OK: Request completed successfully. | ||||
* | * | ||||
* ERROR: An error occurred, look at the error string for a | * ERROR: An error occurred, look at the error string for a | ||||
▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines |