[qca-ssdk] Support more switch chip in ssdk
Fix compile issue in acl_multicast and security module
Add support for s17 chip
Change-Id: I9b6ffefd39fabee8d3fa5b4026df1412f6d04213
Signed-off-by: Zou Shunxiang <shunxian@codeaurora.org>
diff --git a/config b/config
index e1e8494..4da4db8 100755
--- a/config
+++ b/config
@@ -27,7 +27,6 @@
endif
OS_SUB=31
-CHIP_TYPE=ISISC
ifndef OS_VER
OS_VER=2_6
@@ -51,7 +50,7 @@
SYS_PATH=/disk/ap81fus/sw/linux/kernels/mips-linux-2.6.15
endif
ifeq ($(ARCH), mips)
- CPU_CFLAG=-Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB -D$(BOARD_NAME)
+ CPU_CFLAG=-Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-common -fno-strict-aliasing -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB -D$(BOARD_NAME)
endif
@@ -94,7 +93,7 @@
FAL=TRUE
#CHIP_TYPE can be defined as ATHENA, GARUDA, SHIVA, HORUS, ISIS, ISISC and ALL_CHIP(ALL_CHIP means GARUDA, SHIVA, HORUS and ISIS)
-CHIP_TYPE=ISISC
+CHIP_TYPE=ALL_CHIP
#UK_IF=FALSE or not define UK_IF, UK_IF will not be included in SSDK
#when UK_IF=TRUE one of UK_NETLINK,UK_IOCTL must be defined as TRUE
diff --git a/ko_Makefile b/ko_Makefile
index b88dac3..5cfb1f3 100755
--- a/ko_Makefile
+++ b/ko_Makefile
@@ -1,9 +1,3 @@
obj-m := qca-ssdk.o
-OBJ_LIST:=$(wildcard ./*.o)
-QCA_SSDK_BASE_OBJ := api_access.o hsl_port_prop.o isisc_igmp.o isisc_led.o isisc_sec.o isisc_nat.o isisc_reg_access.o sd.o f1_phy.o isisc_acl.o isisc_init.o isisc_mib.o isisc_port_ctrl.o isisc_stp.o ssdk_init.o hsl_acl.o isisc_acl_parse.o isisc_interface_ctrl.o isisc_mirror.o isisc_portvlan.o isisc_trunk.o hsl_api.o isisc_cosmap.o isisc_ip.o isisc_misc.o isisc_qos.o isisc_vlan.o sw_api_ks_ioctl.o hsl_dev.o isisc_fdb.o isisc_leaky.o isisc_multicast_acl.o isisc_rate.o util.o fal_acl.o fal_interface_ctrl.o fal_mirror.o fal_qos.o fal_trunk.o fal_cosmap.o fal_ip.o fal_misc.o fal_rate.o fal_vlan.o fal_fdb.o fal_leaky.o fal_nat.o fal_reg_access.o fal_igmp.o fal_led.o fal_port_ctrl.o fal_sec.o fal_init.o fal_mib.o fal_portvlan.o fal_stp.o ref_vlan.o ref_fdb.o ref_mib.o ref_port_ctrl.o ref_misc.o ref_uci.o \
- shell.o shell_sw.o shell_config.o shell_io.o
-ifeq ($(HNAT_FEATURE), enable)
-HNAT_OBJ := host_helper.o nat_helper_hsl.o napt_helper.o nat_helper.o nat_helper_dt.o nat_ipt_helper.o napt_acl.o napt_procfs.o
-endif
-
-qca-ssdk-objs := $(QCA_SSDK_BASE_OBJ) $(HNAT_OBJ)
+OBJ_LIST:=$(notdir $(wildcard $(PRJ_PATH)/temp/*.o))
+qca-ssdk-objs := $(OBJ_LIST)
diff --git a/make/config.mk b/make/config.mk
index 4a55061..4c14738 100755
--- a/make/config.mk
+++ b/make/config.mk
@@ -55,7 +55,7 @@
ifneq (TRUE, $(FAL))
$(error FAL must be TRUE when CHIP_TYPE is defined as ALL_CHIP!)
endif
- SUPPORT_CHIP = GARUDA SHIVA HORUS ISIS ISISC
+ SUPPORT_CHIP = ISIS ISISC
endif
ifndef SUPPORT_CHIP
diff --git a/src/api/api_access.c b/src/api/api_access.c
index 467d135..f517008 100755
--- a/src/api/api_access.c
+++ b/src/api/api_access.c
@@ -14,125 +14,8 @@
#include "sw.h"
#include "fal.h"
-#if (defined(KERNEL_MODULE))
#include "hsl.h"
#include "hsl_dev.h"
-#if defined ATHENA
-#include "fal_igmp.h"
-#include "fal_leaky.h"
-#include "athena_mib.h"
-#include "athena_port_ctrl.h"
-#include "athena_portvlan.h"
-#include "athena_fdb.h"
-#include "athena_vlan.h"
-#include "athena_init.h"
-#include "athena_reg_access.h"
-#include "athena_reg.h"
-#elif defined GARUDA
-#include "garuda_mib.h"
-#include "garuda_qos.h"
-#include "garuda_rate.h"
-#include "garuda_port_ctrl.h"
-#include "garuda_portvlan.h"
-#include "garuda_fdb.h"
-#include "garuda_vlan.h"
-#include "garuda_mirror.h"
-#include "garuda_stp.h"
-#include "garuda_misc.h"
-#include "garuda_leaky.h"
-#include "garuda_igmp.h"
-#include "garuda_acl.h"
-#include "garuda_led.h"
-#include "garuda_init.h"
-#include "garuda_reg_access.h"
-#include "garuda_reg.h"
-#elif defined SHIVA
-#include "shiva_mib.h"
-#include "shiva_qos.h"
-#include "shiva_rate.h"
-#include "shiva_port_ctrl.h"
-#include "shiva_portvlan.h"
-#include "shiva_fdb.h"
-#include "shiva_vlan.h"
-#include "shiva_mirror.h"
-#include "shiva_stp.h"
-#include "shiva_misc.h"
-#include "shiva_leaky.h"
-#include "shiva_igmp.h"
-#include "shiva_acl.h"
-#include "shiva_led.h"
-#include "shiva_init.h"
-#include "shiva_reg_access.h"
-#include "shiva_reg.h"
-#elif defined HORUS
-#include "horus_mib.h"
-#include "horus_qos.h"
-#include "horus_rate.h"
-#include "horus_port_ctrl.h"
-#include "horus_portvlan.h"
-#include "horus_fdb.h"
-#include "horus_vlan.h"
-#include "horus_mirror.h"
-#include "horus_stp.h"
-#include "horus_misc.h"
-#include "horus_leaky.h"
-#include "horus_igmp.h"
-#include "horus_led.h"
-#include "horus_init.h"
-#include "horus_reg_access.h"
-#include "horus_reg.h"
-#elif defined ISIS
-#include "isis_mib.h"
-#include "isis_qos.h"
-#include "isis_cosmap.h"
-#include "isis_rate.h"
-#include "isis_port_ctrl.h"
-#include "isis_portvlan.h"
-#include "isis_fdb.h"
-#include "isis_vlan.h"
-#include "isis_mirror.h"
-#include "isis_stp.h"
-#include "isis_misc.h"
-#include "isis_leaky.h"
-#include "isis_igmp.h"
-#include "isis_acl.h"
-#include "isis_led.h"
-#include "isis_cosmap.h"
-#include "isis_ip.h"
-#include "isis_nat.h"
-#include "isis_trunk.h"
-#include "isis_sec.h"
-#include "isis_interface_ctrl.h"
-#include "isis_init.h"
-#include "isis_reg_access.h"
-#include "isis_reg.h"
-#elif defined ISISC
-#include "isisc_mib.h"
-#include "isisc_qos.h"
-#include "isisc_cosmap.h"
-#include "isisc_rate.h"
-#include "isisc_port_ctrl.h"
-#include "isisc_portvlan.h"
-#include "isisc_fdb.h"
-#include "isisc_vlan.h"
-#include "isisc_mirror.h"
-#include "isisc_stp.h"
-#include "isisc_misc.h"
-#include "isisc_leaky.h"
-#include "isisc_igmp.h"
-#include "isisc_acl.h"
-#include "isisc_led.h"
-#include "isisc_cosmap.h"
-#include "isisc_ip.h"
-#include "isisc_nat.h"
-#include "isisc_trunk.h"
-#include "isisc_sec.h"
-#include "isisc_interface_ctrl.h"
-#include "isisc_init.h"
-#include "isisc_reg_access.h"
-#include "isisc_reg.h"
-#endif
-#endif
#include "sw_api.h"
#include "api_desc.h"
diff --git a/src/hsl/isis/isis_multicast_acl.c b/src/hsl/isis/isis_multicast_acl.c
index fe555ef..b7f58dd 100755
--- a/src/hsl/isis/isis_multicast_acl.c
+++ b/src/hsl/isis/isis_multicast_acl.c
@@ -102,6 +102,9 @@
fal_igmp_sg_entry_t entry; //Stores the specific ACL rule info
} multi_acl_info_t;
#endif
+
+static a_uint32_t rule_nr=1;
+
void
isis_multicast_init(a_uint32_t dev_id);
diff --git a/src/hsl/isis/isis_reg_access.c b/src/hsl/isis/isis_reg_access.c
index d1158e6..9aa8efc 100755
--- a/src/hsl/isis/isis_reg_access.c
+++ b/src/hsl/isis/isis_reg_access.c
@@ -143,6 +143,7 @@
if (value_len != sizeof (a_uint32_t))
return SW_BAD_LEN;
+#if 0
/* change reg_addr to 16-bit word address, 32-bit aligned */
reg_word_addr = (reg_addr & 0xfffffffc) >> 1;
@@ -182,6 +183,9 @@
SW_RTN_ON_ERROR(rv);
reg_val |= (((a_uint32_t)tmp_val) << 16);
+#else
+ reg_val = qca_ar8216_mii_read(reg_addr);
+#endif
aos_mem_copy(value, ®_val, sizeof (a_uint32_t));
return SW_OK;
@@ -202,6 +206,7 @@
aos_mem_copy(®_val, value, sizeof (a_uint32_t));
+#if 0
/* change reg_addr to 16-bit word address, 32-bit aligned */
reg_word_addr = (reg_addr & 0xfffffffc) >> 1;
@@ -242,6 +247,9 @@
rv = sd_reg_mdio_set(dev_id, phy_addr, phy_reg, phy_val);
SW_RTN_ON_ERROR(rv);
+#else
+ qca_ar8216_mii_write(reg_addr, reg_val);
+#endif
return SW_OK;
}
diff --git a/src/hsl/isis/isis_sec.c b/src/hsl/isis/isis_sec.c
index d9cb2ca..b6ee68e 100755
--- a/src/hsl/isis/isis_sec.c
+++ b/src/hsl/isis/isis_sec.c
@@ -426,7 +426,7 @@
case FAL_NROM_IP4_INVALID_HL_CMD:
addr = NORM_CTRL0_ADDR;
- offset = 2;
+ offset = 3;
break;
case FAL_NROM_IP4_HDR_OPTIONS_CMD: