linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 09/18] mac80211: make bridge_packets a virtual interface option
Date: Thu, 11 Sep 2008 00:01:54 +0200	[thread overview]
Message-ID: <20080910220418.565468000@sipsolutions.net> (raw)
In-Reply-To: 20080910220145.707263000@sipsolutions.net

The bridge_packets configuration really should be per virtual
interface (theoretically per AP/VLAN, but this is much easier);
there currently is no way to set it yet though. Also invert
the option to "NO_BRIDGE_PACKETS" so the default is to bridge.

While at it, also document the flags properly.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/debugfs.c     |    4 ----
 net/mac80211/ieee80211_i.h |   29 +++++++++++++++++++----------
 net/mac80211/main.c        |    2 --
 net/mac80211/rx.c          |    5 +++--
 4 files changed, 22 insertions(+), 18 deletions(-)

--- everything.orig/net/mac80211/ieee80211_i.h	2008-09-10 23:58:00.000000000 +0200
+++ everything/net/mac80211/ieee80211_i.h	2008-09-10 23:58:01.000000000 +0200
@@ -402,11 +402,25 @@ struct ieee80211_if_mesh {
 	do { } while (0)
 #endif
 
-/* flags used in struct ieee80211_sub_if_data.flags */
-#define IEEE80211_SDATA_ALLMULTI	BIT(0)
-#define IEEE80211_SDATA_PROMISC		BIT(1)
-#define IEEE80211_SDATA_USERSPACE_MLME	BIT(2)
-#define IEEE80211_SDATA_OPERATING_GMODE	BIT(3)
+/**
+ * enum ieee80211_sub_if_data_flags - virtual interface flags
+ *
+ * @IEEE80211_SDATA_ALLMULTI: interface wants all multicast packets
+ * @IEEE80211_SDATA_PROMISC: interface is promisc
+ * @IEEE80211_SDATA_USERSPACE_MLME: userspace MLME is active
+ * @IEEE80211_SDATA_OPERATING_GMODE: operating in G-only mode
+ * @IEEE80211_SDATA_DONT_BRIDGE_PACKETS: bridge packets between
+ *	associated stations and deliver multicast frames both
+ *	back to wireless media and to the local net stack.
+ */
+enum ieee80211_sub_if_data_flags {
+	IEEE80211_SDATA_ALLMULTI		= BIT(0),
+	IEEE80211_SDATA_PROMISC			= BIT(1),
+	IEEE80211_SDATA_USERSPACE_MLME		= BIT(2),
+	IEEE80211_SDATA_OPERATING_GMODE		= BIT(3),
+	IEEE80211_SDATA_DONT_BRIDGE_PACKETS	= BIT(4),
+};
+
 struct ieee80211_sub_if_data {
 	struct list_head list;
 
@@ -635,10 +649,6 @@ struct ieee80211_local {
 	struct crypto_blkcipher *wep_rx_tfm;
 	u32 wep_iv;
 
-	int bridge_packets; /* bridge packets between associated stations and
-			     * deliver multicast frames both back to wireless
-			     * media and to the local net stack */
-
 	struct list_head interfaces;
 
 	/*
@@ -726,7 +736,6 @@ struct ieee80211_local {
 		struct dentry *frequency;
 		struct dentry *antenna_sel_tx;
 		struct dentry *antenna_sel_rx;
-		struct dentry *bridge_packets;
 		struct dentry *rts_threshold;
 		struct dentry *fragmentation_threshold;
 		struct dentry *short_retry_limit;
--- everything.orig/net/mac80211/main.c	2008-09-10 23:57:58.000000000 +0200
+++ everything/net/mac80211/main.c	2008-09-10 23:58:01.000000000 +0200
@@ -1280,8 +1280,6 @@ struct ieee80211_hw *ieee80211_alloc_hw(
 
 	local->hw.queues = 1; /* default */
 
-	local->bridge_packets = 1;
-
 	local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
 	local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD;
 	local->short_retry_limit = 7;
--- everything.orig/net/mac80211/rx.c	2008-09-10 23:57:55.000000000 +0200
+++ everything/net/mac80211/rx.c	2008-09-10 23:58:01.000000000 +0200
@@ -1221,8 +1221,9 @@ ieee80211_deliver_skb(struct ieee80211_r
 	skb = rx->skb;
 	xmit_skb = NULL;
 
-	if (local->bridge_packets && (sdata->vif.type == IEEE80211_IF_TYPE_AP ||
-				      sdata->vif.type == IEEE80211_IF_TYPE_VLAN) &&
+	if ((sdata->vif.type == IEEE80211_IF_TYPE_AP ||
+	     sdata->vif.type == IEEE80211_IF_TYPE_VLAN) &&
+	    !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) &&
 	    (rx->flags & IEEE80211_RX_RA_MATCH)) {
 		if (is_multicast_ether_addr(ehdr->h_dest)) {
 			/*
--- everything.orig/net/mac80211/debugfs.c	2008-09-10 23:50:26.000000000 +0200
+++ everything/net/mac80211/debugfs.c	2008-09-10 23:58:01.000000000 +0200
@@ -51,8 +51,6 @@ DEBUGFS_READONLY_FILE(antenna_sel_tx, 20
 		      local->hw.conf.antenna_sel_tx);
 DEBUGFS_READONLY_FILE(antenna_sel_rx, 20, "%d",
 		      local->hw.conf.antenna_sel_rx);
-DEBUGFS_READONLY_FILE(bridge_packets, 20, "%d",
-		      local->bridge_packets);
 DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d",
 		      local->rts_threshold);
 DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d",
@@ -206,7 +204,6 @@ void debugfs_hw_add(struct ieee80211_loc
 	DEBUGFS_ADD(frequency);
 	DEBUGFS_ADD(antenna_sel_tx);
 	DEBUGFS_ADD(antenna_sel_rx);
-	DEBUGFS_ADD(bridge_packets);
 	DEBUGFS_ADD(rts_threshold);
 	DEBUGFS_ADD(fragmentation_threshold);
 	DEBUGFS_ADD(short_retry_limit);
@@ -263,7 +260,6 @@ void debugfs_hw_del(struct ieee80211_loc
 	DEBUGFS_DEL(frequency);
 	DEBUGFS_DEL(antenna_sel_tx);
 	DEBUGFS_DEL(antenna_sel_rx);
-	DEBUGFS_DEL(bridge_packets);
 	DEBUGFS_DEL(rts_threshold);
 	DEBUGFS_DEL(fragmentation_threshold);
 	DEBUGFS_DEL(short_retry_limit);

-- 


  parent reply	other threads:[~2008-09-10 22:13 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-10 22:01 [PATCH 00/18] mac80211 cleanups and fixes Johannes Berg
2008-09-10 22:01 ` [PATCH 01/18] mac80211: move ieee80211_sta_expire Johannes Berg
2008-09-10 22:01 ` [PATCH 02/18] mac80211: move STA timer restart Johannes Berg
2008-09-10 22:01 ` [PATCH 03/18] mac80211: dont set REQ_RUN when scan finishes Johannes Berg
2008-09-10 22:01 ` [PATCH 04/18] mac80211: split off mesh handling entirely Johannes Berg
2008-09-10 22:01 ` [PATCH 05/18] mac80211: fix work race Johannes Berg
2008-09-10 22:01 ` [PATCH 06/18] mac80211: fix scan vs. interface removal race Johannes Berg
2008-09-10 22:01 ` [PATCH 07/18] mac80211: reorder MLME code more Johannes Berg
2008-09-10 22:01 ` [PATCH 08/18] mac80211: move ieee80211_set_freq to utils Johannes Berg
2008-09-10 22:01 ` Johannes Berg [this message]
2008-09-10 22:01 ` [PATCH 10/18] mac80211: clean up scan namespace Johannes Berg
2008-09-10 22:01 ` [PATCH 11/18] mac80211: clean up some comments Johannes Berg
2008-09-10 22:01 ` [PATCH 12/18] mac80211: inform driver of basic rateset Johannes Berg
2008-09-10 22:01 ` [PATCH 13/18] mac80211: use nl80211 interface types Johannes Berg
2008-09-10 22:01 ` [PATCH 14/18] mac80211: move regular interface handling Johannes Berg
2008-09-10 22:02 ` [PATCH 15/18] mac80211: warn on some invalid vlan operations Johannes Berg
2008-09-10 22:02 ` [PATCH 16/18] mac80211 hwsim: verify vif pointers Johannes Berg
2008-09-11  0:06   ` Luis R. Rodriguez
2008-09-11  0:09     ` Johannes Berg
2008-09-11  0:17       ` Luis R. Rodriguez
2008-09-11  0:16   ` [PATCH v2 " Johannes Berg
2008-09-10 22:02 ` [PATCH 17/18] mac80211: share STA information with driver Johannes Berg
2008-09-10 22:02 ` [PATCH 18/18] mac80211 hwsim: verify sta pointers Johannes Berg
2008-09-11  0:17   ` [PATCH v2 " Johannes Berg
2008-09-11 19:26     ` Johannes Berg
2008-09-11  0:03 ` [PATCH 19/18] mac80211: small rate control changes Johannes Berg
2008-09-11  0:22 ` [PATCH 20/18] mac80211: move last_txrate_idx into RC algorithms Johannes Berg
2008-09-11  0:45 ` [PATCH 21/18] mac80211: share sta->supp_rates Johannes Berg
2008-09-11  1:04 ` [PATCH 22/18] mac80211: move txrate_idx into RC algorithms Johannes Berg
2008-09-11  1:14 ` [PATCH 23/18] mac80211: share sta_info->ht_info Johannes Berg
2008-09-11  1:17 ` [PATCH 24/18] iwlwifi: don't access mac80211's AMPDU state machine Johannes Berg
2008-09-11  3:27 ` [PATCH 25/18] mac80211: pass AP vif pointer for VLANs Johannes Berg
2008-09-11  8:29 ` [PATCH 00/18] mac80211 cleanups and fixes Sujith
2008-09-11 13:22   ` Johannes Berg
2008-09-11 16:50     ` Luis R. Rodriguez
2008-09-11 16:53       ` Johannes Berg
2008-09-11 17:10         ` Luis R. Rodriguez
2008-09-11 17:13           ` Johannes Berg
2008-09-11 17:31             ` Luis R. Rodriguez
2008-09-11 17:33         ` Luis R. Rodriguez
2008-09-11 17:39           ` Johannes Berg
2008-09-11 17:42             ` Johannes Berg
2008-09-11 17:47               ` Johannes Berg
2008-09-11 17:54             ` Luis R. Rodriguez
2008-09-12  3:14     ` Sujith
2008-09-12  7:45       ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080910220418.565468000@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).