ISCSI_PERSISTENT_ADDRESS |
ISCSI_TARGET_NAME |
ISCSI_TPGT,
- .host_param_mask = ISCSI_HOST_HWADDRESS,
+ .host_param_mask = ISCSI_HOST_HWADDRESS |
+ ISCSI_HOST_INITIATOR_NAME,
.host_template = &iscsi_iser_sht,
.conndata_size = sizeof(struct iscsi_conn),
.max_lun = ISCSI_ISER_MAX_LUN,
ISCSI_PERSISTENT_ADDRESS |
ISCSI_TARGET_NAME |
ISCSI_TPGT,
- .host_param_mask = ISCSI_HOST_HWADDRESS,
+ .host_param_mask = ISCSI_HOST_HWADDRESS |
+ ISCSI_HOST_INITIATOR_NAME,
.host_template = &iscsi_sht,
.conndata_size = sizeof(struct iscsi_conn),
.max_conn = 1,
kfree(session->targetname);
kfree(session->hwaddress);
+ kfree(session->initiatorname);
iscsi_destroy_session(cls_session);
scsi_host_put(shost);
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;
}
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;
}
.name = DRIVER_NAME,
.param_mask = ISCSI_CONN_PORT | ISCSI_CONN_ADDRESS |
ISCSI_TARGET_NAME | ISCSI_TPGT,
- .host_param_mask = ISCSI_HOST_HWADDRESS,
+ .host_param_mask = ISCSI_HOST_HWADDRESS |
+ ISCSI_HOST_INITIATOR_NAME,
.sessiondata_size = sizeof(struct ddb_entry),
.host_template = &qla4xxx_driver_template,
case ISCSI_HOST_PARAM_HWADDRESS:
len = format_addr(buf, ha->my_mac, MAC_ADDR_LEN);
break;
+ case ISCSI_HOST_PARAM_INITIATOR_NAME:
+ len = sprintf(buf, ha->name_string);
+ break;
default:
return -ENOSYS;
}
#define ISCSI_SESSION_ATTRS 11
#define ISCSI_CONN_ATTRS 11
-#define ISCSI_HOST_ATTRS 1
+#define ISCSI_HOST_ATTRS 2
#define ISCSI_TRANSPORT_VERSION "2.0-724"
struct iscsi_internal {
NULL);
iscsi_host_attr(hwaddress, ISCSI_HOST_PARAM_HWADDRESS);
+iscsi_host_attr(initiatorname, ISCSI_HOST_PARAM_INITIATOR_NAME);
#define SETUP_PRIV_SESSION_RD_ATTR(field) \
do { \
transport_container_register(&priv->t.host_attrs);
SETUP_HOST_RD_ATTR(hwaddress, ISCSI_HOST_HWADDRESS);
+ SETUP_HOST_RD_ATTR(initiatorname, ISCSI_HOST_INITIATOR_NAME);
BUG_ON(count > ISCSI_HOST_ATTRS);
priv->host_attrs[count] = NULL;
count = 0;
/* iSCSI HBA params */
enum iscsi_host_param {
ISCSI_HOST_PARAM_HWADDRESS,
+ ISCSI_HOST_PARAM_INITIATOR_NAME,
ISCSI_HOST_PARAM_MAX,
};
#define ISCSI_HOST_HWADDRESS (1 << ISCSI_HOST_PARAM_HWADDRESS)
+#define ISCSI_HOST_INITIATOR_NAME (1 << ISCSI_HOST_PARAM_INITIATOR_NAME)
#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle)
#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr)
int erl;
int tpgt;
char *targetname;
+ char *initiatorname;
/* hw address being used for iscsi connection */
char *hwaddress;
/* control data */