changeset 11428:30da49fa0630 onnv_131

6913795 mii keeps incorrect link state when interface is unplumbed
author Garrett D'Amore <gdamore@opensolaris.org>
date Mon, 04 Jan 2010 22:05:04 -0800
parents 7cb2f6a56f2f
children 3398895a8df2
files usr/src/uts/common/io/mii/mii.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/mii/mii.c	Tue Jan 05 11:31:17 2010 +0800
+++ b/usr/src/uts/common/io/mii/mii.c	Mon Jan 04 22:05:04 2010 -0800
@@ -401,8 +401,19 @@
 {
 	mutex_enter(&mh->m_lock);
 	mh->m_started = B_FALSE;
+	/*
+	 * Reset link state to unknown defaults, since we're not
+	 * monitoring it anymore.  We'll reprobe all link state later.
+	 */
+	mh->m_link = LINK_STATE_UNKNOWN;
+	mh->m_phy = &mh->m_bogus_phy;
 	cv_broadcast(&mh->m_cv);
 	mutex_exit(&mh->m_lock);
+	/*
+	 * Notify the MAC driver.  This will allow it to call back
+	 * into the MAC framework to clear any previous link state.
+	 */
+	_mii_notify(mh);
 }
 
 void