net/ice/base: include more E810T adapters
[dpdk.git] / drivers / net / ice / base / ice_nvm.c
index c807ce9..aeb4da9 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2001-2020 Intel Corporation
+ * Copyright(c) 2001-2021 Intel Corporation
  */
 
 #include "ice_common.h"
@@ -1077,6 +1077,34 @@ enum ice_status ice_nvm_validate_checksum(struct ice_hw *hw)
        return status;
 }
 
+/**
+ * ice_nvm_recalculate_checksum
+ * @hw: pointer to the HW struct
+ *
+ * Recalculate NVM PFA checksum (0x0706)
+ */
+enum ice_status ice_nvm_recalculate_checksum(struct ice_hw *hw)
+{
+       struct ice_aqc_nvm_checksum *cmd;
+       struct ice_aq_desc desc;
+       enum ice_status status;
+
+       status = ice_acquire_nvm(hw, ICE_RES_READ);
+       if (status)
+               return status;
+
+       cmd = &desc.params.nvm_checksum;
+
+       ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_nvm_checksum);
+       cmd->flags = ICE_AQC_NVM_CHECKSUM_RECALC;
+
+       status = ice_aq_send_cmd(hw, &desc, NULL, 0, NULL);
+
+       ice_release_nvm(hw);
+
+       return status;
+}
+
 /**
  * ice_nvm_access_get_features - Return the NVM access features structure
  * @cmd: NVM access command to process