Kernel component to enable the new 'boot_nic' param in the kernel
session sysfs.


Signed-off-by: Eddie Wai <eddie....@broadcom.com>
---
 kernel/libiscsi.c             |    6 ++++++
 kernel/libiscsi.h             |    2 ++
 kernel/scsi_transport_iscsi.c |    2 ++
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/kernel/libiscsi.c b/kernel/libiscsi.c
index 59e3a5f..56cf22a 100644
--- a/kernel/libiscsi.c
+++ b/kernel/libiscsi.c
@@ -2833,6 +2833,7 @@ void iscsi_session_teardown(struct iscsi_cls_session 
*cls_session)
        kfree(session->username_in);
        kfree(session->targetname);
        kfree(session->initiatorname);
+       kfree(session->boot_nic);
        kfree(session->ifacename);
 
        iscsi_destroy_session(cls_session);
@@ -3279,6 +3280,8 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
                return iscsi_switch_str_param(&session->ifacename, buf);
        case ISCSI_PARAM_INITIATOR_NAME:
                return iscsi_switch_str_param(&session->initiatorname, buf);
+       case ISCSI_PARAM_BOOT_NIC:
+               return iscsi_switch_str_param(&session->boot_nic, buf);
        default:
                return -ENOSYS;
        }
@@ -3354,6 +3357,9 @@ int iscsi_session_get_param(struct iscsi_cls_session 
*cls_session,
        case ISCSI_PARAM_INITIATOR_NAME:
                len = sprintf(buf, "%s\n", session->initiatorname);
                break;
+       case ISCSI_PARAM_BOOT_NIC:
+               len = sprintf(buf, "%s\n", session->boot_nic);
+               break;
        default:
                return -ENOSYS;
        }
diff --git a/kernel/libiscsi.h b/kernel/libiscsi.h
index 0563539..762692c 100644
--- a/kernel/libiscsi.h
+++ b/kernel/libiscsi.h
@@ -287,6 +287,8 @@ struct iscsi_session {
        char                    *targetname;
        char                    *ifacename;
        char                    *initiatorname;
+       char                    *boot_nic;
+
        /* control data */
        struct iscsi_transport  *tt;
        struct Scsi_Host        *host;
diff --git a/kernel/scsi_transport_iscsi.c b/kernel/scsi_transport_iscsi.c
index fed8c9e..6f23318 100644
--- a/kernel/scsi_transport_iscsi.c
+++ b/kernel/scsi_transport_iscsi.c
@@ -1764,6 +1764,7 @@ iscsi_session_attr(lu_reset_tmo, 
ISCSI_PARAM_LU_RESET_TMO, 0);
 iscsi_session_attr(tgt_reset_tmo, ISCSI_PARAM_TGT_RESET_TMO, 0);
 iscsi_session_attr(ifacename, ISCSI_PARAM_IFACE_NAME, 0);
 iscsi_session_attr(initiatorname, ISCSI_PARAM_INITIATOR_NAME, 0)
+iscsi_session_attr(boot_nic, ISCSI_PARAM_BOOT_NIC, 0)
 
 static ssize_t
 show_priv_session_state(struct device *dev, struct device_attribute *attr,
@@ -2006,6 +2007,7 @@ iscsi_register_transport(struct iscsi_transport *tt)
        SETUP_SESSION_RD_ATTR(tgt_reset_tmo,ISCSI_TGT_RESET_TMO);
        SETUP_SESSION_RD_ATTR(ifacename, ISCSI_IFACE_NAME);
        SETUP_SESSION_RD_ATTR(initiatorname, ISCSI_INITIATOR_NAME);
+       SETUP_SESSION_RD_ATTR(boot_nic, ISCSI_BOOT_NIC);
        SETUP_PRIV_SESSION_RD_ATTR(recovery_tmo);
        SETUP_PRIV_SESSION_RD_ATTR(state);
 
-- 
1.7.7.4


-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to