Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41452
b: refs/heads/master
c: a189317
h: refs/heads/master
v: v3
  • Loading branch information
Francois Romieu authored and Jeff Garzik committed Dec 2, 2006
1 parent 03fc3a0 commit d51067f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c3070d713d798f7f9e7ee3614e49b47655d14d8
refs/heads/master: a189317fa0e9d425cd3a4c248b06f96d876cf7fd
47 changes: 46 additions & 1 deletion trunk/drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -4603,6 +4603,50 @@ static void __devexit nv_remove(struct pci_dev *pci_dev)
pci_set_drvdata(pci_dev, NULL);
}

#ifdef CONFIG_PM
static int nv_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct fe_priv *np = netdev_priv(dev);

if (!netif_running(dev))
goto out;

netif_device_detach(dev);

// Gross.
nv_close(dev);

pci_save_state(pdev);
pci_enable_wake(pdev, pci_choose_state(pdev, state), np->wolenabled);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
out:
return 0;
}

static int nv_resume(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
int rc = 0;

if (!netif_running(dev))
goto out;

netif_device_attach(dev);

pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
pci_enable_wake(pdev, PCI_D0, 0);

rc = nv_open(dev);
out:
return rc;
}
#else
#define nv_suspend NULL
#define nv_resume NULL
#endif /* CONFIG_PM */

static struct pci_device_id pci_tbl[] = {
{ /* nForce Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_1),
Expand Down Expand Up @@ -4704,9 +4748,10 @@ static struct pci_driver driver = {
.id_table = pci_tbl,
.probe = nv_probe,
.remove = __devexit_p(nv_remove),
.suspend = nv_suspend,
.resume = nv_resume,
};


static int __init init_nic(void)
{
printk(KERN_INFO "forcedeth.c: Reverse Engineered nForce ethernet driver. Version %s.\n", FORCEDETH_VERSION);
Expand Down

0 comments on commit d51067f

Please sign in to comment.