e1000/base: support inverted format ETrackId
authorWenzhuo Lu <wenzhuo.lu@intel.com>
Fri, 16 Oct 2015 02:50:59 +0000 (10:50 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 27 Oct 2015 15:12:57 +0000 (16:12 +0100)
There are some images which contain ETrackID in inverted format. This patch
allows reading this format.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
drivers/net/e1000/base/e1000_nvm.c

index 01be9e4..762acd1 100644 (file)
@@ -1373,8 +1373,12 @@ etrack_id:
                hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verh);
                fw_vers->etrack_id = (eeprom_verh << NVM_ETRACK_SHIFT)
                        | eeprom_verl;
+       } else if ((etrack_test & NVM_ETRACK_VALID) == 0) {
+               hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verh);
+               hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verl);
+               fw_vers->etrack_id = (eeprom_verh << NVM_ETRACK_SHIFT) |
+                                    eeprom_verl;
        }
-       return;
 }