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

Function wds_input

freebsd/net80211/ieee80211_wds.c:412–740  ·  view source on GitHub ↗

* Process a received frame. The node associated with the sender * should be supplied. If nothing was found in the node table then * the caller is assumed to supply a reference to iv_bss instead. * The RSSI and a timestamp are also supplied. The RSSI data is used * during AP scanning to select a AP to associate with; it can have * any units so long as values have consistent units and higher

Source from the content-addressed store, hash-verified

410 * by the 802.11 layer.
411 */
412static int
413wds_input(struct ieee80211_node *ni, struct mbuf *m,
414 const struct ieee80211_rx_stats *rxs, int rssi, int nf)
415{
416 struct ieee80211vap *vap = ni->ni_vap;
417 struct ieee80211com *ic = ni->ni_ic;
418 struct ifnet *ifp = vap->iv_ifp;
419 struct ieee80211_frame *wh;
420 struct ieee80211_key *key;
421 struct ether_header *eh;
422 int hdrspace, need_tap = 1; /* mbuf need to be tapped. */
423 uint8_t dir, type, subtype, qos;
424 int is_hw_decrypted = 0;
425 int has_decrypted = 0;
426
427 /*
428 * Some devices do hardware decryption all the way through
429 * to pretending the frame wasn't encrypted in the first place.
430 * So, tag it appropriately so it isn't discarded inappropriately.
431 */
432 if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_DECRYPTED))
433 is_hw_decrypted = 1;
434
435 if (m->m_flags & M_AMPDU_MPDU) {
436 /*
437 * Fastpath for A-MPDU reorder q resubmission. Frames
438 * w/ M_AMPDU_MPDU marked have already passed through
439 * here but were received out of order and been held on
440 * the reorder queue. When resubmitted they are marked
441 * with the M_AMPDU_MPDU flag and we can bypass most of
442 * the normal processing.
443 */
444 wh = mtod(m, struct ieee80211_frame *);
445 type = IEEE80211_FC0_TYPE_DATA;
446 dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK;
447 subtype = IEEE80211_FC0_SUBTYPE_QOS;
448 hdrspace = ieee80211_hdrspace(ic, wh); /* XXX optimize? */
449 goto resubmit_ampdu;
450 }
451
452 KASSERT(ni != NULL, ("null node"));
453
454 type = -1; /* undefined */
455
456 if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_min)) {
457 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
458 ni->ni_macaddr, NULL,
459 "too short (1): len %u", m->m_pkthdr.len);
460 vap->iv_stats.is_rx_tooshort++;
461 goto out;
462 }
463 /*
464 * Bit of a cheat here, we use a pointer for a 3-address
465 * frame format but don't reference fields past outside
466 * ieee80211_frame_min w/o first validating the data is
467 * present.
468 */
469 wh = mtod(m, struct ieee80211_frame *);

Callers

nothing calls this directly

Calls 15

ieee80211_hdrspaceFunction · 0.85
ieee80211_gettidFunction · 0.85
ieee80211_check_rxseqFunction · 0.85
m_pullupFunction · 0.85
ieee80211_ampdu_reorderFunction · 0.85
ieee80211_crypto_decapFunction · 0.85
ieee80211_getqosFunction · 0.85
ieee80211_defragFunction · 0.85
ieee80211_crypto_demicFunction · 0.85
ieee80211_radiotap_rxFunction · 0.85
ieee80211_decapFunction · 0.85

Tested by

no test coverage detected