Blob Blame History Raw
From: Daniel Wagner <dwagner@suse.de>
Date: Tue, 24 Sep 2019 09:29:06 +0200
Subject: scsi: qedf: Add port_id getter
Patch-mainline: v5.5-rc1
Git-commit: c3dde2f3fe6aa48ed4650e103d23aac8f9620ddd
References: bsc#1150660

Add qedf_get_host_port_id() to the transport template.

The fc_transport_template initializes the port_id member to the default
value of -1. The new getter ensures that the sysfs entry shows the current
value and not the default one, e.g by using 'lsscsi -H -t'

Link: https://lore.kernel.org/r/20190924072906.23737-1-dwagner@suse.de
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Acked-by: Saurav Kashyap <skashyap@marvell.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
---
 drivers/scsi/qedf/qedf_main.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -1849,6 +1849,13 @@ static int qedf_fcoe_reset(struct Scsi_H
 	return 0;
 }
 
+static void qedf_get_host_port_id(struct Scsi_Host *shost)
+{
+	struct fc_lport *lport = shost_priv(shost);
+
+	fc_host_port_id(shost) = lport->port_id;
+}
+
 static struct fc_host_statistics *qedf_fc_get_host_stats(struct Scsi_Host
 	*shost)
 {
@@ -1919,6 +1926,7 @@ static struct fc_function_template qedf_
 	.show_host_active_fc4s = 1,
 	.show_host_maxframe_size = 1,
 
+	.get_host_port_id = qedf_get_host_port_id,
 	.show_host_port_id = 1,
 	.show_host_supported_speeds = 1,
 	.get_host_speed = fc_get_host_speed,