diff options
author | Carolyn Wyborny <carolyn.wyborny@intel.com> | 2011-05-04 00:29:51 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-05-04 15:09:53 -0400 |
commit | f6b1bfd17d42f9dc1d799b7e0eed817ed75005ec (patch) | |
tree | c72bf2923be1ffdbc47234ce98b2d1930b50ad4d /drivers/net/igb | |
parent | ec7e97e9a0265255485e217f4f2d3513949e7083 (diff) |
igb: Add check for invalid size to igb_get_invariants_82575()
Recent commits have changed how EEPROM size is checked and if the size
word is misconfigured, the driver will fail to load. This patch adds a
check for invalid size word in the EEPROM and uses default size instead
for 82576 parts.
Reported-by: Stefan Assmann <sassmann@redhat.com>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | drivers/net/igb/e1000_82575.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index 0cd41c49bc17..0f563c8c5ffc 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c | |||
@@ -244,6 +244,14 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) | |||
244 | */ | 244 | */ |
245 | size += NVM_WORD_SIZE_BASE_SHIFT; | 245 | size += NVM_WORD_SIZE_BASE_SHIFT; |
246 | 246 | ||
247 | /* | ||
248 | * Check for invalid size | ||
249 | */ | ||
250 | if ((hw->mac.type == e1000_82576) && (size > 15)) { | ||
251 | printk("igb: The NVM size is not valid, " | ||
252 | "defaulting to 32K.\n"); | ||
253 | size = 15; | ||
254 | } | ||
247 | nvm->word_size = 1 << size; | 255 | nvm->word_size = 1 << size; |
248 | if (nvm->word_size == (1 << 15)) | 256 | if (nvm->word_size == (1 << 15)) |
249 | nvm->page_size = 128; | 257 | nvm->page_size = 128; |