igbvf: convert to ndo_fix_features
[pandora-kernel.git] / drivers / net / ethernet / intel / igbvf / netdev.c
index a6bdb3c..32b3044 100644 (file)
@@ -2061,10 +2061,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
                buffer_info->time_stamp = jiffies;
                buffer_info->next_to_watch = i;
                buffer_info->mapped_as_page = true;
-               buffer_info->dma = dma_map_page(&pdev->dev,
-                                               frag->page,
-                                               frag->page_offset,
-                                               len,
+               buffer_info->dma = skb_frag_dma_map(&pdev->dev, frag, 0, len,
                                                DMA_TO_DEVICE);
                if (dma_mapping_error(&pdev->dev, buffer_info->dma))
                        goto dma_error;
@@ -2533,6 +2530,18 @@ static void igbvf_print_device_info(struct igbvf_adapter *adapter)
        dev_info(&pdev->dev, "MAC: %d\n", hw->mac.type);
 }
 
+static int igbvf_set_features(struct net_device *netdev, u32 features)
+{
+       struct igbvf_adapter *adapter = netdev_priv(netdev);
+
+       if (features & NETIF_F_RXCSUM)
+               adapter->flags &= ~IGBVF_FLAG_RX_CSUM_DISABLED;
+       else
+               adapter->flags |= IGBVF_FLAG_RX_CSUM_DISABLED;
+
+       return 0;
+}
+
 static const struct net_device_ops igbvf_netdev_ops = {
        .ndo_open                       = igbvf_open,
        .ndo_stop                       = igbvf_close,
@@ -2548,6 +2557,7 @@ static const struct net_device_ops igbvf_netdev_ops = {
 #ifdef CONFIG_NET_POLL_CONTROLLER
        .ndo_poll_controller            = igbvf_netpoll,
 #endif
+       .ndo_set_features               = igbvf_set_features,
 };
 
 /**
@@ -2655,16 +2665,18 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
 
        adapter->bd_number = cards_found++;
 
-       netdev->features = NETIF_F_SG |
+       netdev->hw_features = NETIF_F_SG |
                           NETIF_F_IP_CSUM |
+                          NETIF_F_IPV6_CSUM |
+                          NETIF_F_TSO |
+                          NETIF_F_TSO6 |
+                          NETIF_F_RXCSUM;
+
+       netdev->features = netdev->hw_features |
                           NETIF_F_HW_VLAN_TX |
                           NETIF_F_HW_VLAN_RX |
                           NETIF_F_HW_VLAN_FILTER;
 
-       netdev->features |= NETIF_F_IPV6_CSUM;
-       netdev->features |= NETIF_F_TSO;
-       netdev->features |= NETIF_F_TSO6;
-
        if (pci_using_dac)
                netdev->features |= NETIF_F_HIGHDMA;