aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-11-09 02:00:54 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-09 02:00:54 -0500
commitd0e1e88d6e7dbd8e1661cb6a058ca30f54ee39e4 (patch)
treedaab7cc0db83226672f76d2fc9277e4355f89e6b /drivers/net/benet
parent9e0d57fd6dad37d72a3ca6db00ca8c76f2215454 (diff)
parent2606289779cb297320a185db5997729d29b6700b (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/can/usb/ems_usb.c
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be.h2
-rw-r--r--drivers/net/benet/be_ethtool.c8
-rw-r--r--drivers/net/benet/be_main.c28
3 files changed, 24 insertions, 14 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index ce7563175cef..67e165cf3f4e 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -269,6 +269,8 @@ struct be_adapter {
269 u32 port_num; 269 u32 port_num;
270 bool promiscuous; 270 bool promiscuous;
271 u32 cap; 271 u32 cap;
272 u32 rx_fc; /* Rx flow control */
273 u32 tx_fc; /* Tx flow control */
272}; 274};
273 275
274extern const struct ethtool_ops be_ethtool_ops; 276extern const struct ethtool_ops be_ethtool_ops;
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index edebce994906..e8f92831021a 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -362,10 +362,12 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
362 362
363 if (ecmd->autoneg != 0) 363 if (ecmd->autoneg != 0)
364 return -EINVAL; 364 return -EINVAL;
365 adapter->tx_fc = ecmd->tx_pause;
366 adapter->rx_fc = ecmd->rx_pause;
365 367
366 status = be_cmd_set_flow_control(adapter, ecmd->tx_pause, 368 status = be_cmd_set_flow_control(adapter,
367 ecmd->rx_pause); 369 adapter->tx_fc, adapter->rx_fc);
368 if (!status) 370 if (status)
369 dev_warn(&adapter->pdev->dev, "Pause param set failed.\n"); 371 dev_warn(&adapter->pdev->dev, "Pause param set failed.\n");
370 372
371 return status; 373 return status;
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 43180dc210a2..c0bd20356eaf 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1611,11 +1611,21 @@ static int be_open(struct net_device *netdev)
1611 status = be_cmd_link_status_query(adapter, &link_up, &mac_speed, 1611 status = be_cmd_link_status_query(adapter, &link_up, &mac_speed,
1612 &link_speed); 1612 &link_speed);
1613 if (status) 1613 if (status)
1614 return status; 1614 goto ret_sts;
1615 be_link_status_update(adapter, link_up); 1615 be_link_status_update(adapter, link_up);
1616 1616
1617 status = be_vid_config(adapter);
1618 if (status)
1619 goto ret_sts;
1620
1621 status = be_cmd_set_flow_control(adapter,
1622 adapter->tx_fc, adapter->rx_fc);
1623 if (status)
1624 goto ret_sts;
1625
1617 schedule_delayed_work(&adapter->work, msecs_to_jiffies(100)); 1626 schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
1618 return 0; 1627ret_sts:
1628 return status;
1619} 1629}
1620 1630
1621static int be_setup(struct be_adapter *adapter) 1631static int be_setup(struct be_adapter *adapter)
@@ -1649,17 +1659,8 @@ static int be_setup(struct be_adapter *adapter)
1649 if (status != 0) 1659 if (status != 0)
1650 goto rx_qs_destroy; 1660 goto rx_qs_destroy;
1651 1661
1652 status = be_vid_config(adapter);
1653 if (status != 0)
1654 goto mccqs_destroy;
1655
1656 status = be_cmd_set_flow_control(adapter, true, true);
1657 if (status != 0)
1658 goto mccqs_destroy;
1659 return 0; 1662 return 0;
1660 1663
1661mccqs_destroy:
1662 be_mcc_queues_destroy(adapter);
1663rx_qs_destroy: 1664rx_qs_destroy:
1664 be_rx_queues_destroy(adapter); 1665 be_rx_queues_destroy(adapter);
1665tx_qs_destroy: 1666tx_qs_destroy:
@@ -1910,6 +1911,10 @@ static void be_netdev_init(struct net_device *netdev)
1910 1911
1911 adapter->rx_csum = true; 1912 adapter->rx_csum = true;
1912 1913
1914 /* Default settings for Rx and Tx flow control */
1915 adapter->rx_fc = true;
1916 adapter->tx_fc = true;
1917
1913 netif_set_gso_max_size(netdev, 65535); 1918 netif_set_gso_max_size(netdev, 65535);
1914 1919
1915 BE_SET_NETDEV_OPS(netdev, &be_netdev_ops); 1920 BE_SET_NETDEV_OPS(netdev, &be_netdev_ops);
@@ -2172,6 +2177,7 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state)
2172 be_close(netdev); 2177 be_close(netdev);
2173 rtnl_unlock(); 2178 rtnl_unlock();
2174 } 2179 }
2180 be_cmd_get_flow_control(adapter, &adapter->tx_fc, &adapter->rx_fc);
2175 be_clear(adapter); 2181 be_clear(adapter);
2176 2182
2177 pci_save_state(pdev); 2183 pci_save_state(pdev);