linux/drivers/target/target_core_alua.h
<<
>>
Prefs
   1#ifndef TARGET_CORE_ALUA_H
   2#define TARGET_CORE_ALUA_H
   3
   4/*
   5 * INQUIRY response data, TPGS Field
   6 *
   7 * from spc4r17 section 6.4.2 Table 135
   8 */
   9#define TPGS_NO_ALUA                            0x00
  10#define TPGS_IMPLICT_ALUA                       0x10
  11#define TPGS_EXPLICT_ALUA                       0x20
  12
  13/*
  14 * ASYMMETRIC ACCESS STATE field
  15 *
  16 * from spc4r17 section 6.27 Table 245
  17 */
  18#define ALUA_ACCESS_STATE_ACTIVE_OPTMIZED       0x0
  19#define ALUA_ACCESS_STATE_ACTIVE_NON_OPTIMIZED  0x1
  20#define ALUA_ACCESS_STATE_STANDBY               0x2
  21#define ALUA_ACCESS_STATE_UNAVAILABLE           0x3
  22#define ALUA_ACCESS_STATE_OFFLINE               0xe
  23#define ALUA_ACCESS_STATE_TRANSITION            0xf
  24
  25/*
  26 * REPORT_TARGET_PORT_GROUP STATUS CODE
  27 *
  28 * from spc4r17 section 6.27 Table 246
  29 */
  30#define ALUA_STATUS_NONE                                0x00
  31#define ALUA_STATUS_ALTERED_BY_EXPLICT_STPG             0x01
  32#define ALUA_STATUS_ALTERED_BY_IMPLICT_ALUA             0x02
  33
  34/*
  35 * From spc4r17, Table D.1: ASC and ASCQ Assignement
  36 */
  37#define ASCQ_04H_ALUA_STATE_TRANSITION                  0x0a
  38#define ASCQ_04H_ALUA_TG_PT_STANDBY                     0x0b
  39#define ASCQ_04H_ALUA_TG_PT_UNAVAILABLE                 0x0c
  40#define ASCQ_04H_ALUA_OFFLINE                           0x12
  41
  42/*
  43 * Used as the default for Active/NonOptimized delay (in milliseconds)
  44 * This can also be changed via configfs on a per target port group basis..
  45 */
  46#define ALUA_DEFAULT_NONOP_DELAY_MSECS                  100
  47#define ALUA_MAX_NONOP_DELAY_MSECS                      10000 /* 10 seconds */
  48/*
  49 * Used for implict and explict ALUA transitional delay, that is disabled
  50 * by default, and is intended to be used for debugging client side ALUA code.
  51 */
  52#define ALUA_DEFAULT_TRANS_DELAY_MSECS                  0
  53#define ALUA_MAX_TRANS_DELAY_MSECS                      30000 /* 30 seconds */
  54/*
  55 * Used for the recommended application client implict transition timeout
  56 * in seconds, returned by the REPORT_TARGET_PORT_GROUPS w/ extended header.
  57 */
  58#define ALUA_DEFAULT_IMPLICT_TRANS_SECS                 0
  59#define ALUA_MAX_IMPLICT_TRANS_SECS                     255
  60/*
  61 * Used by core_alua_update_tpg_primary_metadata() and
  62 * core_alua_update_tpg_secondary_metadata()
  63 */
  64#define ALUA_METADATA_PATH_LEN                          512
  65/*
  66 * Used by core_alua_update_tpg_secondary_metadata()
  67 */
  68#define ALUA_SECONDARY_METADATA_WWN_LEN                 256
  69
  70extern struct kmem_cache *t10_alua_lu_gp_cache;
  71extern struct kmem_cache *t10_alua_lu_gp_mem_cache;
  72extern struct kmem_cache *t10_alua_tg_pt_gp_cache;
  73extern struct kmem_cache *t10_alua_tg_pt_gp_mem_cache;
  74
  75extern sense_reason_t target_emulate_report_target_port_groups(struct se_cmd *);
  76extern sense_reason_t target_emulate_set_target_port_groups(struct se_cmd *);
  77extern int core_alua_check_nonop_delay(struct se_cmd *);
  78extern int core_alua_do_port_transition(struct t10_alua_tg_pt_gp *,
  79                                struct se_device *, struct se_port *,
  80                                struct se_node_acl *, int, int);
  81extern char *core_alua_dump_status(int);
  82extern struct t10_alua_lu_gp *core_alua_allocate_lu_gp(const char *, int);
  83extern int core_alua_set_lu_gp_id(struct t10_alua_lu_gp *, u16);
  84extern void core_alua_free_lu_gp(struct t10_alua_lu_gp *);
  85extern void core_alua_free_lu_gp_mem(struct se_device *);
  86extern struct t10_alua_lu_gp *core_alua_get_lu_gp_by_name(const char *);
  87extern void core_alua_put_lu_gp_from_name(struct t10_alua_lu_gp *);
  88extern void __core_alua_attach_lu_gp_mem(struct t10_alua_lu_gp_member *,
  89                                        struct t10_alua_lu_gp *);
  90extern void __core_alua_drop_lu_gp_mem(struct t10_alua_lu_gp_member *,
  91                                        struct t10_alua_lu_gp *);
  92extern void core_alua_drop_lu_gp_dev(struct se_device *);
  93extern struct t10_alua_tg_pt_gp *core_alua_allocate_tg_pt_gp(
  94                        struct se_device *, const char *, int);
  95extern int core_alua_set_tg_pt_gp_id(struct t10_alua_tg_pt_gp *, u16);
  96extern struct t10_alua_tg_pt_gp_member *core_alua_allocate_tg_pt_gp_mem(
  97                                        struct se_port *);
  98extern void core_alua_free_tg_pt_gp(struct t10_alua_tg_pt_gp *);
  99extern void core_alua_free_tg_pt_gp_mem(struct se_port *);
 100extern void __core_alua_attach_tg_pt_gp_mem(struct t10_alua_tg_pt_gp_member *,
 101                                        struct t10_alua_tg_pt_gp *);
 102extern ssize_t core_alua_show_tg_pt_gp_info(struct se_port *, char *);
 103extern ssize_t core_alua_store_tg_pt_gp_info(struct se_port *, const char *,
 104                                                size_t);
 105extern ssize_t core_alua_show_access_type(struct t10_alua_tg_pt_gp *, char *);
 106extern ssize_t core_alua_store_access_type(struct t10_alua_tg_pt_gp *,
 107                                        const char *, size_t);
 108extern ssize_t core_alua_show_nonop_delay_msecs(struct t10_alua_tg_pt_gp *,
 109                                                char *);
 110extern ssize_t core_alua_store_nonop_delay_msecs(struct t10_alua_tg_pt_gp *,
 111                                        const char *, size_t);
 112extern ssize_t core_alua_show_trans_delay_msecs(struct t10_alua_tg_pt_gp *,
 113                                        char *);
 114extern ssize_t core_alua_store_trans_delay_msecs(struct t10_alua_tg_pt_gp *,
 115                                        const char *, size_t);
 116extern ssize_t core_alua_show_implict_trans_secs(struct t10_alua_tg_pt_gp *,
 117                                        char *);
 118extern ssize_t core_alua_store_implict_trans_secs(struct t10_alua_tg_pt_gp *,
 119                                        const char *, size_t);
 120extern ssize_t core_alua_show_preferred_bit(struct t10_alua_tg_pt_gp *,
 121                                        char *);
 122extern ssize_t core_alua_store_preferred_bit(struct t10_alua_tg_pt_gp *,
 123                                        const char *, size_t);
 124extern ssize_t core_alua_show_offline_bit(struct se_lun *, char *);
 125extern ssize_t core_alua_store_offline_bit(struct se_lun *, const char *,
 126                                        size_t);
 127extern ssize_t core_alua_show_secondary_status(struct se_lun *, char *);
 128extern ssize_t core_alua_store_secondary_status(struct se_lun *,
 129                                        const char *, size_t);
 130extern ssize_t core_alua_show_secondary_write_metadata(struct se_lun *,
 131                                        char *);
 132extern ssize_t core_alua_store_secondary_write_metadata(struct se_lun *,
 133                                        const char *, size_t);
 134extern int core_setup_alua(struct se_device *);
 135extern sense_reason_t target_alua_state_check(struct se_cmd *cmd);
 136
 137#endif /* TARGET_CORE_ALUA_H */
 138
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.