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

Go to the source code of this file.

Data Structures

struct  enc_element
 
struct  enc_fsm_state
 
struct  enc_vec
 
struct  enc_cache
 
struct  enc_softc
 
struct  ses_mgmt_mode_page
 

Macros

#define ENC_FLAG_INVALID   0x01
 
#define ENC_FLAG_INITIALIZED   0x02
 
#define ENC_FLAG_SHUTDOWN   0x04
 
#define ENC_UPDATE_NONE   0x00
 
#define ENC_UPDATE_INVALID   0xff
 
#define ENC_ANNOUNCE_SZ   400
 
#define SES_MGMT_MODE_PAGE_CODE   0x14
 
#define SES_MGMT_MODE_PAGE_LEN   6
 
#define SES_MGMT_TIMED_COMP_EN   0x1
 
#define ENC_CFLAGS   CAM_RETRY_SELTO
 
#define ENC_FLAGS   SF_NO_PRINT | SF_RETRY_UA
 
#define STRNCMP   strncmp
 
#define PRINTF   printf
 
#define ENC_LOG   enc_log
 
#define ENC_DLOG   if (0) enc_log
 
#define ENC_VLOG   if (enc_verbose) enc_log
 
#define ENC_MALLOC(amt)   malloc(amt, M_SCSIENC, M_NOWAIT)
 
#define ENC_MALLOCZ(amt)   malloc(amt, M_SCSIENC, M_ZERO|M_NOWAIT)
 
#define ENC_FREE(ptr)   free((void *)((uintptr_t)ptr), M_SCSIENC)
 
#define ENC_FREE_AND_NULL(ptr)
 
#define MEMZERO   bzero
 
#define MEMCPY(dest, src, amt)   bcopy(src, dest, amt)
 

Typedefs

typedef struct enc_element enc_element_t
 
typedef struct enc_softc enc_softc_t
 
typedef int fsm_fill_handler_t(enc_softc_t *ssc, struct enc_fsm_state *state, union ccb *ccb, uint8_t *buf)
 
typedef int fsm_error_handler_t(union ccb *ccb, uint32_t cflags, uint32_t sflags)
 
typedef int fsm_done_handler_t(enc_softc_t *ssc, struct enc_fsm_state *state, union ccb *ccb, uint8_t **bufp, int error, int xfer_len)
 
typedef int() enc_softc_init_t(enc_softc_t *)
 
typedef void() enc_softc_invalidate_t(enc_softc_t *)
 
typedef void() enc_softc_cleanup_t(enc_softc_t *)
 
typedef int() enc_init_enc_t(enc_softc_t *)
 
typedef int() enc_set_enc_status_t(enc_softc_t *, encioc_enc_status_t, int)
 
typedef int() enc_get_elm_status_t(enc_softc_t *, encioc_elm_status_t *, int)
 
typedef int() enc_set_elm_status_t(enc_softc_t *, encioc_elm_status_t *, int)
 
typedef int() enc_get_elm_desc_t(enc_softc_t *, encioc_elm_desc_t *)
 
typedef int() enc_get_elm_devnames_t(enc_softc_t *, encioc_elm_devnames_t *)
 
typedef int() enc_handle_string_t(enc_softc_t *, encioc_string_t *, unsigned long)
 
typedef void() enc_device_found_t(enc_softc_t *)
 
typedef void() enc_poll_status_t(enc_softc_t *)
 
typedef struct enc_cache enc_cache_t
 

Enumerations

enum  enctyp {
  ENC_NONE , ENC_SES , ENC_SES_PASSTHROUGH , ENC_SAFT ,
  ENC_SEMB_SES , ENC_SEMB_SAFT
}
 

Functions

static enc_cache_tenc_other_cache (enc_softc_t *enc, enc_cache_t *primary)
 
int enc_runcmd (struct enc_softc *, char *, int, char *, int *)
 
void enc_log (struct enc_softc *, const char *,...)
 
int enc_error (union ccb *, uint32_t, uint32_t)
 
void enc_update_request (enc_softc_t *, uint32_t)
 Queue an update request for a given action, if needed. More...
 
 SYSCTL_DECL (_kern_cam_enc)
 
 MALLOC_DECLARE (M_SCSIENC)
 

Variables

enc_softc_init_t ses_softc_init
 
enc_softc_init_t safte_softc_init
 
int enc_verbose
 

Macro Definition Documentation

◆ ENC_ANNOUNCE_SZ

#define ENC_ANNOUNCE_SZ   400

Definition at line 166 of file scsi_enc_internal.h.

◆ ENC_CFLAGS

#define ENC_CFLAGS   CAM_RETRY_SELTO

Definition at line 208 of file scsi_enc_internal.h.

◆ ENC_DLOG

#define ENC_DLOG   if (0) enc_log

Definition at line 216 of file scsi_enc_internal.h.

◆ ENC_FLAG_INITIALIZED

#define ENC_FLAG_INITIALIZED   0x02

Definition at line 143 of file scsi_enc_internal.h.

◆ ENC_FLAG_INVALID

#define ENC_FLAG_INVALID   0x01

Definition at line 142 of file scsi_enc_internal.h.

◆ ENC_FLAG_SHUTDOWN

#define ENC_FLAG_SHUTDOWN   0x04

Definition at line 144 of file scsi_enc_internal.h.

◆ ENC_FLAGS

#define ENC_FLAGS   SF_NO_PRINT | SF_RETRY_UA

Definition at line 209 of file scsi_enc_internal.h.

◆ ENC_FREE

#define ENC_FREE (   ptr)    free((void *)((uintptr_t)ptr), M_SCSIENC)

Definition at line 222 of file scsi_enc_internal.h.

◆ ENC_FREE_AND_NULL

#define ENC_FREE_AND_NULL (   ptr)
Value:
do { \
if (ptr != NULL) { \
ENC_FREE(ptr); \
ptr = NULL; \
} \
} while(0)

Definition at line 223 of file scsi_enc_internal.h.

◆ ENC_LOG

#define ENC_LOG   enc_log

Definition at line 212 of file scsi_enc_internal.h.

◆ ENC_MALLOC

#define ENC_MALLOC (   amt)    malloc(amt, M_SCSIENC, M_NOWAIT)

Definition at line 219 of file scsi_enc_internal.h.

◆ ENC_MALLOCZ

#define ENC_MALLOCZ (   amt)    malloc(amt, M_SCSIENC, M_ZERO|M_NOWAIT)

Definition at line 220 of file scsi_enc_internal.h.

◆ ENC_UPDATE_INVALID

#define ENC_UPDATE_INVALID   0xff

Definition at line 155 of file scsi_enc_internal.h.

◆ ENC_UPDATE_NONE

#define ENC_UPDATE_NONE   0x00

Definition at line 154 of file scsi_enc_internal.h.

◆ ENC_VLOG

#define ENC_VLOG   if (enc_verbose) enc_log

Definition at line 218 of file scsi_enc_internal.h.

◆ MEMCPY

#define MEMCPY (   dest,
  src,
  amt 
)    bcopy(src, dest, amt)

Definition at line 230 of file scsi_enc_internal.h.

◆ MEMZERO

#define MEMZERO   bzero

Definition at line 229 of file scsi_enc_internal.h.

◆ PRINTF

#define PRINTF   printf

Definition at line 211 of file scsi_enc_internal.h.

◆ SES_MGMT_MODE_PAGE_CODE

#define SES_MGMT_MODE_PAGE_CODE   0x14

Definition at line 182 of file scsi_enc_internal.h.

◆ SES_MGMT_MODE_PAGE_LEN

#define SES_MGMT_MODE_PAGE_LEN   6

Definition at line 184 of file scsi_enc_internal.h.

◆ SES_MGMT_TIMED_COMP_EN

#define SES_MGMT_TIMED_COMP_EN   0x1

Definition at line 187 of file scsi_enc_internal.h.

◆ STRNCMP

#define STRNCMP   strncmp

Definition at line 210 of file scsi_enc_internal.h.

Typedef Documentation

◆ enc_cache_t

typedef struct enc_cache enc_cache_t

◆ enc_device_found_t

typedef void() enc_device_found_t(enc_softc_t *)

Definition at line 98 of file scsi_enc_internal.h.

◆ enc_element_t

typedef struct enc_element enc_element_t

◆ enc_get_elm_desc_t

typedef int() enc_get_elm_desc_t(enc_softc_t *, encioc_elm_desc_t *)

Definition at line 94 of file scsi_enc_internal.h.

◆ enc_get_elm_devnames_t

typedef int() enc_get_elm_devnames_t(enc_softc_t *, encioc_elm_devnames_t *)

Definition at line 95 of file scsi_enc_internal.h.

◆ enc_get_elm_status_t

typedef int() enc_get_elm_status_t(enc_softc_t *, encioc_elm_status_t *, int)

Definition at line 92 of file scsi_enc_internal.h.

◆ enc_handle_string_t

typedef int() enc_handle_string_t(enc_softc_t *, encioc_string_t *, unsigned long)

Definition at line 96 of file scsi_enc_internal.h.

◆ enc_init_enc_t

typedef int() enc_init_enc_t(enc_softc_t *)

Definition at line 90 of file scsi_enc_internal.h.

◆ enc_poll_status_t

typedef void() enc_poll_status_t(enc_softc_t *)

Definition at line 99 of file scsi_enc_internal.h.

◆ enc_set_elm_status_t

typedef int() enc_set_elm_status_t(enc_softc_t *, encioc_elm_status_t *, int)

Definition at line 93 of file scsi_enc_internal.h.

◆ enc_set_enc_status_t

typedef int() enc_set_enc_status_t(enc_softc_t *, encioc_enc_status_t, int)

Definition at line 91 of file scsi_enc_internal.h.

◆ enc_softc_cleanup_t

typedef void() enc_softc_cleanup_t(enc_softc_t *)

Definition at line 89 of file scsi_enc_internal.h.

◆ enc_softc_init_t

typedef int() enc_softc_init_t(enc_softc_t *)

Definition at line 87 of file scsi_enc_internal.h.

◆ enc_softc_invalidate_t

typedef void() enc_softc_invalidate_t(enc_softc_t *)

Definition at line 88 of file scsi_enc_internal.h.

◆ enc_softc_t

typedef struct enc_softc enc_softc_t

Definition at line 64 of file scsi_enc_internal.h.

◆ fsm_done_handler_t

typedef int fsm_done_handler_t(enc_softc_t *ssc, struct enc_fsm_state *state, union ccb *ccb, uint8_t **bufp, int error, int xfer_len)

Definition at line 73 of file scsi_enc_internal.h.

◆ fsm_error_handler_t

typedef int fsm_error_handler_t(union ccb *ccb, uint32_t cflags, uint32_t sflags)

Definition at line 71 of file scsi_enc_internal.h.

◆ fsm_fill_handler_t

typedef int fsm_fill_handler_t(enc_softc_t *ssc, struct enc_fsm_state *state, union ccb *ccb, uint8_t *buf)

Definition at line 67 of file scsi_enc_internal.h.

Enumeration Type Documentation

◆ enctyp

enum enctyp
Enumerator
ENC_NONE 
ENC_SES 
ENC_SES_PASSTHROUGH 
ENC_SAFT 
ENC_SEMB_SES 
ENC_SEMB_SAFT 

Definition at line 54 of file scsi_enc_internal.h.

Function Documentation

◆ enc_error()

int enc_error ( union ccb ccb,
uint32_t  cflags,
uint32_t  sflags 
)

Definition at line 346 of file scsi_enc.c.

References cam_periph_error().

Referenced by enc_ioctl(), enc_runcmd(), and ses_set_timed_completion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enc_log()

void enc_log ( struct enc_softc enc,
const char *  fmt,
  ... 
)

Definition at line 652 of file scsi_enc.c.

References enc_softc::periph, cam_periph::periph_name, and cam_periph::unit_number.

◆ enc_other_cache()

static enc_cache_t * enc_other_cache ( enc_softc_t enc,
enc_cache_t primary 
)
inlinestatic

Definition at line 171 of file scsi_enc_internal.h.

References enc_softc::enc_cache, and enc_softc::enc_daemon_cache.

Referenced by ses_cache_free(), ses_cache_free_elm_addlstatus(), ses_cache_free_elm_descs(), and ses_cache_free_status().

Here is the caller graph for this function:

◆ enc_runcmd()

◆ enc_update_request()

void enc_update_request ( enc_softc_t enc,
uint32_t  action 
)

◆ MALLOC_DECLARE()

MALLOC_DECLARE ( M_SCSIENC  )

◆ SYSCTL_DECL()

SYSCTL_DECL ( _kern_cam_enc  )

Variable Documentation

◆ enc_verbose

int enc_verbose
extern

Definition at line 87 of file scsi_enc.c.

◆ safte_softc_init

enc_softc_init_t safte_softc_init

Definition at line 201 of file scsi_enc_internal.h.

Referenced by enc_ctor().

◆ ses_softc_init

enc_softc_init_t ses_softc_init

Definition at line 198 of file scsi_enc_internal.h.

Referenced by enc_ctor().