linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mac80211 rx filter in mesh mode, rt2x00 mesh point operation
@ 2008-10-23 21:49 Andrey Yurovsky
  2008-10-23 22:07 ` Javier Cardona
  0 siblings, 1 reply; 11+ messages in thread
From: Andrey Yurovsky @ 2008-10-23 21:49 UTC (permalink / raw)
  To: linux-wireless; +Cc: ivdoorn

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.



^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-10-30 14:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-23 21:49 [RFC] mac80211 rx filter in mesh mode, rt2x00 mesh point operation Andrey Yurovsky
2008-10-23 22:07 ` 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

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).