diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2007-05-30 13:57:13 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2007-06-01 12:56:40 -0400 |
commit | 8ad5781ae9702a8f95cfdf30967752e4297613ee (patch) | |
tree | caafde966ac7e9cda0e27e3b5412f25021d2d561 /drivers/scsi/libiscsi.c | |
parent | 0801c242a33426fddc005c2f559a3d2fa6fca7eb (diff) |
[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 <michaelc@cs.wisc.edu>
Cc: Roland Dreier <rdreier@cisco.com>
Cc: David C Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r-- | drivers/scsi/libiscsi.c | 12 |
1 files changed, 12 insertions, 0 deletions
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) | |||
1463 | 1463 | ||
1464 | kfree(session->targetname); | 1464 | kfree(session->targetname); |
1465 | kfree(session->hwaddress); | 1465 | kfree(session->hwaddress); |
1466 | kfree(session->initiatorname); | ||
1466 | 1467 | ||
1467 | iscsi_destroy_session(cls_session); | 1468 | iscsi_destroy_session(cls_session); |
1468 | scsi_host_put(shost); | 1469 | scsi_host_put(shost); |
@@ -2004,6 +2005,13 @@ int iscsi_host_get_param(struct Scsi_Host *shost, enum iscsi_host_param param, | |||
2004 | else | 2005 | else |
2005 | len = sprintf(buf, "%s\n", session->hwaddress); | 2006 | len = sprintf(buf, "%s\n", session->hwaddress); |
2006 | break; | 2007 | break; |
2008 | case ISCSI_HOST_PARAM_INITIATOR_NAME: | ||
2009 | if (!session->initiatorname) | ||
2010 | len = sprintf(buf, "%s\n", "unknown"); | ||
2011 | else | ||
2012 | len = sprintf(buf, "%s\n", session->initiatorname); | ||
2013 | break; | ||
2014 | |||
2007 | default: | 2015 | default: |
2008 | return -ENOSYS; | 2016 | return -ENOSYS; |
2009 | } | 2017 | } |
@@ -2022,6 +2030,10 @@ int iscsi_host_set_param(struct Scsi_Host *shost, enum iscsi_host_param param, | |||
2022 | if (!session->hwaddress) | 2030 | if (!session->hwaddress) |
2023 | session->hwaddress = kstrdup(buf, GFP_KERNEL); | 2031 | session->hwaddress = kstrdup(buf, GFP_KERNEL); |
2024 | break; | 2032 | break; |
2033 | case ISCSI_HOST_PARAM_INITIATOR_NAME: | ||
2034 | if (!session->initiatorname) | ||
2035 | session->initiatorname = kstrdup(buf, GFP_KERNEL); | ||
2036 | break; | ||
2025 | default: | 2037 | default: |
2026 | return -ENOSYS; | 2038 | return -ENOSYS; |
2027 | } | 2039 | } |