summaryrefslogtreecommitdiff
path: root/net/mac80211
diff options
context:
space:
mode:
authorPhilipp Borgers <borgers@mi.fu-berlin.de>2021-05-19 15:20:19 +0300
committerJohannes Berg <johannes.berg@intel.com>2021-06-23 12:01:49 +0300
commit4e6c78bdcfbc3aad01a527e46b89e7ab70e0c332 (patch)
treef4bef1650d78db3f44af55198280161a30dd41ee /net/mac80211
parentd333322361e7a099dc74df2498d3fa5fde5c4fa7 (diff)
downloadlinux-4e6c78bdcfbc3aad01a527e46b89e7ab70e0c332.tar.xz
mac80211: refactor rc_no_data_or_no_ack_use_min function
Use newly introduced helper function ieee80211_is_tx_data to check if frame is a data frame. Takes into account that hardware encapsulation can be enabled for a frame and therefore no ieee80211 header is present. Signed-off-by: Philipp Borgers <borgers@mi.fu-berlin.de> Link: https://lore.kernel.org/r/20210519122019.92359-4-borgers@mi.fu-berlin.de Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/rate.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index 01d6407b0279..9418daa52f68 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -297,15 +297,11 @@ void ieee80211_check_rate_mask(struct ieee80211_sub_if_data *sdata)
static bool rc_no_data_or_no_ack_use_min(struct ieee80211_tx_rate_control *txrc)
{
struct sk_buff *skb = txrc->skb;
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
- __le16 fc;
-
- fc = hdr->frame_control;
return (info->flags & (IEEE80211_TX_CTL_NO_ACK |
IEEE80211_TX_CTL_USE_MINRATE)) ||
- !ieee80211_is_data(fc);
+ !ieee80211_is_tx_data(skb);
}
static void rc_send_low_basicrate(struct ieee80211_tx_rate *rate,