Skip to content

Commit e12a42f

Browse files
Michael-CY Leejmberg-intel
authored andcommitted
wifi: mac80211: fix the type of status_code for negotiated TID to Link Mapping
The status code should be type of __le16. Fixes: 83e897a ("wifi: ieee80211: add definitions for negotiated TID to Link map") Fixes: 8f500fb ("wifi: mac80211: process and save negotiated TID to Link mapping request") Signed-off-by: Michael-CY Lee <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 023c1f2 commit e12a42f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/linux/ieee80211.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ struct ieee80211_mgmt {
15261526
struct {
15271527
u8 action_code;
15281528
u8 dialog_token;
1529-
u8 status_code;
1529+
__le16 status_code;
15301530
u8 variable[];
15311531
} __packed ttlm_res;
15321532
struct {

net/mac80211/mlme.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7675,6 +7675,7 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata,
76757675
int hdr_len = offsetofend(struct ieee80211_mgmt, u.action.u.ttlm_res);
76767676
int ttlm_max_len = 2 + 1 + sizeof(struct ieee80211_ttlm_elem) + 1 +
76777677
2 * 2 * IEEE80211_TTLM_NUM_TIDS;
7678+
u16 status_code;
76787679

76797680
skb = dev_alloc_skb(local->tx_headroom + hdr_len + ttlm_max_len);
76807681
if (!skb)
@@ -7697,19 +7698,18 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata,
76977698
WARN_ON(1);
76987699
fallthrough;
76997700
case NEG_TTLM_RES_REJECT:
7700-
mgmt->u.action.u.ttlm_res.status_code =
7701-
WLAN_STATUS_DENIED_TID_TO_LINK_MAPPING;
7701+
status_code = WLAN_STATUS_DENIED_TID_TO_LINK_MAPPING;
77027702
break;
77037703
case NEG_TTLM_RES_ACCEPT:
7704-
mgmt->u.action.u.ttlm_res.status_code = WLAN_STATUS_SUCCESS;
7704+
status_code = WLAN_STATUS_SUCCESS;
77057705
break;
77067706
case NEG_TTLM_RES_SUGGEST_PREFERRED:
7707-
mgmt->u.action.u.ttlm_res.status_code =
7708-
WLAN_STATUS_PREF_TID_TO_LINK_MAPPING_SUGGESTED;
7707+
status_code = WLAN_STATUS_PREF_TID_TO_LINK_MAPPING_SUGGESTED;
77097708
ieee80211_neg_ttlm_add_suggested_map(skb, neg_ttlm);
77107709
break;
77117710
}
77127711

7712+
mgmt->u.action.u.ttlm_res.status_code = cpu_to_le16(status_code);
77137713
ieee80211_tx_skb(sdata, skb);
77147714
}
77157715

@@ -7875,7 +7875,7 @@ void ieee80211_process_neg_ttlm_res(struct ieee80211_sub_if_data *sdata,
78757875
* This can be better implemented in the future, to handle request
78767876
* rejections.
78777877
*/
7878-
if (mgmt->u.action.u.ttlm_res.status_code != WLAN_STATUS_SUCCESS)
7878+
if (le16_to_cpu(mgmt->u.action.u.ttlm_res.status_code) != WLAN_STATUS_SUCCESS)
78797879
__ieee80211_disconnect(sdata);
78807880
}
78817881

0 commit comments

Comments
 (0)