Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Apr 2009 23:11:22 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r191555 - head/sys/net80211
Message-ID:  <200904262311.n3QNBMGE097799@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sam
Date: Sun Apr 26 23:11:22 2009
New Revision: 191555
URL: http://svn.freebsd.org/changeset/base/191555

Log:
  add IEEE80211_FEXT_4ADDR to indicate ieee80211_encap should do 4-address
  encapsulation when relaying frames; this reduces the cost of the test and
  enables use for situations other than "sta vap + dwds"

Modified:
  head/sys/net80211/ieee80211_ioctl.c
  head/sys/net80211/ieee80211_output.c
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/net80211/ieee80211_ioctl.c
==============================================================================
--- head/sys/net80211/ieee80211_ioctl.c	Sun Apr 26 23:04:35 2009	(r191554)
+++ head/sys/net80211/ieee80211_ioctl.c	Sun Apr 26 23:11:22 2009	(r191555)
@@ -3048,8 +3048,13 @@ ieee80211_ioctl_set80211(struct ieee8021
 			    vap->iv_opmode != IEEE80211_M_STA)
 				return EINVAL;
 			vap->iv_flags |= IEEE80211_F_DWDS;
-		} else
+			if (vap->iv_opmode == IEEE80211_M_STA)
+				vap->iv_flags_ext |= IEEE80211_FEXT_4ADDR;
+		} else {
 			vap->iv_flags &= ~IEEE80211_F_DWDS;
+			if (vap->iv_opmode == IEEE80211_M_STA)
+				vap->iv_flags_ext &= ~IEEE80211_FEXT_4ADDR;
+		}
 		break;
 	case IEEE80211_IOC_INACTIVITY:
 		if (ireq->i_val)

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Sun Apr 26 23:04:35 2009	(r191554)
+++ head/sys/net80211/ieee80211_output.c	Sun Apr 26 23:11:22 2009	(r191555)
@@ -974,12 +974,11 @@ ieee80211_encap(struct ieee80211vap *vap
 	/*
 	 * 4-address frames need to be generated for:
 	 * o packets sent through a WDS vap (IEEE80211_M_WDS)
-	 * o packets relayed by a station operating with dynamic WDS
-	 *   (IEEE80211_M_STA+IEEE80211_F_DWDS and src address)
+	 * o packets sent through a vap marked for relaying
+	 *   (e.g. a station operating with dynamic WDS)
 	 */
 	is4addr = vap->iv_opmode == IEEE80211_M_WDS ||
-	    (vap->iv_opmode == IEEE80211_M_STA &&
-	     (vap->iv_flags & IEEE80211_F_DWDS) &&
+	    ((vap->iv_flags_ext & IEEE80211_FEXT_4ADDR) &&
 	     !IEEE80211_ADDR_EQ(eh.ether_shost, vap->iv_myaddr));
 	if (is4addr)
 		hdrsize += IEEE80211_ADDR_LEN;

Modified: head/sys/net80211/ieee80211_var.h
==============================================================================
--- head/sys/net80211/ieee80211_var.h	Sun Apr 26 23:04:35 2009	(r191554)
+++ head/sys/net80211/ieee80211_var.h	Sun Apr 26 23:11:22 2009	(r191555)
@@ -514,6 +514,7 @@ MALLOC_DECLARE(M_80211_VAP);
 #define	IEEE80211_FEXT_TSN 	 0x00000020	/* CONF: TSN enabled */
 #define	IEEE80211_FEXT_SCANREQ	 0x00000040	/* STATUS: scan req params */
 #define	IEEE80211_FEXT_RESUME	 0x00000080	/* STATUS: start on resume */
+#define	IEEE80211_FEXT_4ADDR	 0x00000100	/* CONF: apply 4-addr encap */
 #define	IEEE80211_FEXT_NONERP_PR 0x00000200	/* STATUS: non-ERP sta present*/
 #define	IEEE80211_FEXT_SWBMISS	 0x00000400	/* CONF: do bmiss in s/w */
 #define	IEEE80211_FEXT_DFS	 0x00000800	/* CONF: DFS enabled */
@@ -535,8 +536,8 @@ MALLOC_DECLARE(M_80211_VAP);
 
 #define	IEEE80211_FEXT_BITS \
 	"\20\1NONHT_PR\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \
-	"\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\22WDSLEGACY\23PROBECHAN\24HT" \
-	"\25AMDPU_TX\26AMPDU_TX\27AMSDU_TX\30AMSDU_RX\31USEHT40\32PUREN" \
+	"\0114ADDR\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\22WDSLEGACY\23PROBECHAN" \
+	"\24HT\25AMDPU_TX\26AMPDU_TX\27AMSDU_TX\30AMSDU_RX\31USEHT40\32PUREN" \
 	"\33SHORTGI20\34SHORTGI40\35HTCOMPAT\36RIFS"
 
 #define	IEEE80211_FVEN_BITS	"\20"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904262311.n3QNBMGE097799>