mac80211: update to trunk as of r26534
[openwrt-10.03/.git] / package / mac80211 / patches / 552-mac80211_enable_iftype_wds_aggregation.patch
diff --git a/package/mac80211/patches/552-mac80211_enable_iftype_wds_aggregation.patch b/package/mac80211/patches/552-mac80211_enable_iftype_wds_aggregation.patch
new file mode 100644 (file)
index 0000000..953ff59
--- /dev/null
@@ -0,0 +1,67 @@
+--- a/net/mac80211/agg-tx.c
++++ b/net/mac80211/agg-tx.c
+@@ -79,7 +79,8 @@ static void ieee80211_send_addba_request
+       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);
+@@ -377,7 +378,8 @@ int ieee80211_start_tx_ba_session(struct
+        */
+       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)) {
+--- a/net/mac80211/agg-rx.c
++++ b/net/mac80211/agg-rx.c
+@@ -160,6 +160,8 @@ static void ieee80211_send_addba_resp(st
+               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);
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2132,7 +2132,8 @@ ieee80211_rx_h_action(struct ieee80211_r
+                */
+               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 */
+@@ -2717,13 +2718,16 @@ static int prepare_for_handlers(struct i
+               }
+               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 */