diff options
Diffstat (limited to 'net/mac80211/tdls.c')
-rw-r--r-- | net/mac80211/tdls.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index 99d5ed3aa474..398a41302972 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c | |||
@@ -46,11 +46,16 @@ static void ieee80211_tdls_add_ext_capab(struct sk_buff *skb) | |||
46 | *pos++ = WLAN_EXT_CAPA5_TDLS_ENABLED; | 46 | *pos++ = WLAN_EXT_CAPA5_TDLS_ENABLED; |
47 | } | 47 | } |
48 | 48 | ||
49 | static u16 ieee80211_get_tdls_sta_capab(struct ieee80211_sub_if_data *sdata) | 49 | static u16 ieee80211_get_tdls_sta_capab(struct ieee80211_sub_if_data *sdata, |
50 | u16 status_code) | ||
50 | { | 51 | { |
51 | struct ieee80211_local *local = sdata->local; | 52 | struct ieee80211_local *local = sdata->local; |
52 | u16 capab; | 53 | u16 capab; |
53 | 54 | ||
55 | /* The capability will be 0 when sending a failure code */ | ||
56 | if (status_code != 0) | ||
57 | return 0; | ||
58 | |||
54 | capab = 0; | 59 | capab = 0; |
55 | if (ieee80211_get_sdata_band(sdata) != IEEE80211_BAND_2GHZ) | 60 | if (ieee80211_get_sdata_band(sdata) != IEEE80211_BAND_2GHZ) |
56 | return capab; | 61 | return capab; |
@@ -207,7 +212,8 @@ ieee80211_prep_tdls_encap_data(struct wiphy *wiphy, struct net_device *dev, | |||
207 | skb_put(skb, sizeof(tf->u.setup_req)); | 212 | skb_put(skb, sizeof(tf->u.setup_req)); |
208 | tf->u.setup_req.dialog_token = dialog_token; | 213 | tf->u.setup_req.dialog_token = dialog_token; |
209 | tf->u.setup_req.capability = | 214 | tf->u.setup_req.capability = |
210 | cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata)); | 215 | cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata, |
216 | status_code)); | ||
211 | break; | 217 | break; |
212 | case WLAN_TDLS_SETUP_RESPONSE: | 218 | case WLAN_TDLS_SETUP_RESPONSE: |
213 | tf->category = WLAN_CATEGORY_TDLS; | 219 | tf->category = WLAN_CATEGORY_TDLS; |
@@ -217,7 +223,8 @@ ieee80211_prep_tdls_encap_data(struct wiphy *wiphy, struct net_device *dev, | |||
217 | tf->u.setup_resp.status_code = cpu_to_le16(status_code); | 223 | tf->u.setup_resp.status_code = cpu_to_le16(status_code); |
218 | tf->u.setup_resp.dialog_token = dialog_token; | 224 | tf->u.setup_resp.dialog_token = dialog_token; |
219 | tf->u.setup_resp.capability = | 225 | tf->u.setup_resp.capability = |
220 | cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata)); | 226 | cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata, |
227 | status_code)); | ||
221 | break; | 228 | break; |
222 | case WLAN_TDLS_SETUP_CONFIRM: | 229 | case WLAN_TDLS_SETUP_CONFIRM: |
223 | tf->category = WLAN_CATEGORY_TDLS; | 230 | tf->category = WLAN_CATEGORY_TDLS; |
@@ -274,7 +281,8 @@ ieee80211_prep_tdls_direct(struct wiphy *wiphy, struct net_device *dev, | |||
274 | mgmt->u.action.u.tdls_discover_resp.dialog_token = | 281 | mgmt->u.action.u.tdls_discover_resp.dialog_token = |
275 | dialog_token; | 282 | dialog_token; |
276 | mgmt->u.action.u.tdls_discover_resp.capability = | 283 | mgmt->u.action.u.tdls_discover_resp.capability = |
277 | cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata)); | 284 | cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata, |
285 | status_code)); | ||
278 | break; | 286 | break; |
279 | default: | 287 | default: |
280 | return -EINVAL; | 288 | return -EINVAL; |