From bc06d56dc89af9d13d3b993dae0de46e76dfc3a7 Mon Sep 17 00:00:00 2001
From: Sam Shih <sam.shih@mediatek.com>
Date: Fri, 2 Jun 2023 13:06:28 +0800
Subject: [PATCH] [networking][999-2705-hwnat_Kconfig_Makefile.patch]

---
 net/Kconfig  | 12 ++++++++++++
 net/Makefile |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/net/Kconfig b/net/Kconfig
index 46d9b3827..123e4bc28 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -460,6 +460,18 @@ config FAILOVER
 	  migration of VMs with direct attached VFs by failing over to the
 	  paravirtual datapath when the VF is unplugged.
 
+config HW_NAT
+	bool "HW NAT support"
+	default n
+	---help---
+	 This feature provides a fast path to support network lan/wan nat.
+	 If you need hw_nat engine to reduce cpu loading, please say Y.
+
+	  Note that the answer to this question doesn't directly affect the
+	  kernel: saying N will just cause the configurator to skip all
+	  the questions about Mediatek Ethernet devices. If you say Y,
+	  you will be asked for your specific card in the following questions.
+
 endif   # if NET
 
 # Used by archs to tell that they support BPF JIT compiler plus which flavour.
diff --git a/net/Makefile b/net/Makefile
index 9603e98f0..673f0a664 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -62,6 +62,9 @@ endif
 obj-$(CONFIG_6LOWPAN)		+= 6lowpan/
 obj-$(CONFIG_IEEE802154)	+= ieee802154/
 obj-$(CONFIG_MAC802154)		+= mac802154/
+ifeq ($(CONFIG_HW_NAT),y)
+obj-y                           += nat/foe_hook/
+endif
 
 ifeq ($(CONFIG_NET),y)
 obj-$(CONFIG_SYSCTL)		+= sysctl_net.o
-- 
2.34.1

