aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2008-11-03 19:51:11 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-03 19:51:11 -0500
commitb2aee1545dc3c05c8d5cf116de1e92907e98009b (patch)
treef86743af60dd384afd8d4c7ef811fb16fda3ce8b /drivers/net/tg3.c
parent63532394af307795ea637a283bd1fd057f5dfcea (diff)
tg3: Preserve DASH connectivity when WOL enabled
DASH firmware runs on the APE side of the chip, but it requires a few MAC to be programmed correctly. When WOL is enabled and management firmware is disabled, incoming packets are evaluated and discarded at the chip's rule processor. When management firmware is enabled, the hardware must be informed that there are agents further up the stack that still use the incoming frames. Normally management firmware will configure the MAC correctly on its own, but there can be cases where the setting could get clobbered by the driver. The first hunk of this patch preserves this setting. The second hunk of this patch wipes out the driver present signature of the APE memory space. By doing so, the DASH firmware can assume driver absent behavior. 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>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index e129a6a581f6..e04cd9814e85 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -2156,8 +2156,14 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
2156 tw32(MAC_LED_CTRL, tp->led_ctrl); 2156 tw32(MAC_LED_CTRL, tp->led_ctrl);
2157 2157
2158 if (pci_pme_capable(tp->pdev, state) && 2158 if (pci_pme_capable(tp->pdev, state) &&
2159 (tp->tg3_flags & TG3_FLAG_WOL_ENABLE)) 2159 (tp->tg3_flags & TG3_FLAG_WOL_ENABLE)) {
2160 mac_mode |= MAC_MODE_MAGIC_PKT_ENABLE; 2160 mac_mode |= MAC_MODE_MAGIC_PKT_ENABLE;
2161 if (((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) &&
2162 !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) &&
2163 ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) ||
2164 (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)))
2165 mac_mode |= MAC_MODE_KEEP_FRAME_IN_WOL;
2166 }
2161 2167
2162 if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) { 2168 if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) {
2163 mac_mode |= tp->mac_mode & 2169 mac_mode |= tp->mac_mode &
@@ -5562,6 +5568,13 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind)
5562 event = APE_EVENT_STATUS_STATE_START; 5568 event = APE_EVENT_STATUS_STATE_START;
5563 break; 5569 break;
5564 case RESET_KIND_SHUTDOWN: 5570 case RESET_KIND_SHUTDOWN:
5571 /* With the interface we are currently using,
5572 * APE does not track driver state. Wiping
5573 * out the HOST SEGMENT SIGNATURE forces
5574 * the APE to assume OS absent status.
5575 */
5576 tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG, 0x0);
5577
5565 event = APE_EVENT_STATUS_STATE_UNLOAD; 5578 event = APE_EVENT_STATUS_STATE_UNLOAD;
5566 break; 5579 break;
5567 case RESET_KIND_SUSPEND: 5580 case RESET_KIND_SUSPEND: