Commit 9d6f9be1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] 3c59x: bring back the `enable_wol' option

Some machines appear to have BIOS problems which are causing 3c59x adapters
to come up in a powered-off state when WOL and PM are enabled.

So bring back the 2.4 `enable_wol' module option which disables wake-on-lan
unless the user specifically asked for it.
parent f96489a2
...@@ -216,6 +216,19 @@ watchdog=N ...@@ -216,6 +216,19 @@ watchdog=N
to increase this value on LANs which have very high collision rates. to increase this value on LANs which have very high collision rates.
The default value is 5000 (5.0 seconds). The default value is 5000 (5.0 seconds).
enable_wol=N1,N2,N3,...
Enable Wake-on-LAN support for the relevant interface. Donald
Becker's `ether-wake' application may be used to wake suspended
machines.
Also enables the NIC's power management support.
global_enable_wol=N
Sets enable_wol mode for all 3c59x NICs in the machine. Entries in
the `enable_wol' array above will override any setting of this.
Media selection Media selection
--------------- ---------------
......
...@@ -291,6 +291,8 @@ MODULE_PARM(global_full_duplex, "i"); ...@@ -291,6 +291,8 @@ MODULE_PARM(global_full_duplex, "i");
MODULE_PARM(full_duplex, "1-" __MODULE_STRING(8) "i"); MODULE_PARM(full_duplex, "1-" __MODULE_STRING(8) "i");
MODULE_PARM(hw_checksums, "1-" __MODULE_STRING(8) "i"); MODULE_PARM(hw_checksums, "1-" __MODULE_STRING(8) "i");
MODULE_PARM(flow_ctrl, "1-" __MODULE_STRING(8) "i"); MODULE_PARM(flow_ctrl, "1-" __MODULE_STRING(8) "i");
MODULE_PARM(global_enable_wol, "i");
MODULE_PARM(enable_wol, "1-" __MODULE_STRING(8) "i");
MODULE_PARM(rx_copybreak, "i"); MODULE_PARM(rx_copybreak, "i");
MODULE_PARM(max_interrupt_work, "i"); MODULE_PARM(max_interrupt_work, "i");
MODULE_PARM(compaq_ioaddr, "i"); MODULE_PARM(compaq_ioaddr, "i");
...@@ -304,6 +306,8 @@ MODULE_PARM_DESC(full_duplex, "3c59x full duplex setting(s) (1)"); ...@@ -304,6 +306,8 @@ MODULE_PARM_DESC(full_duplex, "3c59x full duplex setting(s) (1)");
MODULE_PARM_DESC(global_full_duplex, "3c59x: same as full_duplex, but applies to all NICs if options is unset"); MODULE_PARM_DESC(global_full_duplex, "3c59x: same as full_duplex, but applies to all NICs if options is unset");
MODULE_PARM_DESC(hw_checksums, "3c59x Hardware checksum checking by adapter(s) (0-1)"); MODULE_PARM_DESC(hw_checksums, "3c59x Hardware checksum checking by adapter(s) (0-1)");
MODULE_PARM_DESC(flow_ctrl, "3c59x 802.3x flow control usage (PAUSE only) (0-1)"); MODULE_PARM_DESC(flow_ctrl, "3c59x 802.3x flow control usage (PAUSE only) (0-1)");
MODULE_PARM_DESC(enable_wol, "3c59x: Turn on Wake-on-LAN for adapter(s) (0-1)");
MODULE_PARM_DESC(global_enable_wol, "3c59x: same as enable_wol, but applies to all NICs if options is unset");
MODULE_PARM_DESC(rx_copybreak, "3c59x copy breakpoint for copy-only-tiny-frames"); MODULE_PARM_DESC(rx_copybreak, "3c59x copy breakpoint for copy-only-tiny-frames");
MODULE_PARM_DESC(max_interrupt_work, "3c59x maximum events handled per interrupt"); MODULE_PARM_DESC(max_interrupt_work, "3c59x maximum events handled per interrupt");
MODULE_PARM_DESC(compaq_ioaddr, "3c59x PCI I/O base address (Compaq BIOS problem workaround)"); MODULE_PARM_DESC(compaq_ioaddr, "3c59x PCI I/O base address (Compaq BIOS problem workaround)");
...@@ -813,6 +817,7 @@ struct vortex_private { ...@@ -813,6 +817,7 @@ struct vortex_private {
flow_ctrl:1, /* Use 802.3x flow control (PAUSE only) */ flow_ctrl:1, /* Use 802.3x flow control (PAUSE only) */
partner_flow_ctrl:1, /* Partner supports flow control */ partner_flow_ctrl:1, /* Partner supports flow control */
has_nway:1, has_nway:1,
enable_wol:1, /* Wake-on-LAN is enabled */
pm_state_valid:1, /* power_state[] has sane contents */ pm_state_valid:1, /* power_state[] has sane contents */
open:1, open:1,
medialock:1, medialock:1,
...@@ -909,8 +914,10 @@ static int options[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1,}; ...@@ -909,8 +914,10 @@ static int options[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1,};
static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int hw_checksums[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; static int hw_checksums[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int flow_ctrl[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; static int flow_ctrl[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int enable_wol[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int global_options = -1; static int global_options = -1;
static int global_full_duplex = -1; static int global_full_duplex = -1;
static int global_enable_wol = -1;
/* #define dev_alloc_skb dev_alloc_skb_debug */ /* #define dev_alloc_skb dev_alloc_skb_debug */
...@@ -1130,6 +1137,8 @@ static int __devinit vortex_probe1(struct device *gendev, ...@@ -1130,6 +1137,8 @@ static int __devinit vortex_probe1(struct device *gendev,
vortex_debug = 7; vortex_debug = 7;
if (option & 0x4000) if (option & 0x4000)
vortex_debug = 2; vortex_debug = 2;
if (option & 0x0400)
vp->enable_wol = 1;
} }
print_info = (vortex_debug > 1); print_info = (vortex_debug > 1);
...@@ -1217,12 +1226,16 @@ static int __devinit vortex_probe1(struct device *gendev, ...@@ -1217,12 +1226,16 @@ static int __devinit vortex_probe1(struct device *gendev,
if (global_full_duplex > 0) if (global_full_duplex > 0)
vp->full_duplex = 1; vp->full_duplex = 1;
if (global_enable_wol > 0)
vp->enable_wol = 1;
if (card_idx < MAX_UNITS) { if (card_idx < MAX_UNITS) {
if (full_duplex[card_idx] > 0) if (full_duplex[card_idx] > 0)
vp->full_duplex = 1; vp->full_duplex = 1;
if (flow_ctrl[card_idx] > 0) if (flow_ctrl[card_idx] > 0)
vp->flow_ctrl = 1; vp->flow_ctrl = 1;
if (enable_wol[card_idx] > 0)
vp->enable_wol = 1;
} }
vp->force_fd = vp->full_duplex; vp->force_fd = vp->full_duplex;
...@@ -1450,7 +1463,7 @@ static int __devinit vortex_probe1(struct device *gendev, ...@@ -1450,7 +1463,7 @@ static int __devinit vortex_probe1(struct device *gendev,
dev->set_multicast_list = set_rx_mode; dev->set_multicast_list = set_rx_mode;
dev->tx_timeout = vortex_tx_timeout; dev->tx_timeout = vortex_tx_timeout;
dev->watchdog_timeo = (watchdog * HZ) / 1000; dev->watchdog_timeo = (watchdog * HZ) / 1000;
if (pdev) { if (pdev && vp->enable_wol) {
vp->pm_state_valid = 1; vp->pm_state_valid = 1;
pci_save_state(VORTEX_PCI(vp), vp->power_state); pci_save_state(VORTEX_PCI(vp), vp->power_state);
acpi_set_WOL(dev); acpi_set_WOL(dev);
...@@ -1507,7 +1520,7 @@ vortex_up(struct net_device *dev) ...@@ -1507,7 +1520,7 @@ vortex_up(struct net_device *dev)
unsigned int config; unsigned int config;
int i; int i;
if (VORTEX_PCI(vp)) { if (VORTEX_PCI(vp) && vp->enable_wol) {
pci_set_power_state(VORTEX_PCI(vp), 0); /* Go active */ pci_set_power_state(VORTEX_PCI(vp), 0); /* Go active */
pci_restore_state(VORTEX_PCI(vp), vp->power_state); pci_restore_state(VORTEX_PCI(vp), vp->power_state);
} }
...@@ -2656,7 +2669,7 @@ vortex_down(struct net_device *dev) ...@@ -2656,7 +2669,7 @@ vortex_down(struct net_device *dev)
if (vp->full_bus_master_tx) if (vp->full_bus_master_tx)
outl(0, ioaddr + DownListPtr); outl(0, ioaddr + DownListPtr);
if (VORTEX_PCI(vp)) { if (VORTEX_PCI(vp) && vp->enable_wol) {
pci_save_state(VORTEX_PCI(vp), vp->power_state); pci_save_state(VORTEX_PCI(vp), vp->power_state);
acpi_set_WOL(dev); acpi_set_WOL(dev);
} }
...@@ -3033,7 +3046,7 @@ static void __devexit vortex_remove_one (struct pci_dev *pdev) ...@@ -3033,7 +3046,7 @@ static void __devexit vortex_remove_one (struct pci_dev *pdev)
/* Should really use issue_and_wait() here */ /* Should really use issue_and_wait() here */
outw(TotalReset|0x14, dev->base_addr + EL3_CMD); outw(TotalReset|0x14, dev->base_addr + EL3_CMD);
if (VORTEX_PCI(vp)) { if (VORTEX_PCI(vp) && vp->enable_wol) {
pci_set_power_state(VORTEX_PCI(vp), 0); /* Go active */ pci_set_power_state(VORTEX_PCI(vp), 0); /* Go active */
if (vp->pm_state_valid) if (vp->pm_state_valid)
pci_restore_state(VORTEX_PCI(vp), vp->power_state); pci_restore_state(VORTEX_PCI(vp), vp->power_state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment