mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 01:34:14 +08:00
Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Tony Nguyen says: ==================== 1GbE Intel Wired LAN Driver Updates 2020-07-30 This series contains updates to e100, e1000, e1000e, igb, igbvf, ixgbe, ixgbevf, iavf, and driver documentation. Vaibhav Gupta converts legacy .suspend() and .resume() to generic PM callbacks for e100, igbvf, ixgbe, ixgbevf, and iavf. Suraj Upadhyay replaces 1 byte memsets with assignments for e1000, e1000e, igb, and ixgbe. Alexander Klimov replaces http links with https. Miaohe Lin replaces uses of memset to clear MAC addresses with eth_zero_addr(). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
c6886957d2
@ -41,7 +41,7 @@ Identifying Your Adapter
|
|||||||
|
|
||||||
For information on how to identify your adapter, and for the latest Intel
|
For information on how to identify your adapter, and for the latest Intel
|
||||||
network drivers, refer to the Intel Support website:
|
network drivers, refer to the Intel Support website:
|
||||||
http://www.intel.com/support
|
https://www.intel.com/support
|
||||||
|
|
||||||
Driver Configuration Parameters
|
Driver Configuration Parameters
|
||||||
===============================
|
===============================
|
||||||
@ -179,7 +179,7 @@ filtering by
|
|||||||
Support
|
Support
|
||||||
=======
|
=======
|
||||||
For general information, go to the Intel support website at:
|
For general information, go to the Intel support website at:
|
||||||
http://www.intel.com/support/
|
https://www.intel.com/support/
|
||||||
|
|
||||||
or the Intel Wired Networking project hosted by Sourceforge at:
|
or the Intel Wired Networking project hosted by Sourceforge at:
|
||||||
http://sourceforge.net/projects/e1000
|
http://sourceforge.net/projects/e1000
|
||||||
|
@ -22,7 +22,7 @@ Ethernet Multi-host Controller.
|
|||||||
|
|
||||||
For information on how to identify your adapter, and for the latest Intel
|
For information on how to identify your adapter, and for the latest Intel
|
||||||
network drivers, refer to the Intel Support website:
|
network drivers, refer to the Intel Support website:
|
||||||
http://www.intel.com/support
|
https://www.intel.com/support
|
||||||
|
|
||||||
|
|
||||||
Flow Control
|
Flow Control
|
||||||
|
@ -43,7 +43,7 @@ device.
|
|||||||
|
|
||||||
For information on how to identify your adapter, and for the latest NVM/FW
|
For information on how to identify your adapter, and for the latest NVM/FW
|
||||||
images and Intel network drivers, refer to the Intel Support website:
|
images and Intel network drivers, refer to the Intel Support website:
|
||||||
http://www.intel.com/support
|
https://www.intel.com/support
|
||||||
|
|
||||||
|
|
||||||
Additional Features and Configurations
|
Additional Features and Configurations
|
||||||
|
@ -20,7 +20,7 @@ Identifying Your Adapter
|
|||||||
========================
|
========================
|
||||||
For information on how to identify your adapter, and for the latest Intel
|
For information on how to identify your adapter, and for the latest Intel
|
||||||
network drivers, refer to the Intel Support website:
|
network drivers, refer to the Intel Support website:
|
||||||
http://www.intel.com/support
|
https://www.intel.com/support
|
||||||
|
|
||||||
|
|
||||||
Command Line Parameters
|
Command Line Parameters
|
||||||
|
@ -35,7 +35,7 @@ Identifying Your Adapter
|
|||||||
========================
|
========================
|
||||||
For information on how to identify your adapter, and for the latest Intel
|
For information on how to identify your adapter, and for the latest Intel
|
||||||
network drivers, refer to the Intel Support website:
|
network drivers, refer to the Intel Support website:
|
||||||
http://www.intel.com/support
|
https://www.intel.com/support
|
||||||
|
|
||||||
|
|
||||||
Additional Features and Configurations
|
Additional Features and Configurations
|
||||||
|
@ -203,7 +203,7 @@ With the 10 Gigabit server adapters, the default Linux configuration will
|
|||||||
very likely limit the total available throughput artificially. There is a set
|
very likely limit the total available throughput artificially. There is a set
|
||||||
of configuration changes that, when applied together, will increase the ability
|
of configuration changes that, when applied together, will increase the ability
|
||||||
of Linux to transmit and receive data. The following enhancements were
|
of Linux to transmit and receive data. The following enhancements were
|
||||||
originally acquired from settings published at http://www.spec.org/web99/ for
|
originally acquired from settings published at https://www.spec.org/web99/ for
|
||||||
various submitted results using Linux.
|
various submitted results using Linux.
|
||||||
|
|
||||||
NOTE:
|
NOTE:
|
||||||
|
@ -2993,8 +2993,6 @@ static void __e100_shutdown(struct pci_dev *pdev, bool *enable_wake)
|
|||||||
e100_down(nic);
|
e100_down(nic);
|
||||||
netif_device_detach(netdev);
|
netif_device_detach(netdev);
|
||||||
|
|
||||||
pci_save_state(pdev);
|
|
||||||
|
|
||||||
if ((nic->flags & wol_magic) | e100_asf(nic)) {
|
if ((nic->flags & wol_magic) | e100_asf(nic)) {
|
||||||
/* enable reverse auto-negotiation */
|
/* enable reverse auto-negotiation */
|
||||||
if (nic->phy == phy_82552_v) {
|
if (nic->phy == phy_82552_v) {
|
||||||
@ -3024,24 +3022,22 @@ static int __e100_power_off(struct pci_dev *pdev, bool wake)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
static int __maybe_unused e100_suspend(struct device *dev_d)
|
||||||
static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
|
|
||||||
{
|
{
|
||||||
bool wake;
|
bool wake;
|
||||||
__e100_shutdown(pdev, &wake);
|
|
||||||
return __e100_power_off(pdev, wake);
|
__e100_shutdown(to_pci_dev(dev_d), &wake);
|
||||||
|
|
||||||
|
device_wakeup_disable(dev_d);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int e100_resume(struct pci_dev *pdev)
|
static int __maybe_unused e100_resume(struct device *dev_d)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = dev_get_drvdata(dev_d);
|
||||||
struct nic *nic = netdev_priv(netdev);
|
struct nic *nic = netdev_priv(netdev);
|
||||||
|
|
||||||
pci_set_power_state(pdev, PCI_D0);
|
|
||||||
pci_restore_state(pdev);
|
|
||||||
/* ack any pending wake events, disable PME */
|
|
||||||
pci_enable_wake(pdev, PCI_D0, 0);
|
|
||||||
|
|
||||||
/* disable reverse auto-negotiation */
|
/* disable reverse auto-negotiation */
|
||||||
if (nic->phy == phy_82552_v) {
|
if (nic->phy == phy_82552_v) {
|
||||||
u16 smartspeed = mdio_read(netdev, nic->mii.phy_id,
|
u16 smartspeed = mdio_read(netdev, nic->mii.phy_id,
|
||||||
@ -3058,7 +3054,6 @@ static int e100_resume(struct pci_dev *pdev)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PM */
|
|
||||||
|
|
||||||
static void e100_shutdown(struct pci_dev *pdev)
|
static void e100_shutdown(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
@ -3146,16 +3141,17 @@ static const struct pci_error_handlers e100_err_handler = {
|
|||||||
.resume = e100_io_resume,
|
.resume = e100_io_resume,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(e100_pm_ops, e100_suspend, e100_resume);
|
||||||
|
|
||||||
static struct pci_driver e100_driver = {
|
static struct pci_driver e100_driver = {
|
||||||
.name = DRV_NAME,
|
.name = DRV_NAME,
|
||||||
.id_table = e100_id_table,
|
.id_table = e100_id_table,
|
||||||
.probe = e100_probe,
|
.probe = e100_probe,
|
||||||
.remove = e100_remove,
|
.remove = e100_remove,
|
||||||
#ifdef CONFIG_PM
|
|
||||||
/* Power Management hooks */
|
/* Power Management hooks */
|
||||||
.suspend = e100_suspend,
|
.driver.pm = &e100_pm_ops,
|
||||||
.resume = e100_resume,
|
|
||||||
#endif
|
|
||||||
.shutdown = e100_shutdown,
|
.shutdown = e100_shutdown,
|
||||||
.err_handler = &e100_err_handler,
|
.err_handler = &e100_err_handler,
|
||||||
};
|
};
|
||||||
|
@ -1356,8 +1356,8 @@ static void e1000_create_lbtest_frame(struct sk_buff *skb,
|
|||||||
memset(skb->data, 0xFF, frame_size);
|
memset(skb->data, 0xFF, frame_size);
|
||||||
frame_size &= ~1;
|
frame_size &= ~1;
|
||||||
memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
|
memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
|
||||||
memset(&skb->data[frame_size / 2 + 10], 0xBE, 1);
|
skb->data[frame_size / 2 + 10] = 0xBE;
|
||||||
memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
|
skb->data[frame_size / 2 + 12] = 0xAF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int e1000_check_lbtest_frame(const unsigned char *data,
|
static int e1000_check_lbtest_frame(const unsigned char *data,
|
||||||
|
@ -1608,8 +1608,8 @@ static void e1000_create_lbtest_frame(struct sk_buff *skb,
|
|||||||
memset(skb->data, 0xFF, frame_size);
|
memset(skb->data, 0xFF, frame_size);
|
||||||
frame_size &= ~1;
|
frame_size &= ~1;
|
||||||
memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
|
memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
|
||||||
memset(&skb->data[frame_size / 2 + 10], 0xBE, 1);
|
skb->data[frame_size / 2 + 10] = 0xBE;
|
||||||
memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
|
skb->data[frame_size / 2 + 12] = 0xAF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int e1000_check_lbtest_frame(struct sk_buff *skb,
|
static int e1000_check_lbtest_frame(struct sk_buff *skb,
|
||||||
|
@ -3766,7 +3766,6 @@ err_dma:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
/**
|
/**
|
||||||
* iavf_suspend - Power management suspend routine
|
* iavf_suspend - Power management suspend routine
|
||||||
* @pdev: PCI device information struct
|
* @pdev: PCI device information struct
|
||||||
@ -3774,11 +3773,10 @@ err_dma:
|
|||||||
*
|
*
|
||||||
* Called when the system (VM) is entering sleep/suspend.
|
* Called when the system (VM) is entering sleep/suspend.
|
||||||
**/
|
**/
|
||||||
static int iavf_suspend(struct pci_dev *pdev, pm_message_t state)
|
static int __maybe_unused iavf_suspend(struct device *dev_d)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = dev_get_drvdata(dev_d);
|
||||||
struct iavf_adapter *adapter = netdev_priv(netdev);
|
struct iavf_adapter *adapter = netdev_priv(netdev);
|
||||||
int retval = 0;
|
|
||||||
|
|
||||||
netif_device_detach(netdev);
|
netif_device_detach(netdev);
|
||||||
|
|
||||||
@ -3796,12 +3794,6 @@ static int iavf_suspend(struct pci_dev *pdev, pm_message_t state)
|
|||||||
|
|
||||||
clear_bit(__IAVF_IN_CRITICAL_TASK, &adapter->crit_section);
|
clear_bit(__IAVF_IN_CRITICAL_TASK, &adapter->crit_section);
|
||||||
|
|
||||||
retval = pci_save_state(pdev);
|
|
||||||
if (retval)
|
|
||||||
return retval;
|
|
||||||
|
|
||||||
pci_disable_device(pdev);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3811,24 +3803,13 @@ static int iavf_suspend(struct pci_dev *pdev, pm_message_t state)
|
|||||||
*
|
*
|
||||||
* Called when the system (VM) is resumed from sleep/suspend.
|
* Called when the system (VM) is resumed from sleep/suspend.
|
||||||
**/
|
**/
|
||||||
static int iavf_resume(struct pci_dev *pdev)
|
static int __maybe_unused iavf_resume(struct device *dev_d)
|
||||||
{
|
{
|
||||||
|
struct pci_dev *pdev = to_pci_dev(dev_d);
|
||||||
struct iavf_adapter *adapter = pci_get_drvdata(pdev);
|
struct iavf_adapter *adapter = pci_get_drvdata(pdev);
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
u32 err;
|
u32 err;
|
||||||
|
|
||||||
pci_set_power_state(pdev, PCI_D0);
|
|
||||||
pci_restore_state(pdev);
|
|
||||||
/* pci_restore_state clears dev->state_saved so call
|
|
||||||
* pci_save_state to restore it.
|
|
||||||
*/
|
|
||||||
pci_save_state(pdev);
|
|
||||||
|
|
||||||
err = pci_enable_device_mem(pdev);
|
|
||||||
if (err) {
|
|
||||||
dev_err(&pdev->dev, "Cannot enable PCI device from suspend.\n");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
pci_set_master(pdev);
|
pci_set_master(pdev);
|
||||||
|
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
@ -3852,7 +3833,6 @@ static int iavf_resume(struct pci_dev *pdev)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_PM */
|
|
||||||
/**
|
/**
|
||||||
* iavf_remove - Device Removal Routine
|
* iavf_remove - Device Removal Routine
|
||||||
* @pdev: PCI device information struct
|
* @pdev: PCI device information struct
|
||||||
@ -3954,16 +3934,15 @@ static void iavf_remove(struct pci_dev *pdev)
|
|||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(iavf_pm_ops, iavf_suspend, iavf_resume);
|
||||||
|
|
||||||
static struct pci_driver iavf_driver = {
|
static struct pci_driver iavf_driver = {
|
||||||
.name = iavf_driver_name,
|
.name = iavf_driver_name,
|
||||||
.id_table = iavf_pci_tbl,
|
.id_table = iavf_pci_tbl,
|
||||||
.probe = iavf_probe,
|
.probe = iavf_probe,
|
||||||
.remove = iavf_remove,
|
.remove = iavf_remove,
|
||||||
#ifdef CONFIG_PM
|
.driver.pm = &iavf_pm_ops,
|
||||||
.suspend = iavf_suspend,
|
.shutdown = iavf_shutdown,
|
||||||
.resume = iavf_resume,
|
|
||||||
#endif
|
|
||||||
.shutdown = iavf_shutdown,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1782,8 +1782,8 @@ static void igb_create_lbtest_frame(struct sk_buff *skb,
|
|||||||
memset(skb->data, 0xFF, frame_size);
|
memset(skb->data, 0xFF, frame_size);
|
||||||
frame_size /= 2;
|
frame_size /= 2;
|
||||||
memset(&skb->data[frame_size], 0xAA, frame_size - 1);
|
memset(&skb->data[frame_size], 0xAA, frame_size - 1);
|
||||||
memset(&skb->data[frame_size + 10], 0xBE, 1);
|
skb->data[frame_size + 10] = 0xBE;
|
||||||
memset(&skb->data[frame_size + 12], 0xAF, 1);
|
skb->data[frame_size + 12] = 0xAF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int igb_check_lbtest_frame(struct igb_rx_buffer *rx_buffer,
|
static int igb_check_lbtest_frame(struct igb_rx_buffer *rx_buffer,
|
||||||
|
@ -7159,7 +7159,7 @@ static void igb_flush_mac_table(struct igb_adapter *adapter)
|
|||||||
|
|
||||||
for (i = 0; i < hw->mac.rar_entry_count; i++) {
|
for (i = 0; i < hw->mac.rar_entry_count; i++) {
|
||||||
adapter->mac_table[i].state &= ~IGB_MAC_STATE_IN_USE;
|
adapter->mac_table[i].state &= ~IGB_MAC_STATE_IN_USE;
|
||||||
memset(adapter->mac_table[i].addr, 0, ETH_ALEN);
|
eth_zero_addr(adapter->mac_table[i].addr);
|
||||||
adapter->mac_table[i].queue = 0;
|
adapter->mac_table[i].queue = 0;
|
||||||
igb_rar_set_index(adapter, i);
|
igb_rar_set_index(adapter, i);
|
||||||
}
|
}
|
||||||
@ -7308,7 +7308,7 @@ static int igb_del_mac_filter_flags(struct igb_adapter *adapter,
|
|||||||
} else {
|
} else {
|
||||||
adapter->mac_table[i].state = 0;
|
adapter->mac_table[i].state = 0;
|
||||||
adapter->mac_table[i].queue = 0;
|
adapter->mac_table[i].queue = 0;
|
||||||
memset(adapter->mac_table[i].addr, 0, ETH_ALEN);
|
eth_zero_addr(adapter->mac_table[i].addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
igb_rar_set_index(adapter, i);
|
igb_rar_set_index(adapter, i);
|
||||||
|
@ -2457,13 +2457,10 @@ static int igbvf_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int igbvf_suspend(struct pci_dev *pdev, pm_message_t state)
|
static int igbvf_suspend(struct device *dev_d)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = dev_get_drvdata(dev_d);
|
||||||
struct igbvf_adapter *adapter = netdev_priv(netdev);
|
struct igbvf_adapter *adapter = netdev_priv(netdev);
|
||||||
#ifdef CONFIG_PM
|
|
||||||
int retval = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
netif_device_detach(netdev);
|
netif_device_detach(netdev);
|
||||||
|
|
||||||
@ -2473,31 +2470,16 @@ static int igbvf_suspend(struct pci_dev *pdev, pm_message_t state)
|
|||||||
igbvf_free_irq(adapter);
|
igbvf_free_irq(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
retval = pci_save_state(pdev);
|
|
||||||
if (retval)
|
|
||||||
return retval;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pci_disable_device(pdev);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
static int __maybe_unused igbvf_resume(struct device *dev_d)
|
||||||
static int igbvf_resume(struct pci_dev *pdev)
|
|
||||||
{
|
{
|
||||||
|
struct pci_dev *pdev = to_pci_dev(dev_d);
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
struct igbvf_adapter *adapter = netdev_priv(netdev);
|
struct igbvf_adapter *adapter = netdev_priv(netdev);
|
||||||
u32 err;
|
u32 err;
|
||||||
|
|
||||||
pci_restore_state(pdev);
|
|
||||||
err = pci_enable_device_mem(pdev);
|
|
||||||
if (err) {
|
|
||||||
dev_err(&pdev->dev, "Cannot enable PCI device from suspend\n");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
pci_set_master(pdev);
|
pci_set_master(pdev);
|
||||||
|
|
||||||
if (netif_running(netdev)) {
|
if (netif_running(netdev)) {
|
||||||
@ -2515,11 +2497,10 @@ static int igbvf_resume(struct pci_dev *pdev)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void igbvf_shutdown(struct pci_dev *pdev)
|
static void igbvf_shutdown(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
igbvf_suspend(pdev, PMSG_SUSPEND);
|
igbvf_suspend(&pdev->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||||
@ -2960,17 +2941,15 @@ static const struct pci_device_id igbvf_pci_tbl[] = {
|
|||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(pci, igbvf_pci_tbl);
|
MODULE_DEVICE_TABLE(pci, igbvf_pci_tbl);
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(igbvf_pm_ops, igbvf_suspend, igbvf_resume);
|
||||||
|
|
||||||
/* PCI Device API Driver */
|
/* PCI Device API Driver */
|
||||||
static struct pci_driver igbvf_driver = {
|
static struct pci_driver igbvf_driver = {
|
||||||
.name = igbvf_driver_name,
|
.name = igbvf_driver_name,
|
||||||
.id_table = igbvf_pci_tbl,
|
.id_table = igbvf_pci_tbl,
|
||||||
.probe = igbvf_probe,
|
.probe = igbvf_probe,
|
||||||
.remove = igbvf_remove,
|
.remove = igbvf_remove,
|
||||||
#ifdef CONFIG_PM
|
.driver.pm = &igbvf_pm_ops,
|
||||||
/* Power Management Hooks */
|
|
||||||
.suspend = igbvf_suspend,
|
|
||||||
.resume = igbvf_resume,
|
|
||||||
#endif
|
|
||||||
.shutdown = igbvf_shutdown,
|
.shutdown = igbvf_shutdown,
|
||||||
.err_handler = &igbvf_err_handler
|
.err_handler = &igbvf_err_handler
|
||||||
};
|
};
|
||||||
|
@ -1951,8 +1951,8 @@ static void ixgbe_create_lbtest_frame(struct sk_buff *skb,
|
|||||||
memset(skb->data, 0xFF, frame_size);
|
memset(skb->data, 0xFF, frame_size);
|
||||||
frame_size >>= 1;
|
frame_size >>= 1;
|
||||||
memset(&skb->data[frame_size], 0xAA, frame_size / 2 - 1);
|
memset(&skb->data[frame_size], 0xAA, frame_size / 2 - 1);
|
||||||
memset(&skb->data[frame_size + 10], 0xBE, 1);
|
skb->data[frame_size + 10] = 0xBE;
|
||||||
memset(&skb->data[frame_size + 12], 0xAF, 1);
|
skb->data[frame_size + 12] = 0xAF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ixgbe_check_lbtest_frame(struct ixgbe_rx_buffer *rx_buffer,
|
static bool ixgbe_check_lbtest_frame(struct ixgbe_rx_buffer *rx_buffer,
|
||||||
|
@ -6877,32 +6877,20 @@ int ixgbe_close(struct net_device *netdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
static int __maybe_unused ixgbe_resume(struct device *dev_d)
|
||||||
static int ixgbe_resume(struct pci_dev *pdev)
|
|
||||||
{
|
{
|
||||||
|
struct pci_dev *pdev = to_pci_dev(dev_d);
|
||||||
struct ixgbe_adapter *adapter = pci_get_drvdata(pdev);
|
struct ixgbe_adapter *adapter = pci_get_drvdata(pdev);
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
u32 err;
|
u32 err;
|
||||||
|
|
||||||
adapter->hw.hw_addr = adapter->io_addr;
|
adapter->hw.hw_addr = adapter->io_addr;
|
||||||
pci_set_power_state(pdev, PCI_D0);
|
|
||||||
pci_restore_state(pdev);
|
|
||||||
/*
|
|
||||||
* pci_restore_state clears dev->state_saved so call
|
|
||||||
* pci_save_state to restore it.
|
|
||||||
*/
|
|
||||||
pci_save_state(pdev);
|
|
||||||
|
|
||||||
err = pci_enable_device_mem(pdev);
|
|
||||||
if (err) {
|
|
||||||
e_dev_err("Cannot enable PCI device from suspend\n");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
smp_mb__before_atomic();
|
smp_mb__before_atomic();
|
||||||
clear_bit(__IXGBE_DISABLED, &adapter->state);
|
clear_bit(__IXGBE_DISABLED, &adapter->state);
|
||||||
pci_set_master(pdev);
|
pci_set_master(pdev);
|
||||||
|
|
||||||
pci_wake_from_d3(pdev, false);
|
device_wakeup_disable(dev_d);
|
||||||
|
|
||||||
ixgbe_reset(adapter);
|
ixgbe_reset(adapter);
|
||||||
|
|
||||||
@ -6920,7 +6908,6 @@ static int ixgbe_resume(struct pci_dev *pdev)
|
|||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PM */
|
|
||||||
|
|
||||||
static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
|
static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
|
||||||
{
|
{
|
||||||
@ -6929,9 +6916,6 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
|
|||||||
struct ixgbe_hw *hw = &adapter->hw;
|
struct ixgbe_hw *hw = &adapter->hw;
|
||||||
u32 ctrl;
|
u32 ctrl;
|
||||||
u32 wufc = adapter->wol;
|
u32 wufc = adapter->wol;
|
||||||
#ifdef CONFIG_PM
|
|
||||||
int retval = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
netif_device_detach(netdev);
|
netif_device_detach(netdev);
|
||||||
@ -6942,12 +6926,6 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
|
|||||||
ixgbe_clear_interrupt_scheme(adapter);
|
ixgbe_clear_interrupt_scheme(adapter);
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
retval = pci_save_state(pdev);
|
|
||||||
if (retval)
|
|
||||||
return retval;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
if (hw->mac.ops.stop_link_on_d3)
|
if (hw->mac.ops.stop_link_on_d3)
|
||||||
hw->mac.ops.stop_link_on_d3(hw);
|
hw->mac.ops.stop_link_on_d3(hw);
|
||||||
|
|
||||||
@ -7002,26 +6980,18 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
static int __maybe_unused ixgbe_suspend(struct device *dev_d)
|
||||||
static int ixgbe_suspend(struct pci_dev *pdev, pm_message_t state)
|
|
||||||
{
|
{
|
||||||
|
struct pci_dev *pdev = to_pci_dev(dev_d);
|
||||||
int retval;
|
int retval;
|
||||||
bool wake;
|
bool wake;
|
||||||
|
|
||||||
retval = __ixgbe_shutdown(pdev, &wake);
|
retval = __ixgbe_shutdown(pdev, &wake);
|
||||||
if (retval)
|
|
||||||
return retval;
|
|
||||||
|
|
||||||
if (wake) {
|
device_set_wakeup_enable(dev_d, wake);
|
||||||
pci_prepare_to_sleep(pdev);
|
|
||||||
} else {
|
|
||||||
pci_wake_from_d3(pdev, false);
|
|
||||||
pci_set_power_state(pdev, PCI_D3hot);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return retval;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PM */
|
|
||||||
|
|
||||||
static void ixgbe_shutdown(struct pci_dev *pdev)
|
static void ixgbe_shutdown(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
@ -11383,16 +11353,15 @@ static const struct pci_error_handlers ixgbe_err_handler = {
|
|||||||
.resume = ixgbe_io_resume,
|
.resume = ixgbe_io_resume,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(ixgbe_pm_ops, ixgbe_suspend, ixgbe_resume);
|
||||||
|
|
||||||
static struct pci_driver ixgbe_driver = {
|
static struct pci_driver ixgbe_driver = {
|
||||||
.name = ixgbe_driver_name,
|
.name = ixgbe_driver_name,
|
||||||
.id_table = ixgbe_pci_tbl,
|
.id_table = ixgbe_pci_tbl,
|
||||||
.probe = ixgbe_probe,
|
.probe = ixgbe_probe,
|
||||||
.remove = ixgbe_remove,
|
.remove = ixgbe_remove,
|
||||||
#ifdef CONFIG_PM
|
.driver.pm = &ixgbe_pm_ops,
|
||||||
.suspend = ixgbe_suspend,
|
.shutdown = ixgbe_shutdown,
|
||||||
.resume = ixgbe_resume,
|
|
||||||
#endif
|
|
||||||
.shutdown = ixgbe_shutdown,
|
|
||||||
.sriov_configure = ixgbe_pci_sriov_configure,
|
.sriov_configure = ixgbe_pci_sriov_configure,
|
||||||
.err_handler = &ixgbe_err_handler
|
.err_handler = &ixgbe_err_handler
|
||||||
};
|
};
|
||||||
|
@ -783,7 +783,7 @@ static int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter,
|
|||||||
memcpy(adapter->vfinfo[vf].vf_mac_addresses, mac_addr,
|
memcpy(adapter->vfinfo[vf].vf_mac_addresses, mac_addr,
|
||||||
ETH_ALEN);
|
ETH_ALEN);
|
||||||
else
|
else
|
||||||
memset(adapter->vfinfo[vf].vf_mac_addresses, 0, ETH_ALEN);
|
eth_zero_addr(adapter->vfinfo[vf].vf_mac_addresses);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -4297,13 +4297,10 @@ static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ixgbevf_suspend(struct pci_dev *pdev, pm_message_t state)
|
static int __maybe_unused ixgbevf_suspend(struct device *dev_d)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = dev_get_drvdata(dev_d);
|
||||||
struct ixgbevf_adapter *adapter = netdev_priv(netdev);
|
struct ixgbevf_adapter *adapter = netdev_priv(netdev);
|
||||||
#ifdef CONFIG_PM
|
|
||||||
int retval = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
netif_device_detach(netdev);
|
netif_device_detach(netdev);
|
||||||
@ -4314,37 +4311,16 @@ static int ixgbevf_suspend(struct pci_dev *pdev, pm_message_t state)
|
|||||||
ixgbevf_clear_interrupt_scheme(adapter);
|
ixgbevf_clear_interrupt_scheme(adapter);
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
retval = pci_save_state(pdev);
|
|
||||||
if (retval)
|
|
||||||
return retval;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
if (!test_and_set_bit(__IXGBEVF_DISABLED, &adapter->state))
|
|
||||||
pci_disable_device(pdev);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
static int __maybe_unused ixgbevf_resume(struct device *dev_d)
|
||||||
static int ixgbevf_resume(struct pci_dev *pdev)
|
|
||||||
{
|
{
|
||||||
|
struct pci_dev *pdev = to_pci_dev(dev_d);
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
struct ixgbevf_adapter *adapter = netdev_priv(netdev);
|
struct ixgbevf_adapter *adapter = netdev_priv(netdev);
|
||||||
u32 err;
|
u32 err;
|
||||||
|
|
||||||
pci_restore_state(pdev);
|
|
||||||
/* pci_restore_state clears dev->state_saved so call
|
|
||||||
* pci_save_state to restore it.
|
|
||||||
*/
|
|
||||||
pci_save_state(pdev);
|
|
||||||
|
|
||||||
err = pci_enable_device_mem(pdev);
|
|
||||||
if (err) {
|
|
||||||
dev_err(&pdev->dev, "Cannot enable PCI device from suspend\n");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
adapter->hw.hw_addr = adapter->io_addr;
|
adapter->hw.hw_addr = adapter->io_addr;
|
||||||
smp_mb__before_atomic();
|
smp_mb__before_atomic();
|
||||||
clear_bit(__IXGBEVF_DISABLED, &adapter->state);
|
clear_bit(__IXGBEVF_DISABLED, &adapter->state);
|
||||||
@ -4365,10 +4341,9 @@ static int ixgbevf_resume(struct pci_dev *pdev)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_PM */
|
|
||||||
static void ixgbevf_shutdown(struct pci_dev *pdev)
|
static void ixgbevf_shutdown(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
ixgbevf_suspend(pdev, PMSG_SUSPEND);
|
ixgbevf_suspend(&pdev->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ixgbevf_get_tx_ring_stats(struct rtnl_link_stats64 *stats,
|
static void ixgbevf_get_tx_ring_stats(struct rtnl_link_stats64 *stats,
|
||||||
@ -4888,16 +4863,17 @@ static const struct pci_error_handlers ixgbevf_err_handler = {
|
|||||||
.resume = ixgbevf_io_resume,
|
.resume = ixgbevf_io_resume,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(ixgbevf_pm_ops, ixgbevf_suspend, ixgbevf_resume);
|
||||||
|
|
||||||
static struct pci_driver ixgbevf_driver = {
|
static struct pci_driver ixgbevf_driver = {
|
||||||
.name = ixgbevf_driver_name,
|
.name = ixgbevf_driver_name,
|
||||||
.id_table = ixgbevf_pci_tbl,
|
.id_table = ixgbevf_pci_tbl,
|
||||||
.probe = ixgbevf_probe,
|
.probe = ixgbevf_probe,
|
||||||
.remove = ixgbevf_remove,
|
.remove = ixgbevf_remove,
|
||||||
#ifdef CONFIG_PM
|
|
||||||
/* Power Management Hooks */
|
/* Power Management Hooks */
|
||||||
.suspend = ixgbevf_suspend,
|
.driver.pm = &ixgbevf_pm_ops,
|
||||||
.resume = ixgbevf_resume,
|
|
||||||
#endif
|
|
||||||
.shutdown = ixgbevf_shutdown,
|
.shutdown = ixgbevf_shutdown,
|
||||||
.err_handler = &ixgbevf_err_handler
|
.err_handler = &ixgbevf_err_handler
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user