MCPcopy Create free account
hub / github.com/F-Stack/f-stack / monitor_newstate

Function monitor_newstate

freebsd/net80211/ieee80211_monitor.c:95–124  ·  view source on GitHub ↗

* IEEE80211_M_MONITOR vap state machine handler. */

Source from the content-addressed store, hash-verified

93 * IEEE80211_M_MONITOR vap state machine handler.
94 */
95static int
96monitor_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
97{
98 struct ieee80211com *ic = vap->iv_ic;
99 enum ieee80211_state ostate;
100
101 IEEE80211_LOCK_ASSERT(ic);
102
103 ostate = vap->iv_state;
104 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (%d)\n",
105 __func__, ieee80211_state_name[ostate],
106 ieee80211_state_name[nstate], arg);
107 vap->iv_state = nstate; /* state transition */
108 if (nstate == IEEE80211_S_RUN) {
109 switch (ostate) {
110 case IEEE80211_S_INIT:
111 ieee80211_create_ibss(vap, ic->ic_curchan);
112 break;
113 default:
114 break;
115 }
116 /*
117 * NB: this shouldn't be here but many people use
118 * monitor mode for raw packets; once we switch
119 * them over to adhoc demo mode remove this.
120 */
121 ieee80211_node_authorize(vap->iv_bss);
122 }
123 return 0;
124}
125
126/*
127 * Process a received frame in monitor mode.

Callers

nothing calls this directly

Calls 1

ieee80211_node_authorizeFunction · 0.85

Tested by

no test coverage detected