[qca-ssdk]:[ReducedProfile]: add IN_IP_MINI macro and cut out the IP code.

Change-Id: Ie471d935a916234a79edfdd0c8663022fda626ab
Signed-off-by: zhongjia <zhongjia@codeaurora.org>
diff --git a/config b/config
index b2d5533..c7468fb 100755
--- a/config
+++ b/config
@@ -279,12 +279,12 @@
 IN_FLOW_MINI=TRUE
 IN_QM_MINI=TRUE
 IN_UNIPHY_MINI=TRUE
+IN_IP_MINI=TRUE
 #disable modules for MINI HPPE/CPPE
 ifneq (, $(filter HPPE CPPE, $(CHIP_TYPE)))
 IN_SERVCODE=FALSE
 IN_PPPOE=FALSE
 IN_NAT=FALSE
-IN_IP=FALSE
 IN_COSMAP=FALSE
 IN_RATE=FALSE
 IN_IGMP=FALSE
diff --git a/include/fal/fal_api.h b/include/fal/fal_api.h
index 9a52ead..e976085 100755
--- a/include/fal/fal_api.h
+++ b/include/fal/fal_api.h
@@ -1271,6 +1271,7 @@
 #endif
 
 #ifdef IN_IP
+#ifndef IN_IP_MINI
 #define IP_API \
     SW_API_DEF(SW_API_IP_HOST_ADD, fal_ip_host_add), \
     SW_API_DEF(SW_API_IP_HOST_DEL, fal_ip_host_del), \
@@ -1426,6 +1427,10 @@
 #define IP_API
 #define IP_API_PARAM
 #endif
+#else
+#define IP_API
+#define IP_API_PARAM
+#endif
 
 #ifdef IN_FLOW
 #ifndef IN_FLOW_MINI
diff --git a/include/fal/fal_ip.h b/include/fal/fal_ip.h
index 3bc136f..54eed89 100755
--- a/include/fal/fal_ip.h
+++ b/include/fal/fal_ip.h
@@ -360,169 +360,170 @@
 	FUNC_IP_GLOBAL_CTRL_SET,
 };
 
-    sw_error_t
-    fal_ip_host_add(a_uint32_t dev_id, fal_host_entry_t * host_entry);
+#ifndef IN_IP_MINI
+sw_error_t
+fal_ip_host_add(a_uint32_t dev_id, fal_host_entry_t * host_entry);
 
-    sw_error_t
-    fal_ip_host_del(a_uint32_t dev_id, a_uint32_t del_mode,
-                    fal_host_entry_t * host_entry);
+sw_error_t
+fal_ip_host_del(a_uint32_t dev_id, a_uint32_t del_mode,
+                fal_host_entry_t * host_entry);
 
-    sw_error_t
-    fal_ip_host_get(a_uint32_t dev_id, a_uint32_t get_mode,
-                    fal_host_entry_t * host_entry);
+sw_error_t
+fal_ip_host_get(a_uint32_t dev_id, a_uint32_t get_mode,
+                fal_host_entry_t * host_entry);
 
-    sw_error_t
-    fal_ip_host_next(a_uint32_t dev_id, a_uint32_t next_mode,
-                     fal_host_entry_t * host_entry);
+sw_error_t
+fal_ip_host_next(a_uint32_t dev_id, a_uint32_t next_mode,
+                 fal_host_entry_t * host_entry);
 
-    sw_error_t
-    fal_ip_host_counter_bind(a_uint32_t dev_id, a_uint32_t entry_id,
-                             a_uint32_t cnt_id, a_bool_t enable);
+sw_error_t
+fal_ip_host_counter_bind(a_uint32_t dev_id, a_uint32_t entry_id,
+                         a_uint32_t cnt_id, a_bool_t enable);
 
-    sw_error_t
-    fal_ip_host_pppoe_bind(a_uint32_t dev_id, a_uint32_t entry_id,
-                           a_uint32_t pppoe_id, a_bool_t enable);
+sw_error_t
+fal_ip_host_pppoe_bind(a_uint32_t dev_id, a_uint32_t entry_id,
+                       a_uint32_t pppoe_id, a_bool_t enable);
 
-    sw_error_t
-    fal_ip_pt_arp_learn_set(a_uint32_t dev_id, fal_port_t port_id,
-                            a_uint32_t flags);
+sw_error_t
+fal_ip_pt_arp_learn_set(a_uint32_t dev_id, fal_port_t port_id,
+                        a_uint32_t flags);
 
-    sw_error_t
-    fal_ip_pt_arp_learn_get(a_uint32_t dev_id, fal_port_t port_id,
-                            a_uint32_t * flags);
+sw_error_t
+fal_ip_pt_arp_learn_get(a_uint32_t dev_id, fal_port_t port_id,
+                        a_uint32_t * flags);
 
-    sw_error_t
-    fal_ip_arp_learn_set(a_uint32_t dev_id, fal_arp_learn_mode_t mode);
+sw_error_t
+fal_ip_arp_learn_set(a_uint32_t dev_id, fal_arp_learn_mode_t mode);
 
-    sw_error_t
-    fal_ip_arp_learn_get(a_uint32_t dev_id, fal_arp_learn_mode_t * mode);
+sw_error_t
+fal_ip_arp_learn_get(a_uint32_t dev_id, fal_arp_learn_mode_t * mode);
 
-    sw_error_t
-    fal_ip_source_guard_set(a_uint32_t dev_id, fal_port_t port_id,
-                            fal_source_guard_mode_t mode);
+sw_error_t
+fal_ip_source_guard_set(a_uint32_t dev_id, fal_port_t port_id,
+                        fal_source_guard_mode_t mode);
 
-    sw_error_t
-    fal_ip_source_guard_get(a_uint32_t dev_id, fal_port_t port_id,
-                            fal_source_guard_mode_t * mode);
+sw_error_t
+fal_ip_source_guard_get(a_uint32_t dev_id, fal_port_t port_id,
+                        fal_source_guard_mode_t * mode);
 
-    sw_error_t
-    fal_ip_arp_guard_set(a_uint32_t dev_id, fal_port_t port_id,
-                         fal_source_guard_mode_t mode);
+sw_error_t
+fal_ip_arp_guard_set(a_uint32_t dev_id, fal_port_t port_id,
+                     fal_source_guard_mode_t mode);
 
-    sw_error_t
-    fal_ip_arp_guard_get(a_uint32_t dev_id, fal_port_t port_id,
-                         fal_source_guard_mode_t * mode);
+sw_error_t
+fal_ip_arp_guard_get(a_uint32_t dev_id, fal_port_t port_id,
+                     fal_source_guard_mode_t * mode);
 
-    sw_error_t
-    fal_ip_route_status_set(a_uint32_t dev_id, a_bool_t enable);
+sw_error_t
+fal_ip_route_status_set(a_uint32_t dev_id, a_bool_t enable);
 
-    sw_error_t
-    fal_ip_route_status_get(a_uint32_t dev_id, a_bool_t * enable);
+sw_error_t
+fal_ip_route_status_get(a_uint32_t dev_id, a_bool_t * enable);
 
-    sw_error_t
-    fal_ip_intf_entry_add(a_uint32_t dev_id, fal_intf_mac_entry_t * entry);
+sw_error_t
+fal_ip_intf_entry_add(a_uint32_t dev_id, fal_intf_mac_entry_t * entry);
 
-    sw_error_t
-    fal_ip_intf_entry_del(a_uint32_t dev_id, a_uint32_t del_mode,
-                          fal_intf_mac_entry_t * entry);
+sw_error_t
+fal_ip_intf_entry_del(a_uint32_t dev_id, a_uint32_t del_mode,
+                      fal_intf_mac_entry_t * entry);
 
-    sw_error_t
-    fal_ip_intf_entry_next(a_uint32_t dev_id, a_uint32_t next_mode,
-                           fal_intf_mac_entry_t * entry);
+sw_error_t
+fal_ip_intf_entry_next(a_uint32_t dev_id, a_uint32_t next_mode,
+                       fal_intf_mac_entry_t * entry);
 
-    sw_error_t
-    fal_ip_unk_source_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd);
+sw_error_t
+fal_ip_unk_source_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd);
 
-    sw_error_t
-    fal_ip_unk_source_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd);
+sw_error_t
+fal_ip_unk_source_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd);
 
-    sw_error_t
-    fal_arp_unk_source_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd);
+sw_error_t
+fal_arp_unk_source_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd);
 
-    sw_error_t
-    fal_arp_unk_source_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd);
+sw_error_t
+fal_arp_unk_source_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd);
 
-    sw_error_t
-    fal_ip_age_time_set(a_uint32_t dev_id, a_uint32_t * time);
+sw_error_t
+fal_ip_age_time_set(a_uint32_t dev_id, a_uint32_t * time);
 
-    sw_error_t
-    fal_ip_age_time_get(a_uint32_t dev_id, a_uint32_t * time);
+sw_error_t
+fal_ip_age_time_get(a_uint32_t dev_id, a_uint32_t * time);
 
-    sw_error_t
-    fal_ip_wcmp_entry_set(a_uint32_t dev_id, a_uint32_t wcmp_id, fal_ip_wcmp_t * wcmp);
+sw_error_t
+fal_ip_wcmp_entry_set(a_uint32_t dev_id, a_uint32_t wcmp_id, fal_ip_wcmp_t * wcmp);
 
-    sw_error_t
-    fal_ip_wcmp_entry_get(a_uint32_t dev_id, a_uint32_t wcmp_id, fal_ip_wcmp_t * wcmp);
+sw_error_t
+fal_ip_wcmp_entry_get(a_uint32_t dev_id, a_uint32_t wcmp_id, fal_ip_wcmp_t * wcmp);
 
-    sw_error_t
-    fal_ip_wcmp_hash_mode_set(a_uint32_t dev_id, a_uint32_t hash_mode);
+sw_error_t
+fal_ip_wcmp_hash_mode_set(a_uint32_t dev_id, a_uint32_t hash_mode);
 
-	sw_error_t
-	fal_ip_rfs_ip4_rule_set(a_uint32_t dev_id, fal_ip4_rfs_t * rfs);
+sw_error_t
+fal_ip_rfs_ip4_rule_set(a_uint32_t dev_id, fal_ip4_rfs_t * rfs);
 
-	sw_error_t
-	fal_ip_rfs_ip6_rule_set(a_uint32_t dev_id, fal_ip6_rfs_t * rfs);
+sw_error_t
+fal_ip_rfs_ip6_rule_set(a_uint32_t dev_id, fal_ip6_rfs_t * rfs);
 
-	sw_error_t
-	fal_ip_rfs_ip4_rule_del(a_uint32_t dev_id, fal_ip4_rfs_t * rfs);
+sw_error_t
+fal_ip_rfs_ip4_rule_del(a_uint32_t dev_id, fal_ip4_rfs_t * rfs);
 
-	sw_error_t
-	fal_ip_rfs_ip6_rule_del(a_uint32_t dev_id, fal_ip6_rfs_t * rfs);
+sw_error_t
+fal_ip_rfs_ip6_rule_del(a_uint32_t dev_id, fal_ip6_rfs_t * rfs);
 
-    sw_error_t
-    fal_ip_wcmp_hash_mode_get(a_uint32_t dev_id, a_uint32_t * hash_mode);
+sw_error_t
+fal_ip_wcmp_hash_mode_get(a_uint32_t dev_id, a_uint32_t * hash_mode);
 
-    sw_error_t
-    fal_ip_vrf_base_addr_set(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t addr);
+sw_error_t
+fal_ip_vrf_base_addr_set(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t addr);
 
-    sw_error_t
-    fal_ip_vrf_base_addr_get(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t * addr);
+sw_error_t
+fal_ip_vrf_base_addr_get(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t * addr);
 
-    sw_error_t
-    fal_ip_vrf_base_mask_set(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t addr);
+sw_error_t
+fal_ip_vrf_base_mask_set(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t addr);
 
-    sw_error_t
-    fal_ip_vrf_base_mask_get(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t * addr);
+sw_error_t
+fal_ip_vrf_base_mask_get(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t * addr);
 
-    sw_error_t
-    fal_ip_default_route_set(a_uint32_t dev_id, a_uint32_t droute_id,
-			fal_default_route_t * entry);
+sw_error_t
+fal_ip_default_route_set(a_uint32_t dev_id, a_uint32_t droute_id,
+		fal_default_route_t * entry);
 
-    sw_error_t
-    fal_ip_default_route_get(a_uint32_t dev_id, a_uint32_t droute_id,
-			fal_default_route_t * entry);
+sw_error_t
+fal_ip_default_route_get(a_uint32_t dev_id, a_uint32_t droute_id,
+		fal_default_route_t * entry);
 
-    sw_error_t
-    fal_ip_host_route_set(a_uint32_t dev_id, a_uint32_t hroute_id,
-			fal_host_route_t * entry);
+sw_error_t
+fal_ip_host_route_set(a_uint32_t dev_id, a_uint32_t hroute_id,
+		fal_host_route_t * entry);
 
-    sw_error_t
-    fal_ip_host_route_get(a_uint32_t dev_id, a_uint32_t hroute_id,
-			fal_host_route_t * entry);
+sw_error_t
+fal_ip_host_route_get(a_uint32_t dev_id, a_uint32_t hroute_id,
+		fal_host_route_t * entry);
 
-	sw_error_t
-    fal_ip_wcmp_entry_set(a_uint32_t dev_id, a_uint32_t wcmp_id,
-			fal_ip_wcmp_t * wcmp);
+sw_error_t
+fal_ip_wcmp_entry_set(a_uint32_t dev_id, a_uint32_t wcmp_id,
+		fal_ip_wcmp_t * wcmp);
 
-    sw_error_t
-    fal_ip_wcmp_entry_get(a_uint32_t dev_id, a_uint32_t wcmp_id,
-			fal_ip_wcmp_t * wcmp);
+sw_error_t
+fal_ip_wcmp_entry_get(a_uint32_t dev_id, a_uint32_t wcmp_id,
+		fal_ip_wcmp_t * wcmp);
 
-    sw_error_t
-    fal_default_flow_cmd_set(a_uint32_t dev_id, a_uint32_t vrf_id,
-			fal_flow_type_t type, fal_default_flow_cmd_t cmd);
+sw_error_t
+fal_default_flow_cmd_set(a_uint32_t dev_id, a_uint32_t vrf_id,
+		fal_flow_type_t type, fal_default_flow_cmd_t cmd);
 
-    sw_error_t
-    fal_default_flow_cmd_get(a_uint32_t dev_id, a_uint32_t vrf_id,
-			fal_flow_type_t type, fal_default_flow_cmd_t * cmd);
+sw_error_t
+fal_default_flow_cmd_get(a_uint32_t dev_id, a_uint32_t vrf_id,
+		fal_flow_type_t type, fal_default_flow_cmd_t * cmd);
 
-    sw_error_t
-    fal_default_rt_flow_cmd_set(a_uint32_t dev_id, a_uint32_t vrf_id,
-			fal_flow_type_t type, fal_default_flow_cmd_t cmd);
+sw_error_t
+fal_default_rt_flow_cmd_set(a_uint32_t dev_id, a_uint32_t vrf_id,
+		fal_flow_type_t type, fal_default_flow_cmd_t cmd);
 
-    sw_error_t
-    fal_default_rt_flow_cmd_get(a_uint32_t dev_id, a_uint32_t vrf_id,
-			fal_flow_type_t type, fal_default_flow_cmd_t * cmd);
+sw_error_t
+fal_default_rt_flow_cmd_get(a_uint32_t dev_id, a_uint32_t vrf_id,
+		fal_flow_type_t type, fal_default_flow_cmd_t * cmd);
 
 sw_error_t
 fal_ip_vsi_arp_sg_cfg_get(a_uint32_t dev_id, a_uint32_t vsi,
@@ -634,7 +635,7 @@
 
 sw_error_t
 fal_ip_global_ctrl_set(a_uint32_t dev_id, fal_ip_global_cfg_t *cfg);
-
+#endif
 
 #ifdef __cplusplus
 }
diff --git a/include/hsl/hppe/hppe_ip.h b/include/hsl/hppe/hppe_ip.h
index 3c77590..e3f17fb 100755
--- a/include/hsl/hppe/hppe_ip.h
+++ b/include/hsl/hppe/hppe_ip.h
@@ -37,6 +37,7 @@
 #define IN_PUB_IP_ADDR_TBL_MAX_ENTRY	16
 #define RT_INTERFACE_CNT_TBL_MAX_ENTRY	512
 
+#ifndef IP_MINI
 sw_error_t
 hppe_rt_interface_cnt_tbl_get(
 		a_uint32_t dev_id,
@@ -132,7 +133,8 @@
 		a_uint32_t dev_id,
 		a_uint32_t index,
 		union network_route_action_u *value);
-
+#endif
+#if ((!defined IN_IP_MINI) || (!defined IN_FLOW_MINI))
 sw_error_t
 hppe_l3_route_ctrl_get(
 		a_uint32_t dev_id,
@@ -152,7 +154,8 @@
 hppe_l3_route_ctrl_ext_set(
 		a_uint32_t dev_id,
 		union l3_route_ctrl_ext_u *value);
-
+#endif
+#ifndef IN_IP_MINI
 sw_error_t
 hppe_host_tbl_op_get(
 		a_uint32_t dev_id,
@@ -162,7 +165,8 @@
 hppe_host_tbl_op_set(
 		a_uint32_t dev_id,
 		union host_tbl_op_u *value);
-
+#endif
+#if ((!defined IN_IP_MINI) || (!defined IN_FLOW_MINI))
 sw_error_t
 hppe_host_tbl_op_data0_get(
 		a_uint32_t dev_id,
@@ -212,7 +216,8 @@
 hppe_host_tbl_op_data4_set(
 		a_uint32_t dev_id,
 		union host_tbl_op_data4_u *value);
-
+#endif
+#ifndef IN_IP_MINI
 sw_error_t
 hppe_host_tbl_op_data5_get(
 		a_uint32_t dev_id,
@@ -282,7 +287,8 @@
 hppe_host_tbl_rd_op_set(
 		a_uint32_t dev_id,
 		union host_tbl_rd_op_u *value);
-
+#endif
+#if ((!defined IN_IP_MINI) || (!defined IN_FLOW_MINI))
 sw_error_t
 hppe_host_tbl_rd_op_data0_get(
 		a_uint32_t dev_id,
@@ -332,7 +338,8 @@
 hppe_host_tbl_rd_op_data4_set(
 		a_uint32_t dev_id,
 		union host_tbl_rd_op_data4_u *value);
-
+#endif
+#ifndef IN_IP_MINI
 sw_error_t
 hppe_host_tbl_rd_op_data5_get(
 		a_uint32_t dev_id,
@@ -522,7 +529,7 @@
 hppe_l3_dbg_rd_data_set(
 		a_uint32_t dev_id,
 		union l3_dbg_rd_data_u *value);
-
+#endif
 sw_error_t
 hppe_l3_vp_port_tbl_get(
 		a_uint32_t dev_id,
@@ -534,7 +541,7 @@
 		a_uint32_t dev_id,
 		a_uint32_t index,
 		union l3_vp_port_tbl_u *value);
-
+#if ((!defined IN_IP_MINI) || (defined IN_PPPOE))
 sw_error_t
 hppe_in_l3_if_tbl_get(
 		a_uint32_t dev_id,
@@ -546,7 +553,8 @@
 		a_uint32_t dev_id,
 		a_uint32_t index,
 		union in_l3_if_tbl_u *value);
-
+#endif
+#ifndef IN_IP_MINI
 sw_error_t
 hppe_host_ipv6_mcast_tbl_get(
 		a_uint32_t dev_id,
@@ -606,7 +614,8 @@
 		a_uint32_t dev_id,
 		a_uint32_t index,
 		union in_nexthop_tbl_u *value);
-
+#endif
+#if ((!defined IN_IP_MINI) || (defined IN_PPPOE))
 sw_error_t
 hppe_eg_l3_if_tbl_get(
 		a_uint32_t dev_id,
@@ -618,7 +627,8 @@
 		a_uint32_t dev_id,
 		a_uint32_t index,
 		union eg_l3_if_tbl_u *value);
-
+#endif
+#ifndef IN_IP_MINI
 sw_error_t
 hppe_my_mac_tbl_mac_da_get(
 		a_uint32_t dev_id,
@@ -2681,6 +2691,6 @@
 
 sw_error_t
 hppe_host_flush_common(a_uint32_t dev_id);
-
+#endif
 
 #endif
diff --git a/include/shell_lib/shell_io.h b/include/shell_lib/shell_io.h
index 410839c..0672831 100755
--- a/include/shell_lib/shell_io.h
+++ b/include/shell_lib/shell_io.h
@@ -310,7 +310,7 @@
 sw_error_t
 cmd_data_check_ip_global(char *cmd_str, void * val, a_uint32_t size);
 #endif
-#ifdef IN_NAT
+#if defined(IN_IP) || defined(IN_NAT)
 sw_error_t
 cmd_data_check_flow_cookie(char *cmd_str, void * val, a_uint32_t size);
 
diff --git a/make/linux_opt.mk b/make/linux_opt.mk
index f58e9d0..27c8636 100755
--- a/make/linux_opt.mk
+++ b/make/linux_opt.mk
@@ -101,6 +101,10 @@
   MODULE_CFLAG += -DIN_IP
 endif
 
+ifeq (TRUE, $(IN_IP_MINI))
+  MODULE_CFLAG += -DIN_IP_MINI
+endif
+
 ifeq (TRUE, $(IN_NAT))
   MODULE_CFLAG += -DIN_NAT
 endif
diff --git a/src/adpt/hppe/adpt_hppe_ip.c b/src/adpt/hppe/adpt_hppe_ip.c
index b0bc356..f4a40dd 100755
--- a/src/adpt/hppe/adpt_hppe_ip.c
+++ b/src/adpt/hppe/adpt_hppe_ip.c
@@ -23,6 +23,7 @@
 #include "hppe_ip.h"
 #include "adpt.h"
 
+#ifndef IN_IP_MINI
 sw_error_t
 adpt_hppe_ip_network_route_get(a_uint32_t dev_id,
 			a_uint32_t index, a_uint8_t type,
@@ -1213,7 +1214,7 @@
 
 	return hppe_in_nexthop_tbl_set(dev_id, index, &in_nexthop_tbl);
 }
-
+#endif
 void adpt_hppe_ip_func_bitmap_init(a_uint32_t dev_id)
 {
 	adpt_api_t *p_adpt_api = NULL;
@@ -1279,7 +1280,7 @@
 		return SW_FAIL;
 
 	adpt_hppe_ip_func_unregister(dev_id, p_adpt_api);
-
+#ifndef IN_IP_MINI
 	if (p_adpt_api->adpt_ip_func_bitmap[0] & (1 << FUNC_IP_NETWORK_ROUTE_GET))
 		p_adpt_api->adpt_ip_network_route_get = adpt_hppe_ip_network_route_get;
 	if (p_adpt_api->adpt_ip_func_bitmap[0] & (1 << FUNC_IP_HOST_ADD))
@@ -1346,10 +1347,9 @@
 		p_adpt_api->adpt_ip_global_ctrl_get = adpt_hppe_ip_global_ctrl_get;
 	if (p_adpt_api->adpt_ip_func_bitmap[1] & (1 << (FUNC_IP_GLOBAL_CTRL_SET % 32)))
 		p_adpt_api->adpt_ip_global_ctrl_set = adpt_hppe_ip_global_ctrl_set;
-
+#endif
 	return SW_OK;
 }
-
 /**
  * @}
  */
diff --git a/src/fal/fal_ip.c b/src/fal/fal_ip.c
index 36a153c..917d312 100755
--- a/src/fal/fal_ip.c
+++ b/src/fal/fal_ip.c
@@ -25,7 +25,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 
-
+#ifndef IN_IP_MINI
 static sw_error_t
 _fal_ip_host_add(a_uint32_t dev_id, fal_host_entry_t * host_entry)
 {
@@ -2362,7 +2362,7 @@
 	FAL_API_UNLOCK;
 	return rv;
 }
-
+#endif
 /*insert flag for outter fal, don't remove it*/
 
 /**
diff --git a/src/hsl/hppe/hppe_ip.c b/src/hsl/hppe/hppe_ip.c
index 3c55270..81af477 100755
--- a/src/hsl/hppe/hppe_ip.c
+++ b/src/hsl/hppe/hppe_ip.c
@@ -23,8 +23,8 @@
 #include "hppe_ip_reg.h"
 #include "hppe_ip.h"
 
+#ifndef IN_IP_MINI
 static a_uint32_t host_cmd_id = 0;
-
 sw_error_t
 hppe_rt_interface_cnt_tbl_get(
 		a_uint32_t dev_id,
@@ -249,7 +249,8 @@
 				index * NETWORK_ROUTE_ACTION_INC,
 				value->val);
 }
-
+#endif
+#if ((!defined IN_IP_MINI) || (!defined IN_FLOW_MINI))
 sw_error_t
 hppe_l3_route_ctrl_get(
 		a_uint32_t dev_id,
@@ -293,7 +294,8 @@
 				IPE_L3_BASE_ADDR + L3_ROUTE_CTRL_EXT_ADDRESS,
 				value->val);
 }
-
+#endif
+#ifndef IN_IP_MINI
 sw_error_t
 hppe_host_tbl_op_get(
 		a_uint32_t dev_id,
@@ -315,7 +317,8 @@
 				IPE_L3_BASE_ADDR + HOST_TBL_OP_ADDRESS,
 				value->val);
 }
-
+#endif
+#if ((!defined IN_IP_MINI) || (!defined IN_FLOW_MINI))
 sw_error_t
 hppe_host_tbl_op_data0_get(
 		a_uint32_t dev_id,
@@ -425,7 +428,8 @@
 				IPE_L3_BASE_ADDR + HOST_TBL_OP_DATA4_ADDRESS,
 				value->val);
 }
-
+#endif
+#ifndef IN_IP_MINI
 sw_error_t
 hppe_host_tbl_op_data5_get(
 		a_uint32_t dev_id,
@@ -576,7 +580,8 @@
 				IPE_L3_BASE_ADDR + HOST_TBL_RD_OP_ADDRESS,
 				value->val);
 }
-
+#endif
+#if ((!defined IN_IP_MINI) || (!defined IN_FLOW_MINI))
 sw_error_t
 hppe_host_tbl_rd_op_data0_get(
 		a_uint32_t dev_id,
@@ -686,7 +691,8 @@
 				IPE_L3_BASE_ADDR + HOST_TBL_RD_OP_DATA4_ADDRESS,
 				value->val);
 }
-
+#endif
+#ifndef IN_IP_MINI
 sw_error_t
 hppe_host_tbl_rd_op_data5_get(
 		a_uint32_t dev_id,
@@ -1068,7 +1074,7 @@
 {
 	return SW_NOT_SUPPORTED;
 }
-
+#endif
 sw_error_t
 hppe_l3_vp_port_tbl_get(
 		a_uint32_t dev_id,
@@ -1096,7 +1102,7 @@
 				value->val,
 				3);
 }
-
+#if ((!defined IN_IP_MINI) || (defined IN_PPPOE))
 sw_error_t
 hppe_in_l3_if_tbl_get(
 		a_uint32_t dev_id,
@@ -1124,7 +1130,8 @@
 				value->val,
 				2);
 }
-
+#endif
+#ifndef IN_IP_MINI
 sw_error_t
 hppe_host_ipv6_mcast_tbl_get(
 		a_uint32_t dev_id,
@@ -1264,7 +1271,8 @@
 				value->val,
 				4);
 }
-
+#endif
+#if ((!defined IN_IP_MINI) || (defined IN_PPPOE))
 sw_error_t
 hppe_eg_l3_if_tbl_get(
 		a_uint32_t dev_id,
@@ -1292,7 +1300,8 @@
 				value->val,
 				3);
 }
-
+#endif
+#ifndef IN_IP_MINI
 sw_error_t
 hppe_my_mac_tbl_mac_da_get(
 		a_uint32_t dev_id,
@@ -6880,6 +6889,4 @@
 	
 	
 }
-
-
-
+#endif
diff --git a/src/init/ssdk_init.c b/src/init/ssdk_init.c
index f478270..5e1dd0f 100755
--- a/src/init/ssdk_init.c
+++ b/src/init/ssdk_init.c
@@ -590,9 +590,9 @@
 qca_ar8327_phy_enable(struct qca_phy_priv *priv)
 {
 	int i = 0;
-	#ifndef BOARD_AR71XX
+#ifndef BOARD_AR71XX
         ssdk_phy_rgmii_set(priv);
-        #endif
+#endif
 	for (i = 0; i < AR8327_NUM_PHYS; i++) {
 		a_uint16_t value = 0;
 
@@ -1220,13 +1220,13 @@
 
 	mutex_unlock(&priv->qm_lock);
 
-	#ifndef SSDK_QM_CHANGE_WQ
+#ifndef SSDK_QM_CHANGE_WQ
 	schedule_delayed_work(&priv->qm_dwork,
 							msecs_to_jiffies(QCA_QM_WORK_DELAY));
-	#else
+#else
 	queue_delayed_work_on(0, system_long_wq, &priv->qm_dwork_polling,
 							msecs_to_jiffies(QCA_QM_WORK_DELAY));
-	#endif
+#endif
 }
 
 static int config_gpio(a_uint32_t  gpio_num)
@@ -1311,13 +1311,13 @@
 
 	mutex_init(&priv->qm_lock);
 	INIT_DELAYED_WORK(&priv->qm_dwork_polling, qm_err_check_work_task_polling);
-	#ifndef SSDK_MIB_CHANGE_WQ
+#ifndef SSDK_MIB_CHANGE_WQ
 	schedule_delayed_work(&priv->qm_dwork_polling,
 							msecs_to_jiffies(QCA_QM_WORK_DELAY));
-	#else
+#else
 	queue_delayed_work_on(0, system_long_wq, &priv->qm_dwork_polling,
 							msecs_to_jiffies(QCA_QM_WORK_DELAY));
-	#endif
+#endif
 
 	return 0;
 }
@@ -1522,11 +1522,11 @@
 #endif
         pdev->supported |= SUPPORTED_1000baseT_Full;
         pdev->advertising |= ADVERTISED_1000baseT_Full;
-		#ifndef BOARD_AR71XX
-		#if defined(CONFIG_OF) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
+#ifndef BOARD_AR71XX
+#if defined(CONFIG_OF) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
 		ssdk_phy_rgmii_set(priv);
-		#endif
-		#endif
+#endif
+#endif
 		return 0;
 	}
 
@@ -1659,8 +1659,8 @@
 		}
 	}
 
-	#if 0
-	#ifdef DESS
+#if 0
+#ifdef DESS
 	if ((ssdk_dt_global.mac_mode == PORT_WRAPPER_SGMII0_RGMII5)
 		||(ssdk_dt_global.mac_mode == PORT_WRAPPER_SGMII1_RGMII5)
 		||(ssdk_dt_global.mac_mode == PORT_WRAPPER_SGMII0_RGMII4)
@@ -1672,17 +1672,17 @@
 			return ret;
 		}
 	}
-	#endif
-	#endif
-	#ifdef HPPE
-	#ifdef HAWKEYE_CHIP
+#endif
+#endif
+#ifdef HPPE
+#ifdef HAWKEYE_CHIP
 	ret = qca_mac_sw_sync_work_start(priv);
 	if (ret != 0) {
 			SSDK_ERROR("qca_mac_sw_sync_work_start failed for chip 0x%02x%02x\n", priv->version, priv->revision);
 			return ret;
 	}
-	#endif
-	#endif
+#endif
+#endif
 
 	return 0;
 
@@ -1692,14 +1692,14 @@
 {
 	qca_phy_mib_work_stop(qca_phy_priv_global[dev_id]);
 	qm_err_check_work_stop(qca_phy_priv_global[dev_id]);
-	#ifdef HPPE
-	#ifdef HAWKEYE_CHIP
+#ifdef HPPE
+#ifdef HAWKEYE_CHIP
 	qca_mac_sw_sync_work_stop(qca_phy_priv_global[dev_id]);
-	#endif
-	#endif
-	#if defined(IN_SWCONFIG)
+#endif
+#endif
+#if defined(IN_SWCONFIG)
 	unregister_switch(&qca_phy_priv_global[dev_id]->sw_dev);
-	#endif
+#endif
 	return 0;
 }
 #endif
@@ -2293,7 +2293,7 @@
 
 void switch_cpuport_setup(a_uint32_t dev_id)
 {
-	#ifdef IN_PORTCONTROL
+#ifdef IN_PORTCONTROL
 	//According to HW suggestion, enable CPU port flow control for Dakota
 	fal_port_flowctrl_forcemode_set(dev_id, 0, A_TRUE);
 	fal_port_flowctrl_set(dev_id, 0, A_TRUE);
@@ -2302,7 +2302,7 @@
 	udelay(10);
 	fal_port_txmac_status_set(dev_id, 0, A_TRUE);
 	fal_port_rxmac_status_set(dev_id, 0, A_TRUE);
-	#endif
+#endif
 }
 
 #ifdef CONFIG_MDIO
@@ -2461,9 +2461,9 @@
 	if(reg_mode == HSL_REG_MDIO && flag == A_FALSE) {
 		phy_driver_unregister(&qca_phy_driver);
 
-	#if defined(BOARD_AR71XX) && defined(IN_SWCONFIG)
+#if defined(BOARD_AR71XX) && defined(IN_SWCONFIG)
 		ssdk_uci_takeover_exit();
-	#endif
+#endif
 	}
 
 	if (reg_mode == HSL_REG_LOCAL_BUS) {
@@ -2555,9 +2555,11 @@
 	{
 		for(type = FAL_FLOW_LAN_TO_LAN; type <= FAL_FLOW_WAN_TO_WAN; type++)
 		{
-			#ifdef IN_IP
+#ifdef IN_IP
+#ifndef IN_IP_MINI
 			fal_default_flow_cmd_set(dev_id, vrf_id, type, FAL_DEFAULT_FLOW_ADMIT_ALL);
-			#endif
+#endif
+#endif
 		}
 	}
 
@@ -2576,12 +2578,12 @@
 			pattern.mode = cfg->led_source_cfg[i].led_pattern.mode;
 			pattern.map = cfg->led_source_cfg[i].led_pattern.map;
 			pattern.freq = cfg->led_source_cfg[i].led_pattern.freq;
-			#ifdef IN_LED
+#ifdef IN_LED
 			fal_led_source_pattern_set(0, led_source_id,&pattern);
-			#endif
+#endif
 			led_num = ((led_source_id-1)/3) + 3;
 			source_id = led_source_id%3;
-		#ifndef BOARD_AR71XX
+#ifndef BOARD_AR71XX
 		#if defined(CONFIG_OF) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) && (LINUX_VERSION_CODE <= KERNEL_VERSION(4,0,0))
 			if (source_id == 1) {
 				if (led_source_id == 1) {
@@ -2634,8 +2636,8 @@
 					ipq40xx_led_source_select(led_num, WAN_10_LNK_ACTIVITY);
 				}
 			}
-		#endif
-		#endif
+#endif
+#endif
 		}
 	}
 	return 0;
@@ -2926,8 +2928,10 @@
 	fal_port_rxhdr_mode_set(dev_id, 0, FAL_ALL_TYPE_FRAME_EN);
 #endif
 #ifdef IN_IP
+#ifndef IN_IP_MINI
 	fal_ip_route_status_set(dev_id, A_TRUE);
 #endif
+#endif
 
 	ssdk_flow_default_act_init(dev_id);
 
@@ -2937,8 +2941,10 @@
 	reg_value &= ~2;
 	qca_switch_reg_write(dev_id, 0x0e38, (a_uint8_t *)&reg_value, 4);
 #ifdef IN_IP
+#ifndef IN_IP_MINI
 	fal_ip_vrf_base_addr_set(dev_id, 0, 0);
 #endif
+#endif
 
 	p_api = hsl_api_ptr_get (dev_id);
 	if (p_api && p_api->port_flowctrl_thresh_set)
@@ -3211,19 +3217,19 @@
 {
 	/* ssdk_dt_global->switch_reg_access_mode == HSL_REG_LOCAL_BUS */
 	if(qca_dess_rfs_registered){
-		#if defined (CONFIG_NF_FLOW_COOKIE)
-		#ifdef IN_NAT
-		#ifdef IN_SFE
+#if defined (CONFIG_NF_FLOW_COOKIE)
+#ifdef IN_NAT
+#ifdef IN_SFE
 		sfe_unregister_flow_cookie_cb(ssdk_flow_cookie_set);
-		#endif
-		#endif
-		#endif
-		#ifdef IN_RFS
+#endif
+#endif
+#endif
+#ifdef IN_RFS
 		rfs_ess_device_unregister(&rfs_dev);
 		unregister_inetaddr_notifier(&ssdk_inet_notifier);
-		#if defined(CONFIG_RFS_ACCEL)
-		#endif
-		#endif
+#if defined(CONFIG_RFS_ACCEL)
+#endif
+#endif
 		qca_dess_rfs_registered = false;
 	}
 
@@ -3232,31 +3238,31 @@
 static void qca_dess_rfs_init(void)
 {
 	if (!qca_dess_rfs_registered) {
-		#if defined (CONFIG_NF_FLOW_COOKIE)
-		#ifdef IN_NAT
-		#ifdef IN_SFE
+#if defined (CONFIG_NF_FLOW_COOKIE)
+#ifdef IN_NAT
+#ifdef IN_SFE
 		sfe_register_flow_cookie_cb(ssdk_flow_cookie_set);
-		#endif
-		#endif
-		#endif
+#endif
+#endif
+#endif
 
-		#ifdef IN_RFS
+#ifdef IN_RFS
 		memset(&rfs_dev, 0, sizeof(rfs_dev));
 		rfs_dev.name = NULL;
-		#ifdef IN_FDB
+#ifdef IN_FDB
 		rfs_dev.mac_rule_cb = ssdk_rfs_mac_rule_set;
-		#endif
-		#ifdef IN_IP
+#endif
+#ifdef IN_IP
 		rfs_dev.ip4_rule_cb = ssdk_rfs_ip4_rule_set;
 		rfs_dev.ip6_rule_cb = ssdk_rfs_ip6_rule_set;
-		#endif
+#endif
 		rfs_ess_device_register(&rfs_dev);
-		#if defined(CONFIG_RFS_ACCEL)
-		#endif
+#if defined(CONFIG_RFS_ACCEL)
+#endif
 		ssdk_inet_notifier.notifier_call = ssdk_inet_event;
 		ssdk_inet_notifier.priority = 1;
 		register_inetaddr_notifier(&ssdk_inet_notifier);
-		#endif
+#endif
 		qca_dess_rfs_registered = true;
 	}
 }
@@ -3374,7 +3380,7 @@
 		{
 			case CHIP_ISIS:
 			case CHIP_ISISC:
-			#if defined (ISISC) || defined (ISIS)
+#if defined (ISISC) || defined (ISIS)
 				if (qca_phy_priv_global[dev_id]->ess_switch_flag == A_TRUE) {
 					SSDK_INFO("Initializing ISISC!!\n");
 					rv = ssdk_switch_register(dev_id);
@@ -3382,20 +3388,20 @@
 					rv = qca_ar8327_hw_init(qca_phy_priv_global[dev_id]);
 					SSDK_INFO("Initializing ISISC Done!!\n");
 				}
-			#endif
+#endif
 				break;
 			case CHIP_HPPE:
-			#if defined(HPPE)
+#if defined(HPPE)
 				SSDK_INFO("Initializing HPPE!!\n");
 				qca_hppe_hw_init(&cfg, dev_id);
 				rv = ssdk_switch_register(dev_id);
 				SW_CNTU_ON_ERROR_AND_COND1_OR_GOTO_OUT(rv, -ENODEV);
 				SSDK_INFO("Initializing HPPE Done!!\n");
-			#endif
+#endif
 				break;
 
 			case CHIP_DESS:
-			#if defined(DESS)
+#if defined(DESS)
 				SSDK_INFO("Initializing DESS!!\n");
 
 				qca_dess_hw_init(&cfg, dev_id);
@@ -3406,7 +3412,7 @@
 				rv = ssdk_switch_register(dev_id);
 				SW_CNTU_ON_ERROR_AND_COND1_OR_GOTO_OUT(rv, -ENODEV);
 				SSDK_INFO("Initializing DESS Done!!\n");
-			#endif
+#endif
 				break;
 
 			case CHIP_SHIVA:
diff --git a/src/ref/ref_uci.c b/src/ref/ref_uci.c
index 6b1349f..06224a7 100755
--- a/src/ref/ref_uci.c
+++ b/src/ref/ref_uci.c
@@ -5600,6 +5600,7 @@
 #endif
 
 #ifdef IN_IP
+#ifndef IN_IP_MINI
 static int
 parse_ip_hostentry(struct switch_val *val)
 {
@@ -6788,7 +6789,7 @@
 
 	return rv;
 }
-
+#endif
 #endif
 
 #ifdef IN_NAT
@@ -10925,6 +10926,7 @@
 parse_ip(const char *command_name, struct switch_val *val)
 {
 	int rv = -1;
+#ifndef IN_IP_MINI
 	if(!strcmp(command_name, "Hostentry")) {
 		rv = parse_ip_hostentry(val);
 	} else if(!strcmp(command_name, "Intfentry")) {
@@ -10994,7 +10996,7 @@
 	} else if (!strcmp(command_name, "Hostentry")) {
 		rv = parse_ip_hostentry(val);
 	}
-
+#endif
 	return rv;
 }
 #endif
diff --git a/src/shell_lib/shell_config.c b/src/shell_lib/shell_config.c
index 8a97d80..d049c63 100755
--- a/src/shell_lib/shell_config.c
+++ b/src/shell_lib/shell_config.c
@@ -1051,6 +1051,7 @@
 #ifdef IN_IP
 struct sub_cmd_des_t g_ip_des[] =
 {
+#ifndef IN_IP_MINI
 	{"hostentry", "set", SW_API_IP_HOST_ADD, NULL},
 	{"hostentry", "add", SW_API_IP_HOST_ADD, NULL},
 	{"hostentry", "del", SW_API_IP_HOST_DEL, NULL},
@@ -1093,6 +1094,7 @@
 	{"portarpsg", "set",  SW_API_IP_PORT_ARP_SG_SET, NULL},
 	{"mcmode", "set",  SW_API_IP_VSI_MC_MODE_SET, NULL},
 	{"globalctrl", "set",  SW_API_GLOBAL_CTRL_SET, NULL},
+#endif
 	{NULL, NULL,  (int)NULL, NULL},/*end of desc*/
 };
 #endif
diff --git a/src/shell_lib/shell_io.c b/src/shell_lib/shell_io.c
index 492e64e..661fd79 100755
--- a/src/shell_lib/shell_io.c
+++ b/src/shell_lib/shell_io.c
@@ -7782,7 +7782,7 @@
 	return SW_OK;
 }
 #endif
-#ifdef IN_NAT
+#if defined(IN_IP) || defined(IN_NAT)
 sw_error_t
 cmd_data_check_flow_cookie(char *cmd_str, void * val, a_uint32_t size)
 {