netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sathya Perla <sathya.perla@avagotech.com>
To: netdev@vger.kernel.org
Subject: [PATCH net-next v3 05/10] be2net: log digital signature errors while flashing FW image
Date: Wed, 30 Dec 2015 01:29:00 -0500	[thread overview]
Message-ID: <1451456945-31606-6-git-send-email-sathya.perla@avagotech.com> (raw)
In-Reply-To: <1451456945-31606-1-git-send-email-sathya.perla@avagotech.com>

From: Suresh Reddy <suresh.reddy@avagotech.com>

>From FW version 11.0 onwards, the FW supports a new "secure mode" feature
(based on a jumper setting on the adapter.) In this mode, the FW image when
flashed is authenticated with a digital signature. This patch logs
appropriate error messages and return a status to ethtool when errors
relating to FW image authentication occur.

Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
---
 drivers/net/ethernet/emulex/benet/be_cmds.c | 14 +++++++++++++-
 drivers/net/ethernet/emulex/benet/be_cmds.h |  4 +++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index da3b398..451f9ea 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -2959,7 +2959,19 @@ flash:
 		} else if (status) {
 			dev_err(dev, "Flashing section type 0x%x failed\n",
 				img_type);
-			return -EFAULT;
+
+			switch (addl_status(status)) {
+			case MCC_ADDL_STATUS_MISSING_SIGNATURE:
+				dev_err(dev,
+					"Digital signature missing in FW\n");
+				return -EINVAL;
+			case MCC_ADDL_STATUS_INVALID_SIGNATURE:
+				dev_err(dev,
+					"Invalid digital signature in FW\n");
+				return -EINVAL;
+			default:
+				return -EFAULT;
+			}
 		}
 	}
 	return 0;
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index 4b0ca99..16415ca 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -66,7 +66,9 @@ enum mcc_addl_status {
 	MCC_ADDL_STATUS_INSUFFICIENT_RESOURCES = 0x16,
 	MCC_ADDL_STATUS_FLASH_IMAGE_CRC_MISMATCH = 0x4d,
 	MCC_ADDL_STATUS_TOO_MANY_INTERFACES = 0x4a,
-	MCC_ADDL_STATUS_INSUFFICIENT_VLANS = 0xab
+	MCC_ADDL_STATUS_INSUFFICIENT_VLANS = 0xab,
+	MCC_ADDL_STATUS_INVALID_SIGNATURE = 0x56,
+	MCC_ADDL_STATUS_MISSING_SIGNATURE = 0x57
 };
 
 #define CQE_BASE_STATUS_MASK		0xFFFF
-- 
2.4.1

  parent reply	other threads:[~2015-12-30  6:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30  6:28 [PATCH net-next v3 00/10] be2net: patch set Sathya Perla
2015-12-30  6:28 ` [PATCH net-next v3 01/10] be2net: fix VF link state transition from disabled to auto Sathya Perla
2015-12-30  6:28 ` [PATCH net-next v3 02/10] be2net: avoid configuring VEPA mode on BE3 Sathya Perla
2015-12-30  6:28 ` [PATCH net-next v3 03/10] be2net: cleanup FW flash image related macro defines Sathya Perla
2015-12-30  6:28 ` [PATCH net-next v3 04/10] be2net: move FW flash cmd code to be_cmds.c Sathya Perla
2015-12-30  6:29 ` Sathya Perla [this message]
2015-12-30  6:29 ` [PATCH net-next v3 06/10] be2net: remove a line of code that has no effect Sathya Perla
2015-12-30  6:29 ` [PATCH net-next v3 07/10] be2net: remove unused error variables Sathya Perla
2015-12-30  6:29 ` [PATCH net-next v3 08/10] be2net: fix port-res desc query of GET_PROFILE_CONFIG FW cmd Sathya Perla
2015-12-30  6:29 ` [PATCH net-next v3 09/10] be2net: support ethtool get-dump option Sathya Perla
2015-12-30  6:29 ` [PATCH net-next v3 10/10] be2net: bump up the driver version to 11.0.0.0 Sathya Perla
2015-12-30 21:32 ` [PATCH net-next v3 00/10] be2net: patch set David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451456945-31606-6-git-send-email-sathya.perla@avagotech.com \
    --to=sathya.perla@avagotech.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).