aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index e88b726ab2e0..c1af2aa8e4e0 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1990,6 +1990,8 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
1990 kfree(session->username); 1990 kfree(session->username);
1991 kfree(session->username_in); 1991 kfree(session->username_in);
1992 kfree(session->targetname); 1992 kfree(session->targetname);
1993 kfree(session->initiatorname);
1994 kfree(session->ifacename);
1993 1995
1994 iscsi_destroy_session(cls_session); 1996 iscsi_destroy_session(cls_session);
1995 module_put(owner); 1997 module_put(owner);
@@ -2453,6 +2455,14 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
2453 if (!conn->persistent_address) 2455 if (!conn->persistent_address)
2454 return -ENOMEM; 2456 return -ENOMEM;
2455 break; 2457 break;
2458 case ISCSI_PARAM_IFACE_NAME:
2459 if (!session->ifacename)
2460 session->ifacename = kstrdup(buf, GFP_KERNEL);
2461 break;
2462 case ISCSI_PARAM_INITIATOR_NAME:
2463 if (!session->initiatorname)
2464 session->initiatorname = kstrdup(buf, GFP_KERNEL);
2465 break;
2456 default: 2466 default:
2457 return -ENOSYS; 2467 return -ENOSYS;
2458 } 2468 }
@@ -2519,6 +2529,15 @@ int iscsi_session_get_param(struct iscsi_cls_session *cls_session,
2519 case ISCSI_PARAM_PASSWORD_IN: 2529 case ISCSI_PARAM_PASSWORD_IN:
2520 len = sprintf(buf, "%s\n", session->password_in); 2530 len = sprintf(buf, "%s\n", session->password_in);
2521 break; 2531 break;
2532 case ISCSI_PARAM_IFACE_NAME:
2533 len = sprintf(buf, "%s\n", session->ifacename);
2534 break;
2535 case ISCSI_PARAM_INITIATOR_NAME:
2536 if (!session->initiatorname)
2537 len = sprintf(buf, "%s\n", "unknown");
2538 else
2539 len = sprintf(buf, "%s\n", session->initiatorname);
2540 break;
2522 default: 2541 default:
2523 return -ENOSYS; 2542 return -ENOSYS;
2524 } 2543 }
@@ -2606,6 +2625,7 @@ int iscsi_host_get_param(struct Scsi_Host *shost, enum iscsi_host_param param,
2606 else 2625 else
2607 len = sprintf(buf, "%s\n", 2626 len = sprintf(buf, "%s\n",
2608 ihost->local_address); 2627 ihost->local_address);
2628 break;
2609 default: 2629 default:
2610 return -ENOSYS; 2630 return -ENOSYS;
2611 } 2631 }