]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tg3: Restrict large prod ring cap devices
authorMatt Carlson <mcarlson@broadcom.com>
Mon, 21 Nov 2011 15:01:19 +0000 (15:01 +0000)
committerJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 02:33:48 +0000 (10:33 +0800)
Future devices may or may not be capable of supporting larger rx
producer rings.  This patch changes the code so that this flag is set on
an ASIC rev to ASIC rev basis.  Also, this patch changes a place where
the LRG_PROD_RING_CAP flag was not controlling how the rx standard
producer ring size was set.

(cherry picked from commit fa6b2aae6ab5ae1ce4b65c1872477c4b794d338e)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/tg3.c

index 0cd1fee9133cd79fc310085f319c79da1dc67b6f..ccdc62f00bf0cb0d3ccec2b722b958a50daf50fe 100644 (file)
@@ -8581,10 +8581,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
                }
 
                if (tg3_flag(tp, 57765_PLUS)) {
-                       if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
-                               val = TG3_RX_STD_MAX_SIZE_5700;
-                       else
-                               val = TG3_RX_STD_MAX_SIZE_5717;
+                       val = TG3_RX_STD_RING_SIZE(tp);
                        val <<= BDINFO_FLAGS_MAXLEN_SHIFT;
                        val |= (TG3_RX_STD_DMA_SZ << 2);
                } else
@@ -14036,7 +14033,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
        if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
                tg3_flag_set(tp, 4K_FIFO_LIMIT);
 
-       if (tg3_flag(tp, 5717_PLUS))
+       if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+           GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+           GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720)
                tg3_flag_set(tp, LRG_PROD_RING_CAP);
 
        if (tg3_flag(tp, 57765_PLUS) &&