wlan-ap-Telecominfraproject/feeds/ipq807x/mac80211/patches/113-ath11k-add-8023-undecap-support.patch
John Crispin 3affbc1cad QualComm/AX: add Hawkeye and Cypress support
This series is based on
* 2020-07-10 ipq6018-ilq-11-0_qca_oem-034672b0676c37b1f4519e5720e18e95fe6236ef

Add support for
* qsdk kernel/v4.4
* qsdk ethernet subsystem
* v5.7 ath11k backport + QualComm staging patches (wlan_ap_1.0)
* ath11k-firmware
* hostapd/iw/...

Feature support
* full boot, system detection
* sysupgrade to nand
* HE support via latest hostapd
* driver support for usb, crypto, hwmon, cpufreq, ...

Missing
* NSS/HW flow offloading - FW blob is not redistributable

Using the qsdk v4.4 is an intermediate solution while the vanilla is being
tested. Vanilla kernel is almost on feature par. Work has already started
to upstream the ethernet and switch drivers. Once complete the target will
be fully upstream.

Signed-off-by: John Crispin <john@phrozen.org>
2020-07-23 18:54:03 +02:00

58 lines
1.8 KiB
Diff

Index: backports-20191227-4.4.60-b805aa84b44f/drivers/net/wireless/ath/ath11k/dp_rx.c
===================================================================
--- backports-20191227-4.4.60-b805aa84b44f.orig/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ backports-20191227-4.4.60-b805aa84b44f/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -2192,6 +2192,42 @@ static void ath11k_dp_rx_h_undecap_eth(s
ether_addr_copy(ieee80211_get_SA(hdr), sa);
}
+static void ath11k_dp_rx_h_undecap_snap(struct ath11k *ar,
+ struct sk_buff *msdu,
+ u8 *first_hdr,
+ enum hal_encrypt_type enctype,
+ struct ieee80211_rx_status *status)
+{
+ struct ieee80211_hdr *hdr;
+ size_t hdr_len;
+ u8 l3_pad_bytes;
+ struct hal_rx_desc *rx_desc;
+
+ /* Delivered decapped frame:
+ * [amsdu header] <-- replaced with 802.11 hdr
+ * [rfc1042/llc]
+ * [payload]
+ */
+
+ rx_desc = (void *)msdu->data - sizeof(*rx_desc);
+ l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(rx_desc);
+
+ skb_put(msdu, l3_pad_bytes);
+ skb_pull(msdu, sizeof(struct ath11k_dp_amsdu_subframe_hdr) + l3_pad_bytes);
+
+ hdr = (struct ieee80211_hdr *)first_hdr;
+ hdr_len = ieee80211_hdrlen(hdr->frame_control);
+
+ if (!(status->flag & RX_FLAG_IV_STRIPPED)) {
+ memcpy(skb_push(msdu,
+ ath11k_dp_rx_crypto_param_len(ar, enctype)),
+ (void *)hdr + hdr_len,
+ ath11k_dp_rx_crypto_param_len(ar, enctype));
+ }
+
+ memcpy(skb_push(msdu, hdr_len), hdr, hdr_len);
+}
+
static void ath11k_dp_rx_h_undecap(struct ath11k *ar, struct sk_buff *msdu,
struct hal_rx_desc *rx_desc,
enum hal_encrypt_type enctype,
@@ -2222,7 +2258,8 @@ static void ath11k_dp_rx_h_undecap(struc
enctype, status);
break;
case DP_RX_DECAP_TYPE_8023:
- /* TODO: Handle undecap for these formats */
+ ath11k_dp_rx_h_undecap_snap(ar, msdu, first_hdr,
+ enctype, status);
break;
}
}