* [PATCH 3/6] tg3: Reset chip when changing MAC address
@ 2006-04-28 23:35 Michael Chan
2006-04-30 1:58 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Michael Chan @ 2006-04-28 23:35 UTC (permalink / raw)
To: davem; +Cc: netdev
Do the full chip reset when changing MAC address if ASF is enabled.
ASF sometimes uses a different MAC address than the driver. Without
the reset, the ASF MAC address may be overwritten when the driver's
MAC address is changed.
Signed-off-by: Michael Chan <mchan@broadcom.com>
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index a307340..0ccfb63 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -5732,9 +5732,23 @@ static int tg3_set_mac_addr(struct net_d
if (!netif_running(dev))
return 0;
- spin_lock_bh(&tp->lock);
- __tg3_set_mac_addr(tp);
- spin_unlock_bh(&tp->lock);
+ if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) {
+ /* Reset chip so that ASF can re-init any MAC addresses it
+ * needs.
+ */
+ tg3_netif_stop(tp);
+ tg3_full_lock(tp, 1);
+
+ tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
+ tg3_init_hw(tp);
+
+ tg3_netif_start(tp);
+ tg3_full_unlock(tp);
+ } else {
+ spin_lock_bh(&tp->lock);
+ __tg3_set_mac_addr(tp);
+ spin_unlock_bh(&tp->lock);
+ }
return 0;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 3/6] tg3: Reset chip when changing MAC address
2006-04-28 23:35 [PATCH 3/6] tg3: Reset chip when changing MAC address Michael Chan
@ 2006-04-30 1:58 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2006-04-30 1:58 UTC (permalink / raw)
To: mchan; +Cc: netdev
From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Apr 2006 16:35:35 -0700
> Do the full chip reset when changing MAC address if ASF is enabled.
>
> ASF sometimes uses a different MAC address than the driver. Without
> the reset, the ASF MAC address may be overwritten when the driver's
> MAC address is changed.
>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
A little heavy handed, but I can't think of another way to
deal with this.
Applied, thanks a lot.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-04-30 1:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-28 23:35 [PATCH 3/6] tg3: Reset chip when changing MAC address Michael Chan
2006-04-30 1:58 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).