Commit d9e38350 authored by Zhi-Jun You's avatar Zhi-Jun You Committed by Kalle Valo

wifi: ath10k: Remove redundant argument offset

This argument of ath10k_htt_rx_h_frag_pn_check() is always set to 0 so
drop this.
Signed-off-by: default avatarZhi-Jun You <hujy652@gmail.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221110164025.14418-1-hujy652@gmail.com
parent 2af77490
...@@ -1844,15 +1844,14 @@ static void ath10k_htt_rx_h_csum_offload(struct ath10k_hw_params *hw, ...@@ -1844,15 +1844,14 @@ static void ath10k_htt_rx_h_csum_offload(struct ath10k_hw_params *hw,
} }
static u64 ath10k_htt_rx_h_get_pn(struct ath10k *ar, struct sk_buff *skb, static u64 ath10k_htt_rx_h_get_pn(struct ath10k *ar, struct sk_buff *skb,
u16 offset,
enum htt_rx_mpdu_encrypt_type enctype) enum htt_rx_mpdu_encrypt_type enctype)
{ {
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
u64 pn = 0; u64 pn = 0;
u8 *ehdr; u8 *ehdr;
hdr = (struct ieee80211_hdr *)(skb->data + offset); hdr = (struct ieee80211_hdr *)skb->data;
ehdr = skb->data + offset + ieee80211_hdrlen(hdr->frame_control); ehdr = skb->data + ieee80211_hdrlen(hdr->frame_control);
if (enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2) { if (enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2) {
pn = ehdr[0]; pn = ehdr[0];
...@@ -1866,19 +1865,17 @@ static u64 ath10k_htt_rx_h_get_pn(struct ath10k *ar, struct sk_buff *skb, ...@@ -1866,19 +1865,17 @@ static u64 ath10k_htt_rx_h_get_pn(struct ath10k *ar, struct sk_buff *skb,
} }
static bool ath10k_htt_rx_h_frag_multicast_check(struct ath10k *ar, static bool ath10k_htt_rx_h_frag_multicast_check(struct ath10k *ar,
struct sk_buff *skb, struct sk_buff *skb)
u16 offset)
{ {
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
hdr = (struct ieee80211_hdr *)(skb->data + offset); hdr = (struct ieee80211_hdr *)skb->data;
return !is_multicast_ether_addr(hdr->addr1); return !is_multicast_ether_addr(hdr->addr1);
} }
static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar, static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar,
struct sk_buff *skb, struct sk_buff *skb,
u16 peer_id, u16 peer_id,
u16 offset,
enum htt_rx_mpdu_encrypt_type enctype) enum htt_rx_mpdu_encrypt_type enctype)
{ {
struct ath10k_peer *peer; struct ath10k_peer *peer;
...@@ -1893,14 +1890,14 @@ static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar, ...@@ -1893,14 +1890,14 @@ static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar,
return false; return false;
} }
hdr = (struct ieee80211_hdr *)(skb->data + offset); hdr = (struct ieee80211_hdr *)skb->data;
if (ieee80211_is_data_qos(hdr->frame_control)) if (ieee80211_is_data_qos(hdr->frame_control))
tid = ieee80211_get_tid(hdr); tid = ieee80211_get_tid(hdr);
else else
tid = ATH10K_TXRX_NON_QOS_TID; tid = ATH10K_TXRX_NON_QOS_TID;
last_pn = &peer->frag_tids_last_pn[tid]; last_pn = &peer->frag_tids_last_pn[tid];
new_pn.pn48 = ath10k_htt_rx_h_get_pn(ar, skb, offset, enctype); new_pn.pn48 = ath10k_htt_rx_h_get_pn(ar, skb, enctype);
frag_number = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; frag_number = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG;
seq = IEEE80211_SEQ_TO_SN(__le16_to_cpu(hdr->seq_ctrl)); seq = IEEE80211_SEQ_TO_SN(__le16_to_cpu(hdr->seq_ctrl));
...@@ -2059,13 +2056,11 @@ static void ath10k_htt_rx_h_mpdu(struct ath10k *ar, ...@@ -2059,13 +2056,11 @@ static void ath10k_htt_rx_h_mpdu(struct ath10k *ar,
frag_pn_check = ath10k_htt_rx_h_frag_pn_check(ar, frag_pn_check = ath10k_htt_rx_h_frag_pn_check(ar,
msdu, msdu,
peer_id, peer_id,
0,
enctype); enctype);
if (frag) if (frag)
multicast_check = ath10k_htt_rx_h_frag_multicast_check(ar, multicast_check = ath10k_htt_rx_h_frag_multicast_check(ar,
msdu, msdu);
0);
if (!frag_pn_check || !multicast_check) { if (!frag_pn_check || !multicast_check) {
/* Discard the fragment with invalid PN or multicast DA /* Discard the fragment with invalid PN or multicast DA
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment