diff options
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r-- | drivers/net/benet/be_main.c | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 6d5e81f7046f..876b357101fa 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -1610,29 +1610,42 @@ static int be_open(struct net_device *netdev) | |||
1610 | 1610 | ||
1611 | status = be_cmd_link_status_query(adapter, &link_up); | 1611 | status = be_cmd_link_status_query(adapter, &link_up); |
1612 | if (status) | 1612 | if (status) |
1613 | return status; | 1613 | goto ret_sts; |
1614 | be_link_status_update(adapter, link_up); | 1614 | be_link_status_update(adapter, link_up); |
1615 | 1615 | ||
1616 | status = be_vid_config(adapter); | ||
1617 | if (status) | ||
1618 | goto ret_sts; | ||
1619 | |||
1620 | status = be_cmd_set_flow_control(adapter, | ||
1621 | adapter->tx_fc, adapter->rx_fc); | ||
1622 | if (status) | ||
1623 | goto ret_sts; | ||
1624 | |||
1616 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(100)); | 1625 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(100)); |
1617 | return 0; | 1626 | ret_sts: |
1627 | return status; | ||
1618 | } | 1628 | } |
1619 | 1629 | ||
1620 | static int be_setup(struct be_adapter *adapter) | 1630 | static int be_setup(struct be_adapter *adapter) |
1621 | { | 1631 | { |
1622 | struct net_device *netdev = adapter->netdev; | 1632 | struct net_device *netdev = adapter->netdev; |
1623 | u32 if_flags; | 1633 | u32 cap_flags, en_flags; |
1624 | int status; | 1634 | int status; |
1625 | 1635 | ||
1626 | if_flags = BE_IF_FLAGS_BROADCAST | BE_IF_FLAGS_PROMISCUOUS | | 1636 | cap_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST | |
1627 | BE_IF_FLAGS_MCAST_PROMISCUOUS | BE_IF_FLAGS_UNTAGGED | | 1637 | BE_IF_FLAGS_MCAST_PROMISCUOUS | |
1628 | BE_IF_FLAGS_PASS_L3L4_ERRORS; | 1638 | BE_IF_FLAGS_PROMISCUOUS | |
1629 | status = be_cmd_if_create(adapter, if_flags, netdev->dev_addr, | 1639 | BE_IF_FLAGS_PASS_L3L4_ERRORS; |
1630 | false/* pmac_invalid */, &adapter->if_handle, | 1640 | en_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST | |
1631 | &adapter->pmac_id); | 1641 | BE_IF_FLAGS_PASS_L3L4_ERRORS; |
1642 | |||
1643 | status = be_cmd_if_create(adapter, cap_flags, en_flags, | ||
1644 | netdev->dev_addr, false/* pmac_invalid */, | ||
1645 | &adapter->if_handle, &adapter->pmac_id); | ||
1632 | if (status != 0) | 1646 | if (status != 0) |
1633 | goto do_none; | 1647 | goto do_none; |
1634 | 1648 | ||
1635 | |||
1636 | status = be_tx_queues_create(adapter); | 1649 | status = be_tx_queues_create(adapter); |
1637 | if (status != 0) | 1650 | if (status != 0) |
1638 | goto if_destroy; | 1651 | goto if_destroy; |
@@ -1645,17 +1658,8 @@ static int be_setup(struct be_adapter *adapter) | |||
1645 | if (status != 0) | 1658 | if (status != 0) |
1646 | goto rx_qs_destroy; | 1659 | goto rx_qs_destroy; |
1647 | 1660 | ||
1648 | status = be_vid_config(adapter); | ||
1649 | if (status != 0) | ||
1650 | goto mccqs_destroy; | ||
1651 | |||
1652 | status = be_cmd_set_flow_control(adapter, true, true); | ||
1653 | if (status != 0) | ||
1654 | goto mccqs_destroy; | ||
1655 | return 0; | 1661 | return 0; |
1656 | 1662 | ||
1657 | mccqs_destroy: | ||
1658 | be_mcc_queues_destroy(adapter); | ||
1659 | rx_qs_destroy: | 1663 | rx_qs_destroy: |
1660 | be_rx_queues_destroy(adapter); | 1664 | be_rx_queues_destroy(adapter); |
1661 | tx_qs_destroy: | 1665 | tx_qs_destroy: |
@@ -1906,6 +1910,10 @@ static void be_netdev_init(struct net_device *netdev) | |||
1906 | 1910 | ||
1907 | adapter->rx_csum = true; | 1911 | adapter->rx_csum = true; |
1908 | 1912 | ||
1913 | /* Default settings for Rx and Tx flow control */ | ||
1914 | adapter->rx_fc = true; | ||
1915 | adapter->tx_fc = true; | ||
1916 | |||
1909 | netif_set_gso_max_size(netdev, 65535); | 1917 | netif_set_gso_max_size(netdev, 65535); |
1910 | 1918 | ||
1911 | BE_SET_NETDEV_OPS(netdev, &be_netdev_ops); | 1919 | BE_SET_NETDEV_OPS(netdev, &be_netdev_ops); |
@@ -2055,6 +2063,10 @@ static int be_hw_up(struct be_adapter *adapter) | |||
2055 | if (status) | 2063 | if (status) |
2056 | return status; | 2064 | return status; |
2057 | 2065 | ||
2066 | status = be_cmd_reset_function(adapter); | ||
2067 | if (status) | ||
2068 | return status; | ||
2069 | |||
2058 | status = be_cmd_get_fw_ver(adapter, adapter->fw_ver); | 2070 | status = be_cmd_get_fw_ver(adapter, adapter->fw_ver); |
2059 | if (status) | 2071 | if (status) |
2060 | return status; | 2072 | return status; |
@@ -2108,10 +2120,6 @@ static int __devinit be_probe(struct pci_dev *pdev, | |||
2108 | if (status) | 2120 | if (status) |
2109 | goto free_netdev; | 2121 | goto free_netdev; |
2110 | 2122 | ||
2111 | status = be_cmd_reset_function(adapter); | ||
2112 | if (status) | ||
2113 | goto ctrl_clean; | ||
2114 | |||
2115 | status = be_stats_init(adapter); | 2123 | status = be_stats_init(adapter); |
2116 | if (status) | 2124 | if (status) |
2117 | goto ctrl_clean; | 2125 | goto ctrl_clean; |
@@ -2168,6 +2176,7 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2168 | be_close(netdev); | 2176 | be_close(netdev); |
2169 | rtnl_unlock(); | 2177 | rtnl_unlock(); |
2170 | } | 2178 | } |
2179 | be_cmd_get_flow_control(adapter, &adapter->tx_fc, &adapter->rx_fc); | ||
2171 | be_clear(adapter); | 2180 | be_clear(adapter); |
2172 | 2181 | ||
2173 | pci_save_state(pdev); | 2182 | pci_save_state(pdev); |