[rdkb][common][config][Add flow offload feature]
[Description]
Add flow offload feature
1. kernel, mac80211 and mt76 will use flow offload feature to decide patch wed patch or not
[Release-log]
diff --git a/recipes-wifi/linux-mt76/linux-mt76.bb b/recipes-wifi/linux-mt76/linux-mt76.bb
index bf4b282..69d67b0 100644
--- a/recipes-wifi/linux-mt76/linux-mt76.bb
+++ b/recipes-wifi/linux-mt76/linux-mt76.bb
@@ -11,21 +11,53 @@
SRC_URI = " \
git://git@github.com/openwrt/mt76.git;protocol=https \
file://COPYING;subdir=git \
+ file://0001-mt76-add-internal-wed_tiny-header-file.patch;apply=no \
"
SRC_URI += " \
file://src \
"
+
+
DEPENDS += "virtual/kernel"
DEPENDS += "linux-mac80211"
FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:"
FILESEXTRAPATHS_prepend := "${THISDIR}/src:"
-require files/patches/patches.inc
+#require files/patches/patches.inc
+SRC_URI += "file://*.patch;apply=no"
S = "${WORKDIR}/git"
+do_mtk_patches() {
+ cd ${S}
+
+ DISTRO_FlowBlock_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','flow_offload','true','false',d)}"
+
+ if [ ! -e mtk_wifi_patch_applied ]; then
+ for i in ${WORKDIR}/*.patch
+ do
+ if [ $DISTRO_FlowBlock_ENABLED = 'true' ]; then
+ patch -p1 < $i;
+ else
+ prefix=$(echo -n "${WORKDIR}"|wc -c)
+ patch_number_start=$(expr $prefix + 2)
+ patch_number_end=$(expr $patch_number_start + 3 )
+ patch_number=$(echo "$i" | cut -c"$patch_number_start"-"$patch_number_end")
+
+ if [ "$patch_number" -ge "3000" ]; then
+ continue;
+ else
+ patch -p1 < $i;
+ fi
+ fi
+ done
+ fi
+ touch mtk_wifi_patch_applied
+}
+addtask mtk_patches after do_patch before do_configure
+
NOSTDINC_FLAGS = " \
-I${B} \
-I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211-backport/uapi \