aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2013-11-19 03:07:49 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2013-11-20 14:26:37 -0500
commitc0dc941e2bdfad4deccf3ba2626f485b5a5f59a4 (patch)
treed909e4e782af830619338183c9c6e76f87c99a0d
parent73f3bf51e0b296acc58f895639be743739347da1 (diff)
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: Hannes Reinecke <hare@suse.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/target/target_core_alua.c14
-rw-r--r--drivers/target/target_core_alua.h11
-rw-r--r--include/target/target_core_base.h1
3 files changed, 20 insertions, 6 deletions
diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
index 08e41e33ab91..fdcee326bfbc 100644
--- a/drivers/target/target_core_alua.c
+++ b/drivers/target/target_core_alua.c
@@ -117,12 +117,7 @@ target_emulate_report_target_port_groups(struct se_cmd *cmd)
117 /* 117 /*
118 * Set supported ASYMMETRIC ACCESS State bits 118 * Set supported ASYMMETRIC ACCESS State bits
119 */ 119 */
120 buf[off] = 0x80; /* T_SUP */ 120 buf[off++] |= tg_pt_gp->tg_pt_gp_alua_supported_states;
121 buf[off] |= 0x40; /* O_SUP */
122 buf[off] |= 0x8; /* U_SUP */
123 buf[off] |= 0x4; /* S_SUP */
124 buf[off] |= 0x2; /* AN_SUP */
125 buf[off++] |= 0x1; /* AO_SUP */
126 /* 121 /*
127 * TARGET PORT GROUP 122 * TARGET PORT GROUP
128 */ 123 */
@@ -1367,6 +1362,13 @@ struct t10_alua_tg_pt_gp *core_alua_allocate_tg_pt_gp(struct se_device *dev,
1367 tg_pt_gp->tg_pt_gp_trans_delay_msecs = ALUA_DEFAULT_TRANS_DELAY_MSECS; 1362 tg_pt_gp->tg_pt_gp_trans_delay_msecs = ALUA_DEFAULT_TRANS_DELAY_MSECS;
1368 tg_pt_gp->tg_pt_gp_implicit_trans_secs = ALUA_DEFAULT_IMPLICIT_TRANS_SECS; 1363 tg_pt_gp->tg_pt_gp_implicit_trans_secs = ALUA_DEFAULT_IMPLICIT_TRANS_SECS;
1369 1364
1365 /*
1366 * Enable all supported states
1367 */
1368 tg_pt_gp->tg_pt_gp_alua_supported_states =
1369 ALUA_T_SUP | ALUA_O_SUP |
1370 ALUA_U_SUP | ALUA_S_SUP | ALUA_AN_SUP | ALUA_AO_SUP;
1371
1370 if (def_group) { 1372 if (def_group) {
1371 spin_lock(&dev->t10_alua.tg_pt_gps_lock); 1373 spin_lock(&dev->t10_alua.tg_pt_gps_lock);
1372 tg_pt_gp->tg_pt_gp_id = 1374 tg_pt_gp->tg_pt_gp_id =
diff --git a/drivers/target/target_core_alua.h b/drivers/target/target_core_alua.h
index d6db78b3e9e4..88e2e835f14a 100644
--- a/drivers/target/target_core_alua.h
+++ b/drivers/target/target_core_alua.h
@@ -23,6 +23,17 @@
23#define ALUA_ACCESS_STATE_TRANSITION 0xf 23#define ALUA_ACCESS_STATE_TRANSITION 0xf
24 24
25/* 25/*
26 * from spc4r36j section 6.37 Table 306
27 */
28#define ALUA_T_SUP 0x80
29#define ALUA_O_SUP 0x40
30#define ALUA_LBD_SUP 0x10
31#define ALUA_U_SUP 0x08
32#define ALUA_S_SUP 0x04
33#define ALUA_AN_SUP 0x02
34#define ALUA_AO_SUP 0x01
35
36/*
26 * REPORT_TARGET_PORT_GROUP STATUS CODE 37 * REPORT_TARGET_PORT_GROUP STATUS CODE
27 * 38 *
28 * from spc4r17 section 6.27 Table 246 39 * from spc4r17 section 6.27 Table 246
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 3b0b64aefc27..45412a6afa69 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -283,6 +283,7 @@ struct t10_alua_lu_gp_member {
283struct t10_alua_tg_pt_gp { 283struct t10_alua_tg_pt_gp {
284 u16 tg_pt_gp_id; 284 u16 tg_pt_gp_id;
285 int tg_pt_gp_valid_id; 285 int tg_pt_gp_valid_id;
286 int tg_pt_gp_alua_supported_states;
286 int tg_pt_gp_alua_access_status; 287 int tg_pt_gp_alua_access_status;
287 int tg_pt_gp_alua_access_type; 288 int tg_pt_gp_alua_access_type;
288 int tg_pt_gp_nonop_delay_msecs; 289 int tg_pt_gp_nonop_delay_msecs;