Commit c0dc941e authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Nicholas Bellinger

target_core_alua: Store supported ALUA states

The supported ALUA states might be different for individual
devices, so store it in a separate field.

(nab: Remove unnecessary line continuation)
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 73f3bf51
...@@ -117,12 +117,7 @@ target_emulate_report_target_port_groups(struct se_cmd *cmd) ...@@ -117,12 +117,7 @@ target_emulate_report_target_port_groups(struct se_cmd *cmd)
/* /*
* Set supported ASYMMETRIC ACCESS State bits * Set supported ASYMMETRIC ACCESS State bits
*/ */
buf[off] = 0x80; /* T_SUP */ buf[off++] |= tg_pt_gp->tg_pt_gp_alua_supported_states;
buf[off] |= 0x40; /* O_SUP */
buf[off] |= 0x8; /* U_SUP */
buf[off] |= 0x4; /* S_SUP */
buf[off] |= 0x2; /* AN_SUP */
buf[off++] |= 0x1; /* AO_SUP */
/* /*
* TARGET PORT GROUP * TARGET PORT GROUP
*/ */
...@@ -1367,6 +1362,13 @@ struct t10_alua_tg_pt_gp *core_alua_allocate_tg_pt_gp(struct se_device *dev, ...@@ -1367,6 +1362,13 @@ struct t10_alua_tg_pt_gp *core_alua_allocate_tg_pt_gp(struct se_device *dev,
tg_pt_gp->tg_pt_gp_trans_delay_msecs = ALUA_DEFAULT_TRANS_DELAY_MSECS; tg_pt_gp->tg_pt_gp_trans_delay_msecs = ALUA_DEFAULT_TRANS_DELAY_MSECS;
tg_pt_gp->tg_pt_gp_implicit_trans_secs = ALUA_DEFAULT_IMPLICIT_TRANS_SECS; tg_pt_gp->tg_pt_gp_implicit_trans_secs = ALUA_DEFAULT_IMPLICIT_TRANS_SECS;
/*
* Enable all supported states
*/
tg_pt_gp->tg_pt_gp_alua_supported_states =
ALUA_T_SUP | ALUA_O_SUP |
ALUA_U_SUP | ALUA_S_SUP | ALUA_AN_SUP | ALUA_AO_SUP;
if (def_group) { if (def_group) {
spin_lock(&dev->t10_alua.tg_pt_gps_lock); spin_lock(&dev->t10_alua.tg_pt_gps_lock);
tg_pt_gp->tg_pt_gp_id = tg_pt_gp->tg_pt_gp_id =
......
...@@ -22,6 +22,17 @@ ...@@ -22,6 +22,17 @@
#define ALUA_ACCESS_STATE_OFFLINE 0xe #define ALUA_ACCESS_STATE_OFFLINE 0xe
#define ALUA_ACCESS_STATE_TRANSITION 0xf #define ALUA_ACCESS_STATE_TRANSITION 0xf
/*
* from spc4r36j section 6.37 Table 306
*/
#define ALUA_T_SUP 0x80
#define ALUA_O_SUP 0x40
#define ALUA_LBD_SUP 0x10
#define ALUA_U_SUP 0x08
#define ALUA_S_SUP 0x04
#define ALUA_AN_SUP 0x02
#define ALUA_AO_SUP 0x01
/* /*
* REPORT_TARGET_PORT_GROUP STATUS CODE * REPORT_TARGET_PORT_GROUP STATUS CODE
* *
......
...@@ -283,6 +283,7 @@ struct t10_alua_lu_gp_member { ...@@ -283,6 +283,7 @@ struct t10_alua_lu_gp_member {
struct t10_alua_tg_pt_gp { struct t10_alua_tg_pt_gp {
u16 tg_pt_gp_id; u16 tg_pt_gp_id;
int tg_pt_gp_valid_id; int tg_pt_gp_valid_id;
int tg_pt_gp_alua_supported_states;
int tg_pt_gp_alua_access_status; int tg_pt_gp_alua_access_status;
int tg_pt_gp_alua_access_type; int tg_pt_gp_alua_access_type;
int tg_pt_gp_nonop_delay_msecs; int tg_pt_gp_nonop_delay_msecs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment