tg3.c (aea983801c6b5e4e9af333a32220d580a77f6783) | tg3.c (e1c6dccaf3af291488fbad155d7ee6bc29db262a) |
---|---|
1/* 2 * tg3.c: Broadcom Tigon3 ethernet driver. 3 * 4 * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) 5 * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com) 6 * Copyright (C) 2004 Sun Microsystems Inc. 7 * Copyright (C) 2005-2014 Broadcom Corporation. 8 * --- 110 unchanged lines hidden (view full) --- 119 120/* length of time before we decide the hardware is borked, 121 * and dev->tx_timeout() should be called to fix the problem 122 */ 123 124#define TG3_TX_TIMEOUT (5 * HZ) 125 126/* hardware minimum and maximum for a single frame's data payload */ | 1/* 2 * tg3.c: Broadcom Tigon3 ethernet driver. 3 * 4 * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) 5 * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com) 6 * Copyright (C) 2004 Sun Microsystems Inc. 7 * Copyright (C) 2005-2014 Broadcom Corporation. 8 * --- 110 unchanged lines hidden (view full) --- 119 120/* length of time before we decide the hardware is borked, 121 * and dev->tx_timeout() should be called to fix the problem 122 */ 123 124#define TG3_TX_TIMEOUT (5 * HZ) 125 126/* hardware minimum and maximum for a single frame's data payload */ |
127#define TG3_MIN_MTU 60 | 127#define TG3_MIN_MTU ETH_ZLEN |
128#define TG3_MAX_MTU(tp) \ 129 (tg3_flag(tp, JUMBO_CAPABLE) ? 9000 : 1500) 130 131/* These numbers seem to be hard coded in the NIC firmware somehow. 132 * You can't change the ring sizes, but you can change where you place 133 * them in the NIC onboard memory. 134 */ 135#define TG3_RX_STD_RING_SIZE(tp) \ --- 14058 unchanged lines hidden (view full) --- 14194} 14195 14196static int tg3_change_mtu(struct net_device *dev, int new_mtu) 14197{ 14198 struct tg3 *tp = netdev_priv(dev); 14199 int err; 14200 bool reset_phy = false; 14201 | 128#define TG3_MAX_MTU(tp) \ 129 (tg3_flag(tp, JUMBO_CAPABLE) ? 9000 : 1500) 130 131/* These numbers seem to be hard coded in the NIC firmware somehow. 132 * You can't change the ring sizes, but you can change where you place 133 * them in the NIC onboard memory. 134 */ 135#define TG3_RX_STD_RING_SIZE(tp) \ --- 14058 unchanged lines hidden (view full) --- 14194} 14195 14196static int tg3_change_mtu(struct net_device *dev, int new_mtu) 14197{ 14198 struct tg3 *tp = netdev_priv(dev); 14199 int err; 14200 bool reset_phy = false; 14201 |
14202 if (new_mtu < TG3_MIN_MTU || new_mtu > TG3_MAX_MTU(tp)) 14203 return -EINVAL; 14204 | |
14205 if (!netif_running(dev)) { 14206 /* We'll just catch it later when the 14207 * device is up'd. 14208 */ 14209 tg3_set_mtu(dev, tp, new_mtu); 14210 return 0; 14211 } 14212 --- 3581 unchanged lines hidden (view full) --- 17794 if (tg3_asic_rev(tp) != ASIC_REV_5780 && 17795 !tg3_flag(tp, CPMU_PRESENT)) 17796 /* Add the loopback capability */ 17797 features |= NETIF_F_LOOPBACK; 17798 17799 dev->hw_features |= features; 17800 dev->priv_flags |= IFF_UNICAST_FLT; 17801 | 14202 if (!netif_running(dev)) { 14203 /* We'll just catch it later when the 14204 * device is up'd. 14205 */ 14206 tg3_set_mtu(dev, tp, new_mtu); 14207 return 0; 14208 } 14209 --- 3581 unchanged lines hidden (view full) --- 17791 if (tg3_asic_rev(tp) != ASIC_REV_5780 && 17792 !tg3_flag(tp, CPMU_PRESENT)) 17793 /* Add the loopback capability */ 17794 features |= NETIF_F_LOOPBACK; 17795 17796 dev->hw_features |= features; 17797 dev->priv_flags |= IFF_UNICAST_FLT; 17798 |
17799 /* MTU range: 60 - 9000 or 1500, depending on hardware */ 17800 dev->min_mtu = TG3_MIN_MTU; 17801 dev->max_mtu = TG3_MAX_MTU(tp); 17802 |
|
17802 if (tg3_chip_rev_id(tp) == CHIPREV_ID_5705_A1 && 17803 !tg3_flag(tp, TSO_CAPABLE) && 17804 !(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH)) { 17805 tg3_flag_set(tp, MAX_RXPEND_64); 17806 tp->rx_pending = 63; 17807 } 17808 17809 err = tg3_get_device_address(tp); --- 476 unchanged lines hidden --- | 17803 if (tg3_chip_rev_id(tp) == CHIPREV_ID_5705_A1 && 17804 !tg3_flag(tp, TSO_CAPABLE) && 17805 !(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH)) { 17806 tg3_flag_set(tp, MAX_RXPEND_64); 17807 tp->rx_pending = 63; 17808 } 17809 17810 err = tg3_get_device_address(tp); --- 476 unchanged lines hidden --- |