]> git.baikalelectronics.ru Git - kernel.git/commit
tg3: Refine power management and WOL code
authorMatt Carlson <mcarlson@broadcom.com>
Tue, 4 Nov 2008 00:53:46 +0000 (16:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Nov 2008 00:53:46 +0000 (16:53 -0800)
commite83f3a1d405b53bb385da764c3374b45aa356016
tree51445add708f53d22ed919b0b7b5d6f98b102b7c
parentb177a73bb36a703007f60bbb1bca2fb8463b6bc3
tg3: Refine power management and WOL code

Commit a5c1d2b607668125551d711b3a737685cc5306fc ("tg3: adapt tg3 to
use reworked PCI PM code") introduced the new PCI PM API to the tg3
driver.  The patch was understandably conservative, so this patch
elaborates on that work.

The patch starts by creating a single point in tg3_set_power_state()
to decide whether or not to enable WOL.  The rest of the code in
tg3_set_power_state() was then pivoted to use the result of this
decision.

The patch then makes sure the device is allowed to wakeup before
reporting whether or not WOL is currently enabled.  The final hunks of
the patch consolidate where the WOL capability and WOL enabled flags
are set to a single location.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c