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

Function sta_recv_mgmt

freebsd/net80211/ieee80211_sta.c:1384–2041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1382#endif
1383
1384static void
1385sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype,
1386 const struct ieee80211_rx_stats *rxs,
1387 int rssi, int nf)
1388{
1389#define ISREASSOC(_st) ((_st) == IEEE80211_FC0_SUBTYPE_REASSOC_RESP)
1390 struct ieee80211vap *vap = ni->ni_vap;
1391 struct ieee80211com *ic = ni->ni_ic;
1392 struct ieee80211_channel *rxchan = ic->ic_curchan;
1393 struct ieee80211_frame *wh;
1394 int ht_state_change = 0, do_ht = 0;
1395 uint8_t *frm, *efrm;
1396 uint8_t *rates, *xrates, *wme, *htcap, *htinfo;
1397 uint8_t *vhtcap, *vhtopmode;
1398 uint8_t rate;
1399 uint8_t qosinfo;
1400
1401 wh = mtod(m0, struct ieee80211_frame *);
1402 frm = (uint8_t *)&wh[1];
1403 efrm = mtod(m0, uint8_t *) + m0->m_len;
1404 switch (subtype) {
1405 case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
1406 case IEEE80211_FC0_SUBTYPE_BEACON: {
1407 struct ieee80211_scanparams scan;
1408 struct ieee80211_channel *c;
1409 /*
1410 * We process beacon/probe response frames:
1411 * o when scanning, or
1412 * o station mode when associated (to collect state
1413 * updates such as 802.11g slot time)
1414 * Frames otherwise received are discarded.
1415 */
1416 if (!((ic->ic_flags & IEEE80211_F_SCAN) || ni->ni_associd)) {
1417 vap->iv_stats.is_rx_mgtdiscard++;
1418 return;
1419 }
1420
1421 /* Override RX channel as appropriate */
1422 if (rxs != NULL) {
1423 c = ieee80211_lookup_channel_rxstatus(vap, rxs);
1424 if (c != NULL)
1425 rxchan = c;
1426 }
1427
1428 /* XXX probe response in sta mode when !scanning? */
1429 if (ieee80211_parse_beacon(ni, m0, rxchan, &scan) != 0) {
1430 if (! (ic->ic_flags & IEEE80211_F_SCAN))
1431 vap->iv_stats.is_beacon_bad++;
1432 return;
1433 }
1434
1435 /*
1436 * Count frame now that we know it's to be processed.
1437 */
1438 if (subtype == IEEE80211_FC0_SUBTYPE_BEACON) {
1439 vap->iv_stats.is_rx_beacon++; /* XXX remove */
1440 IEEE80211_NODE_STAT(ni, rx_beacons);
1441 } else

Callers

nothing calls this directly

Tested by

no test coverage detected