svn commit: r361811 - head/sys/net80211

Adrian Chadd adrian at FreeBSD.org
Fri Jun 5 00:11:45 UTC 2020


Author: adrian
Date: Fri Jun  5 00:11:44 2020
New Revision: 361811
URL: https://svnweb.freebsd.org/changeset/base/361811

Log:
  [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

Modified:
  head/sys/net80211/ieee80211_adhoc.c

Modified: head/sys/net80211/ieee80211_adhoc.c
==============================================================================
--- head/sys/net80211/ieee80211_adhoc.c	Thu Jun  4 22:58:37 2020	(r361810)
+++ head/sys/net80211/ieee80211_adhoc.c	Fri Jun  5 00:11:44 2020	(r361811)
@@ -715,6 +715,15 @@ adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf
 	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
 				} 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
 			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++;


More information about the svn-src-all mailing list