Skip to content

Commit 6a6307f

Browse files
Ramasamy Kaliappangregkh
authored andcommitted
wifi: ath12k: Fix the QoS control field offset to build QoS header
[ Upstream commit 8599d4c ] Currently, in the mac80211 layer, received EAPOL packets are dropped when the HT control field is present in the QoS header. This issue arises due to an incorrect QoS control field offset used to build the QoS header in the MSDU data, leading to a corrupted header in the mac80211 layer. This issue also applies to other frames that contain the QoS control field, such as QoS data or Null frames. To resolve this, use ieee80211_get_qos_ctl() to obtain the correct QoS control offset from the MSDU data. Additionally, ensure the QoS control header is copied in little-endian format within the MSDU data. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Fixes: d889913 ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Ramasamy Kaliappan <quic_rkaliapp@quicinc.com> Signed-off-by: Nithyanantham Paramasivam <nithyanantham.paramasivam@oss.qualcomm.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Link: https://patch.msgid.link/20250415184102.2707300-1-nithyanantham.paramasivam@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0c2de95 commit 6a6307f

File tree

1 file changed

+6
-6
lines changed
  • drivers/net/wireless/ath/ath12k

1 file changed

+6
-6
lines changed

drivers/net/wireless/ath/ath12k/dp_rx.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,7 +2064,7 @@ static void ath12k_get_dot11_hdr_from_rx_desc(struct ath12k *ar,
20642064
struct ath12k_base *ab = ar->ab;
20652065
size_t hdr_len, crypto_len;
20662066
struct ieee80211_hdr hdr;
2067-
u16 qos_ctl;
2067+
__le16 qos_ctl;
20682068
u8 *crypto_hdr, mesh_ctrl;
20692069

20702070
ath12k_dp_rx_desc_get_dot11_hdr(ab, rx_desc, &hdr);
@@ -2085,13 +2085,13 @@ static void ath12k_get_dot11_hdr_from_rx_desc(struct ath12k *ar,
20852085

20862086
/* Add QOS header */
20872087
if (ieee80211_is_data_qos(hdr.frame_control)) {
2088-
qos_ctl = rxcb->tid;
2088+
struct ieee80211_hdr *qos_ptr = (struct ieee80211_hdr *)msdu->data;
2089+
2090+
qos_ctl = cpu_to_le16(rxcb->tid & IEEE80211_QOS_CTL_TID_MASK);
20892091
if (mesh_ctrl)
2090-
qos_ctl |= IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT;
2092+
qos_ctl |= cpu_to_le16(IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT);
20912093

2092-
/* TODO: Add other QoS ctl fields when required */
2093-
memcpy(msdu->data + (hdr_len - IEEE80211_QOS_CTL_LEN),
2094-
&qos_ctl, IEEE80211_QOS_CTL_LEN);
2094+
memcpy(ieee80211_get_qos_ctl(qos_ptr), &qos_ctl, IEEE80211_QOS_CTL_LEN);
20952095
}
20962096
}
20972097

0 commit comments

Comments
 (0)