aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/8139cp.c46
-rw-r--r--drivers/net/bonding/bond_main.c3
-rw-r--r--drivers/net/spider_net.c4
3 files changed, 30 insertions, 23 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 34b80de34fae..bc537440ca02 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -353,8 +353,6 @@ struct cp_private {
353 353
354 struct net_device_stats net_stats; 354 struct net_device_stats net_stats;
355 struct cp_extra_stats cp_stats; 355 struct cp_extra_stats cp_stats;
356 struct cp_dma_stats *nic_stats;
357 dma_addr_t nic_stats_dma;
358 356
359 unsigned rx_tail ____cacheline_aligned; 357 unsigned rx_tail ____cacheline_aligned;
360 struct cp_desc *rx_ring; 358 struct cp_desc *rx_ring;
@@ -1143,10 +1141,6 @@ static int cp_alloc_rings (struct cp_private *cp)
1143 cp->rx_ring = mem; 1141 cp->rx_ring = mem;
1144 cp->tx_ring = &cp->rx_ring[CP_RX_RING_SIZE]; 1142 cp->tx_ring = &cp->rx_ring[CP_RX_RING_SIZE];
1145 1143
1146 mem += (CP_RING_BYTES - CP_STATS_SIZE);
1147 cp->nic_stats = mem;
1148 cp->nic_stats_dma = cp->ring_dma + (CP_RING_BYTES - CP_STATS_SIZE);
1149
1150 return cp_init_rings(cp); 1144 return cp_init_rings(cp);
1151} 1145}
1152 1146
@@ -1187,7 +1181,6 @@ static void cp_free_rings (struct cp_private *cp)
1187 pci_free_consistent(cp->pdev, CP_RING_BYTES, cp->rx_ring, cp->ring_dma); 1181 pci_free_consistent(cp->pdev, CP_RING_BYTES, cp->rx_ring, cp->ring_dma);
1188 cp->rx_ring = NULL; 1182 cp->rx_ring = NULL;
1189 cp->tx_ring = NULL; 1183 cp->tx_ring = NULL;
1190 cp->nic_stats = NULL;
1191} 1184}
1192 1185
1193static int cp_open (struct net_device *dev) 1186static int cp_open (struct net_device *dev)
@@ -1516,13 +1509,17 @@ static void cp_get_ethtool_stats (struct net_device *dev,
1516 struct ethtool_stats *estats, u64 *tmp_stats) 1509 struct ethtool_stats *estats, u64 *tmp_stats)
1517{ 1510{
1518 struct cp_private *cp = netdev_priv(dev); 1511 struct cp_private *cp = netdev_priv(dev);
1512 struct cp_dma_stats *nic_stats;
1513 dma_addr_t dma;
1519 int i; 1514 int i;
1520 1515
1521 memset(cp->nic_stats, 0, sizeof(struct cp_dma_stats)); 1516 nic_stats = pci_alloc_consistent(cp->pdev, sizeof(*nic_stats), &dma);
1517 if (!nic_stats)
1518 return;
1522 1519
1523 /* begin NIC statistics dump */ 1520 /* begin NIC statistics dump */
1524 cpw32(StatsAddr + 4, (cp->nic_stats_dma >> 16) >> 16); 1521 cpw32(StatsAddr + 4, (u64)dma >> 32);
1525 cpw32(StatsAddr, (cp->nic_stats_dma & 0xffffffff) | DumpStats); 1522 cpw32(StatsAddr, ((u64)dma & DMA_32BIT_MASK) | DumpStats);
1526 cpr32(StatsAddr); 1523 cpr32(StatsAddr);
1527 1524
1528 for (i = 0; i < 1000; i++) { 1525 for (i = 0; i < 1000; i++) {
@@ -1532,24 +1529,27 @@ static void cp_get_ethtool_stats (struct net_device *dev,
1532 } 1529 }
1533 cpw32(StatsAddr, 0); 1530 cpw32(StatsAddr, 0);
1534 cpw32(StatsAddr + 4, 0); 1531 cpw32(StatsAddr + 4, 0);
1532 cpr32(StatsAddr);
1535 1533
1536 i = 0; 1534 i = 0;
1537 tmp_stats[i++] = le64_to_cpu(cp->nic_stats->tx_ok); 1535 tmp_stats[i++] = le64_to_cpu(nic_stats->tx_ok);
1538 tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok); 1536 tmp_stats[i++] = le64_to_cpu(nic_stats->rx_ok);
1539 tmp_stats[i++] = le64_to_cpu(cp->nic_stats->tx_err); 1537 tmp_stats[i++] = le64_to_cpu(nic_stats->tx_err);
1540 tmp_stats[i++] = le32_to_cpu(cp->nic_stats->rx_err); 1538 tmp_stats[i++] = le32_to_cpu(nic_stats->rx_err);
1541 tmp_stats[i++] = le16_to_cpu(cp->nic_stats->rx_fifo); 1539 tmp_stats[i++] = le16_to_cpu(nic_stats->rx_fifo);
1542 tmp_stats[i++] = le16_to_cpu(cp->nic_stats->frame_align); 1540 tmp_stats[i++] = le16_to_cpu(nic_stats->frame_align);
1543 tmp_stats[i++] = le32_to_cpu(cp->nic_stats->tx_ok_1col); 1541 tmp_stats[i++] = le32_to_cpu(nic_stats->tx_ok_1col);
1544 tmp_stats[i++] = le32_to_cpu(cp->nic_stats->tx_ok_mcol); 1542 tmp_stats[i++] = le32_to_cpu(nic_stats->tx_ok_mcol);
1545 tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok_phys); 1543 tmp_stats[i++] = le64_to_cpu(nic_stats->rx_ok_phys);
1546 tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok_bcast); 1544 tmp_stats[i++] = le64_to_cpu(nic_stats->rx_ok_bcast);
1547 tmp_stats[i++] = le32_to_cpu(cp->nic_stats->rx_ok_mcast); 1545 tmp_stats[i++] = le32_to_cpu(nic_stats->rx_ok_mcast);
1548 tmp_stats[i++] = le16_to_cpu(cp->nic_stats->tx_abort); 1546 tmp_stats[i++] = le16_to_cpu(nic_stats->tx_abort);
1549 tmp_stats[i++] = le16_to_cpu(cp->nic_stats->tx_underrun); 1547 tmp_stats[i++] = le16_to_cpu(nic_stats->tx_underrun);
1550 tmp_stats[i++] = cp->cp_stats.rx_frags; 1548 tmp_stats[i++] = cp->cp_stats.rx_frags;
1551 if (i != CP_NUM_STATS) 1549 if (i != CP_NUM_STATS)
1552 BUG(); 1550 BUG();
1551
1552 pci_free_consistent(cp->pdev, sizeof(*nic_stats), nic_stats, dma);
1553} 1553}
1554 1554
1555static struct ethtool_ops cp_ethtool_ops = { 1555static struct ethtool_ops cp_ethtool_ops = {
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 94c9f68dd16b..f8dedb623dc0 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2879,6 +2879,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2879 * This target is not on a VLAN 2879 * This target is not on a VLAN
2880 */ 2880 */
2881 if (rt->u.dst.dev == bond->dev) { 2881 if (rt->u.dst.dev == bond->dev) {
2882 ip_rt_put(rt);
2882 dprintk("basa: rtdev == bond->dev: arp_send\n"); 2883 dprintk("basa: rtdev == bond->dev: arp_send\n");
2883 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], 2884 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i],
2884 bond->master_ip, 0); 2885 bond->master_ip, 0);
@@ -2898,6 +2899,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2898 } 2899 }
2899 2900
2900 if (vlan_id) { 2901 if (vlan_id) {
2902 ip_rt_put(rt);
2901 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], 2903 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i],
2902 vlan->vlan_ip, vlan_id); 2904 vlan->vlan_ip, vlan_id);
2903 continue; 2905 continue;
@@ -2909,6 +2911,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2909 bond->dev->name, NIPQUAD(fl.fl4_dst), 2911 bond->dev->name, NIPQUAD(fl.fl4_dst),
2910 rt->u.dst.dev ? rt->u.dst.dev->name : "NULL"); 2912 rt->u.dst.dev ? rt->u.dst.dev->name : "NULL");
2911 } 2913 }
2914 ip_rt_put(rt);
2912 } 2915 }
2913} 2916}
2914 2917
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 4e19220473d0..c796f41b4a52 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1817,6 +1817,10 @@ spider_net_setup_phy(struct spider_net_card *card)
1817 /* LEDs active in both modes, autosense prio = fiber */ 1817 /* LEDs active in both modes, autosense prio = fiber */
1818 spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0x945f); 1818 spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0x945f);
1819 1819
1820 /* switch off fibre autoneg */
1821 spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0xfc01);
1822 spider_net_write_phy(card->netdev, 1, 0x0b, 0x0004);
1823
1820 phy->def->ops->read_link(phy); 1824 phy->def->ops->read_link(phy);
1821 pr_info("Found %s with %i Mbps, %s-duplex.\n", phy->def->name, 1825 pr_info("Found %s with %i Mbps, %s-duplex.\n", phy->def->name,
1822 phy->speed, phy->duplex==1 ? "Full" : "Half"); 1826 phy->speed, phy->duplex==1 ? "Full" : "Half");