@@ -2135,7 +2135,7 @@ static void ath12k_get_dot11_hdr_from_rx_desc(struct ath12k *ar,
struct ath12k_base *ab = ar->ab;
size_t hdr_len, crypto_len;
struct ieee80211_hdr hdr;
- u16 qos_ctl;
+ __le16 qos_ctl;
u8 *crypto_hdr, mesh_ctrl;
ath12k_dp_rx_desc_get_dot11_hdr(ab, rx_desc, &hdr);
@@ -2156,13 +2156,13 @@ static void ath12k_get_dot11_hdr_from_rx_desc(struct ath12k *ar,
/* Add QOS header */
if (ieee80211_is_data_qos(hdr.frame_control)) {
- qos_ctl = rxcb->tid;
+ struct ieee80211_hdr *qos_ptr = (struct ieee80211_hdr *)msdu->data;
+
+ qos_ctl = cpu_to_le16(rxcb->tid & IEEE80211_QOS_CTL_TID_MASK);
if (mesh_ctrl)
- qos_ctl |= IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT;
+ qos_ctl |= cpu_to_le16(IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT);
- /* TODO: Add other QoS ctl fields when required */
- memcpy(msdu->data + (hdr_len - IEEE80211_QOS_CTL_LEN),
- &qos_ctl, IEEE80211_QOS_CTL_LEN);
+ memcpy(ieee80211_get_qos_ctl(qos_ptr), &qos_ctl, IEEE80211_QOS_CTL_LEN);
}
}