linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Yurovsky <andrey@cozybit.com>
To: linux-wireless@vger.kernel.org
Cc: ivdoorn@gmail.com
Subject: [RFC] mac80211 rx filter in mesh mode, rt2x00 mesh point operation
Date: Thu, 23 Oct 2008 14:49:31 -0700 (PDT)	[thread overview]
Message-ID: <4900f16b.0b0c360a.2bc3.ffffa11a@mx.google.com> (raw)

I've come across a problem with the RX filter setting while testing mesh point
operation in the rt2x00 driver (my hardware is rt73usb).  We transmit and 
receive mesh beacons but mesh peer link action frames are dropped.  A patch
for enabling mesh point mode is included here, this works except that:

The RX filter, as set by mac80211 in mesh mode is 0x02, that is FIF_ALLMULTI is
set.  This is sufficient for other drivers but not for rt2x00.  I noticed that
running tcpdump on the MP interface sets the filter to 0x43, this adds
FIF_OTHER_BSS and FIF_PROMISC_IN_BSS, and rt2x00 is then able to make peer
links and mesh point mode works correctly.

Actually for rt2x00, setting either FIF_OTHER_BSS or FIF_PROMISC_IN_BSS is the 
key here because they are both treated as FIF_PROMISC_IN_BSS, which causes the 
driver to enable TXRX_CSR0_DROP_TO_DS.

To solve this problem, it seems that we can either:
1. change the RX filter specified in mesh point mode.  I am concerned that this
   would pass up unnecessary frames to the other drivers which otherwise work
   fine with just FIF_ALLMULTI set.  Are there any opinions on this?
2. modify the rt2x00 rx filter setting implementation to set additional flags,
   possibly with knowledge that the interface is in mesh point mode.  This 
   seems hacky as the filter setting is supposed to be fairly generic.
3. revisit the setting of TXRX_CSR0_DROP_TO_DS and possibly other bits in the
   HW rx filter, CCing Ivo regarding this.

diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 7910147..3021c2a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -42,6 +42,7 @@ void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev,
 	switch (type) {
 	case NL80211_IFTYPE_ADHOC:
 	case NL80211_IFTYPE_AP:
+	case NL80211_IFTYPE_MESH_POINT:
 		conf.sync = TSF_SYNC_BEACON;
 		break;
 	case NL80211_IFTYPE_STATION:
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 697806c..2b9d0a0 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -466,7 +466,8 @@ static void rt2x00lib_beacondone_iter(void *data, u8 *mac,
 	struct rt2x00_intf *intf = vif_to_intf(vif);
 
 	if (vif->type != NL80211_IFTYPE_AP &&
-	    vif->type != NL80211_IFTYPE_ADHOC)
+	    vif->type != NL80211_IFTYPE_ADHOC &&
+	    vif->type != NL80211_IFTYPE_MESH_POINT)
 		return;
 
 	/*
@@ -1053,7 +1054,8 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
 	rt2x00dev->hw->wiphy->interface_modes =
 	    BIT(NL80211_IFTYPE_AP) |
 	    BIT(NL80211_IFTYPE_STATION) |
-	    BIT(NL80211_IFTYPE_ADHOC);
+	    BIT(NL80211_IFTYPE_ADHOC) |
+	    BIT(NL80211_IFTYPE_MESH_POINT);
 
 	/*
 	 * Let the driver probe the device to detect the capabilities.
@@ -1208,10 +1210,11 @@ static void rt2x00lib_resume_intf(void *data, u8 *mac,
 
 
 	/*
-	 * Master or Ad-hoc mode require a new beacon update.
+	 * Master, Ad-hoc, or Mesh Point mode require a new beacon update.
 	 */
 	if (vif->type == NL80211_IFTYPE_AP ||
-	    vif->type == NL80211_IFTYPE_ADHOC)
+	    vif->type == NL80211_IFTYPE_ADHOC ||
+	    vif->type == NL80211_IFTYPE_MESH_POINT)
 		intf->delayed_flags |= DELAYED_UPDATE_BEACON;
 
 	spin_unlock(&intf->lock);
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index da7b49a..d4bd072 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -229,6 +229,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
 		break;
 	case NL80211_IFTYPE_STATION:
 	case NL80211_IFTYPE_ADHOC:
+	case NL80211_IFTYPE_MESH_POINT:
 		/*
 		 * We don't support mixed combinations of
 		 * sta and ap interfaces.



             reply	other threads:[~2008-10-23 21:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23 21:49 Andrey Yurovsky [this message]
2008-10-23 22:07 ` [RFC] mac80211 rx filter in mesh mode, rt2x00 mesh point operation Javier Cardona
2008-10-24  9:02   ` Johannes Berg
2008-10-24 17:05     ` Javier Cardona
2008-10-25 10:28   ` Ivo van Doorn
2008-10-26  1:20     ` Javier Cardona
2008-10-26  8:09       ` Johannes Berg
2008-10-26  8:37         ` Ivo van Doorn
2008-10-26 20:34         ` Javier Cardona
2008-10-30 12:26           ` Johannes Berg
2008-10-30 14:31             ` 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=4900f16b.0b0c360a.2bc3.ffffa11a@mx.google.com \
    --to=andrey@cozybit.com \
    --cc=ivdoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /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).