1
From 26c1abde043c8186b483fd29715d2a03e864ac4e Mon Sep 17 00:00:00 2001
2
From: Tomas Winkler <tomas.winkler@intel.com>
3
Date: Sat, 30 Jun 2007 08:42:00 +0800
4
Subject: [PATCH] mac80211: [HT] fix ieee80211_send_addba_resp interface
6
Fix ieee80211_send_addba_resp interface to support dialog_token,
7
policy, buffer size and timeout.
9
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
10
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
12
net/mac80211/ieee80211_sta.c | 24 +++++++++++++-----------
13
1 files changed, 13 insertions(+), 11 deletions(-)
15
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
16
index a13d665..e84bbad 100644
17
--- a/net/mac80211/ieee80211_sta.c
18
+++ b/net/mac80211/ieee80211_sta.c
19
@@ -2503,16 +2503,16 @@ static void ieee80211_rx_mgmt_probe_req(struct net_device *dev,
20
ieee80211_sta_tx(dev, skb, 0);
23
-static void ieee80211_send_addba_resp(struct net_device *dev,
24
- struct ieee80211_mgmt *mgmt_src,
27
+void ieee80211_send_addba_resp(struct net_device *dev, u8 *da, u16 tid,
28
+ u8 dialog_token, u16 status, u16 policy,
29
+ u16 buf_size,u16 timeout)
31
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
32
struct ieee80211_if_sta *ifsta = &sdata->u.sta;
33
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
35
struct ieee80211_mgmt *mgmt;
38
skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
40
@@ -2524,7 +2524,7 @@ static void ieee80211_send_addba_resp(struct net_device *dev,
41
skb_reserve(skb, local->hw.extra_tx_headroom);
42
mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
44
- memcpy(mgmt->da, ifsta->bssid, ETH_ALEN);
45
+ memcpy(mgmt->da, da, ETH_ALEN);
46
memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN);
47
memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN);
48
mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT,
49
@@ -2533,12 +2533,14 @@ static void ieee80211_send_addba_resp(struct net_device *dev,
50
skb_put(skb, 1 + sizeof(mgmt->u.action.u.addba_resp));
51
mgmt->u.action.category = WLAN_CATEGORY_BACK;
52
mgmt->u.action.u.addba_resp.action_code = WLAN_ACTION_ADDBA_RESP;
53
- mgmt->u.action.u.addba_resp.dialog_token =
54
- mgmt_src->u.action.u.addba_req.dialog_token;
55
- mgmt->u.action.u.addba_resp.capab =
56
- mgmt_src->u.action.u.addba_req.capab;
57
- mgmt->u.action.u.addba_resp.timeout =
58
- mgmt_src->u.action.u.addba_req.timeout;
59
+ mgmt->u.action.u.addba_resp.dialog_token = dialog_token;
61
+ capab |= (u16)(policy << 1); /* bit 1 aggregation policy (1 - immediate 0 - delayed )*/
62
+ capab |= (u16)(tid << 2); /* bit 5:2 TID number */
63
+ capab |= (u16)(buf_size << 6); /* bit 15:6 max size of aggergation */
65
+ mgmt->u.action.u.addba_resp.capab = cpu_to_le16(capab);
66
+ mgmt->u.action.u.addba_resp.timeout = cpu_to_le16(timeout);
67
mgmt->u.action.u.addba_resp.status = cpu_to_le16(status);
69
ieee80211_sta_tx(dev, skb, 0);