Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp545288ybn; Wed, 25 Sep 2019 04:04:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhB3JhWBwEp40nfryetePckJtC2547M4tw9By57P/7BvttJqv26mHhBOl4Vn+Fyzxt9VoD X-Received: by 2002:a05:6512:210:: with SMTP id a16mr5468919lfo.42.1569409482854; Wed, 25 Sep 2019 04:04:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569409482; cv=none; d=google.com; s=arc-20160816; b=Yb4Lam0ZC89TCfy3ovF1jMcvA1omf8+jiwxFPiM43B4P1prFyAqr1S7gNGth2FtrSU DFi6xEerwXIyEliGy0HUWT43M+wxbOo0MJBRkRAAnxrgqhYJo7m93V32F8/MkYLPjUI4 NDuvzcLMrn7GTu6WW0kTB1z6jVtwiiEcX1CVlOJ9R6P/vvbEJyKX78NPR+YQQUAXE1Ze oXekgL899HuUR9QYFiQZ4Omuj2dpAtHcYk6H+MIawwhT5m0R33pmhPWyzDjK38CZb+Hv rhpGHsegtFFVYNBUaWLkPiGQp/dQ2THtU7x/Jw6cGzIbWy5uoBVZDz8dRzZb/Wog3XXZ 0NNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=s9EEyUx3narWaVipL5cU0QtNtoxyuTIVMTQ4Y+e7ba0=; b=Sjzxq9TKYoEeS1kVMm7t2O5jTzE+hapqnLNYvRsPJZbl0Qy6P+h/Vj7tPBvFkF/Lnj NFePOxYePZ56rC+algtG06PHIcgnyUdEnvvTw0HLMz3v1BJby9AidgEzDk2urKuRp1qr J4aPLLXFuNuDuG/Y/3zqtrJtOC+Re2Fwq+7qvF5x6aBZltwV3kjBGdWJAJIo/pNw/pZO G7EFCyF0GiqA05qemI0D0LiuGKxX6OvHdVr9iZsU2ZABP5DW2Qygj3SCctu6LzxU/96H 4GDgkikbAaZCYkiPIlHEvK+EIx/mJO9bwqsyGoqcvfS/LDytt+5XwbKk+GVn4932zkrs qOeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k9si2504146ejh.263.2019.09.25.04.04.19; Wed, 25 Sep 2019 04:04:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439464AbfIWKhl (ORCPT + 99 others); Mon, 23 Sep 2019 06:37:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:36922 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729662AbfIWKhl (ORCPT ); Mon, 23 Sep 2019 06:37:41 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D4972B152; Mon, 23 Sep 2019 10:37:39 +0000 (UTC) From: Daniel Wagner To: QLogic-Storage-Upstream@cavium.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Wagner Subject: [PATCH] scsi: qedf: Add port_id getter Date: Mon, 23 Sep 2019 12:37:38 +0200 Message-Id: <20190923103738.67749-1-dwagner@suse.de> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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' Signed-off-by: Daniel Wagner --- drivers/scsi/qedf/qedf_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 9c24f3834d70..8fe8c3fdde1b 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -1926,6 +1926,13 @@ static int qedf_fcoe_reset(struct Scsi_Host *shost) 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) { @@ -1996,6 +2003,7 @@ static struct fc_function_template qedf_fc_transport_fn = { .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, -- 2.16.4