]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
bnxt_en: Add support for updating flash more securely
authorRob Swindell <rob.swindell@broadcom.com>
Fri, 1 Jul 2016 22:46:22 +0000 (18:46 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Jul 2016 18:52:35 +0000 (14:52 -0400)
To support Secure Firmware Update, we must be able to allocate
a staging area in the Flash.  This patch adds support for the
"update" type to tell firmware to do that.

Signed-off-by: Rob Swindell <rob.swindell@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
drivers/net/ethernet/broadcom/bnxt/bnxt_nvm_defs.h

index c63ed2fc5b9792f7a171551389c325018fee4d7c..3328aa5b30dcbfd30533da9eb38ad75f0820c837 100644 (file)
@@ -1186,7 +1186,8 @@ static int bnxt_flash_firmware_from_file(struct net_device *dev,
        const struct firmware  *fw;
        int                     rc;
 
-       if (bnxt_dir_type_is_executable(dir_type) == false)
+       if (dir_type != BNX_DIR_TYPE_UPDATE &&
+           bnxt_dir_type_is_executable(dir_type) == false)
                return -EINVAL;
 
        rc = request_firmware(&fw, filename, &dev->dev);
index 40a7b0e0961204f44c93c1e97a662d47e41f216e..73f2249555b57c2b0ef4470e076f4bdd442dd463 100644 (file)
@@ -13,6 +13,7 @@
 enum bnxt_nvm_directory_type {
        BNX_DIR_TYPE_UNUSED = 0,
        BNX_DIR_TYPE_PKG_LOG = 1,
+       BNX_DIR_TYPE_UPDATE = 2,
        BNX_DIR_TYPE_CHIMP_PATCH = 3,
        BNX_DIR_TYPE_BOOTCODE = 4,
        BNX_DIR_TYPE_VPD = 5,