Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c8fad18 authored by Daniel Ritz's avatar Daniel Ritz Committed by Linus Torvalds
Browse files

[PATCH] 3c59x: only put the device into D3 when we're actually using WOL



During a warm boot the device is in D3 and has troubles coming out of it.

Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1922163c
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -1581,6 +1581,7 @@ vortex_up(struct net_device *dev)


	if (VORTEX_PCI(vp)) {
	if (VORTEX_PCI(vp)) {
		pci_set_power_state(VORTEX_PCI(vp), PCI_D0);	/* Go active */
		pci_set_power_state(VORTEX_PCI(vp), PCI_D0);	/* Go active */
		if (vp->pm_state_valid)
			pci_restore_state(VORTEX_PCI(vp));
			pci_restore_state(VORTEX_PCI(vp));
		pci_enable_device(VORTEX_PCI(vp));
		pci_enable_device(VORTEX_PCI(vp));
	}
	}
@@ -2741,6 +2742,7 @@ vortex_down(struct net_device *dev, int final_down)
		outl(0, ioaddr + DownListPtr);
		outl(0, ioaddr + DownListPtr);


	if (final_down && VORTEX_PCI(vp)) {
	if (final_down && VORTEX_PCI(vp)) {
		vp->pm_state_valid = 1;
		pci_save_state(VORTEX_PCI(vp));
		pci_save_state(VORTEX_PCI(vp));
		acpi_set_WOL(dev);
		acpi_set_WOL(dev);
	}
	}
@@ -3243,10 +3245,11 @@ static void acpi_set_WOL(struct net_device *dev)
		outw(RxEnable, ioaddr + EL3_CMD);
		outw(RxEnable, ioaddr + EL3_CMD);


		pci_enable_wake(VORTEX_PCI(vp), 0, 1);
		pci_enable_wake(VORTEX_PCI(vp), 0, 1);
	}

		/* Change the power state to D3; RxEnable doesn't take effect. */
		/* Change the power state to D3; RxEnable doesn't take effect. */
		pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot);
		pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot);
	}
	}
}




static void __devexit vortex_remove_one (struct pci_dev *pdev)
static void __devexit vortex_remove_one (struct pci_dev *pdev)