|
3 | 3 |
|
4 | 4 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
5 | 5 |
|
6 | | -#include <linux/module.h> |
7 | | -#include <linux/types.h> |
8 | | -#include <linux/init.h> |
9 | | -#include <linux/pci.h> |
10 | | -#include <linux/vmalloc.h> |
11 | | -#include <linux/pagemap.h> |
| 6 | +#include <linux/bitfield.h> |
12 | 7 | #include <linux/delay.h> |
13 | | -#include <linux/netdevice.h> |
14 | | -#include <linux/tcp.h> |
15 | | -#include <linux/ipv6.h> |
16 | | -#include <linux/slab.h> |
17 | | -#include <net/checksum.h> |
18 | | -#include <net/ip6_checksum.h> |
19 | | -#include <linux/mii.h> |
20 | 8 | #include <linux/ethtool.h> |
21 | 9 | #include <linux/if_vlan.h> |
| 10 | +#include <linux/init.h> |
| 11 | +#include <linux/ipv6.h> |
| 12 | +#include <linux/mii.h> |
| 13 | +#include <linux/module.h> |
| 14 | +#include <linux/netdevice.h> |
| 15 | +#include <linux/pagemap.h> |
| 16 | +#include <linux/pci.h> |
22 | 17 | #include <linux/prefetch.h> |
23 | 18 | #include <linux/sctp.h> |
24 | | - |
| 19 | +#include <linux/slab.h> |
| 20 | +#include <linux/tcp.h> |
| 21 | +#include <linux/types.h> |
| 22 | +#include <linux/vmalloc.h> |
| 23 | +#include <net/checksum.h> |
| 24 | +#include <net/ip6_checksum.h> |
25 | 25 | #include "igbvf.h" |
26 | 26 |
|
27 | 27 | char igbvf_driver_name[] = "igbvf"; |
@@ -273,9 +273,8 @@ static bool igbvf_clean_rx_irq(struct igbvf_adapter *adapter, |
273 | 273 | * that case, it fills the header buffer and spills the rest |
274 | 274 | * into the page. |
275 | 275 | */ |
276 | | - hlen = (le16_to_cpu(rx_desc->wb.lower.lo_dword.hs_rss.hdr_info) |
277 | | - & E1000_RXDADV_HDRBUFLEN_MASK) >> |
278 | | - E1000_RXDADV_HDRBUFLEN_SHIFT; |
| 276 | + hlen = le16_get_bits(rx_desc->wb.lower.lo_dword.hs_rss.hdr_info, |
| 277 | + E1000_RXDADV_HDRBUFLEN_MASK); |
279 | 278 | if (hlen > adapter->rx_ps_hdr_size) |
280 | 279 | hlen = adapter->rx_ps_hdr_size; |
281 | 280 |
|
@@ -2471,7 +2470,7 @@ static int igbvf_suspend(struct device *dev_d) |
2471 | 2470 | return 0; |
2472 | 2471 | } |
2473 | 2472 |
|
2474 | | -static int __maybe_unused igbvf_resume(struct device *dev_d) |
| 2473 | +static int igbvf_resume(struct device *dev_d) |
2475 | 2474 | { |
2476 | 2475 | struct pci_dev *pdev = to_pci_dev(dev_d); |
2477 | 2476 | struct net_device *netdev = pci_get_drvdata(pdev); |
@@ -2656,7 +2655,7 @@ igbvf_features_check(struct sk_buff *skb, struct net_device *dev, |
2656 | 2655 | unsigned int network_hdr_len, mac_hdr_len; |
2657 | 2656 |
|
2658 | 2657 | /* Make certain the headers can be described by a context descriptor */ |
2659 | | - mac_hdr_len = skb_network_header(skb) - skb->data; |
| 2658 | + mac_hdr_len = skb_network_offset(skb); |
2660 | 2659 | if (unlikely(mac_hdr_len > IGBVF_MAX_MAC_HDR_LEN)) |
2661 | 2660 | return features & ~(NETIF_F_HW_CSUM | |
2662 | 2661 | NETIF_F_SCTP_CRC | |
@@ -2958,15 +2957,15 @@ static const struct pci_device_id igbvf_pci_tbl[] = { |
2958 | 2957 | }; |
2959 | 2958 | MODULE_DEVICE_TABLE(pci, igbvf_pci_tbl); |
2960 | 2959 |
|
2961 | | -static SIMPLE_DEV_PM_OPS(igbvf_pm_ops, igbvf_suspend, igbvf_resume); |
| 2960 | +static DEFINE_SIMPLE_DEV_PM_OPS(igbvf_pm_ops, igbvf_suspend, igbvf_resume); |
2962 | 2961 |
|
2963 | 2962 | /* PCI Device API Driver */ |
2964 | 2963 | static struct pci_driver igbvf_driver = { |
2965 | 2964 | .name = igbvf_driver_name, |
2966 | 2965 | .id_table = igbvf_pci_tbl, |
2967 | 2966 | .probe = igbvf_probe, |
2968 | 2967 | .remove = igbvf_remove, |
2969 | | - .driver.pm = &igbvf_pm_ops, |
| 2968 | + .driver.pm = pm_sleep_ptr(&igbvf_pm_ops), |
2970 | 2969 | .shutdown = igbvf_shutdown, |
2971 | 2970 | .err_handler = &igbvf_err_handler |
2972 | 2971 | }; |
|
0 commit comments