diff options
author | Andre Oppermann <andre@FreeBSD.org> | 2004-05-05 15:48:06 +0000 |
---|---|---|
committer | Andre Oppermann <andre@FreeBSD.org> | 2004-05-05 15:48:06 +0000 |
commit | ba99a9b120451a33e24ff2853e7e0235c4fb270d (patch) | |
tree | 6b404c33f4dd463a83a59759c2b3003679c2568e /sys/net80211/ieee80211.c | |
parent | c7e459ed6c95f1ad522d898f478ca67e43a2144e (diff) | |
download | src-ba99a9b120451a33e24ff2853e7e0235c4fb270d.tar.gz src-ba99a9b120451a33e24ff2853e7e0235c4fb270d.zip |
Link state change notification of ethernet media to the routing socket.
o The ieee80211_media_status() function updates the ifi_link_state field
and calls rt_ifmsg() to notify listeners on the routing socket.
Approved by: sam
Notes
Notes:
svn path=/head/; revision=128966
Diffstat (limited to 'sys/net80211/ieee80211.c')
-rw-r--r-- | sys/net80211/ieee80211.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index a7d34458d795..9558bd86c611 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include <net/if_arp.h> #include <net/ethernet.h> #include <net/if_llc.h> +#include <net/route.h> #include <net80211/ieee80211_var.h> @@ -534,11 +535,15 @@ ieee80211_media_status(struct ifnet *ifp, struct ifmediareq *imr) { struct ieee80211com *ic = (void *)ifp; struct ieee80211_node *ni = NULL; + int old_status = imr->ifm_status; imr->ifm_status = IFM_AVALID; imr->ifm_active = IFM_IEEE80211; - if (ic->ic_state == IEEE80211_S_RUN) + if (ic->ic_state == IEEE80211_S_RUN) { imr->ifm_status |= IFM_ACTIVE; + ifp->if_link_state = LINK_STATE_UP; + } else + ifp->if_link_state = LINK_STATE_DOWN; imr->ifm_active |= IFM_AUTO; switch (ic->ic_opmode) { case IEEE80211_M_STA: @@ -578,6 +583,10 @@ ieee80211_media_status(struct ifnet *ifp, struct ifmediareq *imr) | IFM_IEEE80211_TURBO; break; } + + /* Notify that the link state has changed. */ + if (imr->ifm_status != old_status) + rt_ifmsg(ifp); } void |