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

Function ieee80211_setup_rates

freebsd/net80211/ieee80211_input.c:393–420  ·  view source on GitHub ↗

* Install received rate set information in the node's state block. */

Source from the content-addressed store, hash-verified

391 * Install received rate set information in the node's state block.
392 */
393int
394ieee80211_setup_rates(struct ieee80211_node *ni,
395 const uint8_t *rates, const uint8_t *xrates, int flags)
396{
397 struct ieee80211vap *vap = ni->ni_vap;
398 struct ieee80211_rateset *rs = &ni->ni_rates;
399
400 memset(rs, 0, sizeof(*rs));
401 rs->rs_nrates = rates[1];
402 memcpy(rs->rs_rates, rates + 2, rs->rs_nrates);
403 if (xrates != NULL) {
404 uint8_t nxrates;
405 /*
406 * Tack on 11g extended supported rate element.
407 */
408 nxrates = xrates[1];
409 if (rs->rs_nrates + nxrates > IEEE80211_RATE_MAXSIZE) {
410 nxrates = IEEE80211_RATE_MAXSIZE - rs->rs_nrates;
411 IEEE80211_NOTE(vap, IEEE80211_MSG_XRATE, ni,
412 "extended rate set too large; only using "
413 "%u of %u rates", nxrates, xrates[1]);
414 vap->iv_stats.is_rx_rstoobig++;
415 }
416 memcpy(rs->rs_rates + rs->rs_nrates, xrates+2, nxrates);
417 rs->rs_nrates += nxrates;
418 }
419 return ieee80211_fix_rate(ni, rs, flags);
420}
421
422/*
423 * Send a management frame error response to the specified

Callers 4

sta_recv_mgmtFunction · 0.85
ieee80211_sta_joinFunction · 0.85
ieee80211_init_neighborFunction · 0.85
hostap_recv_mgmtFunction · 0.85

Calls 3

memsetFunction · 0.85
ieee80211_fix_rateFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected