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

Function ieee80211_node_create_wds

freebsd/net80211/ieee80211_node.c:1517–1574  ·  view source on GitHub ↗

* Create a bss node for a legacy WDS vap. The far end does * not associate so we just create create a new node and * simulate an association. The caller is responsible for * installing the node as the bss node and handling any further * setup work like authorizing the port. */

Source from the content-addressed store, hash-verified

1515 * setup work like authorizing the port.
1516 */
1517struct ieee80211_node *
1518ieee80211_node_create_wds(struct ieee80211vap *vap,
1519 const uint8_t bssid[IEEE80211_ADDR_LEN], struct ieee80211_channel *chan)
1520{
1521 struct ieee80211com *ic = vap->iv_ic;
1522 struct ieee80211_node *ni;
1523
1524 /* XXX check if node already in sta table? */
1525 ni = ieee80211_alloc_node(&ic->ic_sta, vap, bssid);
1526 if (ni != NULL) {
1527 ni->ni_wdsvap = vap;
1528 IEEE80211_ADDR_COPY(ni->ni_bssid, bssid);
1529 /*
1530 * Inherit any manually configured settings.
1531 */
1532 copy_bss(ni, vap->iv_bss);
1533 ieee80211_node_set_chan(ni, chan);
1534 /* NB: propagate ssid so available to WPA supplicant */
1535 ni->ni_esslen = vap->iv_des_ssid[0].len;
1536 memcpy(ni->ni_essid, vap->iv_des_ssid[0].ssid, ni->ni_esslen);
1537 /* NB: no associd for peer */
1538 /*
1539 * There are no management frames to use to
1540 * discover neighbor capabilities, so blindly
1541 * propagate the local configuration.
1542 */
1543 if (vap->iv_flags & IEEE80211_F_WME)
1544 ni->ni_flags |= IEEE80211_NODE_QOS;
1545#ifdef IEEE80211_SUPPORT_SUPERG
1546 if (vap->iv_flags & IEEE80211_F_FF)
1547 ni->ni_flags |= IEEE80211_NODE_FF;
1548#endif
1549 /* XXX VHT */
1550 if ((ic->ic_htcaps & IEEE80211_HTC_HT) &&
1551 (vap->iv_flags_ht & IEEE80211_FHT_HT)) {
1552 /*
1553 * Device is HT-capable and HT is enabled for
1554 * the vap; setup HT operation. On return
1555 * ni_chan will be adjusted to an HT channel.
1556 */
1557 ieee80211_ht_wds_init(ni);
1558 if (vap->iv_flags_vht & IEEE80211_FVHT_VHT) {
1559 printf("%s: TODO: vht_wds_init\n", __func__);
1560 }
1561 } else {
1562 struct ieee80211_channel *c = ni->ni_chan;
1563 /*
1564 * Force a legacy channel to be used.
1565 */
1566 c = ieee80211_find_channel(ic,
1567 c->ic_freq, c->ic_flags &~ IEEE80211_CHAN_HT);
1568 KASSERT(c != NULL, ("no legacy channel, %u/%x",
1569 ni->ni_chan->ic_freq, ni->ni_chan->ic_flags));
1570 ni->ni_chan = c;
1571 }
1572 }
1573 return ni;
1574}

Callers 1

ieee80211_create_wdsFunction · 0.85

Calls 7

ieee80211_alloc_nodeFunction · 0.85
copy_bssFunction · 0.85
ieee80211_node_set_chanFunction · 0.85
ieee80211_ht_wds_initFunction · 0.85
ieee80211_find_channelFunction · 0.85
memcpyFunction · 0.50
printfFunction · 0.50

Tested by

no test coverage detected