aboutsummaryrefslogtreecommitdiff
path: root/sys/net80211
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2020-05-22 11:25:45 +0000
committerAndriy Gapon <avg@FreeBSD.org>2020-05-22 11:25:45 +0000
commit2c13efdf1c3a8906a6b882923a071d9100ec1d32 (patch)
tree71040c4ad3d54070943948a2e758f73c2baefc80 /sys/net80211
parent8a719b0cee8bb1cdfd81bb08c4be702bb8321a86 (diff)
downloadsrc-2c13efdf1c3a8906a6b882923a071d9100ec1d32.tar.gz
src-2c13efdf1c3a8906a6b882923a071d9100ec1d32.zip
net80211: post RTM_IFINFO notification after toggling IFF_DRV_RUNNING
This is useful when a wireless driver is stopped or started in response to events like an RF Kill button press. Applications like wpa_supplicant depend on such events to have a correct view of interface state. Reviewed by: adrian, cy, melifaro MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24925
Notes
Notes: svn path=/head/; revision=361364
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_freebsd.c13
-rw-r--r--sys/net80211/ieee80211_proto.c3
-rw-r--r--sys/net80211/ieee80211_proto.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c
index 35c999587f58..ec9eca628ab4 100644
--- a/sys/net80211/ieee80211_freebsd.c
+++ b/sys/net80211/ieee80211_freebsd.c
@@ -963,6 +963,19 @@ ieee80211_notify_radio(struct ieee80211com *ic, int state)
}
void
+ieee80211_notify_ifnet_change(struct ieee80211vap *vap)
+{
+ struct ifnet *ifp = vap->iv_ifp;
+
+ IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG, "%s\n",
+ "interface state change");
+
+ CURVNET_SET(ifp->if_vnet);
+ rt_ifmsg(ifp);
+ CURVNET_RESTORE();
+}
+
+void
ieee80211_load_module(const char *modname)
{
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index 24f78e88c070..c70a159adad0 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -1511,6 +1511,8 @@ ieee80211_start_locked(struct ieee80211vap *vap)
* back in here and complete the work.
*/
ifp->if_drv_flags |= IFF_DRV_RUNNING;
+ ieee80211_notify_ifnet_change(vap);
+
/*
* We are not running; if this we are the first vap
* to be brought up auto-up the parent if necessary.
@@ -1624,6 +1626,7 @@ ieee80211_stop_locked(struct ieee80211vap *vap)
ieee80211_new_state_locked(vap, IEEE80211_S_INIT, -1);
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* mark us stopped */
+ ieee80211_notify_ifnet_change(vap);
if (--ic->ic_nrunning == 0) {
IEEE80211_DPRINTF(vap,
IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG,
diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h
index 717de30d00f9..9d224b1f5c18 100644
--- a/sys/net80211/ieee80211_proto.h
+++ b/sys/net80211/ieee80211_proto.h
@@ -455,4 +455,5 @@ void ieee80211_notify_node_auth(struct ieee80211_node *);
void ieee80211_notify_country(struct ieee80211vap *, const uint8_t [],
const uint8_t cc[2]);
void ieee80211_notify_radio(struct ieee80211com *, int);
+void ieee80211_notify_ifnet_change(struct ieee80211vap *);
#endif /* _NET80211_IEEE80211_PROTO_H_ */