tg3: Fix 5762 NVRAM sizing
authorMichael Chan <mchan@broadcom.com>
Thu, 14 Feb 2013 12:13:40 +0000 (12:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Feb 2013 19:02:59 +0000 (14:02 -0500)
Don't set the default size to 128K if it is 5762.  Instead, rely on the
size we obtain from NVRAM location 0xf0.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c

index 3004d69596c348a0ffd0879b57a3d10c9dde4467..7ac0bd008738e6384298997d5b201c983684f3b1 100644 (file)
@@ -13883,7 +13883,8 @@ static void tg3_get_5720_nvram_info(struct tg3 *tp)
                        tp->nvram_size = TG3_NVRAM_SIZE_1MB;
                        break;
                default:
-                       tp->nvram_size = TG3_NVRAM_SIZE_128KB;
+                       if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5762)
+                               tp->nvram_size = TG3_NVRAM_SIZE_128KB;
                        break;
                }
                break;
@@ -13929,7 +13930,8 @@ static void tg3_get_5720_nvram_info(struct tg3 *tp)
                        tp->nvram_size = TG3_NVRAM_SIZE_1MB;
                        break;
                default:
-                       tp->nvram_size = TG3_NVRAM_SIZE_128KB;
+                       if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5762)
+                               tp->nvram_size = TG3_NVRAM_SIZE_128KB;
                        break;
                }
                break;