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

Function ieee80211_parse_athparams

freebsd/net80211/ieee80211_superg.c:222–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222int
223ieee80211_parse_athparams(struct ieee80211_node *ni, uint8_t *frm,
224 const struct ieee80211_frame *wh)
225{
226 struct ieee80211vap *vap = ni->ni_vap;
227 const struct ieee80211_ath_ie *ath;
228 u_int len = frm[1];
229 int capschanged;
230 uint16_t defkeyix;
231
232 if (len < sizeof(struct ieee80211_ath_ie)-2) {
233 IEEE80211_DISCARD_IE(vap,
234 IEEE80211_MSG_ELEMID | IEEE80211_MSG_SUPERG,
235 wh, "Atheros", "too short, len %u", len);
236 return -1;
237 }
238 ath = (const struct ieee80211_ath_ie *)frm;
239 capschanged = (ni->ni_ath_flags != ath->ath_capability);
240 defkeyix = le16dec(ath->ath_defkeyix);
241 if (capschanged || defkeyix != ni->ni_ath_defkeyix) {
242 ni->ni_ath_flags = ath->ath_capability;
243 ni->ni_ath_defkeyix = defkeyix;
244 IEEE80211_NOTE(vap, IEEE80211_MSG_SUPERG, ni,
245 "ath ie change: new caps 0x%x defkeyix 0x%x",
246 ni->ni_ath_flags, ni->ni_ath_defkeyix);
247 }
248 if (IEEE80211_ATH_CAP(vap, ni, ATHEROS_CAP_TURBO_PRIME)) {
249 uint16_t curflags, newflags;
250
251 /*
252 * Check for turbo mode switch. Calculate flags
253 * for the new mode and effect the switch.
254 */
255 newflags = curflags = vap->iv_ic->ic_bsschan->ic_flags;
256 /* NB: BOOST is not in ic_flags, so get it from the ie */
257 if (ath->ath_capability & ATHEROS_CAP_BOOST)
258 newflags |= IEEE80211_CHAN_TURBO;
259 else
260 newflags &= ~IEEE80211_CHAN_TURBO;
261 if (newflags != curflags)
262 ieee80211_dturbo_switch(vap, newflags);
263 }
264 return capschanged;
265}
266
267/*
268 * Decap the encapsulated frame pair and dispatch the first

Callers 1

sta_recv_mgmtFunction · 0.85

Calls 2

le16decFunction · 0.85
ieee80211_dturbo_switchFunction · 0.85

Tested by

no test coverage detected