linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: linux-wireless@vger.kernel.org
Cc: linville@tuxdriver.com, johannes@sipsolutions.net
Subject: [PATCH 3/3] mac80211: receive action frames for WDS interfaces
Date: Tue, 31 May 2011 21:16:34 +0200	[thread overview]
Message-ID: <1306869394-83047-3-git-send-email-nbd@openwrt.org> (raw)
In-Reply-To: <1306869394-83047-2-git-send-email-nbd@openwrt.org>

Adds support for aggregation

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 net/mac80211/agg-rx.c |    2 ++
 net/mac80211/agg-tx.c |    6 ++++--
 net/mac80211/rx.c     |   16 ++++++++++------
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index 9c0d76c..0f83b37 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -161,6 +161,8 @@ static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *d
 		memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
 	else if (sdata->vif.type == NL80211_IFTYPE_STATION)
 		memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+	else if (sdata->vif.type == NL80211_IFTYPE_WDS)
+		memcpy(mgmt->bssid, da, ETH_ALEN);
 
 	mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
 					  IEEE80211_STYPE_ACTION);
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index cd5125f..7117108 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -79,7 +79,8 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
 	memcpy(mgmt->da, da, ETH_ALEN);
 	memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
 	if (sdata->vif.type == NL80211_IFTYPE_AP ||
-	    sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
+	    sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
+	    sdata->vif.type == NL80211_IFTYPE_WDS)
 		memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
 	else if (sdata->vif.type == NL80211_IFTYPE_STATION)
 		memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
@@ -388,7 +389,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
 	 */
 	if (sdata->vif.type != NL80211_IFTYPE_STATION &&
 	    sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
-	    sdata->vif.type != NL80211_IFTYPE_AP)
+	    sdata->vif.type != NL80211_IFTYPE_AP &&
+	    sdata->vif.type != NL80211_IFTYPE_WDS)
 		return -EINVAL;
 
 	if (test_sta_flags(sta, WLAN_STA_BLOCK_BA)) {
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 683a46b..33f1fb5 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2137,7 +2137,8 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
 		 */
 		if (sdata->vif.type != NL80211_IFTYPE_STATION &&
 		    sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
-		    sdata->vif.type != NL80211_IFTYPE_AP)
+		    sdata->vif.type != NL80211_IFTYPE_AP &&
+		    sdata->vif.type != NL80211_IFTYPE_WDS)
 			break;
 
 		/* verify action_code is present */
@@ -2681,13 +2682,16 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
 		}
 		break;
 	case NL80211_IFTYPE_WDS:
-		if (bssid) {
-			if (!ieee80211_is_beacon(hdr->frame_control))
-				return 0;
-		} else if (!ieee80211_is_data(hdr->frame_control))
-			return 0;
 		if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2))
 			return 0;
+
+		if (ieee80211_is_data(hdr->frame_control) ||
+		    ieee80211_is_action(hdr->frame_control)) {
+			if (compare_ether_addr(sdata->vif.addr, hdr->addr1))
+				return 0;
+		} else if (!ieee80211_is_beacon(hdr->frame_control))
+			return 0;
+
 		break;
 	default:
 		/* should never get here */
-- 
1.7.3.2


  reply	other threads:[~2011-05-31 19:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31 19:16 [PATCH 1/3] mac80211: remove the useless WLAN_STA_WDS station flag Felix Fietkau
2011-05-31 19:16 ` [PATCH 2/3] mac80211: create a STA entry for a WDS interface after receiving a beacon Felix Fietkau
2011-05-31 19:16   ` Felix Fietkau [this message]
2011-05-31 19:31   ` Johannes Berg
2011-05-31 19:46     ` Felix Fietkau
2011-05-31 20:05       ` Johannes Berg
2011-05-31 19:32   ` Johannes Berg
2011-05-31 19:39     ` Felix Fietkau
2011-05-31 20:06       ` Johannes Berg
2011-05-31 20:22         ` Felix Fietkau
2011-06-01  4:17           ` Johannes Berg
2011-06-01 10:53             ` Felix Fietkau
2011-06-01 11:02               ` Johannes Berg
2011-06-01 11:18                 ` Felix Fietkau
2011-06-01 11:30                   ` Johannes Berg
2011-06-01 11:41                     ` Felix Fietkau
2011-06-01 12:26                       ` Johannes Berg
2011-06-01 12:48                         ` Felix Fietkau
2011-06-06 18:24                           ` John W. Linville

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=1306869394-83047-3-git-send-email-nbd@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=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).