diff options
Diffstat (limited to 'drivers/net/e1000e/ethtool.c')
-rw-r--r-- | drivers/net/e1000e/ethtool.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index 983493f2330c..6ff376cfe139 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c | |||
@@ -412,7 +412,6 @@ static int e1000_set_tso(struct net_device *netdev, u32 data) | |||
412 | netdev->features &= ~NETIF_F_TSO6; | 412 | netdev->features &= ~NETIF_F_TSO6; |
413 | } | 413 | } |
414 | 414 | ||
415 | e_info("TSO is %s\n", data ? "Enabled" : "Disabled"); | ||
416 | adapter->flags |= FLAG_TSO_FORCE; | 415 | adapter->flags |= FLAG_TSO_FORCE; |
417 | return 0; | 416 | return 0; |
418 | } | 417 | } |
@@ -1069,10 +1068,10 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter) | |||
1069 | if (tx_ring->desc && tx_ring->buffer_info) { | 1068 | if (tx_ring->desc && tx_ring->buffer_info) { |
1070 | for (i = 0; i < tx_ring->count; i++) { | 1069 | for (i = 0; i < tx_ring->count; i++) { |
1071 | if (tx_ring->buffer_info[i].dma) | 1070 | if (tx_ring->buffer_info[i].dma) |
1072 | pci_unmap_single(pdev, | 1071 | dma_unmap_single(&pdev->dev, |
1073 | tx_ring->buffer_info[i].dma, | 1072 | tx_ring->buffer_info[i].dma, |
1074 | tx_ring->buffer_info[i].length, | 1073 | tx_ring->buffer_info[i].length, |
1075 | PCI_DMA_TODEVICE); | 1074 | DMA_TO_DEVICE); |
1076 | if (tx_ring->buffer_info[i].skb) | 1075 | if (tx_ring->buffer_info[i].skb) |
1077 | dev_kfree_skb(tx_ring->buffer_info[i].skb); | 1076 | dev_kfree_skb(tx_ring->buffer_info[i].skb); |
1078 | } | 1077 | } |
@@ -1081,9 +1080,9 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter) | |||
1081 | if (rx_ring->desc && rx_ring->buffer_info) { | 1080 | if (rx_ring->desc && rx_ring->buffer_info) { |
1082 | for (i = 0; i < rx_ring->count; i++) { | 1081 | for (i = 0; i < rx_ring->count; i++) { |
1083 | if (rx_ring->buffer_info[i].dma) | 1082 | if (rx_ring->buffer_info[i].dma) |
1084 | pci_unmap_single(pdev, | 1083 | dma_unmap_single(&pdev->dev, |
1085 | rx_ring->buffer_info[i].dma, | 1084 | rx_ring->buffer_info[i].dma, |
1086 | 2048, PCI_DMA_FROMDEVICE); | 1085 | 2048, DMA_FROM_DEVICE); |
1087 | if (rx_ring->buffer_info[i].skb) | 1086 | if (rx_ring->buffer_info[i].skb) |
1088 | dev_kfree_skb(rx_ring->buffer_info[i].skb); | 1087 | dev_kfree_skb(rx_ring->buffer_info[i].skb); |
1089 | } | 1088 | } |
@@ -1163,9 +1162,10 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) | |||
1163 | tx_ring->buffer_info[i].skb = skb; | 1162 | tx_ring->buffer_info[i].skb = skb; |
1164 | tx_ring->buffer_info[i].length = skb->len; | 1163 | tx_ring->buffer_info[i].length = skb->len; |
1165 | tx_ring->buffer_info[i].dma = | 1164 | tx_ring->buffer_info[i].dma = |
1166 | pci_map_single(pdev, skb->data, skb->len, | 1165 | dma_map_single(&pdev->dev, skb->data, skb->len, |
1167 | PCI_DMA_TODEVICE); | 1166 | DMA_TO_DEVICE); |
1168 | if (pci_dma_mapping_error(pdev, tx_ring->buffer_info[i].dma)) { | 1167 | if (dma_mapping_error(&pdev->dev, |
1168 | tx_ring->buffer_info[i].dma)) { | ||
1169 | ret_val = 4; | 1169 | ret_val = 4; |
1170 | goto err_nomem; | 1170 | goto err_nomem; |
1171 | } | 1171 | } |
@@ -1226,9 +1226,10 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) | |||
1226 | skb_reserve(skb, NET_IP_ALIGN); | 1226 | skb_reserve(skb, NET_IP_ALIGN); |
1227 | rx_ring->buffer_info[i].skb = skb; | 1227 | rx_ring->buffer_info[i].skb = skb; |
1228 | rx_ring->buffer_info[i].dma = | 1228 | rx_ring->buffer_info[i].dma = |
1229 | pci_map_single(pdev, skb->data, 2048, | 1229 | dma_map_single(&pdev->dev, skb->data, 2048, |
1230 | PCI_DMA_FROMDEVICE); | 1230 | DMA_FROM_DEVICE); |
1231 | if (pci_dma_mapping_error(pdev, rx_ring->buffer_info[i].dma)) { | 1231 | if (dma_mapping_error(&pdev->dev, |
1232 | rx_ring->buffer_info[i].dma)) { | ||
1232 | ret_val = 8; | 1233 | ret_val = 8; |
1233 | goto err_nomem; | 1234 | goto err_nomem; |
1234 | } | 1235 | } |
@@ -1556,10 +1557,10 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter) | |||
1556 | for (i = 0; i < 64; i++) { /* send the packets */ | 1557 | for (i = 0; i < 64; i++) { /* send the packets */ |
1557 | e1000_create_lbtest_frame(tx_ring->buffer_info[k].skb, | 1558 | e1000_create_lbtest_frame(tx_ring->buffer_info[k].skb, |
1558 | 1024); | 1559 | 1024); |
1559 | pci_dma_sync_single_for_device(pdev, | 1560 | dma_sync_single_for_device(&pdev->dev, |
1560 | tx_ring->buffer_info[k].dma, | 1561 | tx_ring->buffer_info[k].dma, |
1561 | tx_ring->buffer_info[k].length, | 1562 | tx_ring->buffer_info[k].length, |
1562 | PCI_DMA_TODEVICE); | 1563 | DMA_TO_DEVICE); |
1563 | k++; | 1564 | k++; |
1564 | if (k == tx_ring->count) | 1565 | if (k == tx_ring->count) |
1565 | k = 0; | 1566 | k = 0; |
@@ -1569,9 +1570,9 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter) | |||
1569 | time = jiffies; /* set the start time for the receive */ | 1570 | time = jiffies; /* set the start time for the receive */ |
1570 | good_cnt = 0; | 1571 | good_cnt = 0; |
1571 | do { /* receive the sent packets */ | 1572 | do { /* receive the sent packets */ |
1572 | pci_dma_sync_single_for_cpu(pdev, | 1573 | dma_sync_single_for_cpu(&pdev->dev, |
1573 | rx_ring->buffer_info[l].dma, 2048, | 1574 | rx_ring->buffer_info[l].dma, 2048, |
1574 | PCI_DMA_FROMDEVICE); | 1575 | DMA_FROM_DEVICE); |
1575 | 1576 | ||
1576 | ret_val = e1000_check_lbtest_frame( | 1577 | ret_val = e1000_check_lbtest_frame( |
1577 | rx_ring->buffer_info[l].skb, 1024); | 1578 | rx_ring->buffer_info[l].skb, 1024); |
@@ -1889,7 +1890,7 @@ static int e1000_get_coalesce(struct net_device *netdev, | |||
1889 | { | 1890 | { |
1890 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1891 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1891 | 1892 | ||
1892 | if (adapter->itr_setting <= 3) | 1893 | if (adapter->itr_setting <= 4) |
1893 | ec->rx_coalesce_usecs = adapter->itr_setting; | 1894 | ec->rx_coalesce_usecs = adapter->itr_setting; |
1894 | else | 1895 | else |
1895 | ec->rx_coalesce_usecs = 1000000 / adapter->itr_setting; | 1896 | ec->rx_coalesce_usecs = 1000000 / adapter->itr_setting; |
@@ -1904,12 +1905,14 @@ static int e1000_set_coalesce(struct net_device *netdev, | |||
1904 | struct e1000_hw *hw = &adapter->hw; | 1905 | struct e1000_hw *hw = &adapter->hw; |
1905 | 1906 | ||
1906 | if ((ec->rx_coalesce_usecs > E1000_MAX_ITR_USECS) || | 1907 | if ((ec->rx_coalesce_usecs > E1000_MAX_ITR_USECS) || |
1907 | ((ec->rx_coalesce_usecs > 3) && | 1908 | ((ec->rx_coalesce_usecs > 4) && |
1908 | (ec->rx_coalesce_usecs < E1000_MIN_ITR_USECS)) || | 1909 | (ec->rx_coalesce_usecs < E1000_MIN_ITR_USECS)) || |
1909 | (ec->rx_coalesce_usecs == 2)) | 1910 | (ec->rx_coalesce_usecs == 2)) |
1910 | return -EINVAL; | 1911 | return -EINVAL; |
1911 | 1912 | ||
1912 | if (ec->rx_coalesce_usecs <= 3) { | 1913 | if (ec->rx_coalesce_usecs == 4) { |
1914 | adapter->itr = adapter->itr_setting = 4; | ||
1915 | } else if (ec->rx_coalesce_usecs <= 3) { | ||
1913 | adapter->itr = 20000; | 1916 | adapter->itr = 20000; |
1914 | adapter->itr_setting = ec->rx_coalesce_usecs; | 1917 | adapter->itr_setting = ec->rx_coalesce_usecs; |
1915 | } else { | 1918 | } else { |