aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVikas Chaudhary <vikas.chaudhary@qlogic.com>2010-07-10 05:21:30 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 10:05:25 -0400
commit3b2bef1fc85f127a99ad6b90a94b033fdc57341c (patch)
tree7de1d09faba5c4ec40459c31a25ba7d0db3b9f3d /drivers
parentbb6f7d5b71356be560ea84dd5a721f083d3a9e8e (diff)
[SCSI] iscsi_transport: added new iscsi_param to display target alias in sysfs
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: Ravi Anand <ravi.anand@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/qla4xxx/ql4_init.c3
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c7
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c6
3 files changed, 13 insertions, 3 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
index e6b73b9fcc5a..266ebd45396d 100644
--- a/drivers/scsi/qla4xxx/ql4_init.c
+++ b/drivers/scsi/qla4xxx/ql4_init.c
@@ -594,6 +594,9 @@ static int qla4xxx_update_ddb_entry(struct scsi_qla_host *ha,
594 memcpy(&ddb_entry->iscsi_name[0], &fw_ddb_entry->iscsi_name[0], 594 memcpy(&ddb_entry->iscsi_name[0], &fw_ddb_entry->iscsi_name[0],
595 min(sizeof(ddb_entry->iscsi_name), 595 min(sizeof(ddb_entry->iscsi_name),
596 sizeof(fw_ddb_entry->iscsi_name))); 596 sizeof(fw_ddb_entry->iscsi_name)));
597 memcpy(&ddb_entry->iscsi_alias[0], &fw_ddb_entry->iscsi_alias[0],
598 min(sizeof(ddb_entry->iscsi_alias),
599 sizeof(fw_ddb_entry->iscsi_alias)));
597 memcpy(&ddb_entry->ip_addr[0], &fw_ddb_entry->ip_addr[0], 600 memcpy(&ddb_entry->ip_addr[0], &fw_ddb_entry->ip_addr[0],
598 min(sizeof(ddb_entry->ip_addr), sizeof(fw_ddb_entry->ip_addr))); 601 min(sizeof(ddb_entry->ip_addr), sizeof(fw_ddb_entry->ip_addr)));
599 602
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index daf5a4bf9b0a..821384147a41 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -126,7 +126,8 @@ static struct iscsi_transport qla4xxx_iscsi_transport = {
126 .caps = CAP_FW_DB | CAP_SENDTARGETS_OFFLOAD | 126 .caps = CAP_FW_DB | CAP_SENDTARGETS_OFFLOAD |
127 CAP_DATA_PATH_OFFLOAD, 127 CAP_DATA_PATH_OFFLOAD,
128 .param_mask = ISCSI_CONN_PORT | ISCSI_CONN_ADDRESS | 128 .param_mask = ISCSI_CONN_PORT | ISCSI_CONN_ADDRESS |
129 ISCSI_TARGET_NAME | ISCSI_TPGT, 129 ISCSI_TARGET_NAME | ISCSI_TPGT |
130 ISCSI_TARGET_ALIAS,
130 .host_param_mask = ISCSI_HOST_HWADDRESS | 131 .host_param_mask = ISCSI_HOST_HWADDRESS |
131 ISCSI_HOST_IPADDRESS | 132 ISCSI_HOST_IPADDRESS |
132 ISCSI_HOST_INITIATOR_NAME, 133 ISCSI_HOST_INITIATOR_NAME,
@@ -210,6 +211,10 @@ static int qla4xxx_sess_get_param(struct iscsi_cls_session *sess,
210 case ISCSI_PARAM_TPGT: 211 case ISCSI_PARAM_TPGT:
211 len = sprintf(buf, "%u\n", ddb_entry->tpgt); 212 len = sprintf(buf, "%u\n", ddb_entry->tpgt);
212 break; 213 break;
214 case ISCSI_PARAM_TARGET_ALIAS:
215 len = snprintf(buf, PAGE_SIZE - 1, "%s\n",
216 ddb_entry->iscsi_alias);
217 break;
213 default: 218 default:
214 return -ENOSYS; 219 return -ENOSYS;
215 } 220 }
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 1e6d4793542c..b9aec304872c 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -31,7 +31,7 @@
31#include <scsi/scsi_transport_iscsi.h> 31#include <scsi/scsi_transport_iscsi.h>
32#include <scsi/iscsi_if.h> 32#include <scsi/iscsi_if.h>
33 33
34#define ISCSI_SESSION_ATTRS 22 34#define ISCSI_SESSION_ATTRS 23
35#define ISCSI_CONN_ATTRS 13 35#define ISCSI_CONN_ATTRS 13
36#define ISCSI_HOST_ATTRS 4 36#define ISCSI_HOST_ATTRS 4
37 37
@@ -1763,7 +1763,8 @@ iscsi_session_attr(abort_tmo, ISCSI_PARAM_ABORT_TMO, 0);
1763iscsi_session_attr(lu_reset_tmo, ISCSI_PARAM_LU_RESET_TMO, 0); 1763iscsi_session_attr(lu_reset_tmo, ISCSI_PARAM_LU_RESET_TMO, 0);
1764iscsi_session_attr(tgt_reset_tmo, ISCSI_PARAM_TGT_RESET_TMO, 0); 1764iscsi_session_attr(tgt_reset_tmo, ISCSI_PARAM_TGT_RESET_TMO, 0);
1765iscsi_session_attr(ifacename, ISCSI_PARAM_IFACE_NAME, 0); 1765iscsi_session_attr(ifacename, ISCSI_PARAM_IFACE_NAME, 0);
1766iscsi_session_attr(initiatorname, ISCSI_PARAM_INITIATOR_NAME, 0) 1766iscsi_session_attr(initiatorname, ISCSI_PARAM_INITIATOR_NAME, 0);
1767iscsi_session_attr(targetalias, ISCSI_PARAM_TARGET_ALIAS, 0);
1767 1768
1768static ssize_t 1769static ssize_t
1769show_priv_session_state(struct device *dev, struct device_attribute *attr, 1770show_priv_session_state(struct device *dev, struct device_attribute *attr,
@@ -2006,6 +2007,7 @@ iscsi_register_transport(struct iscsi_transport *tt)
2006 SETUP_SESSION_RD_ATTR(tgt_reset_tmo,ISCSI_TGT_RESET_TMO); 2007 SETUP_SESSION_RD_ATTR(tgt_reset_tmo,ISCSI_TGT_RESET_TMO);
2007 SETUP_SESSION_RD_ATTR(ifacename, ISCSI_IFACE_NAME); 2008 SETUP_SESSION_RD_ATTR(ifacename, ISCSI_IFACE_NAME);
2008 SETUP_SESSION_RD_ATTR(initiatorname, ISCSI_INITIATOR_NAME); 2009 SETUP_SESSION_RD_ATTR(initiatorname, ISCSI_INITIATOR_NAME);
2010 SETUP_SESSION_RD_ATTR(targetalias, ISCSI_TARGET_ALIAS);
2009 SETUP_PRIV_SESSION_RD_ATTR(recovery_tmo); 2011 SETUP_PRIV_SESSION_RD_ATTR(recovery_tmo);
2010 SETUP_PRIV_SESSION_RD_ATTR(state); 2012 SETUP_PRIV_SESSION_RD_ATTR(state);
2011 2013