mac80211: update to the latest version from trunk
[openwrt-10.03/.git] / package / mac80211 / patches / 542-mac80211_enable_iftype_wds_aggregation.patch
1 --- a/net/mac80211/agg-tx.c
2 +++ b/net/mac80211/agg-tx.c
3 @@ -79,7 +79,8 @@ static void ieee80211_send_addba_request
4         memcpy(mgmt->da, da, ETH_ALEN);
5         memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
6         if (sdata->vif.type == NL80211_IFTYPE_AP ||
7 -           sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
8 +           sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
9 +               sdata->vif.type == NL80211_IFTYPE_WDS)
10                 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
11         else if (sdata->vif.type == NL80211_IFTYPE_STATION)
12                 memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
13 @@ -377,7 +378,8 @@ int ieee80211_start_tx_ba_session(struct
14          */
15         if (sdata->vif.type != NL80211_IFTYPE_STATION &&
16             sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
17 -           sdata->vif.type != NL80211_IFTYPE_AP)
18 +           sdata->vif.type != NL80211_IFTYPE_AP &&
19 +           sdata->vif.type != NL80211_IFTYPE_WDS)
20                 return -EINVAL;
21  
22         if (test_sta_flags(sta, WLAN_STA_BLOCK_BA)) {
23 --- a/net/mac80211/agg-rx.c
24 +++ b/net/mac80211/agg-rx.c
25 @@ -160,6 +160,8 @@ static void ieee80211_send_addba_resp(st
26                 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
27         else if (sdata->vif.type == NL80211_IFTYPE_STATION)
28                 memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
29 +       else if (sdata->vif.type == NL80211_IFTYPE_WDS)
30 +               memcpy(mgmt->bssid, da, ETH_ALEN);
31  
32         mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
33                                           IEEE80211_STYPE_ACTION);
34 --- a/net/mac80211/rx.c
35 +++ b/net/mac80211/rx.c
36 @@ -2132,7 +2132,8 @@ ieee80211_rx_h_action(struct ieee80211_r
37                  */
38                 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
39                     sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
40 -                   sdata->vif.type != NL80211_IFTYPE_AP)
41 +                   sdata->vif.type != NL80211_IFTYPE_AP &&
42 +                   sdata->vif.type != NL80211_IFTYPE_WDS)
43                         break;
44  
45                 /* verify action_code is present */
46 @@ -2717,13 +2718,16 @@ static int prepare_for_handlers(struct i
47                 }
48                 break;
49         case NL80211_IFTYPE_WDS:
50 -               if (bssid) {
51 -                       if (!ieee80211_is_beacon(hdr->frame_control))
52 -                               return 0;
53 -               } else if (!ieee80211_is_data(hdr->frame_control))
54 -                       return 0;
55                 if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2))
56                         return 0;
57 +
58 +               if (ieee80211_is_data(hdr->frame_control) ||
59 +                   ieee80211_is_action(hdr->frame_control)) {
60 +                       if (compare_ether_addr(sdata->vif.addr, hdr->addr1))
61 +                               return 0;
62 +               } else if (!ieee80211_is_beacon(hdr->frame_control))
63 +                       return 0;
64 +
65                 break;
66         default:
67                 /* should never get here */