diff options
author | andre <andre@FreeBSD.org> | 2004-05-05 15:48:06 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2004-05-05 15:48:06 +0000 |
commit | f083d4582071fd10cac285f8bfcbd2d75cd87d3d (patch) | |
tree | 6b404c33f4dd463a83a59759c2b3003679c2568e /sys/net80211 | |
parent | 3a90e388ae830b9879a29cf9d4e5481c10770c0d (diff) | |
download | FreeBSD-src-f083d4582071fd10cac285f8bfcbd2d75cd87d3d.zip FreeBSD-src-f083d4582071fd10cac285f8bfcbd2d75cd87d3d.tar.gz |
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
Diffstat (limited to 'sys/net80211')
-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 a7d3445..9558bd8 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 |