[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/mt76-test.bb b/recipes-wifi/linux-mt76/mt76-test.bb
index f831b9f..6af254f 100644
--- a/recipes-wifi/linux-mt76/mt76-test.bb
+++ b/recipes-wifi/linux-mt76/mt76-test.bb
@@ -13,9 +13,12 @@
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 \
"
+
+
DEPENDS += "virtual/kernel"
DEPENDS += "linux-mac80211"
DEPENDS += "linux-mt76"
@@ -29,11 +32,28 @@
SRC_URI += "file://*.patch;apply=no"
-
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 patch -p1 < $i; done
+ 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
}