[net80211] Send a probe request after IBSS node discovery

This sends a probe request after IBSS node discovery through
beacon frames. This allows things like HT and VHT capabilities
to be "negotiated" in adhoc mode.

It is .. kinda fire and pray - this isn't retried after discovery
so it's quite possible that nodes occasionally don't come up with
HT/VHT rate upgrades. At some point it may be a fun side project
to add support for retrying these probe requests/negotiations
after IBSS node discovery.

Tested:

* tested with multiple ath(4) NICs in 11n mode.

Differential Revision:	https://reviews.freebsd.org/D24979
This commit is contained in:
Adrian Chadd 2020-06-05 00:11:44 +00:00
parent 00a4311adc
commit 0b5aeb89eb

View file

@ -715,6 +715,15 @@ adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
wh = mtod(m0, struct ieee80211_frame *);
frm = (uint8_t *)&wh[1];
efrm = mtod(m0, uint8_t *) + m0->m_len;
IEEE80211_DPRINTF(vap, IEEE80211_MSG_INPUT | IEEE80211_MSG_DEBUG,
"%s: recv mgmt frame, addr2=%6D, ni=%p (%6D) fc=%.02x %.02x\n",
__func__,
wh->i_addr2, ":",
ni,
ni->ni_macaddr, ":",
wh->i_fc[0],
wh->i_fc[1]);
switch (subtype) {
case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
case IEEE80211_FC0_SUBTYPE_BEACON: {
@ -788,6 +797,20 @@ adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
} else
ni = NULL;
/*
* Send a probe request so we announce 11n
* capabilities.
*
* Don't do this if we're scanning.
*/
if (! (ic->ic_flags & IEEE80211_F_SCAN))
ieee80211_send_probereq(ni, /* node */
vap->iv_myaddr, /* SA */
ni->ni_macaddr, /* DA */
vap->iv_bss->ni_bssid, /* BSSID */
vap->iv_bss->ni_essid,
vap->iv_bss->ni_esslen); /* SSID */
} else if (ni->ni_capinfo == 0) {
/*
* Update faked node created on transmit.
@ -936,11 +959,11 @@ adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
vap->iv_stats.is_rx_mgtdiscard++;
} else if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, wh->i_addr1) &&
!IEEE80211_IS_MULTICAST(wh->i_addr1)) {
IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT | IEEE80211_MSG_DEBUG,
wh, NULL, "%s", "not for us");
vap->iv_stats.is_rx_mgtdiscard++;
} else if (vap->iv_state != IEEE80211_S_RUN) {
IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT | IEEE80211_MSG_DEBUG,
wh, NULL, "wrong state %s",
ieee80211_state_name[vap->iv_state]);
vap->iv_stats.is_rx_mgtdiscard++;