Skip to contentSkip to conversation

igc: Add NVM checksum validation

PATCH New Sasha Neftin 2 participants 2 messages Jul 24, 2019 – Aug 2, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igc: Add NVM checksum validation

Add NVM checksum validation during probe functionality.

---
 drivers/net/ethernet/intel/igc/igc_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ethernet/intel/igc/igc_main.c +9 -0
index e5114bebd30b..c855d9cbe431 100644
@@ -4134,6 +4134,15 @@ static int igc_probe(struct pci_dev *pdev,
 	 */
 	hw->mac.ops.reset_hw(hw);
 
+	if (igc_get_flash_presence_i225(hw)) {
+		if (hw->nvm.ops.validate(hw) < 0) {
+			dev_err(&pdev->dev,
+				"The NVM Checksum Is Not Valid\n");
+			err = -EIO;
+			goto err_eeprom;
+		}
+	}
+
 	if (eth_platform_get_mac_address(&pdev->dev, hw->mac.addr)) {
 		/* copy the MAC address out of the NVM */
 		if (hw->mac.ops.read_mac_addr(hw))
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 igc: Add NVM checksum validation

Quoted 6 lines

From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Sasha Neftin
Sent: Wednesday, July 24, 2019 12:06 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH v1] igc: Add NVM checksum validation

Quoted 6 lines

Add NVM checksum validation during probe functionality.

---
 drivers/net/ethernet/intel/igc/igc_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)