From 8ad5781ae9702a8f95cfdf30967752e4297613ee Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Wed, 30 May 2007 12:57:13 -0500 Subject: [SCSI] iscsi class, qla4xxx, iscsi_tcp, ib_iser: export/set initiator name For iscsi root boot, software iscsi needs to know what the BIOS/OF initiator used for the initiator name so this puts it in sysfs for userspace to be able to pick up. For hw iscsi, it is nice to see what the card is using. This patch adds the new param, and hooks in qla4xxx, iscsi_tcp, and ib_iser. Signed-off-by: Mike Christie Cc: Roland Dreier Cc: David C Somayajulu Signed-off-by: James Bottomley --- drivers/scsi/libiscsi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/scsi/libiscsi.c') diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index d430e227e9b7..5e6a42429c39 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -1463,6 +1463,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session) kfree(session->targetname); kfree(session->hwaddress); + kfree(session->initiatorname); iscsi_destroy_session(cls_session); scsi_host_put(shost); @@ -2004,6 +2005,13 @@ int iscsi_host_get_param(struct Scsi_Host *shost, enum iscsi_host_param param, else len = sprintf(buf, "%s\n", session->hwaddress); break; + case ISCSI_HOST_PARAM_INITIATOR_NAME: + if (!session->initiatorname) + len = sprintf(buf, "%s\n", "unknown"); + else + len = sprintf(buf, "%s\n", session->initiatorname); + break; + default: return -ENOSYS; } @@ -2022,6 +2030,10 @@ int iscsi_host_set_param(struct Scsi_Host *shost, enum iscsi_host_param param, if (!session->hwaddress) session->hwaddress = kstrdup(buf, GFP_KERNEL); break; + case ISCSI_HOST_PARAM_INITIATOR_NAME: + if (!session->initiatorname) + session->initiatorname = kstrdup(buf, GFP_KERNEL); + break; default: return -ENOSYS; } -- cgit v1.2.3