diff options
-rw-r--r-- | include/linux/ieee80211.h | 12 | ||||
-rw-r--r-- | net/mac80211/iface.c | 3 | ||||
-rw-r--r-- | net/mac80211/michael.c | 2 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 2 | ||||
-rw-r--r-- | net/mac80211/rc80211_minstrel_ht.c | 2 | ||||
-rw-r--r-- | net/mac80211/rx.c | 6 | ||||
-rw-r--r-- | net/mac80211/tx.c | 9 | ||||
-rw-r--r-- | net/mac80211/wpa.c | 8 |
8 files changed, 23 insertions, 21 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index e4cba332b705..8fe7e4306816 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -8,6 +8,7 @@ | |||
8 | * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net> | 8 | * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net> |
9 | * Copyright (c) 2013 - 2014 Intel Mobile Communications GmbH | 9 | * Copyright (c) 2013 - 2014 Intel Mobile Communications GmbH |
10 | * Copyright (c) 2016 - 2017 Intel Deutschland GmbH | 10 | * Copyright (c) 2016 - 2017 Intel Deutschland GmbH |
11 | * Copyright (c) 2018 Intel Corporation | ||
11 | * | 12 | * |
12 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
13 | * it under the terms of the GNU General Public License version 2 as | 14 | * it under the terms of the GNU General Public License version 2 as |
@@ -2502,6 +2503,17 @@ static inline u8 *ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr) | |||
2502 | } | 2503 | } |
2503 | 2504 | ||
2504 | /** | 2505 | /** |
2506 | * ieee80211_get_tid - get qos TID | ||
2507 | * @hdr: the frame | ||
2508 | */ | ||
2509 | static inline u8 ieee80211_get_tid(struct ieee80211_hdr *hdr) | ||
2510 | { | ||
2511 | u8 *qc = ieee80211_get_qos_ctl(hdr); | ||
2512 | |||
2513 | return qc[0] & IEEE80211_QOS_CTL_TID_MASK; | ||
2514 | } | ||
2515 | |||
2516 | /** | ||
2505 | * ieee80211_get_SA - get pointer to SA | 2517 | * ieee80211_get_SA - get pointer to SA |
2506 | * @hdr: the frame | 2518 | * @hdr: the frame |
2507 | * | 2519 | * |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 5fe01f82df12..d13ba064951f 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -1324,8 +1324,7 @@ static void ieee80211_iface_work(struct work_struct *work) | |||
1324 | mutex_lock(&local->sta_mtx); | 1324 | mutex_lock(&local->sta_mtx); |
1325 | sta = sta_info_get_bss(sdata, mgmt->sa); | 1325 | sta = sta_info_get_bss(sdata, mgmt->sa); |
1326 | if (sta) { | 1326 | if (sta) { |
1327 | u16 tid = *ieee80211_get_qos_ctl(hdr) & | 1327 | u16 tid = ieee80211_get_tid(hdr); |
1328 | IEEE80211_QOS_CTL_TID_MASK; | ||
1329 | 1328 | ||
1330 | __ieee80211_stop_rx_ba_session( | 1329 | __ieee80211_stop_rx_ba_session( |
1331 | sta, tid, WLAN_BACK_RECIPIENT, | 1330 | sta, tid, WLAN_BACK_RECIPIENT, |
diff --git a/net/mac80211/michael.c b/net/mac80211/michael.c index 408649bd4702..37e172701a63 100644 --- a/net/mac80211/michael.c +++ b/net/mac80211/michael.c | |||
@@ -35,7 +35,7 @@ static void michael_mic_hdr(struct michael_mic_ctx *mctx, const u8 *key, | |||
35 | da = ieee80211_get_DA(hdr); | 35 | da = ieee80211_get_DA(hdr); |
36 | sa = ieee80211_get_SA(hdr); | 36 | sa = ieee80211_get_SA(hdr); |
37 | if (ieee80211_is_data_qos(hdr->frame_control)) | 37 | if (ieee80211_is_data_qos(hdr->frame_control)) |
38 | tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; | 38 | tid = ieee80211_get_tid(hdr); |
39 | else | 39 | else |
40 | tid = 0; | 40 | tid = 0; |
41 | 41 | ||
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 39b660b9a908..010b127a3937 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2151,7 +2151,7 @@ static void ieee80211_sta_tx_wmm_ac_notify(struct ieee80211_sub_if_data *sdata, | |||
2151 | u16 tx_time) | 2151 | u16 tx_time) |
2152 | { | 2152 | { |
2153 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 2153 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
2154 | u16 tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; | 2154 | u16 tid = ieee80211_get_tid(hdr); |
2155 | int ac = ieee80211_ac_from_tid(tid); | 2155 | int ac = ieee80211_ac_from_tid(tid); |
2156 | struct ieee80211_sta_tx_tspec *tx_tspec = &ifmgd->tx_tspec[ac]; | 2156 | struct ieee80211_sta_tx_tspec *tx_tspec = &ifmgd->tx_tspec[ac]; |
2157 | unsigned long now = jiffies; | 2157 | unsigned long now = jiffies; |
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 4a5bdad9f303..fb586b6e5d49 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -669,7 +669,7 @@ minstrel_aggr_check(struct ieee80211_sta *pubsta, struct sk_buff *skb) | |||
669 | if (unlikely(skb->protocol == cpu_to_be16(ETH_P_PAE))) | 669 | if (unlikely(skb->protocol == cpu_to_be16(ETH_P_PAE))) |
670 | return; | 670 | return; |
671 | 671 | ||
672 | tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; | 672 | tid = ieee80211_get_tid(hdr); |
673 | if (likely(sta->ampdu_mlme.tid_tx[tid])) | 673 | if (likely(sta->ampdu_mlme.tid_tx[tid])) |
674 | return; | 674 | return; |
675 | 675 | ||
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 478a9c735edb..3dc162ddc3a6 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1189,7 +1189,7 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx, | |||
1189 | 1189 | ||
1190 | ack_policy = *ieee80211_get_qos_ctl(hdr) & | 1190 | ack_policy = *ieee80211_get_qos_ctl(hdr) & |
1191 | IEEE80211_QOS_CTL_ACK_POLICY_MASK; | 1191 | IEEE80211_QOS_CTL_ACK_POLICY_MASK; |
1192 | tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; | 1192 | tid = ieee80211_get_tid(hdr); |
1193 | 1193 | ||
1194 | tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]); | 1194 | tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]); |
1195 | if (!tid_agg_rx) { | 1195 | if (!tid_agg_rx) { |
@@ -1528,9 +1528,7 @@ ieee80211_rx_h_uapsd_and_pspoll(struct ieee80211_rx_data *rx) | |||
1528 | ieee80211_has_pm(hdr->frame_control) && | 1528 | ieee80211_has_pm(hdr->frame_control) && |
1529 | (ieee80211_is_data_qos(hdr->frame_control) || | 1529 | (ieee80211_is_data_qos(hdr->frame_control) || |
1530 | ieee80211_is_qos_nullfunc(hdr->frame_control))) { | 1530 | ieee80211_is_qos_nullfunc(hdr->frame_control))) { |
1531 | u8 tid; | 1531 | u8 tid = ieee80211_get_tid(hdr); |
1532 | |||
1533 | tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; | ||
1534 | 1532 | ||
1535 | ieee80211_sta_uapsd_trigger(&rx->sta->sta, tid); | 1533 | ieee80211_sta_uapsd_trigger(&rx->sta->sta, tid); |
1536 | } | 1534 | } |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 5decd0fb247c..7643178ef132 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -797,7 +797,6 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) | |||
797 | { | 797 | { |
798 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); | 798 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); |
799 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; | 799 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; |
800 | u8 *qc; | ||
801 | int tid; | 800 | int tid; |
802 | 801 | ||
803 | /* | 802 | /* |
@@ -844,9 +843,7 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) | |||
844 | return TX_CONTINUE; | 843 | return TX_CONTINUE; |
845 | 844 | ||
846 | /* include per-STA, per-TID sequence counter */ | 845 | /* include per-STA, per-TID sequence counter */ |
847 | 846 | tid = ieee80211_get_tid(hdr); | |
848 | qc = ieee80211_get_qos_ctl(hdr); | ||
849 | tid = *qc & IEEE80211_QOS_CTL_TID_MASK; | ||
850 | tx->sta->tx_stats.msdu[tid]++; | 847 | tx->sta->tx_stats.msdu[tid]++; |
851 | 848 | ||
852 | hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); | 849 | hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); |
@@ -1158,7 +1155,6 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, | |||
1158 | struct ieee80211_hdr *hdr; | 1155 | struct ieee80211_hdr *hdr; |
1159 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 1156 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
1160 | int tid; | 1157 | int tid; |
1161 | u8 *qc; | ||
1162 | 1158 | ||
1163 | memset(tx, 0, sizeof(*tx)); | 1159 | memset(tx, 0, sizeof(*tx)); |
1164 | tx->skb = skb; | 1160 | tx->skb = skb; |
@@ -1198,8 +1194,7 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, | |||
1198 | !ieee80211_hw_check(&local->hw, TX_AMPDU_SETUP_IN_HW)) { | 1194 | !ieee80211_hw_check(&local->hw, TX_AMPDU_SETUP_IN_HW)) { |
1199 | struct tid_ampdu_tx *tid_tx; | 1195 | struct tid_ampdu_tx *tid_tx; |
1200 | 1196 | ||
1201 | qc = ieee80211_get_qos_ctl(hdr); | 1197 | tid = ieee80211_get_tid(hdr); |
1202 | tid = *qc & IEEE80211_QOS_CTL_TID_MASK; | ||
1203 | 1198 | ||
1204 | tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); | 1199 | tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); |
1205 | if (tid_tx) { | 1200 | if (tid_tx) { |
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 785056cb76f6..58d0b258b684 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -340,7 +340,7 @@ static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad) | |||
340 | a4_included = ieee80211_has_a4(hdr->frame_control); | 340 | a4_included = ieee80211_has_a4(hdr->frame_control); |
341 | 341 | ||
342 | if (ieee80211_is_data_qos(hdr->frame_control)) | 342 | if (ieee80211_is_data_qos(hdr->frame_control)) |
343 | qos_tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; | 343 | qos_tid = ieee80211_get_tid(hdr); |
344 | else | 344 | else |
345 | qos_tid = 0; | 345 | qos_tid = 0; |
346 | 346 | ||
@@ -601,8 +601,7 @@ static void gcmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *j_0, u8 *aad) | |||
601 | aad[23] = 0; | 601 | aad[23] = 0; |
602 | 602 | ||
603 | if (ieee80211_is_data_qos(hdr->frame_control)) | 603 | if (ieee80211_is_data_qos(hdr->frame_control)) |
604 | qos_tid = *ieee80211_get_qos_ctl(hdr) & | 604 | qos_tid = ieee80211_get_tid(hdr); |
605 | IEEE80211_QOS_CTL_TID_MASK; | ||
606 | else | 605 | else |
607 | qos_tid = 0; | 606 | qos_tid = 0; |
608 | 607 | ||
@@ -867,8 +866,7 @@ ieee80211_crypto_cs_decrypt(struct ieee80211_rx_data *rx) | |||
867 | return RX_DROP_UNUSABLE; | 866 | return RX_DROP_UNUSABLE; |
868 | 867 | ||
869 | if (ieee80211_is_data_qos(hdr->frame_control)) | 868 | if (ieee80211_is_data_qos(hdr->frame_control)) |
870 | qos_tid = *ieee80211_get_qos_ctl(hdr) & | 869 | qos_tid = ieee80211_get_tid(hdr); |
871 | IEEE80211_QOS_CTL_TID_MASK; | ||
872 | else | 870 | else |
873 | qos_tid = 0; | 871 | qos_tid = 0; |
874 | 872 | ||