[qca-ssdk]: Reduce image size by module MACRO
Reduce image size by module MACRO.
Change-Id: Id6d4d66a9dd4924325c9cb65925eed40185dbfa4
Signed-off-by: xiaofeis <xiaofeis@codeaurora.org>
diff --git a/config b/config
index 6dcabbc..cbcd60c 100755
--- a/config
+++ b/config
@@ -145,20 +145,27 @@
#IN_X=FALSE or not define IN_X, X will not be included in SSDK
IN_ACL=TRUE
IN_FDB=TRUE
+IN_FDB_MINI=FALSE
IN_IGMP=TRUE
IN_LEAKY=TRUE
IN_LED=TRUE
IN_MIB=TRUE
IN_MIRROR=TRUE
IN_MISC=TRUE
+IN_MISC_MINI=FALSE
IN_PORTCONTROL=TRUE
+IN_PORTCONTROL_MINI=FALSE
IN_PORTVLAN=TRUE
+IN_PORTVLAN_MINI=FALSE
IN_QOS=TRUE
+IN_QOS_MINI=FALSE
IN_RATE=TRUE
IN_STP=TRUE
IN_VLAN=TRUE
+IN_VLAN_MINI=FALSE
IN_REDUCED_ACL=FALSE
IN_COSMAP=TRUE
+IN_COSMAP_MINI=FALSE
IN_IP=TRUE
IN_NAT=TRUE
IN_TRUNK=TRUE
@@ -175,3 +182,4 @@
endif
IN_INTERFACECONTROL=TRUE
IN_MACBLOCK=FALSE
+IN_MALIBU_PHY=TRUE
diff --git a/include/api/sw_api.h b/include/api/sw_api.h
index 3788dda..c071114 100755
--- a/include/api/sw_api.h
+++ b/include/api/sw_api.h
@@ -139,7 +139,6 @@
a_uint16_t data_size;
a_uint8_t data_type;
a_uint8_t param_type;
- a_uint8_t param_name[20];
} sw_api_param_t;
typedef struct
diff --git a/include/fal/fal_api.h b/include/fal/fal_api.h
index 0a2a054..c01d712 100755
--- a/include/fal/fal_api.h
+++ b/include/fal/fal_api.h
@@ -22,6 +22,7 @@
#endif /* __cplusplus */
#ifdef IN_PORTCONTROL
+#ifndef IN_PORTCONTROL_MINI
#define PORTCONTROL_API \
SW_API_DEF(SW_API_PT_DUPLEX_GET, fal_port_duplex_get), \
SW_API_DEF(SW_API_PT_DUPLEX_SET, fal_port_duplex_set), \
@@ -173,6 +174,30 @@
SW_API_DESC(SW_API_PT_COUNTER_SET) \
SW_API_DESC(SW_API_PT_COUNTER_GET) \
SW_API_DESC(SW_API_PT_COUNTER_SHOW)
+
+#else
+#define PORTCONTROL_API \
+ SW_API_DEF(SW_API_PT_DUPLEX_SET, fal_port_duplex_set), \
+ SW_API_DEF(SW_API_PT_SPEED_SET, fal_port_speed_set), \
+ SW_API_DEF(SW_API_PT_TXHDR_SET, fal_port_txhdr_mode_set), \
+ SW_API_DEF(SW_API_PT_RXHDR_SET, fal_port_rxhdr_mode_set), \
+ SW_API_DEF(SW_API_HEADER_TYPE_SET, fal_header_type_set), \
+ SW_API_DEF(SW_API_TXMAC_STATUS_SET, fal_port_txmac_status_set), \
+ SW_API_DEF(SW_API_RXMAC_STATUS_SET, fal_port_rxmac_status_set), \
+ SW_API_DEF(SW_API_TXFC_STATUS_SET, fal_port_txfc_status_set), \
+ SW_API_DEF(SW_API_RXFC_STATUS_SET, fal_port_rxfc_status_set),
+
+#define PORTCONTROL_API_PARAM \
+ SW_API_DESC(SW_API_PT_DUPLEX_SET) \
+ SW_API_DESC(SW_API_PT_SPEED_SET) \
+ SW_API_DESC(SW_API_PT_TXHDR_SET) \
+ SW_API_DESC(SW_API_PT_RXHDR_SET) \
+ SW_API_DESC(SW_API_HEADER_TYPE_SET) \
+ SW_API_DESC(SW_API_TXMAC_STATUS_SET) \
+ SW_API_DESC(SW_API_RXMAC_STATUS_SET) \
+ SW_API_DESC(SW_API_TXFC_STATUS_SET) \
+ SW_API_DESC(SW_API_RXFC_STATUS_SET)
+#endif
#else
#define PORTCONTROL_API
@@ -215,6 +240,7 @@
#endif
#ifdef IN_PORTVLAN
+#ifndef IN_PORTVLAN_MINI
#define PORTVLAN_API \
SW_API_DEF(SW_API_PT_ING_MODE_GET, fal_port_1qmode_get), \
SW_API_DEF(SW_API_PT_ING_MODE_SET, fal_port_1qmode_set), \
@@ -310,12 +336,47 @@
SW_API_DESC(SW_API_EG_FLTR_BYPASS_EN_GET) \
SW_API_DESC(SW_API_PT_VRF_ID_SET) \
SW_API_DESC(SW_API_PT_VRF_ID_GET)
+
+#else
+#define PORTVLAN_API \
+ SW_API_DEF(SW_API_PT_ING_MODE_SET, fal_port_1qmode_set), \
+ SW_API_DEF(SW_API_PT_EG_MODE_SET, fal_port_egvlanmode_set), \
+ SW_API_DEF(SW_API_PT_VLAN_MEM_ADD, fal_portvlan_member_add), \
+ SW_API_DEF(SW_API_PT_VLAN_MEM_DEL, fal_portvlan_member_del), \
+ SW_API_DEF(SW_API_PT_VLAN_MEM_UPDATE, fal_portvlan_member_update), \
+ SW_API_DEF(SW_API_PT_DEF_VID_SET, fal_port_default_vid_set), \
+ SW_API_DEF(SW_API_PT_FORCE_DEF_VID_SET, fal_port_force_default_vid_set), \
+ SW_API_DEF(SW_API_PT_FORCE_PORTVLAN_SET, fal_port_force_portvlan_set), \
+ SW_API_DEF(SW_API_PT_NESTVLAN_SET, fal_port_nestvlan_set), \
+ SW_API_DEF(SW_API_NESTVLAN_TPID_SET, fal_nestvlan_tpid_set), \
+ SW_API_DEF(SW_API_PT_IN_VLAN_MODE_SET, fal_port_invlan_mode_set), \
+ SW_API_DEF(SW_API_PT_DEF_SVID_SET, fal_port_default_svid_set), \
+ SW_API_DEF(SW_API_PT_DEF_CVID_SET, fal_port_default_cvid_set),
+
+#define PORTVLAN_API_PARAM \
+ SW_API_DESC(SW_API_PT_ING_MODE_SET) \
+ SW_API_DESC(SW_API_PT_EG_MODE_SET) \
+ SW_API_DESC(SW_API_PT_VLAN_MEM_ADD) \
+ SW_API_DESC(SW_API_PT_VLAN_MEM_DEL) \
+ SW_API_DESC(SW_API_PT_VLAN_MEM_UPDATE) \
+ SW_API_DESC(SW_API_PT_DEF_VID_SET) \
+ SW_API_DESC(SW_API_PT_FORCE_DEF_VID_SET) \
+ SW_API_DESC(SW_API_PT_FORCE_PORTVLAN_SET) \
+ SW_API_DESC(SW_API_PT_NESTVLAN_SET) \
+ SW_API_DESC(SW_API_NESTVLAN_TPID_SET) \
+ SW_API_DESC(SW_API_PT_IN_VLAN_MODE_SET) \
+ SW_API_DESC(SW_API_PT_DEF_SVID_SET) \
+ SW_API_DESC(SW_API_PT_DEF_CVID_SET)
+
+#endif
+
#else
#define PORTVLAN_API
#define PORTVLAN_API_PARAM
#endif
#ifdef IN_FDB
+#ifndef IN_FDB_MINI
#define FDB_API \
SW_API_DEF(SW_API_FDB_ADD, fal_fdb_add), \
SW_API_DEF(SW_API_FDB_DELALL, fal_fdb_del_all), \
@@ -394,6 +455,14 @@
SW_API_DESC(SW_API_FDB_RFS_SET) \
SW_API_DESC(SW_API_FDB_RFS_DEL)
#else
+#define FDB_API \
+ SW_API_DEF(SW_API_FDB_PT_LEARN_SET, fal_fdb_port_learn_set),
+
+#define FDB_API_PARAM \
+ SW_API_DESC(SW_API_FDB_PT_LEARN_SET)
+
+#endif
+#else
#define FDB_API
#define FDB_API_PARAM
#endif
@@ -443,6 +512,7 @@
#endif
#ifdef IN_QOS
+#ifndef IN_QOS_MINI
#define QOS_API \
SW_API_DEF(SW_API_QOS_SCH_MODE_SET, fal_qos_sch_mode_set), \
SW_API_DEF(SW_API_QOS_SCH_MODE_GET, fal_qos_sch_mode_get), \
@@ -519,6 +589,15 @@
SW_API_DESC(SW_API_QOS_QUEUE_REMARK_SET) \
SW_API_DESC(SW_API_QOS_QUEUE_REMARK_GET)
#else
+#define QOS_API \
+ SW_API_DEF(SW_API_QOS_PT_MODE_SET, fal_qos_port_mode_set),
+
+
+#define QOS_API_PARAM \
+ SW_API_DESC(SW_API_QOS_PT_MODE_SET)
+
+#endif
+#else
#define QOS_API
#define QOS_API_PARAM
#endif
@@ -726,6 +805,7 @@
#endif
#ifdef IN_MISC
+#ifndef IN_MISC_MINI
#define MISC_API \
SW_API_DEF(SW_API_ARP_STATUS_SET, fal_arp_status_set), \
SW_API_DEF(SW_API_ARP_STATUS_GET, fal_arp_status_get), \
@@ -857,7 +937,26 @@
SW_API_DESC(SW_API_LLDP_STATUS_GET) \
SW_API_DESC(SW_API_FRAME_CRC_RESERVE_SET) \
SW_API_DESC(SW_API_FRAME_CRC_RESERVE_GET)
+#else
+#define MISC_API \
+ SW_API_DEF(SW_API_PT_UNK_SA_CMD_SET, fal_port_unk_sa_cmd_set), \
+ SW_API_DEF(SW_API_PT_UNK_UC_FILTER_SET, fal_port_unk_uc_filter_set), \
+ SW_API_DEF(SW_API_PT_UNK_MC_FILTER_SET, fal_port_unk_mc_filter_set), \
+ SW_API_DEF(SW_API_PT_BC_FILTER_SET, fal_port_bc_filter_set), \
+ SW_API_DEF(SW_API_EAPOL_STATUS_SET, fal_eapol_status_set), \
+ SW_API_DEF(SW_API_EAPOL_CMD_SET, fal_eapol_cmd_set), \
+ SW_API_DEF(SW_API_CPU_PORT_STATUS_SET, fal_cpu_port_status_set),
+
+#define MISC_API_PARAM \
+ SW_API_DESC(SW_API_PT_UNK_SA_CMD_SET) \
+ SW_API_DESC(SW_API_PT_UNK_UC_FILTER_SET) \
+ SW_API_DESC(SW_API_PT_UNK_MC_FILTER_SET) \
+ SW_API_DESC(SW_API_PT_BC_FILTER_SET) \
+ SW_API_DESC(SW_API_EAPOL_CMD_SET) \
+ SW_API_DESC(SW_API_EAPOL_STATUS_SET) \
+ SW_API_DESC(SW_API_CPU_PORT_STATUS_SET)
+#endif
#else
#define MISC_API
@@ -878,6 +977,7 @@
#endif
#ifdef IN_COSMAP
+#ifndef IN_COSMAP_MINI
#define COSMAP_API \
SW_API_DEF(SW_API_COSMAP_DSCP_TO_PRI_SET, fal_cosmap_dscp_to_pri_set), \
SW_API_DEF(SW_API_COSMAP_DSCP_TO_PRI_GET, fal_cosmap_dscp_to_pri_get), \
@@ -926,6 +1026,15 @@
SW_API_DESC(SW_API_COSMAP_UP_TO_EHDP_SET) \
SW_API_DESC(SW_API_COSMAP_UP_TO_EHDP_GET)
#else
+#define COSMAP_API \
+ SW_API_DEF(SW_API_COSMAP_PRI_TO_QU_SET, fal_cosmap_pri_to_queue_set), \
+ SW_API_DEF(SW_API_COSMAP_PRI_TO_EHQU_SET, fal_cosmap_pri_to_ehqueue_set),
+
+#define COSMAP_API_PARAM \
+ SW_API_DESC(SW_API_COSMAP_PRI_TO_QU_SET) \
+ SW_API_DESC(SW_API_COSMAP_PRI_TO_EHQU_SET)
+#endif
+#else
#define COSMAP_API
#define COSMAP_API_PARAM
#endif
diff --git a/include/fal/fal_cosmap.h b/include/fal/fal_cosmap.h
index 67edfb1..ae4e188 100755
--- a/include/fal/fal_cosmap.h
+++ b/include/fal/fal_cosmap.h
@@ -40,6 +40,7 @@
a_uint8_t y_dei;
} fal_egress_remark_table_t;
+#ifndef IN_COSMAP_MINI
sw_error_t
fal_cosmap_dscp_to_pri_set(a_uint32_t dev_id, a_uint32_t dscp,
a_uint32_t pri);
@@ -103,20 +104,20 @@
sw_error_t
fal_cosmap_up_to_ehdp_get(a_uint32_t dev_id, a_uint32_t up,
a_uint32_t * dp);
-
+#endif
sw_error_t
fal_cosmap_pri_to_queue_set(a_uint32_t dev_id, a_uint32_t pri,
a_uint32_t queue);
+ sw_error_t
+ fal_cosmap_pri_to_ehqueue_set(a_uint32_t dev_id, a_uint32_t pri,
+ a_uint32_t queue);
+#ifndef IN_COSMAP_MINI
sw_error_t
fal_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri,
a_uint32_t * queue);
sw_error_t
- fal_cosmap_pri_to_ehqueue_set(a_uint32_t dev_id, a_uint32_t pri,
- a_uint32_t queue);
-
- sw_error_t
fal_cosmap_pri_to_ehqueue_get(a_uint32_t dev_id, a_uint32_t pri,
a_uint32_t * queue);
@@ -127,6 +128,7 @@
sw_error_t
fal_cosmap_egress_remark_get(a_uint32_t dev_id, a_uint32_t tbl_id,
fal_egress_remark_table_t * tbl);
+#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/include/fal/fal_fdb.h b/include/fal/fal_fdb.h
index 223afd2..e229173 100755
--- a/include/fal/fal_fdb.h
+++ b/include/fal/fal_fdb.h
@@ -94,6 +94,7 @@
INVALID_VLAN_IVL
} fal_fdb_smode;
+#ifndef IN_FDB_MINI
sw_error_t
fal_fdb_add(a_uint32_t dev_id, const fal_fdb_entry_t * entry);
@@ -103,12 +104,13 @@
sw_error_t
fal_fdb_rfs_del(a_uint32_t dev_id, const fal_fdb_rfs_t * entry);
+#endif
sw_error_t
fal_fdb_del_all(a_uint32_t dev_id, a_uint32_t flag);
-
+#ifndef IN_FDB_MINI
sw_error_t
fal_fdb_del_by_port(a_uint32_t dev_id, a_uint32_t port_id, a_uint32_t flag);
@@ -116,14 +118,14 @@
sw_error_t
fal_fdb_del_by_mac(a_uint32_t dev_id, const fal_fdb_entry_t *entry);
-
+#endif
sw_error_t
fal_fdb_first(a_uint32_t dev_id, fal_fdb_entry_t * entry);
-
+#ifndef IN_FDB_MINI
sw_error_t
fal_fdb_next(a_uint32_t dev_id, fal_fdb_entry_t * entry);
@@ -131,14 +133,14 @@
sw_error_t
fal_fdb_find(a_uint32_t dev_id, fal_fdb_entry_t * entry);
-
+#endif
sw_error_t
fal_fdb_port_learn_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
-
+#ifndef IN_FDB_MINI
sw_error_t
fal_fdb_port_learn_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable);
@@ -168,7 +170,7 @@
sw_error_t
fal_fdb_age_time_get(a_uint32_t dev_id, a_uint32_t * time);
-
+#endif
sw_error_t
fal_fdb_iterate(a_uint32_t dev_id, a_uint32_t * iterator, fal_fdb_entry_t * entry);
@@ -183,7 +185,7 @@
fal_fdb_extend_first(a_uint32_t dev_id, fal_fdb_op_t * option,
fal_fdb_entry_t * entry);
-
+#ifndef IN_FDB_MINI
sw_error_t
fal_fdb_transfer(a_uint32_t dev_id, fal_port_t old_port, fal_port_t new_port,
a_uint32_t fid, fal_fdb_op_t * option);
@@ -253,6 +255,7 @@
sw_error_t
fal_fdb_port_del(a_uint32_t dev_id, a_uint32_t fid, fal_mac_addr_t * addr, fal_port_t port_id);
+#endif
#ifdef __cplusplus
}
diff --git a/include/fal/fal_misc.h b/include/fal/fal_misc.h
index fd91c48..914f897 100755
--- a/include/fal/fal_misc.h
+++ b/include/fal/fal_misc.h
@@ -47,13 +47,13 @@
/* define switch interrupt type bitmap */
#define FAL_SWITCH_INTR_LINK_STATUS 0x1 /* up/down/speed/duplex status */
-
+#ifndef IN_MISC_MINI
sw_error_t fal_arp_status_set(a_uint32_t dev_id, a_bool_t enable);
sw_error_t fal_arp_status_get(a_uint32_t dev_id, a_bool_t * enable);
-
+#endif
sw_error_t fal_frame_max_size_set(a_uint32_t dev_id, a_uint32_t size);
@@ -68,43 +68,32 @@
fal_port_unk_sa_cmd_set(a_uint32_t dev_id, fal_port_t port_id,
fal_fwd_cmd_t cmd);
+ sw_error_t
+ fal_port_unk_uc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable);
+ sw_error_t
+ fal_port_unk_mc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable);
+
+ sw_error_t
+ fal_port_bc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable);
sw_error_t
fal_port_unk_sa_cmd_get(a_uint32_t dev_id, fal_port_t port_id,
fal_fwd_cmd_t * cmd);
-
-
- sw_error_t
- fal_port_unk_uc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable);
-
-
-
sw_error_t
fal_port_unk_uc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable);
-
-
- sw_error_t
- fal_port_unk_mc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable);
-
-
-
sw_error_t
fal_port_unk_mc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable);
sw_error_t
- fal_port_bc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable);
-
-
- sw_error_t
fal_port_bc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable);
@@ -113,7 +102,7 @@
fal_cpu_port_status_set(a_uint32_t dev_id, a_bool_t enable);
-
+#ifndef IN_MISC_MINI
sw_error_t
fal_cpu_port_status_get(a_uint32_t dev_id, a_bool_t * enable);
@@ -164,12 +153,12 @@
sw_error_t
fal_arp_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd);
-
+#endif
sw_error_t
fal_eapol_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd);
-
+#ifndef IN_MISC_MINI
sw_error_t
fal_eapol_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd);
@@ -184,10 +173,10 @@
sw_error_t
fal_pppoe_session_get(a_uint32_t dev_id, a_uint32_t session_id, a_bool_t * strip_hdr);
-
+#endif
sw_error_t
fal_eapol_status_set(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t enable);
-
+#ifndef IN_MISC_MINI
sw_error_t
fal_eapol_status_get(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t * enable);
@@ -311,6 +300,7 @@
sw_error_t
fal_frame_crc_reserve_get(a_uint32_t dev_id, a_bool_t * enable);
+#endif
#ifdef __cplusplus
}
diff --git a/include/fal/fal_port_ctrl.h b/include/fal/fal_port_ctrl.h
index 162e3d0..0a68623 100755
--- a/include/fal/fal_port_ctrl.h
+++ b/include/fal/fal_port_ctrl.h
@@ -244,7 +244,7 @@
sw_error_t
fal_port_speed_get(a_uint32_t dev_id, fal_port_t port_id,
fal_port_speed_t * pspeed);
-
+#ifndef IN_PORTCONTROL_MINI
sw_error_t
fal_port_autoneg_status_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * status);
@@ -272,19 +272,10 @@
a_bool_t * enable);
sw_error_t
- fal_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable);
-
- sw_error_t
fal_port_flowctrl_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable);
sw_error_t
- fal_port_flowctrl_forcemode_set(a_uint32_t dev_id,
- fal_port_t port_id,
- a_bool_t enable);
-
- sw_error_t
fal_port_flowctrl_forcemode_get(a_uint32_t dev_id,
fal_port_t port_id,
a_bool_t * enable);
@@ -309,7 +300,16 @@
fal_port_cdt(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t mdi_pair, fal_cable_status_t * cable_status,
a_uint32_t * cable_len);
+#endif
+ sw_error_t
+ fal_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable);
+
+ sw_error_t
+ fal_port_flowctrl_forcemode_set(a_uint32_t dev_id,
+ fal_port_t port_id,
+ a_bool_t enable);
sw_error_t
fal_port_rxhdr_mode_set(a_uint32_t dev_id, fal_port_t port_id,
fal_port_header_mode_t mode);
@@ -366,6 +366,10 @@
fal_port_rxfc_status_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable);
+ sw_error_t
+ fal_port_link_status_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * status);
+#ifndef IN_PORTCONTROL_MINI
sw_error_t
fal_port_bp_status_set(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t enable);
@@ -383,10 +387,6 @@
a_bool_t * enable);
sw_error_t
- fal_port_link_status_get(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * status);
-
- sw_error_t
fal_ports_link_status_get(a_uint32_t dev_id, a_uint32_t * status);
sw_error_t
@@ -519,6 +519,7 @@
sw_error_t
fal_port_counter_show (a_uint32_t dev_id, fal_port_t port_id,
fal_port_counter_info_t * counter_info);
+#endif
#ifdef __cplusplus
}
diff --git a/include/fal/fal_portvlan.h b/include/fal/fal_portvlan.h
index d8f4f9c..cc0b159 100755
--- a/include/fal/fal_portvlan.h
+++ b/include/fal/fal_portvlan.h
@@ -118,24 +118,24 @@
fal_pt_1qmode_t port_1qmode);
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
fal_port_1qmode_get(a_uint32_t dev_id, fal_port_t port_id,
fal_pt_1qmode_t * pport_1qmode);
-
+#endif
sw_error_t
fal_port_egvlanmode_set(a_uint32_t dev_id, fal_port_t port_id,
fal_pt_1q_egmode_t port_egvlanmode);
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
fal_port_egvlanmode_get(a_uint32_t dev_id, fal_port_t port_id,
fal_pt_1q_egmode_t * pport_egvlanmode);
-
+#endif
sw_error_t
fal_portvlan_member_add(a_uint32_t dev_id, fal_port_t port_id,
@@ -154,11 +154,11 @@
fal_pbmp_t mem_port_map);
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
fal_portvlan_member_get(a_uint32_t dev_id, fal_port_t port_id,
fal_pbmp_t * mem_port_map);
-
+#endif
sw_error_t
@@ -166,23 +166,23 @@
a_uint32_t vid);
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
fal_port_default_vid_get(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * vid);
-
+#endif
sw_error_t
fal_port_force_default_vid_set(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t enable);
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
fal_port_force_default_vid_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable);
-
+#endif
sw_error_t
@@ -190,47 +190,48 @@
a_bool_t enable);
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
fal_port_force_portvlan_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable);
-
+#endif
sw_error_t
fal_port_nestvlan_set(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t enable);
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
fal_port_nestvlan_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable);
-
+#endif
sw_error_t
fal_nestvlan_tpid_set(a_uint32_t dev_id, a_uint32_t tpid);
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
fal_nestvlan_tpid_get(a_uint32_t dev_id, a_uint32_t * tpid);
-
+#endif
sw_error_t
fal_port_invlan_mode_set(a_uint32_t dev_id, fal_port_t port_id,
fal_pt_invlan_mode_t mode);
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
fal_port_invlan_mode_get(a_uint32_t dev_id, fal_port_t port_id,
fal_pt_invlan_mode_t * mode);
-
-
- sw_error_t
+#endif
+ sw_error_t
fal_port_tls_set(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t enable);
+#ifndef IN_PORTVLAN_MINI
+
sw_error_t
@@ -246,32 +247,34 @@
sw_error_t
fal_port_pri_propagation_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable);
-
+#endif
sw_error_t
fal_port_default_svid_set(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t vid);
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
fal_port_default_svid_get(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * vid);
-
+#endif
sw_error_t
fal_port_default_cvid_set(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t vid);
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
fal_port_default_cvid_get(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * vid);
-
-
- sw_error_t
+#endif
+ sw_error_t
fal_port_vlan_propagation_set(a_uint32_t dev_id, fal_port_t port_id,
fal_vlan_propagation_mode_t mode);
+#ifndef IN_PORTVLAN_MINI
+
+
sw_error_t
fal_port_vlan_propagation_get(a_uint32_t dev_id, fal_port_t port_id,
@@ -339,7 +342,7 @@
sw_error_t
fal_port_vrf_id_get(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * vrf_id);
-
+#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/include/fal/fal_qos.h b/include/fal/fal_qos.h
index e43cead..42a005b 100755
--- a/include/fal/fal_qos.h
+++ b/include/fal/fal_qos.h
@@ -58,7 +58,7 @@
#define FAL_DSCP_MIN 0
#define FAL_DSCP_MAX 63
-
+#ifndef IN_QOS_MINI
sw_error_t
fal_qos_sch_mode_set(a_uint32_t dev_id,
fal_sch_mode_t mode, const a_uint32_t weight[]);
@@ -83,12 +83,6 @@
sw_error_t
- fal_qos_queue_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
- fal_queue_t queue_id, a_uint32_t * number);
-
-
-
- sw_error_t
fal_qos_queue_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
fal_queue_t queue_id, a_uint32_t * number);
@@ -104,9 +98,7 @@
fal_qos_port_tx_buf_status_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable);
- sw_error_t
- fal_qos_port_red_en_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable);
+
sw_error_t
@@ -114,9 +106,7 @@
a_bool_t * enable);
- sw_error_t
- fal_qos_port_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * number);
+
@@ -124,10 +114,6 @@
fal_qos_port_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * number);
- sw_error_t
- fal_qos_port_rx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * number);
-
sw_error_t
fal_qos_port_rx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
@@ -155,31 +141,45 @@
sw_error_t
fal_cosmap_dscp_queue_get(a_uint32_t dev_id, a_uint32_t dscp,
fal_queue_t * queue);
+#endif
+ sw_error_t
+ fal_qos_port_rx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * number);
-
+ sw_error_t
+ fal_qos_port_red_en_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable);
sw_error_t
fal_qos_port_mode_set(a_uint32_t dev_id, fal_port_t port_id,
fal_qos_mode_t mode, a_bool_t enable);
+ sw_error_t
+ fal_qos_port_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * number);
+
- sw_error_t
+ sw_error_t
+ fal_qos_queue_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
+ fal_queue_t queue_id, a_uint32_t * number);
+
+#ifndef IN_QOS_MINI
+sw_error_t
fal_qos_port_mode_get(a_uint32_t dev_id, fal_port_t port_id,
fal_qos_mode_t mode, a_bool_t * enable);
-
-
+#endif
sw_error_t
fal_qos_port_mode_pri_set(a_uint32_t dev_id, fal_port_t port_id,
fal_qos_mode_t mode, a_uint32_t pri);
-
+#ifndef IN_QOS_MINI
sw_error_t
fal_qos_port_mode_pri_get(a_uint32_t dev_id, fal_port_t port_id,
fal_qos_mode_t mode, a_uint32_t * pri);
-
+#endif
sw_error_t
@@ -187,66 +187,69 @@
a_uint32_t up);
-
+#ifndef IN_QOS_MINI
sw_error_t
fal_qos_port_default_up_get(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * up);
-
+#endif
sw_error_t
fal_qos_port_sch_mode_set(a_uint32_t dev_id, a_uint32_t port_id,
fal_sch_mode_t mode, const a_uint32_t weight[]);
-
+#ifndef IN_QOS_MINI
sw_error_t
fal_qos_port_sch_mode_get(a_uint32_t dev_id, a_uint32_t port_id,
fal_sch_mode_t * mode, a_uint32_t weight[]);
-
+#endif
sw_error_t
fal_qos_port_default_spri_set(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t spri);
-
+#ifndef IN_QOS_MINI
sw_error_t
fal_qos_port_default_spri_get(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * spri);
-
+#endif
sw_error_t
fal_qos_port_default_cpri_set(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t cpri);
-
+#ifndef IN_QOS_MINI
sw_error_t
fal_qos_port_default_cpri_get(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * cpri);
+#endif
sw_error_t
fal_qos_port_force_spri_status_set(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t enable);
-
+#ifndef IN_QOS_MINI
sw_error_t
fal_qos_port_force_spri_status_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t* enable);
+#endif
sw_error_t
fal_qos_port_force_cpri_status_set(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t enable);
-
+#ifndef IN_QOS_MINI
sw_error_t
fal_qos_port_force_cpri_status_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t* enable);
+#endif
sw_error_t
fal_qos_queue_remark_table_set(a_uint32_t dev_id, fal_port_t port_id,
fal_queue_t queue_id, a_uint32_t tbl_id, a_bool_t enable);
-
+#ifndef IN_QOS_MINI
sw_error_t
fal_qos_queue_remark_table_get(a_uint32_t dev_id, fal_port_t port_id,
fal_queue_t queue_id, a_uint32_t * tbl_id, a_bool_t * enable);
-
+#endif
#ifdef __cplusplus
}
diff --git a/include/hsl/hsl.h b/include/hsl/hsl.h
index 0193004..971167a 100755
--- a/include/hsl/hsl.h
+++ b/include/hsl/hsl.h
@@ -42,6 +42,73 @@
hsl_acl_addr_update acl_addr_update;
} hsl_acl_func_t;
+#if 1
+extern sw_error_t reduce_hsl_reg_entry_get(a_uint32_t dev,a_uint32_t reg,a_uint8_t* value,a_uint8_t val_len);
+#define HSL_REG_ENTRY_GET(rv, dev, reg, index, value, val_len) \
+ rv = reduce_hsl_reg_entry_get(dev,reg##_OFFSET + ((a_uint32_t)index) * reg##_E_OFFSET,value,val_len);
+
+
+extern sw_error_t reduce_hsl_reg_entry_set(a_uint32_t dev,a_uint32_t reg,a_uint8_t* value,a_uint8_t val_len);
+#define HSL_REG_ENTRY_SET(rv, dev, reg, index, value, val_len) \
+ rv = reduce_hsl_reg_entry_set(dev,reg##_OFFSET + ((a_uint32_t)index) * reg##_E_OFFSET,value,val_len);
+
+extern sw_error_t reduce_hsl_reg_field_get(a_uint32_t dev,a_uint32_t reg,a_uint32_t reg_offset,
+ a_uint32_t reg_offset_len,a_uint8_t* value,a_uint8_t val_len);
+#define HSL_REG_FIELD_GET(rv, dev, reg, index, field, value, val_len) \
+ rv = reduce_hsl_reg_field_get(dev,reg##_OFFSET + ((a_uint32_t)index) * reg##_E_OFFSET,\
+ reg##_##field##_BOFFSET, \
+ reg##_##field##_BLEN,value,val_len);
+
+extern sw_error_t reduce_hsl_reg_field_set(a_uint32_t dev,a_uint32_t reg,a_uint32_t reg_offset,
+ a_uint32_t reg_offset_len,a_uint8_t* value,a_uint8_t val_len);
+
+#define HSL_REG_FIELD_SET(rv, dev, reg, index, field, value, val_len) \
+ rv = reduce_hsl_reg_field_set(dev,reg##_OFFSET + ((a_uint32_t)index) * reg##_E_OFFSET,\
+ reg##_##field##_BOFFSET, \
+ reg##_##field##_BLEN,value,val_len);
+
+
+
+extern sw_error_t reduce_hsl_reg_entry_gen_get(a_uint32_t dev,a_uint32_t addr,a_uint8_t* value,a_uint8_t val_len);
+#define HSL_REG_ENTRY_GEN_GET(rv, dev, addr, reg_len, value, val_len) \
+ rv = reduce_hsl_reg_entry_gen_get(dev,addr,(a_uint8_t*)value,val_len);
+
+
+extern sw_error_t reduce_hsl_reg_entry_gen_set(a_uint32_t dev,a_uint32_t addr,a_uint8_t* value,a_uint8_t val_len);
+#define HSL_REG_ENTRY_GEN_SET(rv, dev, addr, reg_len, value, val_len) \
+ rv = reduce_hsl_reg_entry_gen_set(dev,addr,(a_uint8_t*)value,val_len);
+
+
+
+
+extern sw_error_t reduce_hsl_reg_field_gen_get(a_uint32_t dev,a_uint32_t reg_addr,
+ a_uint32_t bitoffset, a_uint32_t field_len, a_uint8_t* value,a_uint8_t val_len);
+#define HSL_REG_FIELD_GEN_GET(rv, dev, regaddr, bitlength, bitoffset, value, val_len) \
+ rv = reduce_hsl_reg_field_gen_get(dev, regaddr, bitoffset, bitlength, (a_uint8_t*)value, val_len);
+
+extern sw_error_t reduce_hsl_reg_field_gen_set(a_uint32_t dev,a_uint32_t regaddr,a_uint32_t bitoffset,
+ a_uint32_t bitlength,a_uint8_t* value,a_uint8_t val_len);
+
+#define HSL_REG_FIELD_GEN_SET(rv, dev, regaddr, bitlength, bitoffset, value, val_len) \
+ rv = reduce_hsl_reg_field_gen_set(dev,regaddr,bitoffset,bitlength, (a_uint8_t*)value,val_len);
+
+
+
+extern sw_error_t reduce_hsl_phy_get(a_uint32_t dev,a_uint32_t phy_addr,a_uint32_t reg,a_uint8_t* value);
+#define HSL_PHY_GET(rv, dev, phy_addr, reg, value) \
+ rv = reduce_hsl_phy_get(dev,phy_addr,reg,(a_uint8_t*)value);
+
+
+extern sw_error_t reduce_hsl_phy_set(a_uint32_t dev,a_uint32_t phy_addr,a_uint32_t reg,a_uint8_t* value);
+#define HSL_PHY_SET(rv, dev, phy_addr, reg, value) \
+ rv = reduce_hsl_phy_set(dev,phy_addr,reg,(a_uint8_t*)value);
+
+
+
+
+
+
+#else
#define HSL_REG_ENTRY_GET(rv, dev, reg, index, value, val_len) \
do { \
hsl_api_t *p_api = hsl_api_ptr_get(dev); \
@@ -149,6 +216,7 @@
rv = SW_NOT_INITIALIZED; \
} \
} while (0);
+#endif
#if (defined(API_LOCK) \
&& (defined(HSL_STANDALONG) || (defined(KERNEL_MODULE) && defined(USER_MODE))))
diff --git a/include/shell_lib/shell.h b/include/shell_lib/shell.h
index e1b77c1..5bdcfb4 100755
--- a/include/shell_lib/shell.h
+++ b/include/shell_lib/shell.h
@@ -30,7 +30,7 @@
#define IOCTL_BUF_SIZE 2048
#define CMDSTR_BUF_SIZE 1024
#define CMDSTR_ARGS_MAX 128
-#define dprintf cmd_print
+#define dprintf
int cmd_run_one(char *cmd_str);
extern void cmd_print(char *fmt, ...);
diff --git a/include/shell_lib/shell_config.h b/include/shell_lib/shell_config.h
index 1556467..1edc10f 100755
--- a/include/shell_lib/shell_config.h
+++ b/include/shell_lib/shell_config.h
@@ -37,22 +37,19 @@
#define SW_CMD_FLOW_SHOW (SW_API_MAX + 10)
#define SW_CMD_MAX (SW_API_MAX + 11)
-#define MAX_SUB_CMD_DES_NUM 80
+#define MAX_SUB_CMD_DES_NUM 40
struct sub_cmd_des_t
{
char *sub_name;
char *sub_act;
- char *sub_memo;
- char *sub_usage;
int sub_api;
sw_error_t (*sub_func) ();
};
struct cmd_des_t
{
char *name;
- char *memo;
- struct sub_cmd_des_t sub_cmd_des[MAX_SUB_CMD_DES_NUM];
+ struct sub_cmd_des_t *sub_cmd_des;
};
extern struct cmd_des_t gcmd_des[];
diff --git a/include/shell_lib/shell_io.h b/include/shell_lib/shell_io.h
index e316a3f..e701377 100755
--- a/include/shell_lib/shell_io.h
+++ b/include/shell_lib/shell_io.h
@@ -48,43 +48,70 @@
a_uint32_t size);
sw_error_t cmd_data_check_pbmp(char *cmd_str, a_uint32_t * arg_val,
a_uint32_t size);
+#ifdef IN_PORTCONTROL
+#ifndef IN_PORTCONTROL_MINI
sw_error_t cmd_data_check_duplex(char *cmd_str, a_uint32_t * arg_val,
a_uint32_t size);
sw_error_t cmd_data_check_speed(char *cmd_str, a_uint32_t * arg_val,
a_uint32_t size);
+#endif
+#endif
+#ifdef IN_PORTVLAN
sw_error_t cmd_data_check_1qmode(char *cmd_str, a_uint32_t * arg_val,
a_uint32_t size);
sw_error_t cmd_data_check_egmode(char *cmd_str, a_uint32_t * arg_val,
a_uint32_t size);
+#endif
+#ifdef IN_PORTCONTROL
+#ifndef IN_PORTCONTROL_MINI
sw_error_t cmd_data_check_capable(char *cmd_str, a_uint32_t * arg_val,
a_uint32_t size);
+#endif
+#endif
+#ifdef IN_FDB
sw_error_t cmd_data_check_fdbentry(char *cmdstr, void *val, a_uint32_t size);
+#endif
sw_error_t cmd_data_check_macaddr(char *cmdstr, void *val, a_uint32_t size);
-
+#ifdef IN_VLAN
sw_error_t cmd_data_check_vlan(char *cmdstr, fal_vlan_t * val, a_uint32_t size);
+#endif
+#ifdef IN_QOS
+#ifndef IN_QOS_MINI
sw_error_t cmd_data_check_qos_sch(char *cmdstr, fal_sch_mode_t * val,
a_uint32_t size);
sw_error_t cmd_data_check_qos_pt(char *cmdstr, fal_qos_mode_t * val,
a_uint32_t size);
+#endif
+#endif
+#ifdef IN_RATE
sw_error_t cmd_data_check_storm(char *cmdstr, fal_storm_type_t * val,
a_uint32_t size);
+#endif
+#ifdef IN_STP
sw_error_t cmd_data_check_stp_state(char *cmdstr, fal_stp_state_t * val,
a_uint32_t size);
+#endif
+#ifdef IN_LEAKY
sw_error_t cmd_data_check_leaky(char *cmdstr, fal_leaky_ctrl_mode_t * val,
a_uint32_t size);
+#endif
sw_error_t cmd_data_check_uinta(char *cmdstr, a_uint32_t * val,
a_uint32_t size);
sw_error_t cmd_data_check_maccmd(char *cmdstr, fal_fwd_cmd_t * val,
a_uint32_t size);
+#ifdef IN_IP
sw_error_t cmd_data_check_flowcmd(char *cmdstr, fal_default_flow_cmd_t * val,
a_uint32_t size);
sw_error_t cmd_data_check_flowtype(char *cmdstr, fal_flow_type_t * val,
a_uint32_t size);
+#endif
+#ifdef IN_LED
sw_error_t cmd_data_check_ledpattern(char *info, void * val, a_uint32_t size);
-
-
+#endif
+#ifdef IN_PORTVLAN
sw_error_t
cmd_data_check_invlan_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size);
+#ifndef IN_PORTVLAN_MINI
sw_error_t
cmd_data_check_vlan_propagation(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size);
sw_error_t
@@ -93,17 +120,23 @@
cmd_data_check_qinq_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size);
sw_error_t
cmd_data_check_qinq_role(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size);
-
+#endif
+#endif
+#ifdef IN_PORTCONTROL
sw_error_t
cmd_data_check_hdrmode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size);
-
+#endif
+#ifdef IN_FDB
sw_error_t
cmd_data_check_fdboperation(char *cmd_str, void * val, a_uint32_t size);
-
+#endif
+#ifdef IN_MISC
+#ifndef IN_MISC_MINI
sw_error_t
cmd_data_check_pppoe(char *cmd_str, void * val, a_uint32_t size);
-
-
+#endif
+#endif
+#if defined(IN_IP) || defined(IN_NAT)
sw_error_t
cmd_data_check_host_entry(char *cmd_str, void * val, a_uint32_t size);
sw_error_t
@@ -131,6 +164,9 @@
sw_error_t
cmd_data_check_intf_mac_entry(char *cmd_str, void * val, a_uint32_t size);
+sw_error_t
+cmd_data_check_pub_addr_entry(char *cmd_str, void * val, a_uint32_t size);
+#endif
sw_error_t
cmd_data_check_ip4addr(char *cmdstr, void * val, a_uint32_t size);
@@ -140,14 +176,9 @@
sw_error_t
-cmd_data_check_pub_addr_entry(char *cmd_str, void * val, a_uint32_t size);
-
-
-
-sw_error_t
cmd_data_check_egress_shaper(char *cmd_str, void * val, a_uint32_t size);
-
+#ifdef IN_RATE
sw_error_t
cmd_data_check_port_policer(char *cmd_str, void * val, a_uint32_t size);
@@ -156,15 +187,16 @@
sw_error_t
cmd_data_check_acl_policer(char *cmd_str, void * val, a_uint32_t size);
-
-
+#endif
+#ifdef IN_FDB
sw_error_t
cmd_data_check_fdb_smode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size);
-
-
+#endif
+#ifdef IN_IGMP
sw_error_t
cmd_data_check_multi(char *info, void *val, a_uint32_t size);
-
+#endif
+#ifdef IN_SEC
sw_error_t
cmd_data_check_sec_mac(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size);
@@ -188,10 +220,12 @@
sw_error_t
cmd_data_check_sec_icmp6(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size);
-
+#endif
+#ifdef IN_COSMAP
sw_error_t
cmd_data_check_remark_entry(char *info, void *val, a_uint32_t size);
-
+#endif
+#ifdef IN_IP
sw_error_t
cmd_data_check_default_route_entry(char *cmd_str, void * val, a_uint32_t size);
@@ -202,14 +236,16 @@
cmd_data_check_ip4_rfs_entry(char *cmd_str, void * val, a_uint32_t size);
sw_error_t
cmd_data_check_ip6_rfs_entry(char *cmd_str, void * val, a_uint32_t size);
+#endif
+#ifdef IN_NAT
sw_error_t
cmd_data_check_flow_cookie(char *cmd_str, void * val, a_uint32_t size);
sw_error_t
-cmd_data_check_fdb_rfs(char *cmd_str, void * val, a_uint32_t size);
-sw_error_t
cmd_data_check_flow_rfs(char *cmd_str, void * val, a_uint32_t size);
-
+#endif
+#ifdef IN_PORTCONTROL
+#ifndef IN_PORTCONTROL_MINI
sw_error_t
cmd_data_check_crossover_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size);
@@ -221,8 +257,11 @@
sw_error_t
cmd_data_check_fiber_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size);
-
+#endif
+#endif
+#ifdef IN_INTERFACECONTROL
sw_error_t
cmd_data_check_interface_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size);
#endif
+#endif
diff --git a/make/linux_opt.mk b/make/linux_opt.mk
index 5a5c234..c2df3c6 100755
--- a/make/linux_opt.mk
+++ b/make/linux_opt.mk
@@ -9,6 +9,10 @@
MODULE_CFLAG += -DIN_FDB
endif
+ifeq (TRUE, $(IN_FDB_MINI))
+ MODULE_CFLAG += -DIN_FDB_MINI
+endif
+
ifeq (TRUE, $(IN_IGMP))
MODULE_CFLAG += -DIN_IGMP
endif
@@ -33,18 +37,34 @@
MODULE_CFLAG += -DIN_MISC
endif
+ifeq (TRUE, $(IN_MISC_MINI))
+ MODULE_CFLAG += -DIN_MISC_MINI
+endif
+
ifeq (TRUE, $(IN_PORTCONTROL))
MODULE_CFLAG += -DIN_PORTCONTROL
endif
+ifeq (TRUE, $(IN_PORTCONTROL_MINI))
+ MODULE_CFLAG += -DIN_PORTCONTROL_MINI
+endif
+
ifeq (TRUE, $(IN_PORTVLAN))
MODULE_CFLAG += -DIN_PORTVLAN
endif
+ifeq (TRUE, $(IN_PORTVLAN_MINI))
+ MODULE_CFLAG += -DIN_PORTVLAN_MINI
+endif
+
ifeq (TRUE, $(IN_QOS))
MODULE_CFLAG += -DIN_QOS
endif
+ifeq (TRUE, $(IN_QOS_MINI))
+ MODULE_CFLAG += -DIN_QOS_MINI
+endif
+
ifeq (TRUE, $(IN_RATE))
MODULE_CFLAG += -DIN_RATE
endif
@@ -57,6 +77,10 @@
MODULE_CFLAG += -DIN_VLAN
endif
+ifeq (TRUE, $(IN_VLAN_MINI))
+ MODULE_CFLAG += -DIN_VLAN_MINI
+endif
+
ifeq (TRUE, $(IN_REDUCED_ACL))
MODULE_CFLAG += -DIN_REDUCED_ACL
endif
@@ -65,6 +89,10 @@
MODULE_CFLAG += -DIN_COSMAP
endif
+ifeq (TRUE, $(IN_COSMAP_MINI))
+ MODULE_CFLAG += -DIN_COSMAP_MINI
+endif
+
ifeq (TRUE, $(IN_IP))
MODULE_CFLAG += -DIN_IP
endif
@@ -97,6 +125,10 @@
MODULE_CFLAG += -DIN_RFS
endif
+ifeq (TRUE, $(IN_MALIBU_PHY))
+ MODULE_CFLAG += -DIN_MALIBU_PHY
+endif
+
ifneq (TRUE, $(FAL))
MODULE_CFLAG += -DHSL_STANDALONG
endif
diff --git a/src/fal/fal_cosmap.c b/src/fal/fal_cosmap.c
index f48118a..4d7d84f 100755
--- a/src/fal/fal_cosmap.c
+++ b/src/fal/fal_cosmap.c
@@ -21,7 +21,7 @@
#include "fal_cosmap.h"
#include "hsl_api.h"
-
+#ifndef IN_COSMAP_MINI
static sw_error_t
_fal_cosmap_dscp_to_pri_set(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t pri)
{
@@ -263,6 +263,7 @@
rv = p_api->cosmap_up_to_ehdp_get(dev_id, up, dp);
return rv;
}
+#endif
static sw_error_t
_fal_cosmap_pri_to_queue_set(a_uint32_t dev_id, a_uint32_t pri,
@@ -281,22 +282,6 @@
}
static sw_error_t
-_fal_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri,
- a_uint32_t * queue)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->cosmap_pri_to_queue_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->cosmap_pri_to_queue_get(dev_id, pri, queue);
- return rv;
-}
-
-static sw_error_t
_fal_cosmap_pri_to_ehqueue_set(a_uint32_t dev_id, a_uint32_t pri,
a_uint32_t queue)
{
@@ -312,6 +297,23 @@
return rv;
}
+#ifndef IN_COSMAP_MINI
+static sw_error_t
+_fal_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri,
+ a_uint32_t * queue)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->cosmap_pri_to_queue_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->cosmap_pri_to_queue_get(dev_id, pri, queue);
+ return rv;
+}
+
static sw_error_t
_fal_cosmap_pri_to_ehqueue_get(a_uint32_t dev_id, a_uint32_t pri,
a_uint32_t * queue)
@@ -649,6 +651,7 @@
FAL_API_UNLOCK;
return rv;
}
+#endif
/**
* @brief Set internal priority to queue mapping on one particular device.
@@ -672,27 +675,6 @@
}
/**
- * @brief Get internal priority to queue mapping on one particular device.
- * @details Comments:
- * This function is for port 1/2/3/4 which have four egress queues
- * @param[in] dev_id device id
- * @param[in] pri internal priority
- * @param[out] queue queue id
- * @return SW_OK or error code
- */
-sw_error_t
-fal_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri,
- a_uint32_t * queue)
-{
- sw_error_t rv;
-
- FAL_API_LOCK;
- rv = _fal_cosmap_pri_to_queue_get(dev_id, pri, queue);
- FAL_API_UNLOCK;
- return rv;
-}
-
-/**
* @brief Set internal priority to queue mapping on one particular device.
* @details Comments:
* This function is for port 0/5/6 which have six egress queues
@@ -713,6 +695,28 @@
return rv;
}
+#ifndef IN_COSMAP_MINI
+/**
+ * @brief Get internal priority to queue mapping on one particular device.
+ * @details Comments:
+ * This function is for port 1/2/3/4 which have four egress queues
+ * @param[in] dev_id device id
+ * @param[in] pri internal priority
+ * @param[out] queue queue id
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri,
+ a_uint32_t * queue)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_cosmap_pri_to_queue_get(dev_id, pri, queue);
+ FAL_API_UNLOCK;
+ return rv;
+}
+
/**
* @brief Get internal priority to queue mapping on one particular device.
* @details Comments:
@@ -771,7 +775,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @}
diff --git a/src/fal/fal_fdb.c b/src/fal/fal_fdb.c
index 619cd1b..d4a2c12 100755
--- a/src/fal/fal_fdb.c
+++ b/src/fal/fal_fdb.c
@@ -25,7 +25,7 @@
#include <linux/module.h>
-
+#ifndef IN_FDB_MINI
static sw_error_t
_fal_fdb_add(a_uint32_t dev_id, const fal_fdb_entry_t * entry)
{
@@ -40,7 +40,7 @@
rv = p_api->fdb_add(dev_id, entry);
return rv;
}
-
+#endif
static sw_error_t
_fal_fdb_del_all(a_uint32_t dev_id, a_uint32_t flag)
@@ -57,7 +57,7 @@
return rv;
}
-
+#ifndef IN_FDB_MINI
static sw_error_t
_fal_fdb_del_by_port(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t flag)
{
@@ -88,7 +88,7 @@
rv = p_api->fdb_del_by_mac(dev_id, entry);
return rv;
}
-
+#endif
static sw_error_t
_fal_fdb_first(a_uint32_t dev_id, fal_fdb_entry_t * entry)
@@ -105,7 +105,7 @@
return rv;
}
-
+#ifndef IN_FDB_MINI
static sw_error_t
_fal_fdb_next(a_uint32_t dev_id, fal_fdb_entry_t * entry)
{
@@ -136,7 +136,7 @@
rv = p_api->fdb_find(dev_id, entry);
return rv;
}
-
+#endif
static sw_error_t
_fal_fdb_port_learn_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
@@ -153,7 +153,7 @@
return rv;
}
-
+#ifndef IN_FDB_MINI
static sw_error_t
_fal_fdb_port_learn_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable)
{
@@ -260,6 +260,7 @@
rv = p_api->age_time_get(dev_id, time);
return rv;
}
+#endif
static sw_error_t
_fal_fdb_iterate(a_uint32_t dev_id, a_uint32_t * iterator, fal_fdb_entry_t * entry)
@@ -308,6 +309,7 @@
return rv;
}
+#ifndef IN_FDB_MINI
static sw_error_t
_fal_fdb_transfer(a_uint32_t dev_id, fal_port_t old_port, fal_port_t new_port,
a_uint32_t fid, fal_fdb_op_t * option)
@@ -618,6 +620,7 @@
FAL_API_UNLOCK;
return rv;
}
+#endif
/**
* @brief Delete all Fdb entries
@@ -639,6 +642,7 @@
return rv;
}
+#ifndef IN_FDB_MINI
/**
* @brief Delete Fdb entries on a particular port
* @details Comments:
@@ -679,6 +683,7 @@
FAL_API_UNLOCK;
return rv;
}
+#endif
/**
* @brief Get first Fdb entry from particular device
@@ -697,6 +702,7 @@
return rv;
}
+#ifndef IN_FDB_MINI
/**
* @brief Get next Fdb entry from particular device
* @details Comments:
@@ -735,6 +741,7 @@
FAL_API_UNLOCK;
return rv;
}
+#endif
/**
* @brief Set dynamic address learning status on a particular port.
@@ -757,6 +764,7 @@
return rv;
}
+#ifndef IN_FDB_MINI
/**
* @brief Get dynamic address learning status on a particular port.
* @param[in] dev_id device id
@@ -886,6 +894,7 @@
FAL_API_UNLOCK;
return rv;
}
+#endif
/**
* @brief Iterate all fdb entries on a particular device.
@@ -944,6 +953,7 @@
return rv;
}
+#ifndef IN_FDB_MINI
/**
* @brief Transfer fdb entries port information on a particular device.
* @param[in] dev_id device id
@@ -1292,6 +1302,7 @@
else
return fal_fdb_rfs_del(0, &entry);
}
+#endif
#if 0
int ssdk_rfs_mac_rule_set(ssdk_fdb_rfs_t *rfs)
diff --git a/src/fal/fal_misc.c b/src/fal/fal_misc.c
index ed81b80..20f31fa 100755
--- a/src/fal/fal_misc.c
+++ b/src/fal/fal_misc.c
@@ -22,6 +22,7 @@
#include "fal_misc.h"
#include "hsl_api.h"
+#ifndef IN_MISC_MINI
static sw_error_t
_fal_arp_status_set(a_uint32_t dev_id, a_bool_t enable)
{
@@ -52,7 +53,7 @@
rv = p_api->arp_status_get(dev_id, enable);
return rv;
}
-
+#endif
static sw_error_t
_fal_frame_max_size_set(a_uint32_t dev_id, a_uint32_t size)
@@ -102,24 +103,6 @@
return rv;
}
-
-static sw_error_t
-_fal_port_unk_sa_cmd_get(a_uint32_t dev_id, fal_port_t port_id,
- fal_fwd_cmd_t * cmd)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->port_unk_sa_cmd_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_unk_sa_cmd_get(dev_id, port_id, cmd);
- return rv;
-}
-
-
static sw_error_t
_fal_port_unk_uc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t enable)
@@ -136,6 +119,70 @@
return rv;
}
+static sw_error_t
+_fal_port_unk_mc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->port_unk_mc_filter_set)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_unk_mc_filter_set(dev_id, port_id, enable);
+ return rv;
+}
+
+static sw_error_t
+_fal_port_bc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->port_bc_filter_set)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_bc_filter_set(dev_id, port_id, enable);
+ return rv;
+}
+
+static sw_error_t
+_fal_cpu_port_status_set(a_uint32_t dev_id, a_bool_t enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->cpu_port_status_set)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->cpu_port_status_set(dev_id, enable);
+ return rv;
+}
+
+#ifndef IN_MISC_MINI
+static sw_error_t
+_fal_port_unk_sa_cmd_get(a_uint32_t dev_id, fal_port_t port_id,
+ fal_fwd_cmd_t * cmd)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->port_unk_sa_cmd_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_unk_sa_cmd_get(dev_id, port_id, cmd);
+ return rv;
+}
+
static sw_error_t
_fal_port_unk_uc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
@@ -155,23 +202,6 @@
static sw_error_t
-_fal_port_unk_mc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->port_unk_mc_filter_set)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_unk_mc_filter_set(dev_id, port_id, enable);
- return rv;
-}
-
-
-static sw_error_t
_fal_port_unk_mc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable)
{
@@ -189,23 +219,6 @@
static sw_error_t
-_fal_port_bc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->port_bc_filter_set)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_bc_filter_set(dev_id, port_id, enable);
- return rv;
-}
-
-
-static sw_error_t
_fal_port_bc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable)
{
@@ -221,23 +234,6 @@
return rv;
}
-
-static sw_error_t
-_fal_cpu_port_status_set(a_uint32_t dev_id, a_bool_t enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->cpu_port_status_set)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->cpu_port_status_set(dev_id, enable);
- return rv;
-}
-
-
static sw_error_t
_fal_cpu_port_status_get(a_uint32_t dev_id, a_bool_t * enable)
{
@@ -407,6 +403,7 @@
rv = p_api->arp_cmd_get(dev_id, cmd);
return rv;
}
+#endif
static sw_error_t
_fal_eapol_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd)
@@ -423,6 +420,7 @@
return rv;
}
+#ifndef IN_MISC_MINI
static sw_error_t
_fal_eapol_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd)
{
@@ -482,6 +480,7 @@
rv = p_api->pppoe_session_get(dev_id, session_id, strip_hdr);
return rv;
}
+#endif
static sw_error_t
_fal_eapol_status_set(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t enable)
@@ -498,6 +497,7 @@
return rv;
}
+#ifndef IN_MISC_MINI
static sw_error_t
_fal_eapol_status_get(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t * enable)
{
@@ -1044,6 +1044,7 @@
FAL_API_UNLOCK;
return rv;
}
+#endif
/**
* @brief Set max frame size which device can received on a particular device.
@@ -1105,25 +1106,6 @@
}
/**
- * @brief Get forwarding command for packets which source address is unknown on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] cmd forwarding command
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_unk_sa_cmd_get(a_uint32_t dev_id, fal_port_t port_id,
- fal_fwd_cmd_t * cmd)
-{
- sw_error_t rv;
-
- FAL_API_LOCK;
- rv = _fal_port_unk_sa_cmd_get(dev_id, port_id, cmd);
- FAL_API_UNLOCK;
- return rv;
-}
-
-/**
* @brief Set flooding status of unknown unicast packets on a particular port.
* @details Comments:
* If enable unknown unicast packets filter on one port then unknown
@@ -1146,25 +1128,6 @@
}
/**
- * @brief Get flooding status of unknown unicast packets on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_unk_uc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
-
- FAL_API_LOCK;
- rv = _fal_port_unk_uc_filter_get(dev_id, port_id, enable);
- FAL_API_UNLOCK;
- return rv;
-}
-
-/**
* @brief Set flooding status of unknown multicast packets on a particular port.
* @details Comments:
* If enable unknown multicast packets filter on one port then unknown
@@ -1187,25 +1150,6 @@
}
/**
- * @brief Get flooding status of unknown multicast packets on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_unk_mc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
-
- FAL_API_LOCK;
- rv = _fal_port_unk_mc_filter_get(dev_id, port_id, enable);
- FAL_API_UNLOCK;
- return rv;
-}
-
-/**
* @brief Set flooding status of broadcast packets on a particular port.
* @details Comments:
* If enable unknown multicast packets filter on one port then unknown
@@ -1228,6 +1172,85 @@
}
/**
+ * @brief Set cpu port status on a particular device.
+ * @param[in] dev_id device id
+ * @param[in] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_cpu_port_status_set(a_uint32_t dev_id, a_bool_t enable)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_cpu_port_status_set(dev_id, enable);
+ FAL_API_UNLOCK;
+ return rv;
+}
+
+#ifndef IN_MISC_MINI
+/**
+ * @brief Get forwarding command for packets which source address is unknown on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] cmd forwarding command
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_unk_sa_cmd_get(a_uint32_t dev_id, fal_port_t port_id,
+ fal_fwd_cmd_t * cmd)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_unk_sa_cmd_get(dev_id, port_id, cmd);
+ FAL_API_UNLOCK;
+ return rv;
+}
+
+/**
+ * @brief Get flooding status of unknown unicast packets on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_unk_uc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_unk_uc_filter_get(dev_id, port_id, enable);
+ FAL_API_UNLOCK;
+ return rv;
+}
+
+
+
+/**
+ * @brief Get flooding status of unknown multicast packets on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_unk_mc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_unk_mc_filter_get(dev_id, port_id, enable);
+ FAL_API_UNLOCK;
+ return rv;
+}
+
+
+
+/**
* @brief Get flooding status of broadcast packets on a particular port.
* @param[in] dev_id device id
* @param[in] port_id port id
@@ -1247,23 +1270,6 @@
}
/**
- * @brief Set cpu port status on a particular device.
- * @param[in] dev_id device id
- * @param[in] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-sw_error_t
-fal_cpu_port_status_set(a_uint32_t dev_id, a_bool_t enable)
-{
- sw_error_t rv;
-
- FAL_API_LOCK;
- rv = _fal_cpu_port_status_set(dev_id, enable);
- FAL_API_UNLOCK;
- return rv;
-}
-
-/**
* @brief Get cpu port status on a particular device.
* @param[in] dev_id device id
* @param[in] enable A_TRUE or A_FALSE
@@ -1458,7 +1464,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set eapol packets forwarding command on a particular device.
* @details Comments:
@@ -1479,6 +1485,7 @@
return rv;
}
+#ifndef IN_MISC_MINI
/**
* @brief Get eapol packets forwarding command on a particular device.
* @param[in] dev_id device id
@@ -1548,7 +1555,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set eapol packets hardware acknowledgement on a particular port.
* @details Comments:
@@ -1569,7 +1576,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_MISC_MINI
/**
* @brief Get eapol packets hardware acknowledgement on a particular port.
* @param[in] dev_id device id
@@ -2157,7 +2164,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
diff --git a/src/fal/fal_port_ctrl.c b/src/fal/fal_port_ctrl.c
index b00c328..997ff63 100755
--- a/src/fal/fal_port_ctrl.c
+++ b/src/fal/fal_port_ctrl.c
@@ -38,6 +38,68 @@
return rv;
}
+static sw_error_t
+_fal_port_speed_set (a_uint32_t dev_id, fal_port_t port_id,
+ fal_port_speed_t speed)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
+
+ if (NULL == p_api->port_speed_set)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_speed_set (dev_id, port_id, speed);
+ return rv;
+}
+
+static sw_error_t
+_fal_port_flowctrl_set (a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
+
+ if (NULL == p_api->port_flowctrl_set)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_flowctrl_set (dev_id, port_id, enable);
+ return rv;
+}
+
+static sw_error_t
+_fal_port_flowctrl_forcemode_set (a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
+
+ if (NULL == p_api->port_flowctrl_forcemode_set)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_flowctrl_forcemode_set (dev_id, port_id, enable);
+ return rv;
+}
+static sw_error_t
+_fal_port_speed_get (a_uint32_t dev_id, fal_port_t port_id,
+ fal_port_speed_t * pspeed)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
+
+ if (NULL == p_api->port_speed_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_speed_get (dev_id, port_id, pspeed);
+ return rv;
+}
static sw_error_t
_fal_port_duplex_get (a_uint32_t dev_id, fal_port_t port_id,
@@ -56,38 +118,9 @@
}
-static sw_error_t
-_fal_port_speed_set (a_uint32_t dev_id, fal_port_t port_id,
- fal_port_speed_t speed)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
-
- if (NULL == p_api->port_speed_set)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_speed_set (dev_id, port_id, speed);
- return rv;
-}
+#ifndef IN_PORTCONTROL_MINI
-static sw_error_t
-_fal_port_speed_get (a_uint32_t dev_id, fal_port_t port_id,
- fal_port_speed_t * pspeed)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
-
- if (NULL == p_api->port_speed_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_speed_get (dev_id, port_id, pspeed);
- return rv;
-}
static sw_error_t
@@ -205,24 +238,6 @@
return rv;
}
-
-static sw_error_t
-_fal_port_flowctrl_set (a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
-
- if (NULL == p_api->port_flowctrl_set)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_flowctrl_set (dev_id, port_id, enable);
- return rv;
-}
-
-
static sw_error_t
_fal_port_flowctrl_get (a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable)
@@ -240,22 +255,6 @@
}
-static sw_error_t
-_fal_port_flowctrl_forcemode_set (a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
-
- if (NULL == p_api->port_flowctrl_forcemode_set)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_flowctrl_forcemode_set (dev_id, port_id, enable);
- return rv;
-}
-
static sw_error_t
_fal_port_flowctrl_forcemode_get (a_uint32_t dev_id, fal_port_t port_id,
@@ -354,7 +353,51 @@
rv = p_api->port_cdt (dev_id, port_id, mdi_pair, cable_status, cable_len);
return rv;
}
+static sw_error_t
+_fal_port_rxhdr_mode_get (a_uint32_t dev_id, fal_port_t port_id,
+ fal_port_header_mode_t * mode)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+ SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
+
+ if (NULL == p_api->port_rxhdr_mode_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_rxhdr_mode_get (dev_id, port_id, mode);
+ return rv;
+}
+static sw_error_t
+_fal_port_txhdr_mode_get (a_uint32_t dev_id, fal_port_t port_id,
+ fal_port_header_mode_t * mode)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
+
+ if (NULL == p_api->port_txhdr_mode_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_txhdr_mode_get (dev_id, port_id, mode);
+ return rv;
+}
+static sw_error_t
+_fal_header_type_get (a_uint32_t dev_id, a_bool_t * enable, a_uint32_t * type)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
+
+ if (NULL == p_api->header_type_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->header_type_get (dev_id, enable, type);
+ return rv;
+}
+#endif
static sw_error_t
_fal_port_rxhdr_mode_set (a_uint32_t dev_id, fal_port_t port_id,
fal_port_header_mode_t mode)
@@ -371,21 +414,7 @@
return rv;
}
-static sw_error_t
-_fal_port_rxhdr_mode_get (a_uint32_t dev_id, fal_port_t port_id,
- fal_port_header_mode_t * mode)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
-
- if (NULL == p_api->port_rxhdr_mode_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_rxhdr_mode_get (dev_id, port_id, mode);
- return rv;
-}
static sw_error_t
_fal_port_txhdr_mode_set (a_uint32_t dev_id, fal_port_t port_id,
@@ -403,21 +432,7 @@
return rv;
}
-static sw_error_t
-_fal_port_txhdr_mode_get (a_uint32_t dev_id, fal_port_t port_id,
- fal_port_header_mode_t * mode)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
-
- if (NULL == p_api->port_txhdr_mode_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_txhdr_mode_get (dev_id, port_id, mode);
- return rv;
-}
static sw_error_t
_fal_header_type_set (a_uint32_t dev_id, a_bool_t enable, a_uint32_t type)
@@ -434,20 +449,7 @@
return rv;
}
-static sw_error_t
-_fal_header_type_get (a_uint32_t dev_id, a_bool_t * enable, a_uint32_t * type)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
-
- if (NULL == p_api->header_type_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->header_type_get (dev_id, enable, type);
- return rv;
-}
static sw_error_t
_fal_port_txmac_status_set (a_uint32_t dev_id, fal_port_t port_id,
@@ -465,21 +467,7 @@
return rv;
}
-static sw_error_t
-_fal_port_txmac_status_get (a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
-
- if (NULL == p_api->port_txmac_status_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_txmac_status_get (dev_id, port_id, enable);
- return rv;
-}
static sw_error_t
_fal_port_rxmac_status_set (a_uint32_t dev_id, fal_port_t port_id,
@@ -497,21 +485,7 @@
return rv;
}
-static sw_error_t
-_fal_port_rxmac_status_get (a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
-
- if (NULL == p_api->port_rxmac_status_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_rxmac_status_get (dev_id, port_id, enable);
- return rv;
-}
static sw_error_t
_fal_port_txfc_status_set (a_uint32_t dev_id, fal_port_t port_id,
@@ -529,21 +503,7 @@
return rv;
}
-static sw_error_t
-_fal_port_txfc_status_get (a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
-
- if (NULL == p_api->port_txfc_status_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_txfc_status_get (dev_id, port_id, enable);
- return rv;
-}
static sw_error_t
_fal_port_rxfc_status_set (a_uint32_t dev_id, fal_port_t port_id,
@@ -560,7 +520,21 @@
rv = p_api->port_rxfc_status_set (dev_id, port_id, enable);
return rv;
}
+static sw_error_t
+_fal_port_txfc_status_get (a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+ SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
+
+ if (NULL == p_api->port_txfc_status_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_txfc_status_get (dev_id, port_id, enable);
+ return rv;
+}
static sw_error_t
_fal_port_rxfc_status_get (a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable)
@@ -576,6 +550,52 @@
rv = p_api->port_rxfc_status_get (dev_id, port_id, enable);
return rv;
}
+static sw_error_t
+_fal_port_link_status_get (a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * status)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
+
+ if (NULL == p_api->port_link_status_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_link_status_get (dev_id, port_id, status);
+ return rv;
+}
+#ifndef IN_PORTCONTROL_MINI
+static sw_error_t
+_fal_port_txmac_status_get (a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
+
+ if (NULL == p_api->port_txmac_status_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_txmac_status_get (dev_id, port_id, enable);
+ return rv;
+}
+static sw_error_t
+_fal_port_rxmac_status_get (a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
+
+ if (NULL == p_api->port_rxmac_status_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_rxmac_status_get (dev_id, port_id, enable);
+ return rv;
+}
static sw_error_t
_fal_port_bp_status_set (a_uint32_t dev_id, fal_port_t port_id,
@@ -641,21 +661,7 @@
return rv;
}
-static sw_error_t
-_fal_port_link_status_get (a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * status)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL (p_api = hsl_api_ptr_get (dev_id));
-
- if (NULL == p_api->port_link_status_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_link_status_get (dev_id, port_id, status);
- return rv;
-}
static sw_error_t
_fal_ports_link_status_get (a_uint32_t dev_id, a_uint32_t * status)
@@ -1205,7 +1211,7 @@
rv = p_api->port_counter_show (dev_id, port_id, counter_info);
return rv;
}
-
+#endif
/**
* @brief Set duplex mode on a particular port.
* @param[in] dev_id device id
@@ -1225,24 +1231,7 @@
return rv;
}
-/**
- * @brief Get duplex mode on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] duplex duplex mode
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_duplex_get (a_uint32_t dev_id, fal_port_t port_id,
- fal_port_duplex_t * pduplex)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_port_duplex_get (dev_id, port_id, pduplex);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Set speed on a particular port.
@@ -1262,6 +1251,24 @@
FAL_API_UNLOCK;
return rv;
}
+/**
+ * @brief Get duplex mode on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] duplex duplex mode
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_duplex_get (a_uint32_t dev_id, fal_port_t port_id,
+ fal_port_duplex_t * pduplex)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_duplex_get (dev_id, port_id, pduplex);
+ FAL_API_UNLOCK;
+ return rv;
+}
/**
* @brief Get speed on a particular port.
@@ -1281,6 +1288,7 @@
FAL_API_UNLOCK;
return rv;
}
+#ifndef IN_PORTCONTROL_MINI
/**
* @brief Get auto negotiation status on a particular port.
@@ -1414,23 +1422,6 @@
return rv;
}
-/**
- * @brief Set flow control status on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[in] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_flowctrl_set (a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
-{
- sw_error_t rv;
-
- FAL_API_LOCK;
- rv = _fal_port_flowctrl_set (dev_id, port_id, enable);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Get flow control status on a particular port.
@@ -1451,24 +1442,7 @@
return rv;
}
-/**
- * @brief Set flow control force mode on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[in] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_flowctrl_forcemode_set (a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_port_flowctrl_forcemode_set (dev_id, port_id, enable);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Get flow control force mode on a particular port.
@@ -1585,6 +1559,133 @@
FAL_API_UNLOCK;
return rv;
}
+/**
+ * @brief Get status of Atheros header packets parsed on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_rxhdr_mode_get (a_uint32_t dev_id, fal_port_t port_id,
+ fal_port_header_mode_t * mode)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_rxhdr_mode_get (dev_id, port_id, mode);
+ FAL_API_UNLOCK;
+ return rv;
+}
+/**
+ * @brief Get status of Atheros header packets parsed on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_txhdr_mode_get (a_uint32_t dev_id, fal_port_t port_id,
+ fal_port_header_mode_t * mode)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_txhdr_mode_get (dev_id, port_id, mode);
+ FAL_API_UNLOCK;
+ return rv;
+}
+/**
+ * @brief Get status of Atheros header type value on a particular device.
+ * @param[in] dev_id device id
+ * @param[out] enable A_TRUE or A_FALSE
+ * @param[out] type header type value
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_header_type_get (a_uint32_t dev_id, a_bool_t * enable, a_uint32_t * type)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_header_type_get (dev_id, enable, type);
+ FAL_API_UNLOCK;
+ return rv;
+}
+/**
+ * @brief Get status of txmac on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_txmac_status_get (a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_txmac_status_get (dev_id, port_id, enable);
+ FAL_API_UNLOCK;
+ return rv;
+}
+/**
+ * @brief Get status of rxmac on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_rxmac_status_get (a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_rxmac_status_get (dev_id, port_id, enable);
+ FAL_API_UNLOCK;
+ return rv;
+}
+#endif
+
+/**
+ * @brief Set flow control status on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[in] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_flowctrl_set (a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_flowctrl_set (dev_id, port_id, enable);
+ FAL_API_UNLOCK;
+ return rv;
+}
+
+/**
+ * @brief Set flow control force mode on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[in] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_flowctrl_forcemode_set (a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_flowctrl_forcemode_set (dev_id, port_id, enable);
+ FAL_API_UNLOCK;
+ return rv;
+}
/**
* @brief Set status of Atheros header packets parsed on a particular port.
@@ -1605,24 +1706,7 @@
return rv;
}
-/**
- * @brief Get status of Atheros header packets parsed on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_rxhdr_mode_get (a_uint32_t dev_id, fal_port_t port_id,
- fal_port_header_mode_t * mode)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_port_rxhdr_mode_get (dev_id, port_id, mode);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Set status of Atheros header packets parsed on a particular port.
@@ -1643,24 +1727,7 @@
return rv;
}
-/**
- * @brief Get status of Atheros header packets parsed on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_txhdr_mode_get (a_uint32_t dev_id, fal_port_t port_id,
- fal_port_header_mode_t * mode)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_port_txhdr_mode_get (dev_id, port_id, mode);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Set status of Atheros header type value on a particular device.
@@ -1679,23 +1746,7 @@
return rv;
}
-/**
- * @brief Get status of Atheros header type value on a particular device.
- * @param[in] dev_id device id
- * @param[out] enable A_TRUE or A_FALSE
- * @param[out] type header type value
- * @return SW_OK or error code
- */
-sw_error_t
-fal_header_type_get (a_uint32_t dev_id, a_bool_t * enable, a_uint32_t * type)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_header_type_get (dev_id, enable, type);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Set status of txmac on a particular port.
@@ -1715,24 +1766,7 @@
return rv;
}
-/**
- * @brief Get status of txmac on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_txmac_status_get (a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_port_txmac_status_get (dev_id, port_id, enable);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Set status of rxmac on a particular port.
@@ -1752,24 +1786,7 @@
return rv;
}
-/**
- * @brief Get status of rxmac on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_rxmac_status_get (a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_port_rxmac_status_get (dev_id, port_id, enable);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Set status of tx flow control on a particular port.
@@ -1789,24 +1806,7 @@
return rv;
}
-/**
- * @brief Get status of tx flow control on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_txfc_status_get (a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_port_txfc_status_get (dev_id, port_id, enable);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Set status of rx flow control on a particular port.
@@ -1826,7 +1826,6 @@
FAL_API_UNLOCK;
return rv;
}
-
/**
* @brief Set status of rx flow control on a particular port.
* @param[in] dev_id device id
@@ -1845,6 +1844,44 @@
FAL_API_UNLOCK;
return rv;
}
+/**
+ * @brief Get status of tx flow control on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_txfc_status_get (a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_txfc_status_get (dev_id, port_id, enable);
+ FAL_API_UNLOCK;
+ return rv;
+}
+/**
+ * @brief Get link status on particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] status link status up (A_TRUE) or down (A_FALSE)
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_port_link_status_get (a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * status)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_port_link_status_get (dev_id, port_id, status);
+ FAL_API_UNLOCK;
+ return rv;
+}
+
+#ifndef IN_PORTCONTROL_MINI
/**
* @brief Set status of back pressure on a particular port.
@@ -1922,24 +1959,7 @@
return rv;
}
-/**
- * @brief Get link status on particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] status link status up (A_TRUE) or down (A_FALSE)
- * @return SW_OK or error code
- */
-sw_error_t
-fal_port_link_status_get (a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * status)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_port_link_status_get (dev_id, port_id, status);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Get link status on all ports.
@@ -2591,7 +2611,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @}
*/
diff --git a/src/fal/fal_portvlan.c b/src/fal/fal_portvlan.c
index bdbd2b4..11e254e 100755
--- a/src/fal/fal_portvlan.c
+++ b/src/fal/fal_portvlan.c
@@ -39,21 +39,7 @@
}
-static sw_error_t
-_fal_port_1qmode_get(a_uint32_t dev_id, fal_port_t port_id,
- fal_pt_1qmode_t * pport_1qmode)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->port_1qmode_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_1qmode_get(dev_id, port_id, pport_1qmode);
- return rv;
-}
static sw_error_t
@@ -73,21 +59,6 @@
}
-static sw_error_t
-_fal_port_egvlanmode_get(a_uint32_t dev_id, fal_port_t port_id,
- fal_pt_1q_egmode_t * pport_egvlanmode)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->port_egvlanmode_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_egvlanmode_get(dev_id, port_id, pport_egvlanmode);
- return rv;
-}
static sw_error_t
_fal_portvlan_member_add(a_uint32_t dev_id, fal_port_t port_id,
@@ -140,22 +111,6 @@
}
-static sw_error_t
-_fal_portvlan_member_get(a_uint32_t dev_id, fal_port_t port_id,
- fal_pbmp_t * mem_port_map)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->portvlan_member_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->portvlan_member_get(dev_id, port_id, mem_port_map);
- return rv;
-}
-
static sw_error_t
_fal_port_default_vid_set(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t vid)
@@ -173,21 +128,6 @@
}
-static sw_error_t
-_fal_port_default_vid_get(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * vid)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->port_default_vid_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_default_vid_get(dev_id, port_id, vid);
- return rv;
-}
static sw_error_t
_fal_port_force_default_vid_set(a_uint32_t dev_id, fal_port_t port_id,
@@ -205,21 +145,6 @@
return rv;
}
-static sw_error_t
-_fal_port_force_default_vid_get(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->port_force_default_vid_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_force_default_vid_get(dev_id, port_id, enable);
- return rv;
-}
static sw_error_t
_fal_port_force_portvlan_set(a_uint32_t dev_id, fal_port_t port_id,
@@ -238,21 +163,7 @@
}
-static sw_error_t
-_fal_port_force_portvlan_get(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->port_force_portvlan_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_force_portvlan_get(dev_id, port_id, enable);
- return rv;
-}
static sw_error_t
_fal_port_nestvlan_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
@@ -270,20 +181,7 @@
}
-static sw_error_t
-_fal_port_nestvlan_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->port_nestvlan_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_nestvlan_get(dev_id, port_id, enable);
- return rv;
-}
static sw_error_t
@@ -301,20 +199,7 @@
return rv;
}
-static sw_error_t
-_fal_nestvlan_tpid_get(a_uint32_t dev_id, a_uint32_t * tpid)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->nestvlan_tpid_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->nestvlan_tpid_get(dev_id, tpid);
- return rv;
-}
static sw_error_t
_fal_port_invlan_mode_set(a_uint32_t dev_id, fal_port_t port_id,
@@ -331,23 +216,6 @@
rv = p_api->port_invlan_mode_set(dev_id, port_id, mode);
return rv;
}
-
-static sw_error_t
-_fal_port_invlan_mode_get(a_uint32_t dev_id, fal_port_t port_id,
- fal_pt_invlan_mode_t * mode)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->port_invlan_mode_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_invlan_mode_get(dev_id, port_id, mode);
- return rv;
-}
-
static sw_error_t
_fal_port_tls_set(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t enable)
@@ -364,6 +232,146 @@
return rv;
}
+#ifndef IN_PORTVLAN_MINI
+static sw_error_t
+_fal_port_invlan_mode_get(a_uint32_t dev_id, fal_port_t port_id,
+ fal_pt_invlan_mode_t * mode)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->port_invlan_mode_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_invlan_mode_get(dev_id, port_id, mode);
+ return rv;
+}
+static sw_error_t
+_fal_nestvlan_tpid_get(a_uint32_t dev_id, a_uint32_t * tpid)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->nestvlan_tpid_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->nestvlan_tpid_get(dev_id, tpid);
+ return rv;
+}
+static sw_error_t
+_fal_port_nestvlan_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->port_nestvlan_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_nestvlan_get(dev_id, port_id, enable);
+ return rv;
+}
+static sw_error_t
+_fal_port_force_portvlan_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->port_force_portvlan_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_force_portvlan_get(dev_id, port_id, enable);
+ return rv;
+}
+static sw_error_t
+_fal_port_force_default_vid_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->port_force_default_vid_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_force_default_vid_get(dev_id, port_id, enable);
+ return rv;
+}
+
+static sw_error_t
+_fal_port_default_vid_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * vid)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->port_default_vid_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_default_vid_get(dev_id, port_id, vid);
+ return rv;
+}
+
+static sw_error_t
+_fal_port_1qmode_get(a_uint32_t dev_id, fal_port_t port_id,
+ fal_pt_1qmode_t * pport_1qmode)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->port_1qmode_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_1qmode_get(dev_id, port_id, pport_1qmode);
+ return rv;
+}
+static sw_error_t
+_fal_port_egvlanmode_get(a_uint32_t dev_id, fal_port_t port_id,
+ fal_pt_1q_egmode_t * pport_egvlanmode)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->port_egvlanmode_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_egvlanmode_get(dev_id, port_id, pport_egvlanmode);
+ return rv;
+}
+
+static sw_error_t
+_fal_portvlan_member_get(a_uint32_t dev_id, fal_port_t port_id,
+ fal_pbmp_t * mem_port_map)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->portvlan_member_get)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->portvlan_member_get(dev_id, port_id, mem_port_map);
+ return rv;
+}
+
+
+
static sw_error_t
_fal_port_tls_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable)
@@ -411,7 +419,7 @@
rv = p_api->port_pri_propagation_get(dev_id, port_id, enable);
return rv;
}
-
+#endif
static sw_error_t
_fal_port_default_svid_set(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t vid)
@@ -428,21 +436,7 @@
return rv;
}
-static sw_error_t
-_fal_port_default_svid_get(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * vid)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->port_default_svid_get)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->port_default_svid_get(dev_id, port_id, vid);
- return rv;
-}
static sw_error_t
_fal_port_default_cvid_set(a_uint32_t dev_id, fal_port_t port_id,
@@ -460,6 +454,24 @@
return rv;
}
+
+
+static sw_error_t
+_fal_port_vlan_propagation_set(a_uint32_t dev_id, fal_port_t port_id,
+ fal_vlan_propagation_mode_t mode)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->port_vlan_propagation_set)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->port_vlan_propagation_set(dev_id, port_id, mode);
+ return rv;
+}
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_fal_port_default_cvid_get(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * vid)
@@ -475,20 +487,19 @@
rv = p_api->port_default_cvid_get(dev_id, port_id, vid);
return rv;
}
-
static sw_error_t
-_fal_port_vlan_propagation_set(a_uint32_t dev_id, fal_port_t port_id,
- fal_vlan_propagation_mode_t mode)
+_fal_port_default_svid_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * vid)
{
sw_error_t rv;
hsl_api_t *p_api;
SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
- if (NULL == p_api->port_vlan_propagation_set)
+ if (NULL == p_api->port_default_svid_get)
return SW_NOT_SUPPORTED;
- rv = p_api->port_vlan_propagation_set(dev_id, port_id, mode);
+ rv = p_api->port_default_svid_get(dev_id, port_id, vid);
return rv;
}
@@ -752,7 +763,7 @@
rv = p_api->port_vrf_id_get(dev_id, port_id, vrf_id);
return rv;
}
-
+#endif
/**
* @brief Set 802.1q work mode on a particular port.
* @param[in] dev_id device id
@@ -771,7 +782,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get 802.1q work mode on a particular port.
* @param[in] dev_id device id
@@ -790,7 +801,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set packets transmitted out vlan tagged mode on a particular port.
* @param[in] dev_id device id
@@ -809,7 +820,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get packets transmitted out vlan tagged mode on a particular port.
* @param[in] dev_id device id
@@ -828,7 +839,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Add member of port based vlan on a particular port.
* @param[in] dev_id device id
@@ -885,7 +896,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get member of port based vlan on a particular port.
* @param[in] dev_id device id
@@ -904,7 +915,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set default vlan id on a particular port.
* @param[in] dev_id device id
@@ -922,7 +933,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get default vlan id on a particular port.
* @param[in] dev_id device id
@@ -941,7 +952,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set force default vlan id status on a particular port.
* @param[in] dev_id device id
@@ -960,7 +971,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get force default vlan id status on a particular port.
* @param[in] dev_id device id
@@ -979,7 +990,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set force port based vlan status on a particular port.
* @param[in] dev_id device id
@@ -998,7 +1009,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get force port based vlan status on a particular port.
* @param[in] dev_id device id
@@ -1017,7 +1028,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set nest vlan feature status on a particular port.
* @param[in] dev_id device id
@@ -1035,7 +1046,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get nest vlan feature status on a particular port.
* @param[in] dev_id device id
@@ -1053,7 +1064,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set nest vlan tpid on a particular device.
* @param[in] dev_id device id
@@ -1070,7 +1081,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get nest vlan tpid on a particular device.
* @param[in] dev_id device id
@@ -1087,7 +1098,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set ingress vlan mode mode on a particular port.
* @param[in] dev_id device id
@@ -1106,7 +1117,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get ingress vlan mode mode on a particular port.
* @param[in] dev_id device id
@@ -1125,7 +1136,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set tls status on a particular port.
* @param[in] dev_id device id
@@ -1144,6 +1155,8 @@
FAL_API_UNLOCK;
return rv;
}
+#ifndef IN_PORTVLAN_MINI
+
/**
* @brief Get tls status on a particular port.
@@ -1201,7 +1214,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set default s-vid on a particular port.
* @param[in] dev_id device id
@@ -1220,7 +1233,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get default s-vid on a particular port.
* @param[in] dev_id device id
@@ -1239,7 +1252,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set default c-vid on a particular port.
* @param[in] dev_id device id
@@ -1258,7 +1271,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get default c-vid on a particular port.
* @param[in] dev_id device id
@@ -1277,7 +1290,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set vlan propagation status on a particular port.
* @param[in] dev_id device id
@@ -1296,6 +1309,8 @@
FAL_API_UNLOCK;
return rv;
}
+#ifndef IN_PORTVLAN_MINI
+
/**
* @brief Get vlan propagation status on a particular port.
@@ -1605,7 +1620,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @}
diff --git a/src/fal/fal_qos.c b/src/fal/fal_qos.c
index 8b9622d..d68f775 100755
--- a/src/fal/fal_qos.c
+++ b/src/fal/fal_qos.c
@@ -21,7 +21,7 @@
#include "fal_qos.h"
#include "hsl_api.h"
-
+#ifndef IN_QOS_MINI
static sw_error_t
_fal_qos_sch_mode_set(a_uint32_t dev_id,
fal_sch_mode_t mode, const a_uint32_t weight[])
@@ -90,21 +90,6 @@
}
-static sw_error_t
-_fal_qos_queue_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
- fal_queue_t queue_id, a_uint32_t * number)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
-
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->qos_queue_tx_buf_nr_set)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->qos_queue_tx_buf_nr_set(dev_id, port_id, queue_id, number);
- return rv;
-}
static sw_error_t
@@ -158,21 +143,7 @@
}
-static sw_error_t
-_fal_qos_port_red_en_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->qos_port_red_en_set)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->qos_port_red_en_set(dev_id, port_id, enable);
- return rv;
-}
static sw_error_t
@@ -191,21 +162,7 @@
return rv;
}
-static sw_error_t
-_fal_qos_port_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * number)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->qos_port_tx_buf_nr_set)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->qos_port_tx_buf_nr_set(dev_id, port_id, number);
- return rv;
-}
static sw_error_t
@@ -224,21 +181,7 @@
return rv;
}
-static sw_error_t
-_fal_qos_port_rx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * number)
-{
- sw_error_t rv;
- hsl_api_t *p_api;
- SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
- if (NULL == p_api->qos_port_rx_buf_nr_set)
- return SW_NOT_SUPPORTED;
-
- rv = p_api->qos_port_rx_buf_nr_set(dev_id, port_id, number);
- return rv;
-}
static sw_error_t
@@ -322,7 +265,67 @@
rv = p_api->cosmap_dscp_queue_get(dev_id, dscp, queue);
return rv;
}
+#endif
+static sw_error_t
+_fal_qos_port_red_en_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->qos_port_red_en_set)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->qos_port_red_en_set(dev_id, port_id, enable);
+ return rv;
+}
+static sw_error_t
+_fal_qos_queue_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
+ fal_queue_t queue_id, a_uint32_t * number)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->qos_queue_tx_buf_nr_set)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->qos_queue_tx_buf_nr_set(dev_id, port_id, queue_id, number);
+ return rv;
+}
+static sw_error_t
+_fal_qos_port_rx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * number)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->qos_port_rx_buf_nr_set)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->qos_port_rx_buf_nr_set(dev_id, port_id, number);
+ return rv;
+}
+static sw_error_t
+_fal_qos_port_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * number)
+{
+ sw_error_t rv;
+ hsl_api_t *p_api;
+
+ SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+
+ if (NULL == p_api->qos_port_tx_buf_nr_set)
+ return SW_NOT_SUPPORTED;
+
+ rv = p_api->qos_port_tx_buf_nr_set(dev_id, port_id, number);
+ return rv;
+}
static sw_error_t
_fal_qos_port_mode_set(a_uint32_t dev_id, fal_port_t port_id,
@@ -341,6 +344,9 @@
}
+
+
+#ifndef IN_QOS_MINI
static sw_error_t
_fal_qos_port_mode_get(a_uint32_t dev_id, fal_port_t port_id,
fal_qos_mode_t mode, a_bool_t * enable)
@@ -356,8 +362,6 @@
rv = p_api->qos_port_mode_get(dev_id, port_id, mode, enable);
return rv;
}
-
-
static sw_error_t
_fal_qos_port_mode_pri_set(a_uint32_t dev_id, fal_port_t port_id,
fal_qos_mode_t mode, a_uint32_t pri)
@@ -702,28 +706,7 @@
return rv;
}
-/**
- * @brief Set max occupied buffer number of transmitting queue on one particular port.
- * @details Comments:
- * Because different device has differnet hardware granularity
- * function will return actual buffer numbers in hardware.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[in] queue_id queue id
- * @param number buffer number
- * @return SW_OK or error code
- */
-sw_error_t
-fal_qos_queue_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
- fal_queue_t queue_id, a_uint32_t * number)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_qos_queue_tx_buf_nr_set(dev_id, port_id, queue_id, number);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Get max occupied buffer number of transmitting queue on one particular port.
@@ -787,24 +770,7 @@
return rv;
}
-/**
- * @brief Set status of port red on one particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[in] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-sw_error_t
-fal_qos_port_red_en_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_qos_port_red_en_set(dev_id, port_id, enable);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Set status of port red on one particular port.
@@ -826,27 +792,7 @@
}
-/**
- * @brief Set max occupied buffer number of transmitting port on one particular port.
- * @details Comments:
- * Because different device has differnet hardware granularity
- * function will return actual buffer number in hardware.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param number buffer number
- * @return SW_OK or error code
- */
-sw_error_t
-fal_qos_port_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * number)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_qos_port_tx_buf_nr_set(dev_id, port_id, number);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Get max occupied buffer number of transmitting port on one particular port.
@@ -867,27 +813,7 @@
return rv;
}
-/**
- * @brief Set max reserved buffer number of receiving port on one particular port.
- * @details Comments:
- * Because different device has differnet hardware granularity
- * function will return actual buffer number in hardware.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param number buffer number
- * @return SW_OK or error code
- */
-sw_error_t
-fal_qos_port_rx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * number)
-{
- sw_error_t rv;
- FAL_API_LOCK;
- rv = _fal_qos_port_rx_buf_nr_set(dev_id, port_id, number);
- FAL_API_UNLOCK;
- return rv;
-}
/**
* @brief Get max reserved buffer number of receiving port on one particular port.
@@ -981,7 +907,89 @@
FAL_API_UNLOCK;
return rv;
}
+#endif
+/**
+ * @brief Set max occupied buffer number of transmitting queue on one particular port.
+ * @details Comments:
+ * Because different device has differnet hardware granularity
+ * function will return actual buffer numbers in hardware.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[in] queue_id queue id
+ * @param number buffer number
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_qos_queue_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
+ fal_queue_t queue_id, a_uint32_t * number)
+{
+ sw_error_t rv;
+ FAL_API_LOCK;
+ rv = _fal_qos_queue_tx_buf_nr_set(dev_id, port_id, queue_id, number);
+ FAL_API_UNLOCK;
+ return rv;
+}
+/**
+ * @brief Set status of port red on one particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[in] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_qos_port_red_en_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_qos_port_red_en_set(dev_id, port_id, enable);
+ FAL_API_UNLOCK;
+ return rv;
+}
+/**
+ * @brief Set max occupied buffer number of transmitting port on one particular port.
+ * @details Comments:
+ * Because different device has differnet hardware granularity
+ * function will return actual buffer number in hardware.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param number buffer number
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_qos_port_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * number)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_qos_port_tx_buf_nr_set(dev_id, port_id, number);
+ FAL_API_UNLOCK;
+ return rv;
+}
+/**
+ * @brief Set max reserved buffer number of receiving port on one particular port.
+ * @details Comments:
+ * Because different device has differnet hardware granularity
+ * function will return actual buffer number in hardware.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param number buffer number
+ * @return SW_OK or error code
+ */
+sw_error_t
+fal_qos_port_rx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * number)
+{
+ sw_error_t rv;
+
+ FAL_API_LOCK;
+ rv = _fal_qos_port_rx_buf_nr_set(dev_id, port_id, number);
+ FAL_API_UNLOCK;
+ return rv;
+}
/**
* @brief Set port qos mode on one particular port.
* @param[in] dev_id device id
@@ -1002,6 +1010,8 @@
return rv;
}
+
+#ifndef IN_QOS_MINI
/**
* @brief Get port qos mode on one particular port.
* @param[in] dev_id device id
@@ -1021,7 +1031,6 @@
FAL_API_UNLOCK;
return rv;
}
-
/**
* @brief Set priority of one particular qos mode on one particular port.
* @details Comments:
@@ -1339,7 +1348,7 @@
FAL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @}
diff --git a/src/hsl/Makefile b/src/hsl/Makefile
index 98888da..f7d2bde 100755
--- a/src/hsl/Makefile
+++ b/src/hsl/Makefile
@@ -6,7 +6,15 @@
SRC_LIST=hsl_dev.c hsl_port_prop.c hsl_api.c
ifeq (TRUE, $(IN_ACL))
- SRC_LIST += hsl_acl.c
+ ifeq (SHIVA, $(CHIP_TYPE))
+ SRC_LIST += hsl_acl.c
+ endif
+ ifeq (GARUDA, $(CHIP_TYPE))
+ SRC_LIST += hsl_acl.c
+ endif
+ ifeq (ALL_CHIP, $(CHIP_TYPE))
+ SRC_LIST += hsl_acl.c
+ endif
endif
ifeq (linux, $(OS))
diff --git a/src/hsl/hsl_dev.c b/src/hsl/hsl_dev.c
index fd38920..f3f7645 100755
--- a/src/hsl/hsl_dev.c
+++ b/src/hsl/hsl_dev.c
@@ -430,3 +430,177 @@
return rv;
}
+sw_error_t reduce_hsl_reg_entry_get(a_uint32_t dev,a_uint32_t reg,a_uint8_t* value,a_uint8_t val_len)
+{
+ sw_error_t rv;
+
+ hsl_api_t *p_api = hsl_api_ptr_get(dev);
+ if (p_api) {
+ rv = p_api->reg_get(dev, reg, (a_uint8_t*)value, (a_uint8_t)val_len);
+ } else {
+ rv = SW_NOT_INITIALIZED;
+ }
+
+ return rv;
+}
+
+sw_error_t reduce_hsl_reg_entry_set(a_uint32_t dev,a_uint32_t reg,a_uint8_t* value,a_uint8_t val_len)
+{
+ sw_error_t rv;
+
+ hsl_api_t *p_api = hsl_api_ptr_get(dev);
+ if (p_api) {
+ rv = p_api->reg_set (dev, reg,
+ (a_uint8_t*)value, (a_uint8_t)val_len);
+ } else {
+ rv = SW_NOT_INITIALIZED;
+ }
+
+ return rv;
+
+}
+
+sw_error_t reduce_hsl_reg_field_get(a_uint32_t dev,a_uint32_t reg,a_uint32_t reg_offset,
+ a_uint32_t reg_offset_len,a_uint8_t* value,a_uint8_t val_len)
+{
+ sw_error_t rv;
+
+ hsl_api_t *p_api = hsl_api_ptr_get(dev);
+ if (p_api) {
+ rv = p_api->reg_field_get(dev, reg, reg_offset, reg_offset_len, (a_uint8_t*)value, val_len);
+ } else {
+ rv = SW_NOT_INITIALIZED;
+ }
+ return rv;
+}
+
+sw_error_t reduce_hsl_reg_field_set(a_uint32_t dev,a_uint32_t reg,a_uint32_t reg_offset,
+ a_uint32_t reg_offset_len,a_uint8_t* value,a_uint8_t val_len)
+{
+ sw_error_t rv;
+
+ hsl_api_t *p_api = hsl_api_ptr_get(dev);
+ if (p_api) {
+ rv = p_api->reg_field_set(dev, reg,
+ reg_offset,
+ reg_offset_len, (a_uint8_t*)value, val_len);
+ } else {
+ rv = SW_NOT_INITIALIZED;
+ }
+ return rv;
+}
+
+sw_error_t reduce_hsl_reg_entry_gen_get(a_uint32_t dev,a_uint32_t addr,a_uint8_t* value,a_uint8_t val_len)
+{
+ sw_error_t rv;
+
+ hsl_api_t *p_api = hsl_api_ptr_get(dev);
+ if (p_api) {
+ rv = p_api->reg_get(dev, addr, (a_uint8_t*)value, val_len);
+ } else {
+ rv = SW_NOT_INITIALIZED;
+ }
+
+ return rv;
+}
+
+
+sw_error_t reduce_hsl_reg_entry_gen_set(a_uint32_t dev,a_uint32_t addr,a_uint8_t* value,a_uint8_t val_len)
+{
+ sw_error_t rv;
+
+ hsl_api_t *p_api = hsl_api_ptr_get(dev);
+ if (p_api) {
+ rv = p_api->reg_set(dev, addr, (a_uint8_t*)value, val_len);
+ } else {
+ rv = SW_NOT_INITIALIZED;
+ }
+
+ return rv;
+}
+
+sw_error_t reduce_hsl_reg_field_gen_get(a_uint32_t dev,a_uint32_t reg_addr,a_uint32_t bitoffset,
+ a_uint32_t field_len,a_uint8_t* value,a_uint8_t val_len)
+{
+ sw_error_t rv;
+
+ hsl_api_t *p_api = hsl_api_ptr_get(dev);
+ if (p_api) {
+ rv = p_api->reg_field_get(dev, reg_addr,
+ bitoffset,
+ field_len, (a_uint8_t*)value, val_len);
+ } else {
+ rv = SW_NOT_INITIALIZED;
+ }
+ return rv;
+}
+
+
+sw_error_t reduce_hsl_reg_field_gen_set(a_uint32_t dev,a_uint32_t regaddr,a_uint32_t bitoffset,
+ a_uint32_t bitlength,a_uint8_t* value,a_uint8_t val_len)
+{
+ sw_error_t rv;
+
+ hsl_api_t *p_api = hsl_api_ptr_get(dev);
+ if (p_api) {
+ rv = p_api->reg_field_set(dev, regaddr,
+ bitoffset,
+ bitlength, (a_uint8_t*)value, val_len);
+ } else {
+ rv = SW_NOT_INITIALIZED;
+ }
+ return rv;
+}
+
+
+sw_error_t reduce_hsl_phy_set(a_uint32_t dev,a_uint32_t phy_addr,a_uint32_t reg,a_uint8_t* value)
+{
+ sw_error_t rv;
+
+ hsl_api_t *p_api = hsl_api_ptr_get(dev);
+ if (p_api) {
+ rv = p_api->phy_set(dev, phy_addr, reg, value);
+ } else {
+ rv = SW_NOT_INITIALIZED;
+ }
+
+ return rv;
+}
+
+sw_error_t reduce_hsl_phy_get(a_uint32_t dev,a_uint32_t phy_addr,a_uint32_t reg,a_uint8_t* value)
+{
+ sw_error_t rv;
+
+ hsl_api_t *p_api = hsl_api_ptr_get(dev);
+ if (p_api) {
+ rv = p_api->phy_get(dev, phy_addr, reg, value);
+ } else {
+ rv = SW_NOT_INITIALIZED;
+ }
+
+ return rv;
+}
+
+#if 0
+void reduce_sw_set_reg_by_field_u32(unsigned int reg_value,unsigned int field_value,
+ unsigned int reg_offset,unsigned int reg_len)
+{
+ do {
+ (reg_value) = (((reg_value) & SW_FIELD_MASK_NOT_U32((reg_offset),(reg_offset)))
+ | (((field_value) & SW_BIT_MASK_U32(reg_len)) << (reg_offset)));
+ } while (0);
+
+}
+
+
+void reduce_sw_field_get_by_reg_u32(unsigned int reg_value,unsigned int field_value,
+ unsigned int reg_offset,unsigned int reg_len)
+{
+ do {
+ (field_value) = (((reg_value) >> (reg_offset)) & SW_BIT_MASK_U32(reg_len));
+ } while (0);
+
+}
+#endif
+
+
diff --git a/src/hsl/isisc/Makefile b/src/hsl/isisc/Makefile
index 009f899..4990ff0 100755
--- a/src/hsl/isisc/Makefile
+++ b/src/hsl/isisc/Makefile
@@ -6,7 +6,7 @@
SRC_LIST=isisc_reg_access.c isisc_init.c
ifeq (TRUE, $(IN_ACL))
- SRC_LIST += isisc_acl.c isisc_acl_parse.c isisc_multicast_acl.c
+ SRC_LIST += isisc_acl.c isisc_acl_parse.c
endif
ifeq (TRUE, $(IN_FDB))
@@ -15,6 +15,9 @@
ifeq (TRUE, $(IN_IGMP))
SRC_LIST += isisc_igmp.c
+ ifeq (TRUE, $(IN_ACL))
+ SRC_LIST += isisc_multicast_acl.c
+ endif
endif
ifeq (TRUE, $(IN_LEAKY))
diff --git a/src/hsl/isisc/isisc_cosmap.c b/src/hsl/isisc/isisc_cosmap.c
index fc5e9fe..b78511e 100755
--- a/src/hsl/isisc/isisc_cosmap.c
+++ b/src/hsl/isisc/isisc_cosmap.c
@@ -39,6 +39,7 @@
#define ISISC_EGRESS_REAMRK_ADDR 0x5ae00
#define ISISC_EGRESS_REAMRK_NUM 16
+#ifndef IN_COSMAP_MINI
static sw_error_t
_isisc_cosmap_dscp_to_pri_dp_set(a_uint32_t dev_id, a_uint32_t mode,
a_uint32_t dscp, a_uint32_t val)
@@ -183,6 +184,7 @@
return SW_OK;
}
+#endif
static sw_error_t
_isisc_cosmap_pri_to_queue_set(a_uint32_t dev_id, a_uint32_t pri,
@@ -209,26 +211,6 @@
}
static sw_error_t
-_isisc_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri,
- a_uint32_t * queue)
-{
- sw_error_t rv;
- a_uint32_t data;
-
- if (ISISC_MAX_PRI < pri)
- {
- return SW_BAD_PARAM;
- }
-
- HSL_REG_ENTRY_GET(rv, dev_id, PRI_TO_QUEUE, 0, (a_uint8_t *) (&data),
- sizeof (a_uint32_t));
- SW_RTN_ON_ERROR(rv);
-
- *queue = (data >> (pri << 2)) & 0x3;
- return SW_OK;
-}
-
-static sw_error_t
_isisc_cosmap_pri_to_ehqueue_set(a_uint32_t dev_id, a_uint32_t pri,
a_uint32_t queue)
{
@@ -252,6 +234,27 @@
return rv;
}
+#ifndef IN_COSMAP_MINI
+static sw_error_t
+_isisc_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri,
+ a_uint32_t * queue)
+{
+ sw_error_t rv;
+ a_uint32_t data;
+
+ if (ISISC_MAX_PRI < pri)
+ {
+ return SW_BAD_PARAM;
+ }
+
+ HSL_REG_ENTRY_GET(rv, dev_id, PRI_TO_QUEUE, 0, (a_uint8_t *) (&data),
+ sizeof (a_uint32_t));
+ SW_RTN_ON_ERROR(rv);
+
+ *queue = (data >> (pri << 2)) & 0x3;
+ return SW_OK;
+}
+
static sw_error_t
_isisc_cosmap_pri_to_ehqueue_get(a_uint32_t dev_id, a_uint32_t pri,
a_uint32_t * queue)
@@ -477,6 +480,7 @@
HSL_API_UNLOCK;
return rv;
}
+#endif
/**
* @brief Set internal priority to queue mapping on one particular device.
@@ -500,27 +504,6 @@
}
/**
- * @brief Get internal priority to queue mapping on one particular device.
- * @details Comments:
- * This function is for port 1/2/3/4 which have four egress queues
- * @param[in] dev_id device id
- * @param[in] pri internal priority
- * @param[out] queue queue id
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri,
- a_uint32_t * queue)
-{
- sw_error_t rv;
-
- HSL_API_LOCK;
- rv = _isisc_cosmap_pri_to_queue_get(dev_id, pri, queue);
- HSL_API_UNLOCK;
- return rv;
-}
-
-/**
* @brief Set internal priority to queue mapping on one particular device.
* @details Comments:
* This function is for port 0/5/6 which have six egress queues
@@ -541,6 +524,28 @@
return rv;
}
+#ifndef IN_COSMAP_MINI
+/**
+ * @brief Get internal priority to queue mapping on one particular device.
+ * @details Comments:
+ * This function is for port 1/2/3/4 which have four egress queues
+ * @param[in] dev_id device id
+ * @param[in] pri internal priority
+ * @param[out] queue queue id
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri,
+ a_uint32_t * queue)
+{
+ sw_error_t rv;
+
+ HSL_API_LOCK;
+ rv = _isisc_cosmap_pri_to_queue_get(dev_id, pri, queue);
+ HSL_API_UNLOCK;
+ return rv;
+}
+
/**
* @brief Get internal priority to queue mapping on one particular device.
* @details Comments:
@@ -599,6 +604,7 @@
HSL_API_UNLOCK;
return rv;
}
+#endif
sw_error_t
isisc_cosmap_init(a_uint32_t dev_id)
@@ -611,6 +617,7 @@
SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
+#ifndef IN_COSMAP_MINI
p_api->cosmap_dscp_to_pri_set = isisc_cosmap_dscp_to_pri_set;
p_api->cosmap_dscp_to_pri_get = isisc_cosmap_dscp_to_pri_get;
p_api->cosmap_dscp_to_dp_set = isisc_cosmap_dscp_to_dp_set;
@@ -619,12 +626,15 @@
p_api->cosmap_up_to_pri_get = isisc_cosmap_up_to_pri_get;
p_api->cosmap_up_to_dp_set = isisc_cosmap_up_to_dp_set;
p_api->cosmap_up_to_dp_get = isisc_cosmap_up_to_dp_get;
+#endif
p_api->cosmap_pri_to_queue_set = isisc_cosmap_pri_to_queue_set;
+ p_api->cosmap_pri_to_ehqueue_set = isisc_cosmap_pri_to_ehqueue_set;
+#ifndef IN_COSMAP_MINI
p_api->cosmap_pri_to_queue_get = isisc_cosmap_pri_to_queue_get;
- p_api->cosmap_pri_to_ehqueue_set = isisc_cosmap_pri_to_ehqueue_set;
p_api->cosmap_pri_to_ehqueue_get = isisc_cosmap_pri_to_ehqueue_get;
p_api->cosmap_egress_remark_set = isisc_cosmap_egress_remark_set;
p_api->cosmap_egress_remark_get = isisc_cosmap_egress_remark_get;
+#endif
}
#endif
diff --git a/src/hsl/isisc/isisc_fdb.c b/src/hsl/isisc/isisc_fdb.c
index 2ce7021..0dd8c54 100755
--- a/src/hsl/isisc/isisc_fdb.c
+++ b/src/hsl/isisc/isisc_fdb.c
@@ -577,7 +577,7 @@
return rv;
}
-
+#ifndef IN_FDB_MINI
static sw_error_t
_isisc_fdb_del_by_port(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t flag)
{
@@ -660,7 +660,7 @@
rv = _isisc_fdb_get(dev_id, &option, entry, ARL_FIND_ENTRY);
return rv;
}
-
+#endif
static sw_error_t
_isisc_fdb_extend_next(a_uint32_t dev_id, fal_fdb_op_t * option,
fal_fdb_entry_t * entry)
@@ -680,7 +680,7 @@
rv = _isisc_fdb_get(dev_id, option, entry, ARL_FIRST_ENTRY);
return rv;
}
-
+#ifndef IN_FDB_MINI
static sw_error_t
_isisc_fdb_transfer(a_uint32_t dev_id, fal_port_t old_port, fal_port_t new_port,
a_uint32_t fid, fal_fdb_op_t * option)
@@ -727,7 +727,7 @@
rv = _isisc_fdb_commit(dev_id, ARL_TRANSFER_ENTRY);
return rv;
}
-
+#endif
static sw_error_t
_isisc_fdb_port_learn_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
{
@@ -758,7 +758,7 @@
(a_uint8_t *) (&data), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_FDB_MINI
static sw_error_t
_isisc_fdb_port_learn_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable)
@@ -1638,7 +1638,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Delete all Fdb entries
* @details Comments:
@@ -1658,7 +1658,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_FDB_MINI
/**
* @brief Delete Fdb entries on a particular port
* @details Comments:
@@ -1719,7 +1719,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Get next Fdb entry from a particular device
* @param[in] dev_id device id
@@ -1757,7 +1757,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_FDB_MINI
/**
* @brief Transfer fdb entries port information on a particular device.
* @param[in] dev_id device id
@@ -1778,7 +1778,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set dynamic address learning status on a particular port.
* @details Comments:
@@ -1799,7 +1799,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_FDB_MINI
/**
* @brief Get dynamic address learning status on a particular port.
* @param[in] dev_id device id
@@ -2225,7 +2225,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
sw_error_t
isisc_fdb_init(a_uint32_t dev_id)
{
@@ -2236,13 +2236,17 @@
hsl_api_t *p_api;
SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
+#ifndef IN_FDB_MINI
p_api->fdb_add = isisc_fdb_add;
+#endif
p_api->fdb_del_all = isisc_fdb_del_all;
+#ifndef IN_FDB_MINI
p_api->fdb_del_by_port = isisc_fdb_del_by_port;
p_api->fdb_del_by_mac = isisc_fdb_del_by_mac;
p_api->fdb_find = isisc_fdb_find;
+#endif
p_api->port_learn_set = isisc_fdb_port_learn_set;
+#ifndef IN_FDB_MINI
p_api->port_learn_get = isisc_fdb_port_learn_get;
p_api->age_ctrl_set = isisc_fdb_age_ctrl_set;
p_api->age_ctrl_get = isisc_fdb_age_ctrl_get;
@@ -2250,8 +2254,10 @@
p_api->vlan_ivl_svl_get = isisc_fdb_vlan_ivl_svl_get;
p_api->age_time_set = isisc_fdb_age_time_set;
p_api->age_time_get = isisc_fdb_age_time_get;
+#endif
p_api->fdb_extend_next = isisc_fdb_extend_next;
p_api->fdb_extend_first = isisc_fdb_extend_first;
+#ifndef IN_FDB_MINI
p_api->fdb_transfer = isisc_fdb_transfer;
p_api->port_fdb_learn_limit_set = isisc_port_fdb_learn_limit_set;
p_api->port_fdb_learn_limit_get = isisc_port_fdb_learn_limit_get;
@@ -2269,6 +2275,7 @@
p_api->fdb_port_learn_static_get = isisc_fdb_port_learn_static_get;
p_api->fdb_port_add = isisc_fdb_port_add;
p_api->fdb_port_del = isisc_fdb_port_del;
+#endif
}
#endif
diff --git a/src/hsl/isisc/isisc_misc.c b/src/hsl/isisc/isisc_misc.c
index ec975d0..46ed16d 100755
--- a/src/hsl/isisc/isisc_misc.c
+++ b/src/hsl/isisc/isisc_misc.c
@@ -204,36 +204,6 @@
return rv;
}
-static sw_error_t
-_isisc_port_unk_uc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
- a_uint32_t reg, field;
-
- HSL_DEV_ID_CHECK(dev_id);
-
- if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
- {
- return SW_BAD_PARAM;
- }
-
- HSL_REG_FIELD_GET(rv, dev_id, FORWARD_CTL1, 0, UNI_FLOOD_DP,
- (a_uint8_t *) (®), sizeof (a_uint32_t));
- SW_RTN_ON_ERROR(rv);
-
- field = reg & (0x1 << port_id);
- if (field)
- {
- *enable = A_FALSE;
- }
- else
- {
- *enable = A_TRUE;
- }
-
- return SW_OK;
-}
static sw_error_t
_isisc_port_unk_mc_filter_set(a_uint32_t dev_id, fal_port_t port_id,
@@ -271,36 +241,6 @@
return rv;
}
-static sw_error_t
-_isisc_port_unk_mc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
- a_uint32_t reg, field;
-
- HSL_DEV_ID_CHECK(dev_id);
-
- if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
- {
- return SW_BAD_PARAM;
- }
-
- HSL_REG_FIELD_GET(rv, dev_id, FORWARD_CTL1, 0, MUL_FLOOD_DP,
- (a_uint8_t *) (®), sizeof (a_uint32_t));
- SW_RTN_ON_ERROR(rv);
-
- field = reg & (0x1 << port_id);
- if (field)
- {
- *enable = A_FALSE;
- }
- else
- {
- *enable = A_TRUE;
- }
-
- return SW_OK;
-}
static sw_error_t
_isisc_port_bc_filter_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
@@ -338,6 +278,33 @@
}
static sw_error_t
+_isisc_cpu_port_status_set(a_uint32_t dev_id, a_bool_t enable)
+{
+ sw_error_t rv;
+ a_uint32_t val;
+
+ HSL_DEV_ID_CHECK(dev_id);
+
+ if (A_TRUE == enable)
+ {
+ val = 1;
+ }
+ else if (A_FALSE == enable)
+ {
+ val = 0;
+ }
+ else
+ {
+ return SW_BAD_PARAM;
+ }
+
+ HSL_REG_FIELD_SET(rv, dev_id, FORWARD_CTL0, 0, CPU_PORT_EN,
+ (a_uint8_t *) (&val), sizeof (a_uint32_t));
+ return rv;
+}
+
+#ifndef IN_MISC_MINI
+static sw_error_t
_isisc_port_bc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable)
{
@@ -369,29 +336,65 @@
}
static sw_error_t
-_isisc_cpu_port_status_set(a_uint32_t dev_id, a_bool_t enable)
+_isisc_port_unk_uc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
{
sw_error_t rv;
- a_uint32_t val;
+ a_uint32_t reg, field;
HSL_DEV_ID_CHECK(dev_id);
- if (A_TRUE == enable)
- {
- val = 1;
- }
- else if (A_FALSE == enable)
- {
- val = 0;
- }
- else
+ if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
{
return SW_BAD_PARAM;
}
- HSL_REG_FIELD_SET(rv, dev_id, FORWARD_CTL0, 0, CPU_PORT_EN,
- (a_uint8_t *) (&val), sizeof (a_uint32_t));
- return rv;
+ HSL_REG_FIELD_GET(rv, dev_id, FORWARD_CTL1, 0, UNI_FLOOD_DP,
+ (a_uint8_t *) (®), sizeof (a_uint32_t));
+ SW_RTN_ON_ERROR(rv);
+
+ field = reg & (0x1 << port_id);
+ if (field)
+ {
+ *enable = A_FALSE;
+ }
+ else
+ {
+ *enable = A_TRUE;
+ }
+
+ return SW_OK;
+}
+
+static sw_error_t
+_isisc_port_unk_mc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+ a_uint32_t reg, field;
+
+ HSL_DEV_ID_CHECK(dev_id);
+
+ if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
+ {
+ return SW_BAD_PARAM;
+ }
+
+ HSL_REG_FIELD_GET(rv, dev_id, FORWARD_CTL1, 0, MUL_FLOOD_DP,
+ (a_uint8_t *) (®), sizeof (a_uint32_t));
+ SW_RTN_ON_ERROR(rv);
+
+ field = reg & (0x1 << port_id);
+ if (field)
+ {
+ *enable = A_FALSE;
+ }
+ else
+ {
+ *enable = A_TRUE;
+ }
+
+ return SW_OK;
}
static sw_error_t
@@ -676,6 +679,7 @@
return SW_OK;
}
+#endif
static sw_error_t
_isisc_eapol_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd)
@@ -703,6 +707,7 @@
return rv;
}
+#ifndef IN_MISC_MINI
static sw_error_t
_isisc_eapol_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd)
{
@@ -1240,7 +1245,7 @@
return rv;
}
-
+#endif
/**
* @brief Set max frame size which device can received on a particular device.
@@ -1303,25 +1308,6 @@
}
/**
- * @brief Get flooding status of unknown unicast packets on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_port_unk_uc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
-
- HSL_API_LOCK;
- rv = _isisc_port_unk_uc_filter_get(dev_id, port_id, enable);
- HSL_API_UNLOCK;
- return rv;
-}
-
-/**
* @brief Set flooding status of unknown multicast packets on a particular port.
* @details Comments:
* If enable unknown multicast packets filter on one port then unknown
@@ -1343,24 +1329,6 @@
return rv;
}
-/** @brief Get flooding status of unknown multicast packets on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_port_unk_mc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t * enable)
-{
- sw_error_t rv;
-
- HSL_API_LOCK;
- rv = _isisc_port_unk_mc_filter_get(dev_id, port_id, enable);
- HSL_API_UNLOCK;
- return rv;
-}
-
/**
* @brief Set flooding status of broadcast packets on a particular port.
* @details Comments:
@@ -1382,6 +1350,61 @@
return rv;
}
+/**
+ * @brief Set cpu port status on a particular device.
+ * @param[in] dev_id device id
+ * @param[in] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_cpu_port_status_set(a_uint32_t dev_id, a_bool_t enable)
+{
+ sw_error_t rv;
+
+ HSL_API_LOCK;
+ rv = _isisc_cpu_port_status_set(dev_id, enable);
+ HSL_API_UNLOCK;
+ return rv;
+}
+
+#ifndef IN_MISC_MINI
+/**
+ * @brief Get flooding status of unknown unicast packets on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_port_unk_uc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+
+ HSL_API_LOCK;
+ rv = _isisc_port_unk_uc_filter_get(dev_id, port_id, enable);
+ HSL_API_UNLOCK;
+ return rv;
+}
+
+/** @brief Get flooding status of unknown multicast packets on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_port_unk_mc_filter_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t * enable)
+{
+ sw_error_t rv;
+
+ HSL_API_LOCK;
+ rv = _isisc_port_unk_mc_filter_get(dev_id, port_id, enable);
+ HSL_API_UNLOCK;
+ return rv;
+}
+
/** @brief Get flooding status of broadcast packets on a particular port.
* @param[in] dev_id device id
* @param[in] port_id port id
@@ -1401,23 +1424,6 @@
}
/**
- * @brief Set cpu port status on a particular device.
- * @param[in] dev_id device id
- * @param[in] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_cpu_port_status_set(a_uint32_t dev_id, a_bool_t enable)
-{
- sw_error_t rv;
-
- HSL_API_LOCK;
- rv = _isisc_cpu_port_status_set(dev_id, enable);
- HSL_API_UNLOCK;
- return rv;
-}
-
-/**
* @brief Get cpu port status on a particular device.
* @param[in] dev_id device id
* @param[in] enable A_TRUE or A_FALSE
@@ -1579,6 +1585,7 @@
HSL_API_UNLOCK;
return rv;
}
+#endif
/**
* @brief Set eapol packets forwarding command on a particular device.
@@ -1601,6 +1608,7 @@
return rv;
}
+#ifndef IN_MISC_MINI
/**
* @brief Get eapol packets forwarding command on a particular device.
* @param[in] dev_id device id
@@ -1712,6 +1720,7 @@
HSL_API_UNLOCK;
return rv;
}
+#endif
/**
* @brief Set eapol packets hardware acknowledgement status on a particular port.
@@ -1731,6 +1740,7 @@
return rv;
}
+#ifndef IN_MISC_MINI
/**
* @brief Get eapol packets hardware acknowledgement status on a particular port.
* @param[in] dev_id device id
@@ -2116,6 +2126,7 @@
FAL_API_UNLOCK;
return rv;
}
+#endif
sw_error_t
isisc_misc_init(a_uint32_t dev_id)
@@ -2131,12 +2142,13 @@
p_api->frame_max_size_set = isisc_frame_max_size_set;
p_api->frame_max_size_get = isisc_frame_max_size_get;
p_api->port_unk_uc_filter_set = isisc_port_unk_uc_filter_set;
- p_api->port_unk_uc_filter_get = isisc_port_unk_uc_filter_get;
p_api->port_unk_mc_filter_set = isisc_port_unk_mc_filter_set;
- p_api->port_unk_mc_filter_get = isisc_port_unk_mc_filter_get;
p_api->port_bc_filter_set = isisc_port_bc_filter_set;
+ p_api->cpu_port_status_set = isisc_cpu_port_status_set;
+#ifndef IN_MISC_MINI
+ p_api->port_unk_uc_filter_get = isisc_port_unk_uc_filter_get;
+ p_api->port_unk_mc_filter_get = isisc_port_unk_mc_filter_get;
p_api->port_bc_filter_get = isisc_port_bc_filter_get;
- p_api->cpu_port_status_set = isisc_cpu_port_status_set;
p_api->cpu_port_status_get = isisc_cpu_port_status_get;
p_api->pppoe_cmd_set = isisc_pppoe_cmd_set;
p_api->pppoe_cmd_get = isisc_pppoe_cmd_get;
@@ -2146,14 +2158,18 @@
p_api->port_dhcp_get = isisc_port_dhcp_get;
p_api->arp_cmd_set = isisc_arp_cmd_set;
p_api->arp_cmd_get = isisc_arp_cmd_get;
+#endif
p_api->eapol_cmd_set = isisc_eapol_cmd_set;
+#ifndef IN_MISC_MINI
p_api->eapol_cmd_get = isisc_eapol_cmd_get;
p_api->pppoe_session_table_add = isisc_pppoe_session_table_add;
p_api->pppoe_session_table_del = isisc_pppoe_session_table_del;
p_api->pppoe_session_table_get = isisc_pppoe_session_table_get;
p_api->pppoe_session_id_set = isisc_pppoe_session_id_set;
p_api->pppoe_session_id_get = isisc_pppoe_session_id_get;
+#endif
p_api->eapol_status_set = isisc_eapol_status_set;
+#ifndef IN_MISC_MINI
p_api->eapol_status_get = isisc_eapol_status_get;
p_api->ripv1_status_set = isisc_ripv1_status_set;
p_api->ripv1_status_get = isisc_ripv1_status_get;
@@ -2176,6 +2192,7 @@
p_api->rtd_pppoe_en_set = isisc_rtd_pppoe_en_set;
p_api->rtd_pppoe_en_get = isisc_rtd_pppoe_en_get;
p_api->intr_status_mac_linkchg_clear = isisc_intr_status_mac_linkchg_clear;
+#endif
}
#endif
diff --git a/src/hsl/isisc/isisc_port_ctrl.c b/src/hsl/isisc/isisc_port_ctrl.c
index b6c168c..476923f 100755
--- a/src/hsl/isisc/isisc_port_ctrl.c
+++ b/src/hsl/isisc/isisc_port_ctrl.c
@@ -24,6 +24,7 @@
#include "isisc_port_ctrl.h"
#include "isisc_reg.h"
#include "hsl_phy.h"
+
static a_bool_t
_isisc_port_phy_connected(a_uint32_t dev_id, fal_port_t port_id)
{
@@ -125,35 +126,6 @@
}
static sw_error_t
-_isisc_port_duplex_get(a_uint32_t dev_id, fal_port_t port_id,
- fal_port_duplex_t * pduplex)
-{
- sw_error_t rv;
- a_uint32_t reg, field;
-
- HSL_DEV_ID_CHECK(dev_id);
-
- if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
- {
- return SW_BAD_PARAM;
- }
-
- HSL_REG_ENTRY_GET(rv, dev_id, PORT_STATUS, port_id,
- (a_uint8_t *) (®), sizeof (a_uint32_t));
- SW_GET_FIELD_BY_REG(PORT_STATUS, DUPLEX_MODE, field, reg);
- if (field)
- {
- *pduplex = FAL_FULL_DUPLEX;
- }
- else
- {
- *pduplex = FAL_HALF_DUPLEX;
- }
-
- return SW_OK;
-}
-
-static sw_error_t
_isisc_port_speed_set(a_uint32_t dev_id, fal_port_t port_id,
fal_port_speed_t speed)
{
@@ -253,6 +225,97 @@
}
static sw_error_t
+_isisc_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
+{
+ sw_error_t rv;
+ a_uint32_t val, force, reg, tmp;
+
+ if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
+ {
+ return SW_BAD_PARAM;
+ }
+
+ if (A_TRUE == enable)
+ {
+ val = 1;
+ }
+ else if (A_FALSE == enable)
+ {
+ val = 0;
+ }
+ else
+ {
+ return SW_BAD_PARAM;
+ }
+
+ HSL_REG_ENTRY_GET(rv, dev_id, PORT_STATUS, port_id,
+ (a_uint8_t *) (®), sizeof (a_uint32_t));
+ SW_RTN_ON_ERROR(rv);
+
+ SW_GET_FIELD_BY_REG(PORT_STATUS, FLOW_LINK_EN, force, reg);
+ if (force)
+ {
+ /* flow control isn't in force mode so can't set */
+ return SW_DISABLE;
+ }
+ tmp = reg;
+
+ SW_SET_REG_BY_FIELD(PORT_STATUS, RX_FLOW_EN, val, reg);
+ SW_SET_REG_BY_FIELD(PORT_STATUS, TX_FLOW_EN, val, reg);
+ SW_SET_REG_BY_FIELD(PORT_STATUS, TX_HALF_FLOW_EN, val, reg);
+ if (tmp == reg)
+ return SW_OK;
+
+ HSL_REG_ENTRY_SET(rv, dev_id, PORT_STATUS, port_id,
+ (a_uint8_t *) (®), sizeof (a_uint32_t));
+ return rv;
+}
+
+static sw_error_t
+_isisc_port_flowctrl_forcemode_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ sw_error_t rv;
+ a_uint32_t reg, tmp;
+
+ if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
+ {
+ return SW_BAD_PARAM;
+ }
+
+ HSL_REG_ENTRY_GET(rv, dev_id, PORT_STATUS, port_id,
+ (a_uint8_t *) (®), sizeof (a_uint32_t));
+ SW_RTN_ON_ERROR(rv);
+ SW_GET_FIELD_BY_REG(PORT_STATUS, FLOW_LINK_EN, tmp, reg);
+
+ if (A_TRUE == enable)
+ {
+ if (tmp == 0)
+ return SW_OK;
+ SW_SET_REG_BY_FIELD(PORT_STATUS, FLOW_LINK_EN, 0, reg);
+ }
+ else if (A_FALSE == enable)
+ {
+ /* for those ports without PHY, it can't sync flow control status */
+ if (A_FALSE == _isisc_port_phy_connected(dev_id, port_id))
+ {
+ return SW_DISABLE;
+ }
+ if (tmp == 1)
+ return SW_OK;
+ SW_SET_REG_BY_FIELD(PORT_STATUS, FLOW_LINK_EN, 1, reg);
+ }
+ else
+ {
+ return SW_BAD_PARAM;
+ }
+
+ HSL_REG_ENTRY_SET(rv, dev_id, PORT_STATUS, port_id,
+ (a_uint8_t *) (®), sizeof (a_uint32_t));
+ return rv;
+}
+
+static sw_error_t
_isisc_port_speed_get(a_uint32_t dev_id, fal_port_t port_id,
fal_port_speed_t * pspeed)
{
@@ -291,6 +354,40 @@
return rv;
}
+static sw_error_t
+_isisc_port_duplex_get(a_uint32_t dev_id, fal_port_t port_id,
+ fal_port_duplex_t * pduplex)
+{
+ sw_error_t rv;
+ a_uint32_t reg, field;
+
+ HSL_DEV_ID_CHECK(dev_id);
+
+ if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
+ {
+ return SW_BAD_PARAM;
+ }
+
+ HSL_REG_ENTRY_GET(rv, dev_id, PORT_STATUS, port_id,
+ (a_uint8_t *) (®), sizeof (a_uint32_t));
+ SW_GET_FIELD_BY_REG(PORT_STATUS, DUPLEX_MODE, field, reg);
+ if (field)
+ {
+ *pduplex = FAL_FULL_DUPLEX;
+ }
+ else
+ {
+ *pduplex = FAL_HALF_DUPLEX;
+ }
+
+ return SW_OK;
+}
+
+#ifndef IN_PORTCONTROL_MINI
+
+
+
+
static sw_error_t
_isisc_port_autoneg_status_get(a_uint32_t dev_id, fal_port_t port_id,
@@ -426,52 +523,7 @@
return SW_OK;
}
-static sw_error_t
-_isisc_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
-{
- sw_error_t rv;
- a_uint32_t val, force, reg, tmp;
- if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
- {
- return SW_BAD_PARAM;
- }
-
- if (A_TRUE == enable)
- {
- val = 1;
- }
- else if (A_FALSE == enable)
- {
- val = 0;
- }
- else
- {
- return SW_BAD_PARAM;
- }
-
- HSL_REG_ENTRY_GET(rv, dev_id, PORT_STATUS, port_id,
- (a_uint8_t *) (®), sizeof (a_uint32_t));
- SW_RTN_ON_ERROR(rv);
-
- SW_GET_FIELD_BY_REG(PORT_STATUS, FLOW_LINK_EN, force, reg);
- if (force)
- {
- /* flow control isn't in force mode so can't set */
- return SW_DISABLE;
- }
- tmp = reg;
-
- SW_SET_REG_BY_FIELD(PORT_STATUS, RX_FLOW_EN, val, reg);
- SW_SET_REG_BY_FIELD(PORT_STATUS, TX_FLOW_EN, val, reg);
- SW_SET_REG_BY_FIELD(PORT_STATUS, TX_HALF_FLOW_EN, val, reg);
- if (tmp == reg)
- return SW_OK;
-
- HSL_REG_ENTRY_SET(rv, dev_id, PORT_STATUS, port_id,
- (a_uint8_t *) (®), sizeof (a_uint32_t));
- return rv;
-}
static sw_error_t
_isisc_port_flowctrl_get(a_uint32_t dev_id, fal_port_t port_id,
@@ -503,49 +555,6 @@
return SW_OK;
}
-static sw_error_t
-_isisc_port_flowctrl_forcemode_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable)
-{
- sw_error_t rv;
- a_uint32_t reg, tmp;
-
- if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
- {
- return SW_BAD_PARAM;
- }
-
- HSL_REG_ENTRY_GET(rv, dev_id, PORT_STATUS, port_id,
- (a_uint8_t *) (®), sizeof (a_uint32_t));
- SW_RTN_ON_ERROR(rv);
- SW_GET_FIELD_BY_REG(PORT_STATUS, FLOW_LINK_EN, tmp, reg);
-
- if (A_TRUE == enable)
- {
- if (tmp == 0)
- return SW_OK;
- SW_SET_REG_BY_FIELD(PORT_STATUS, FLOW_LINK_EN, 0, reg);
- }
- else if (A_FALSE == enable)
- {
- /* for those ports without PHY, it can't sync flow control status */
- if (A_FALSE == _isisc_port_phy_connected(dev_id, port_id))
- {
- return SW_DISABLE;
- }
- if (tmp == 1)
- return SW_OK;
- SW_SET_REG_BY_FIELD(PORT_STATUS, FLOW_LINK_EN, 1, reg);
- }
- else
- {
- return SW_BAD_PARAM;
- }
-
- HSL_REG_ENTRY_SET(rv, dev_id, PORT_STATUS, port_id,
- (a_uint8_t *) (®), sizeof (a_uint32_t));
- return rv;
-}
static sw_error_t
_isisc_port_flowctrl_forcemode_get(a_uint32_t dev_id, fal_port_t port_id,
@@ -708,7 +717,7 @@
return rv;
}
-
+#endif
static sw_error_t
_isisc_port_rxhdr_mode_set(a_uint32_t dev_id, fal_port_t port_id,
fal_port_header_mode_t mode)
@@ -744,7 +753,7 @@
(a_uint8_t *) (&val), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTCONTROL_MINI
static sw_error_t
_isisc_port_rxhdr_mode_get(a_uint32_t dev_id, fal_port_t port_id,
fal_port_header_mode_t * mode)
@@ -778,7 +787,7 @@
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_port_txhdr_mode_set(a_uint32_t dev_id, fal_port_t port_id,
fal_port_header_mode_t mode)
@@ -814,7 +823,7 @@
(a_uint8_t *) (&val), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTCONTROL_MINI
static sw_error_t
_isisc_port_txhdr_mode_get(a_uint32_t dev_id, fal_port_t port_id,
fal_port_header_mode_t * mode)
@@ -848,7 +857,7 @@
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_header_type_set(a_uint32_t dev_id, a_bool_t enable, a_uint32_t type)
{
@@ -884,7 +893,7 @@
(a_uint8_t *) (®), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTCONTROL_MINI
static sw_error_t
_isisc_header_type_get(a_uint32_t dev_id, a_bool_t * enable, a_uint32_t * type)
{
@@ -912,7 +921,7 @@
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_port_txmac_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
{
@@ -969,7 +978,7 @@
(a_uint8_t *) (®), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTCONTROL_MINI
static sw_error_t
_isisc_port_txmac_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable)
{
@@ -998,7 +1007,7 @@
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_port_rxmac_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
{
@@ -1055,7 +1064,7 @@
(a_uint8_t *) (®), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTCONTROL_MINI
static sw_error_t
_isisc_port_rxmac_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable)
{
@@ -1084,7 +1093,7 @@
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_port_txfc_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
{
@@ -1256,7 +1265,48 @@
return SW_OK;
}
+static sw_error_t
+_isisc_port_link_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * status)
+{
+ sw_error_t rv;
+ a_uint32_t phy_id;
+ hsl_phy_ops_t *phy_drv;
+ HSL_DEV_ID_CHECK(dev_id);
+
+ if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
+ {
+ return SW_BAD_PARAM;
+ }
+
+ SW_RTN_ON_NULL (phy_drv = hsl_phy_api_ops_get (dev_id));
+ if (NULL == phy_drv->phy_link_status_get)
+ return SW_NOT_SUPPORTED;
+
+ /* for those ports without PHY device supposed always link up */
+ if (A_FALSE == _isisc_port_phy_connected(dev_id, port_id))
+ {
+ *status = A_TRUE;
+ }
+ else
+ {
+ rv = hsl_port_prop_get_phyid(dev_id, port_id, &phy_id);
+ SW_RTN_ON_ERROR(rv);
+
+ if (A_TRUE == phy_drv->phy_link_status_get (dev_id, phy_id))
+ {
+ *status = A_TRUE;
+ }
+ else
+ {
+ *status = A_FALSE;
+ }
+ }
+
+ return SW_OK;
+}
+
+#ifndef IN_PORTCONTROL_MINI
static sw_error_t
_isisc_port_bp_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
{
@@ -1398,46 +1448,6 @@
return SW_OK;
}
-static sw_error_t
-_isisc_port_link_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * status)
-{
- sw_error_t rv;
- a_uint32_t phy_id;
- hsl_phy_ops_t *phy_drv;
-
- HSL_DEV_ID_CHECK(dev_id);
-
- if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
- {
- return SW_BAD_PARAM;
- }
-
- SW_RTN_ON_NULL (phy_drv = hsl_phy_api_ops_get (dev_id));
- if (NULL == phy_drv->phy_link_status_get)
- return SW_NOT_SUPPORTED;
-
- /* for those ports without PHY device supposed always link up */
- if (A_FALSE == _isisc_port_phy_connected(dev_id, port_id))
- {
- *status = A_TRUE;
- }
- else
- {
- rv = hsl_port_prop_get_phyid(dev_id, port_id, &phy_id);
- SW_RTN_ON_ERROR(rv);
-
- if (A_TRUE == phy_drv->phy_link_status_get (dev_id, phy_id))
- {
- *status = A_TRUE;
- }
- else
- {
- *status = A_FALSE;
- }
- }
-
- return SW_OK;
-}
static sw_error_t
_isisc_ports_link_status_get(a_uint32_t dev_id, a_uint32_t * status)
@@ -1542,7 +1552,7 @@
return SW_OK;
}
-
+#endif
/**
* @brief Set duplex mode on a particular port.
* @param[in] dev_id device id
@@ -1563,25 +1573,6 @@
}
/**
- * @brief Get duplex mode on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] duplex duplex mode
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_port_duplex_get(a_uint32_t dev_id, fal_port_t port_id,
- fal_port_duplex_t * pduplex)
-{
- sw_error_t rv;
-
- HSL_API_LOCK;
- rv = _isisc_port_duplex_get(dev_id, port_id, pduplex);
- HSL_API_UNLOCK;
- return rv;
-}
-
-/**
* @brief Set speed on a particular port.
* @param[in] dev_id device id
* @param[in] port_id port id
@@ -1599,6 +1590,26 @@
HSL_API_UNLOCK;
return rv;
}
+/**
+ * @brief Get duplex mode on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] duplex duplex mode
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_port_duplex_get(a_uint32_t dev_id, fal_port_t port_id,
+ fal_port_duplex_t * pduplex)
+{
+ sw_error_t rv;
+
+ HSL_API_LOCK;
+ rv = _isisc_port_duplex_get(dev_id, port_id, pduplex);
+ HSL_API_UNLOCK;
+ return rv;
+}
+
+
/**
* @brief Get speed on a particular port.
@@ -1618,6 +1629,8 @@
HSL_API_UNLOCK;
return rv;
}
+#ifndef IN_PORTCONTROL_MINI
+
/**
* @brief Get auto negotiation status on a particular port.
@@ -1714,24 +1727,6 @@
}
/**
- * @brief Set flow control(rx/tx/bp) status on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[in] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
-{
- sw_error_t rv;
-
- HSL_API_LOCK;
- rv = _isisc_port_flowctrl_set(dev_id, port_id, enable);
- HSL_API_UNLOCK;
- return rv;
-}
-
-/**
* @brief Get flow control status on a particular port.
* @param[in] dev_id device id
* @param[in] port_id port id
@@ -1749,24 +1744,7 @@
return rv;
}
-/**
- * @brief Set flow control force mode on a particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_port_flowctrl_forcemode_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable)
-{
- sw_error_t rv;
- HSL_API_LOCK;
- rv = _isisc_port_flowctrl_forcemode_set(dev_id, port_id, enable);
- HSL_API_UNLOCK;
- return rv;
-}
/**
* @brief Get flow control force mode on a particular port.
@@ -1881,6 +1859,44 @@
HSL_API_UNLOCK;
return rv;
}
+#endif
+
+/**
+ * @brief Set flow control(rx/tx/bp) status on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[in] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
+{
+ sw_error_t rv;
+
+ HSL_API_LOCK;
+ rv = _isisc_port_flowctrl_set(dev_id, port_id, enable);
+ HSL_API_UNLOCK;
+ return rv;
+}
+
+/**
+ * @brief Set flow control force mode on a particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_port_flowctrl_forcemode_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ sw_error_t rv;
+
+ HSL_API_LOCK;
+ rv = _isisc_port_flowctrl_forcemode_set(dev_id, port_id, enable);
+ HSL_API_UNLOCK;
+ return rv;
+}
/**
* @brief Set status of Atheros header packets parsed on a particular port.
@@ -1900,7 +1916,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTCONTROL_MINI
/**
* @brief Get status of Atheros header packets parsed on a particular port.
* @param[in] dev_id device id
@@ -1919,7 +1935,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set status of Atheros header packets parsed on a particular port.
* @param[in] dev_id device id
@@ -1938,7 +1954,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTCONTROL_MINI
/**
* @brief Get status of Atheros header packets parsed on a particular port.
* @param[in] dev_id device id
@@ -1957,7 +1973,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set status of Atheros header type value on a particular device.
* @param[in] dev_id device id
@@ -1974,7 +1990,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTCONTROL_MINI
/**
* @brief Get status of Atheros header type value on a particular device.
* @param[in] dev_id device id
@@ -1992,7 +2008,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set status of txmac on a particular port.
* @param[in] dev_id device id
@@ -2009,7 +2025,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTCONTROL_MINI
/**
* @brief Get status of txmac on a particular port.
* @param[in] dev_id device id
@@ -2027,7 +2043,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set status of rxmac on a particular port.
* @param[in] dev_id device id
@@ -2044,7 +2060,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTCONTROL_MINI
/**
* @brief Get status of rxmac on a particular port.
* @param[in] dev_id device id
@@ -2062,7 +2078,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set status of tx flow control on a particular port.
* @param[in] dev_id device id
@@ -2132,7 +2148,25 @@
HSL_API_UNLOCK;
return rv;
}
+/**
+ * @brief Get link status on particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] status link status up (A_TRUE) or down (A_FALSE)
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_port_link_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * status)
+{
+ sw_error_t rv;
+ HSL_API_LOCK;
+ rv = _isisc_port_link_status_get(dev_id, port_id, status);
+ HSL_API_UNLOCK;
+ return rv;
+}
+
+#ifndef IN_PORTCONTROL_MINI
/**
* @brief Set status of back pressure on a particular port.
* @param[in] dev_id device id
@@ -2203,23 +2237,6 @@
return rv;
}
-/**
- * @brief Get link status on particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] status link status up (A_TRUE) or down (A_FALSE)
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_port_link_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * status)
-{
- sw_error_t rv;
-
- HSL_API_LOCK;
- rv = _isisc_port_link_status_get(dev_id, port_id, status);
- HSL_API_UNLOCK;
- return rv;
-}
/**
* @brief Get link status on all ports.
@@ -2272,7 +2289,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
sw_error_t
isisc_port_ctrl_init(a_uint32_t dev_id)
{
@@ -2284,46 +2301,51 @@
SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
- p_api->port_duplex_get = isisc_port_duplex_get;
p_api->port_duplex_set = isisc_port_duplex_set;
- p_api->port_speed_get = isisc_port_speed_get;
p_api->port_speed_set = isisc_port_speed_set;
+ p_api->port_flowctrl_set = isisc_port_flowctrl_set;
+ p_api->port_flowctrl_forcemode_set = isisc_port_flowctrl_forcemode_set;
+ p_api->port_duplex_get = isisc_port_duplex_get;
+ p_api->port_speed_get = isisc_port_speed_get;
+#ifndef IN_PORTCONTROL_MINI
p_api->port_autoneg_status_get = isisc_port_autoneg_status_get;
p_api->port_autoneg_enable = isisc_port_autoneg_enable;
p_api->port_autoneg_restart = isisc_port_autoneg_restart;
p_api->port_autoneg_adv_get = isisc_port_autoneg_adv_get;
p_api->port_autoneg_adv_set = isisc_port_autoneg_adv_set;
- p_api->port_flowctrl_set = isisc_port_flowctrl_set;
p_api->port_flowctrl_get = isisc_port_flowctrl_get;
- p_api->port_flowctrl_forcemode_set = isisc_port_flowctrl_forcemode_set;
p_api->port_flowctrl_forcemode_get = isisc_port_flowctrl_forcemode_get;
p_api->port_powersave_set = isisc_port_powersave_set;
p_api->port_powersave_get = isisc_port_powersave_get;
p_api->port_hibernate_set = isisc_port_hibernate_set;
p_api->port_hibernate_get = isisc_port_hibernate_get;
p_api->port_cdt = isisc_port_cdt;
- p_api->port_rxhdr_mode_set = isisc_port_rxhdr_mode_set;
- p_api->port_rxhdr_mode_get = isisc_port_rxhdr_mode_get;
- p_api->port_txhdr_mode_set = isisc_port_txhdr_mode_set;
- p_api->port_txhdr_mode_get = isisc_port_txhdr_mode_get;
- p_api->header_type_set = isisc_header_type_set;
- p_api->header_type_get = isisc_header_type_get;
- p_api->port_txmac_status_set = isisc_port_txmac_status_set;
- p_api->port_txmac_status_get = isisc_port_txmac_status_get;
- p_api->port_rxmac_status_set = isisc_port_rxmac_status_set;
- p_api->port_rxmac_status_get = isisc_port_rxmac_status_get;
- p_api->port_txfc_status_set = isisc_port_txfc_status_set;
- p_api->port_txfc_status_get = isisc_port_txfc_status_get;
- p_api->port_rxfc_status_set = isisc_port_rxfc_status_set;
- p_api->port_rxfc_status_get = isisc_port_rxfc_status_get;
+ p_api->port_rxhdr_mode_get = isisc_port_rxhdr_mode_get;
+ p_api->port_txhdr_mode_get = isisc_port_txhdr_mode_get;
+ p_api->header_type_get = isisc_header_type_get;
+ p_api->port_txmac_status_get = isisc_port_txmac_status_get;
+ p_api->port_rxmac_status_get = isisc_port_rxmac_status_get;
+
+#endif
+ p_api->port_txfc_status_get = isisc_port_txfc_status_get;
+ p_api->port_rxhdr_mode_set = isisc_port_rxhdr_mode_set;
+ p_api->port_txhdr_mode_set = isisc_port_txhdr_mode_set;
+ p_api->header_type_set = isisc_header_type_set;
+ p_api->port_txmac_status_set = isisc_port_txmac_status_set;
+ p_api->port_rxmac_status_set = isisc_port_rxmac_status_set;
+ p_api->port_txfc_status_set = isisc_port_txfc_status_set;
+ p_api->port_rxfc_status_set = isisc_port_rxfc_status_set;
+ p_api->port_link_status_get = isisc_port_link_status_get;
+ p_api->port_rxfc_status_get = isisc_port_rxfc_status_get;
+#ifndef IN_PORTCONTROL_MINI
p_api->port_bp_status_set = isisc_port_bp_status_set;
p_api->port_bp_status_get = isisc_port_bp_status_get;
p_api->port_link_forcemode_set = isisc_port_link_forcemode_set;
p_api->port_link_forcemode_get = isisc_port_link_forcemode_get;
- p_api->port_link_status_get = isisc_port_link_status_get;
p_api->ports_link_status_get = isisc_ports_link_status_get;
p_api->port_mac_loopback_set=isisc_port_mac_loopback_set;
p_api->port_mac_loopback_get=isisc_port_mac_loopback_get;
+#endif
}
#endif
diff --git a/src/hsl/isisc/isisc_portvlan.c b/src/hsl/isisc/isisc_portvlan.c
index 952e987..36e898c 100755
--- a/src/hsl/isisc/isisc_portvlan.c
+++ b/src/hsl/isisc/isisc_portvlan.c
@@ -108,7 +108,7 @@
(a_uint8_t *) (&data), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_isisc_port_1qmode_get(a_uint32_t dev_id, fal_port_t port_id,
fal_pt_1qmode_t * pport_1qmode)
@@ -137,7 +137,7 @@
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_port_egvlanmode_set(a_uint32_t dev_id, fal_port_t port_id,
fal_pt_1q_egmode_t port_egvlanmode)
@@ -175,7 +175,7 @@
(a_uint8_t *) (&data), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_isisc_port_egvlanmode_get(a_uint32_t dev_id, fal_port_t port_id,
fal_pt_1q_egmode_t * pport_egvlanmode)
@@ -204,7 +204,7 @@
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_portvlan_member_add(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t mem_port_id)
@@ -297,7 +297,7 @@
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_isisc_portvlan_member_get(a_uint32_t dev_id, fal_port_t port_id,
fal_pbmp_t * mem_port_map)
@@ -320,7 +320,7 @@
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_port_force_default_vid_set(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t enable)
@@ -352,7 +352,7 @@
FORCE_DEF_VID, (a_uint8_t *) (&val), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_isisc_port_force_default_vid_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable)
@@ -382,7 +382,7 @@
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_port_force_portvlan_set(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t enable)
@@ -414,7 +414,7 @@
FORCE_PVLAN, (a_uint8_t *) (&val), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_isisc_port_force_portvlan_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable)
@@ -444,7 +444,7 @@
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_nestvlan_tpid_set(a_uint32_t dev_id, a_uint32_t tpid)
{
@@ -458,7 +458,7 @@
TAG_VALUE, (a_uint8_t *) (&val), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_isisc_nestvlan_tpid_get(a_uint32_t dev_id, a_uint32_t * tpid)
{
@@ -474,7 +474,7 @@
*tpid = val;
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_port_invlan_mode_set(a_uint32_t dev_id, fal_port_t port_id,
fal_pt_invlan_mode_t mode)
@@ -498,7 +498,7 @@
(a_uint8_t *) (®val[mode]), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_isisc_port_invlan_mode_get(a_uint32_t dev_id, fal_port_t port_id,
fal_pt_invlan_mode_t * mode)
@@ -531,6 +531,7 @@
return rv;
}
+#endif
static sw_error_t
_isisc_port_tls_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable)
@@ -562,7 +563,7 @@
TLS_EN, (a_uint8_t *) (&val), sizeof (a_uint32_t));
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_isisc_port_tls_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable)
{
@@ -655,7 +656,7 @@
return SW_OK;
}
-
+#endif
static sw_error_t
_isisc_port_default_svid_set(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t vid)
@@ -684,7 +685,7 @@
rv = _isisc_port_route_defv_set(dev_id, port_id);
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_isisc_port_default_svid_get(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * vid)
@@ -705,7 +706,7 @@
*vid = val & 0xfff;
return rv;
}
-
+#endif
static sw_error_t
_isisc_port_default_cvid_set(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t vid)
@@ -734,7 +735,7 @@
rv = _isisc_port_route_defv_set(dev_id, port_id);
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_isisc_port_default_cvid_get(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * vid)
@@ -755,7 +756,7 @@
*vid = val & 0xfff;
return rv;
}
-
+#endif
static sw_error_t
_isisc_port_vlan_propagation_set(a_uint32_t dev_id, fal_port_t port_id,
fal_vlan_propagation_mode_t mode)
@@ -801,6 +802,55 @@
(a_uint8_t *) (®), sizeof (a_uint32_t));
return rv;
}
+static sw_error_t
+_isisc_vlan_trans_write(a_uint32_t dev_id, a_uint32_t entry_idx, fal_pbmp_t pbmp,
+ fal_vlan_trans_entry_t entry)
+{
+ sw_error_t rv;
+ a_uint32_t i, addr, table[2] = { 0 };
+
+ addr = ISISC_VLAN_TRANS_ADDR + (entry_idx << 3);
+
+ if (0 != pbmp)
+ {
+ table[0] = entry.o_vid & 0xfff;
+ table[0] |= ((entry.s_vid & 0xfff) << 12);
+ table[0] |= ((entry.c_vid & 0xff) << 24);
+ table[1] = (entry.c_vid >> 8) & 0xf;
+
+ if (A_TRUE == entry.bi_dir)
+ {
+ table[1] |= (0x3 << 4);
+ }
+
+ if (A_TRUE == entry.forward_dir)
+ {
+ table[1] |= (0x1 << 4);
+ }
+
+ if (A_TRUE == entry.reverse_dir)
+ {
+ table[1] |= (0x1 << 5);
+ }
+
+ table[1] |= (pbmp << 6);
+ table[1] |= ((0x1UL & entry.o_vid_is_cvid) << 13);
+ table[1] |= ((0x1UL & entry.s_vid_enable) << 14);
+ table[1] |= ((0x1UL & entry.c_vid_enable) << 15);
+ table[1] |= ((0x1UL & entry.one_2_one_vlan) << 16);
+ }
+
+ /* set vlan trans table */
+ for (i = 0; i < 2; i++)
+ {
+ HSL_REG_ENTRY_GEN_SET(rv, dev_id, addr + (i << 2), sizeof (a_uint32_t),
+ (a_uint8_t *) (&(table[i])), sizeof (a_uint32_t));
+ SW_RTN_ON_ERROR(rv);
+ }
+
+ return SW_OK;
+}
+#ifndef IN_PORTVLAN_MINI
static sw_error_t
_isisc_port_vlan_propagation_get(a_uint32_t dev_id, fal_port_t port_id,
@@ -907,54 +957,7 @@
return SW_OK;
}
-static sw_error_t
-_isisc_vlan_trans_write(a_uint32_t dev_id, a_uint32_t entry_idx, fal_pbmp_t pbmp,
- fal_vlan_trans_entry_t entry)
-{
- sw_error_t rv;
- a_uint32_t i, addr, table[2] = { 0 };
- addr = ISISC_VLAN_TRANS_ADDR + (entry_idx << 3);
-
- if (0 != pbmp)
- {
- table[0] = entry.o_vid & 0xfff;
- table[0] |= ((entry.s_vid & 0xfff) << 12);
- table[0] |= ((entry.c_vid & 0xff) << 24);
- table[1] = (entry.c_vid >> 8) & 0xf;
-
- if (A_TRUE == entry.bi_dir)
- {
- table[1] |= (0x3 << 4);
- }
-
- if (A_TRUE == entry.forward_dir)
- {
- table[1] |= (0x1 << 4);
- }
-
- if (A_TRUE == entry.reverse_dir)
- {
- table[1] |= (0x1 << 5);
- }
-
- table[1] |= (pbmp << 6);
- table[1] |= ((0x1UL & entry.o_vid_is_cvid) << 13);
- table[1] |= ((0x1UL & entry.s_vid_enable) << 14);
- table[1] |= ((0x1UL & entry.c_vid_enable) << 15);
- table[1] |= ((0x1UL & entry.one_2_one_vlan) << 16);
- }
-
- /* set vlan trans table */
- for (i = 0; i < 2; i++)
- {
- HSL_REG_ENTRY_GEN_SET(rv, dev_id, addr + (i << 2), sizeof (a_uint32_t),
- (a_uint8_t *) (&(table[i])), sizeof (a_uint32_t));
- SW_RTN_ON_ERROR(rv);
- }
-
- return SW_OK;
-}
static sw_error_t
_isisc_port_vlan_trans_convert(fal_vlan_trans_entry_t * entry,
@@ -1416,7 +1419,7 @@
*enable = val;
return SW_OK;
}
-
+#endif
/**
@@ -1437,7 +1440,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get 802.1q work mode on a particular port.
* @param[in] dev_id device id
@@ -1456,7 +1459,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set packets transmitted out vlan tagged mode on a particular port.
* @param[in] dev_id device id
@@ -1475,7 +1478,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get packets transmitted out vlan tagged mode on a particular port.
* @param[in] dev_id device id
@@ -1494,7 +1497,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Add member of port based vlan on a particular port.
* @param[in] dev_id device id
@@ -1551,7 +1554,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get member of port based vlan on a particular port.
* @param[in] dev_id device id
@@ -1570,7 +1573,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set force default vlan id status on a particular port.
* @param[in] dev_id device id
@@ -1589,7 +1592,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get force default vlan id status on a particular port.
* @param[in] dev_id device id
@@ -1608,7 +1611,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set force port based vlan status on a particular port.
* @param[in] dev_id device id
@@ -1627,7 +1630,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get force port based vlan status on a particular port.
* @param[in] dev_id device id
@@ -1646,7 +1649,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set nest vlan tpid on a particular device.
* @param[in] dev_id device id
@@ -1663,7 +1666,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get nest vlan tpid on a particular device.
* @param[in] dev_id device id
@@ -1680,7 +1683,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set ingress vlan mode mode on a particular port.
* @param[in] dev_id device id
@@ -1699,7 +1702,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get ingress vlan mode mode on a particular port.
* @param[in] dev_id device id
@@ -1718,7 +1721,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set tls status on a particular port.
* @param[in] dev_id device id
@@ -1736,6 +1739,8 @@
HSL_API_UNLOCK;
return rv;
}
+#ifndef IN_PORTVLAN_MINI
+
/**
* @brief Get tls status on a particular port.
@@ -1792,7 +1797,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set default s-vid on a particular port.
* @param[in] dev_id device id
@@ -1811,7 +1816,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get default s-vid on a particular port.
* @param[in] dev_id device id
@@ -1830,7 +1835,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set default c-vid on a particular port.
* @param[in] dev_id device id
@@ -1849,7 +1854,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#ifndef IN_PORTVLAN_MINI
/**
* @brief Get default c-vid on a particular port.
* @param[in] dev_id device id
@@ -1868,7 +1873,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
/**
* @brief Set vlan propagation status on a particular port.
* @param[in] dev_id device id
@@ -1887,6 +1892,8 @@
HSL_API_UNLOCK;
return rv;
}
+#ifndef IN_PORTVLAN_MINI
+
/**
* @brief Get vlan propagation status on a particular port.
@@ -2174,7 +2181,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
sw_error_t
@@ -2199,31 +2206,34 @@
SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
- p_api->port_1qmode_get = isisc_port_1qmode_get;
- p_api->port_1qmode_set = isisc_port_1qmode_set;
- p_api->port_egvlanmode_get = isisc_port_egvlanmode_get;
- p_api->port_egvlanmode_set = isisc_port_egvlanmode_set;
- p_api->portvlan_member_add = isisc_portvlan_member_add;
- p_api->portvlan_member_del = isisc_portvlan_member_del;
- p_api->portvlan_member_update = isisc_portvlan_member_update;
- p_api->portvlan_member_get = isisc_portvlan_member_get;
- p_api->port_force_default_vid_set = isisc_port_force_default_vid_set;
- p_api->port_force_default_vid_get = isisc_port_force_default_vid_get;
- p_api->port_force_portvlan_set = isisc_port_force_portvlan_set;
- p_api->port_force_portvlan_get = isisc_port_force_portvlan_get;
- p_api->nestvlan_tpid_set = isisc_nestvlan_tpid_set;
- p_api->nestvlan_tpid_get = isisc_nestvlan_tpid_get;
- p_api->port_invlan_mode_set = isisc_port_invlan_mode_set;
- p_api->port_invlan_mode_get = isisc_port_invlan_mode_get;
- p_api->port_tls_set = isisc_port_tls_set;
- p_api->port_tls_get = isisc_port_tls_get;
- p_api->port_pri_propagation_set = isisc_port_pri_propagation_set;
- p_api->port_pri_propagation_get = isisc_port_pri_propagation_get;
- p_api->port_default_svid_set = isisc_port_default_svid_set;
- p_api->port_default_svid_get = isisc_port_default_svid_get;
- p_api->port_default_cvid_set = isisc_port_default_cvid_set;
- p_api->port_default_cvid_get = isisc_port_default_cvid_get;
- p_api->port_vlan_propagation_set = isisc_port_vlan_propagation_set;
+ p_api->port_1qmode_set = isisc_port_1qmode_set;
+ p_api->port_egvlanmode_set = isisc_port_egvlanmode_set;
+ p_api->portvlan_member_add = isisc_portvlan_member_add;
+ p_api->portvlan_member_del = isisc_portvlan_member_del;
+ p_api->portvlan_member_update = isisc_portvlan_member_update;
+ p_api->port_force_default_vid_set = isisc_port_force_default_vid_set;
+ p_api->port_force_portvlan_set = isisc_port_force_portvlan_set;
+ p_api->nestvlan_tpid_set = isisc_nestvlan_tpid_set;
+ p_api->port_invlan_mode_set = isisc_port_invlan_mode_set;
+ p_api->port_tls_set = isisc_port_tls_set;
+ #ifndef IN_PORTVLAN_MINI
+ p_api->port_1qmode_get = isisc_port_1qmode_get;
+ p_api->port_egvlanmode_get = isisc_port_egvlanmode_get;
+ p_api->portvlan_member_get = isisc_portvlan_member_get;
+ p_api->port_force_default_vid_get = isisc_port_force_default_vid_get;
+ p_api->port_force_portvlan_get = isisc_port_force_portvlan_get;
+ p_api->nestvlan_tpid_get = isisc_nestvlan_tpid_get;
+ p_api->port_invlan_mode_get = isisc_port_invlan_mode_get;
+ p_api->port_tls_get = isisc_port_tls_get;
+ p_api->port_pri_propagation_set = isisc_port_pri_propagation_set;
+ p_api->port_pri_propagation_get = isisc_port_pri_propagation_get;
+ #endif
+ p_api->port_default_svid_set = isisc_port_default_svid_set;
+ p_api->port_default_cvid_set = isisc_port_default_cvid_set;
+ p_api->port_vlan_propagation_set = isisc_port_vlan_propagation_set;
+ #ifndef IN_PORTVLAN_MINI
+ p_api->port_default_cvid_get = isisc_port_default_cvid_get;
+ p_api->port_default_svid_get = isisc_port_default_svid_get;
p_api->port_vlan_propagation_get = isisc_port_vlan_propagation_get;
p_api->port_vlan_trans_add = isisc_port_vlan_trans_add;
p_api->port_vlan_trans_del = isisc_port_vlan_trans_del;
@@ -2239,6 +2249,7 @@
p_api->netisolate_get = isisc_netisolate_get;
p_api->eg_trans_filter_bypass_en_set = isisc_eg_trans_filter_bypass_en_set;
p_api->eg_trans_filter_bypass_en_get = isisc_eg_trans_filter_bypass_en_get;
+ #endif
#endif
return SW_OK;
diff --git a/src/hsl/isisc/isisc_qos.c b/src/hsl/isisc/isisc_qos.c
index 9dc4cae..fc9ba49 100755
--- a/src/hsl/isisc/isisc_qos.c
+++ b/src/hsl/isisc/isisc_qos.c
@@ -38,6 +38,29 @@
#define ISISC_MAX_EH_QUEUE 5
static sw_error_t
+_isisc_qos_port_queue_check(fal_port_t port_id, fal_queue_t queue_id)
+{
+ if ((0 == port_id) || (5 == port_id) || (6 == port_id))
+ {
+ if (ISISC_MAX_EH_QUEUE < queue_id)
+ {
+ return SW_BAD_PARAM;
+ }
+ }
+ else
+ {
+ if (ISISC_MAX_QUEUE < queue_id)
+ {
+ return SW_BAD_PARAM;
+ }
+ }
+
+ return SW_OK;
+}
+
+
+#ifndef IN_QOS_MINI
+static sw_error_t
_isisc_qos_queue_tx_buf_status_set(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t enable)
{
@@ -153,34 +176,6 @@
return SW_OK;
}
-static sw_error_t
-_isisc_qos_port_red_en_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable)
-{
- a_uint32_t val = 0;
- sw_error_t rv;
-
- if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
- {
- return SW_BAD_PARAM;
- }
- if (A_TRUE == enable)
- {
- val = 1;
- }
- else if (A_FALSE == enable)
- {
- val = 0;
- }
- else
- {
- return SW_BAD_PARAM;
- }
-
- HSL_REG_FIELD_SET(rv, dev_id, PORT_HOL_CTL1, port_id, PORT_RED_EN,
- (a_uint8_t *) (&val), sizeof (a_uint32_t));
- return rv;
-}
@@ -214,25 +209,101 @@
+
+
static sw_error_t
-_isisc_qos_port_queue_check(fal_port_t port_id, fal_queue_t queue_id)
+_isisc_qos_queue_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
+ fal_queue_t queue_id, a_uint32_t * number)
{
- if ((0 == port_id) || (5 == port_id) || (6 == port_id))
+ a_uint32_t data, val = 0;
+ sw_error_t rv;
+
+ if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
{
- if (ISISC_MAX_EH_QUEUE < queue_id)
- {
- return SW_BAD_PARAM;
- }
+ return SW_BAD_PARAM;
+ }
+
+ rv = _isisc_qos_port_queue_check(port_id, queue_id);
+ SW_RTN_ON_ERROR(rv);
+
+ HSL_REG_ENTRY_GET(rv, dev_id, PORT_HOL_CTL0, port_id, (a_uint8_t *) (&data),
+ sizeof (a_uint32_t));
+ SW_RTN_ON_ERROR(rv);
+
+ val = (data >> (queue_id << 2)) & 0xf;
+ *number = val << ISISC_QOS_HOL_MOD;
+ return SW_OK;
+}
+
+
+static sw_error_t
+_isisc_qos_port_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * number)
+{
+ a_uint32_t val = 0;
+ sw_error_t rv;
+
+ if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
+ {
+ return SW_BAD_PARAM;
+ }
+
+ HSL_REG_FIELD_GET(rv, dev_id, PORT_HOL_CTL0, port_id, PORT_DESC_NR,
+ (a_uint8_t *) (&val), sizeof (a_uint32_t));
+ SW_RTN_ON_ERROR(rv);
+
+ *number = val << ISISC_QOS_HOL_MOD;
+ return SW_OK;
+}
+
+
+static sw_error_t
+_isisc_qos_port_rx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * number)
+{
+ a_uint32_t val = 0;
+ sw_error_t rv;
+
+ if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
+ {
+ return SW_BAD_PARAM;
+ }
+
+ HSL_REG_FIELD_GET(rv, dev_id, PORT_HOL_CTL1, port_id, PORT_IN_DESC_EN,
+ (a_uint8_t *) (&val), sizeof (a_uint32_t));
+ SW_RTN_ON_ERROR(rv);
+
+ *number = val << ISISC_QOS_HOL_MOD;
+ return SW_OK;
+}
+#endif
+static sw_error_t
+_isisc_qos_port_red_en_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ a_uint32_t val = 0;
+ sw_error_t rv;
+
+ if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
+ {
+ return SW_BAD_PARAM;
+ }
+ if (A_TRUE == enable)
+ {
+ val = 1;
+ }
+ else if (A_FALSE == enable)
+ {
+ val = 0;
}
else
{
- if (ISISC_MAX_QUEUE < queue_id)
- {
- return SW_BAD_PARAM;
- }
+ return SW_BAD_PARAM;
}
- return SW_OK;
+ HSL_REG_FIELD_SET(rv, dev_id, PORT_HOL_CTL1, port_id, PORT_RED_EN,
+ (a_uint8_t *) (&val), sizeof (a_uint32_t));
+ return rv;
}
static sw_error_t
@@ -273,30 +344,6 @@
}
static sw_error_t
-_isisc_qos_queue_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
- fal_queue_t queue_id, a_uint32_t * number)
-{
- a_uint32_t data, val = 0;
- sw_error_t rv;
-
- if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
- {
- return SW_BAD_PARAM;
- }
-
- rv = _isisc_qos_port_queue_check(port_id, queue_id);
- SW_RTN_ON_ERROR(rv);
-
- HSL_REG_ENTRY_GET(rv, dev_id, PORT_HOL_CTL0, port_id, (a_uint8_t *) (&data),
- sizeof (a_uint32_t));
- SW_RTN_ON_ERROR(rv);
-
- val = (data >> (queue_id << 2)) & 0xf;
- *number = val << ISISC_QOS_HOL_MOD;
- return SW_OK;
-}
-
-static sw_error_t
_isisc_qos_port_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * number)
{
@@ -321,26 +368,6 @@
}
static sw_error_t
-_isisc_qos_port_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * number)
-{
- a_uint32_t val = 0;
- sw_error_t rv;
-
- if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
- {
- return SW_BAD_PARAM;
- }
-
- HSL_REG_FIELD_GET(rv, dev_id, PORT_HOL_CTL0, port_id, PORT_DESC_NR,
- (a_uint8_t *) (&val), sizeof (a_uint32_t));
- SW_RTN_ON_ERROR(rv);
-
- *number = val << ISISC_QOS_HOL_MOD;
- return SW_OK;
-}
-
-static sw_error_t
_isisc_qos_port_rx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id,
a_uint32_t * number)
{
@@ -365,26 +392,6 @@
}
static sw_error_t
-_isisc_qos_port_rx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * number)
-{
- a_uint32_t val = 0;
- sw_error_t rv;
-
- if (A_TRUE != hsl_port_prop_check(dev_id, port_id, HSL_PP_INCL_CPU))
- {
- return SW_BAD_PARAM;
- }
-
- HSL_REG_FIELD_GET(rv, dev_id, PORT_HOL_CTL1, port_id, PORT_IN_DESC_EN,
- (a_uint8_t *) (&val), sizeof (a_uint32_t));
- SW_RTN_ON_ERROR(rv);
-
- *number = val << ISISC_QOS_HOL_MOD;
- return SW_OK;
-}
-
-static sw_error_t
_isisc_qos_port_mode_set(a_uint32_t dev_id, fal_port_t port_id,
fal_qos_mode_t mode, a_bool_t enable)
{
@@ -480,7 +487,7 @@
return SW_OK;
}
-
+#ifndef IN_QOS_MINI
static sw_error_t
_isisc_qos_port_mode_pri_set(a_uint32_t dev_id, fal_port_t port_id,
fal_qos_mode_t mode, a_uint32_t pri)
@@ -1007,24 +1014,7 @@
return rv;
}
-/**
- * @brief Set status of port red on one particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[in] enable A_TRUE or A_FALSE
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_qos_port_red_en_set(a_uint32_t dev_id, fal_port_t port_id,
- a_bool_t enable)
-{
- sw_error_t rv;
- HSL_API_LOCK;
- rv = _isisc_qos_port_red_en_set(dev_id, port_id, enable);
- HSL_API_UNLOCK;
- return rv;
-}
/**
* @brief Set status of port red on one particular port.
@@ -1046,6 +1036,88 @@
}
+
+
+/**
+ * @brief Get max occupied buffer number of transmitting queue on one particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[in] queue_id queue id
+ * @param[out] number buffer number
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_qos_queue_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
+ fal_queue_t queue_id, a_uint32_t * number)
+{
+ sw_error_t rv;
+
+ HSL_API_LOCK;
+ rv = _isisc_qos_queue_tx_buf_nr_get(dev_id, port_id, queue_id, number);
+ HSL_API_UNLOCK;
+ return rv;
+}
+
+
+
+/**
+ * @brief Get max occupied buffer number of transmitting port on one particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] number buffer number
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_qos_port_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * number)
+{
+ sw_error_t rv;
+
+ HSL_API_LOCK;
+ rv = _isisc_qos_port_tx_buf_nr_get(dev_id, port_id, number);
+ HSL_API_UNLOCK;
+ return rv;
+}
+
+
+
+/**
+ * @brief Get max occupied buffer number of receiving port on one particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[out] number buffer number
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_qos_port_rx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_uint32_t * number)
+{
+ sw_error_t rv;
+
+ HSL_API_LOCK;
+ rv = _isisc_qos_port_rx_buf_nr_get(dev_id, port_id, number);
+ HSL_API_UNLOCK;
+ return rv;
+}
+#endif
+/**
+ * @brief Set status of port red on one particular port.
+ * @param[in] dev_id device id
+ * @param[in] port_id port id
+ * @param[in] enable A_TRUE or A_FALSE
+ * @return SW_OK or error code
+ */
+HSL_LOCAL sw_error_t
+isisc_qos_port_red_en_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ sw_error_t rv;
+
+ HSL_API_LOCK;
+ rv = _isisc_qos_port_red_en_set(dev_id, port_id, enable);
+ HSL_API_UNLOCK;
+ return rv;
+}
/**
* @brief Set max occupied buffer number of transmitting queue on one particular port.
* @details Comments:
@@ -1070,27 +1142,6 @@
HSL_API_UNLOCK;
return rv;
}
-
-/**
- * @brief Get max occupied buffer number of transmitting queue on one particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[in] queue_id queue id
- * @param[out] number buffer number
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_qos_queue_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
- fal_queue_t queue_id, a_uint32_t * number)
-{
- sw_error_t rv;
-
- HSL_API_LOCK;
- rv = _isisc_qos_queue_tx_buf_nr_get(dev_id, port_id, queue_id, number);
- HSL_API_UNLOCK;
- return rv;
-}
-
/**
* @brief Set max occupied buffer number of transmitting port on one particular port.
* @details Comments:
@@ -1113,26 +1164,6 @@
HSL_API_UNLOCK;
return rv;
}
-
-/**
- * @brief Get max occupied buffer number of transmitting port on one particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] number buffer number
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_qos_port_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * number)
-{
- sw_error_t rv;
-
- HSL_API_LOCK;
- rv = _isisc_qos_port_tx_buf_nr_get(dev_id, port_id, number);
- HSL_API_UNLOCK;
- return rv;
-}
-
/**
* @brief Set max occupied buffer number of receiving port on one particular port.
* @details Comments:
@@ -1155,26 +1186,6 @@
HSL_API_UNLOCK;
return rv;
}
-
-/**
- * @brief Get max occupied buffer number of receiving port on one particular port.
- * @param[in] dev_id device id
- * @param[in] port_id port id
- * @param[out] number buffer number
- * @return SW_OK or error code
- */
-HSL_LOCAL sw_error_t
-isisc_qos_port_rx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id,
- a_uint32_t * number)
-{
- sw_error_t rv;
-
- HSL_API_LOCK;
- rv = _isisc_qos_port_rx_buf_nr_get(dev_id, port_id, number);
- HSL_API_UNLOCK;
- return rv;
-}
-
/**
* @brief Set port qos mode on a particular port.
* @param[in] dev_id device id
@@ -1195,6 +1206,8 @@
return rv;
}
+
+#ifndef IN_QOS_MINI
/**
* @brief Get port qos mode on a particular port.
* @param[in] dev_id device id
@@ -1214,7 +1227,6 @@
HSL_API_UNLOCK;
return rv;
}
-
/**
* @brief Set priority of one particular qos mode on one particular port.
* @details Comments:
@@ -1493,7 +1505,7 @@
HSL_API_UNLOCK;
return rv;
}
-
+#endif
sw_error_t
isisc_qos_init(a_uint32_t dev_id)
{
@@ -1504,21 +1516,24 @@
hsl_api_t *p_api;
SW_RTN_ON_NULL(p_api = hsl_api_ptr_get(dev_id));
-
+ p_api->qos_queue_tx_buf_nr_set = isisc_qos_queue_tx_buf_nr_set;
+ p_api->qos_port_red_en_set = isisc_qos_port_red_en_set;
+ p_api->qos_port_tx_buf_nr_set = isisc_qos_port_tx_buf_nr_set;
+ p_api->qos_port_rx_buf_nr_set = isisc_qos_port_rx_buf_nr_set;
+ #ifndef IN_QOS_MINI
p_api->qos_queue_tx_buf_status_set = isisc_qos_queue_tx_buf_status_set;
p_api->qos_queue_tx_buf_status_get = isisc_qos_queue_tx_buf_status_get;
p_api->qos_port_tx_buf_status_set = isisc_qos_port_tx_buf_status_set;
p_api->qos_port_tx_buf_status_get = isisc_qos_port_tx_buf_status_get;
- p_api->qos_port_red_en_set = isisc_qos_port_red_en_set;
p_api->qos_port_red_en_get = isisc_qos_port_red_en_get;
- p_api->qos_queue_tx_buf_nr_set = isisc_qos_queue_tx_buf_nr_set;
p_api->qos_queue_tx_buf_nr_get = isisc_qos_queue_tx_buf_nr_get;
- p_api->qos_port_tx_buf_nr_set = isisc_qos_port_tx_buf_nr_set;
p_api->qos_port_tx_buf_nr_get = isisc_qos_port_tx_buf_nr_get;
- p_api->qos_port_rx_buf_nr_set = isisc_qos_port_rx_buf_nr_set;
p_api->qos_port_rx_buf_nr_get = isisc_qos_port_rx_buf_nr_get;
+ #endif
p_api->qos_port_mode_set = isisc_qos_port_mode_set;
- p_api->qos_port_mode_get = isisc_qos_port_mode_get;
+
+ #ifndef IN_QOS_MINI
+ p_api->qos_port_mode_get = isisc_qos_port_mode_get;
p_api->qos_port_mode_pri_set = isisc_qos_port_mode_pri_set;
p_api->qos_port_mode_pri_get = isisc_qos_port_mode_pri_get;
p_api->qos_port_sch_mode_set = isisc_qos_port_sch_mode_set;
@@ -1533,6 +1548,7 @@
p_api->qos_port_force_cpri_status_get = isisc_qos_port_force_cpri_status_get;
p_api->qos_queue_remark_table_set = isisc_qos_queue_remark_table_set;
p_api->qos_queue_remark_table_get = isisc_qos_queue_remark_table_get;
+ #endif
}
#endif
diff --git a/src/hsl/phy/Makefile b/src/hsl/phy/Makefile
index 035ba14..7bd5c22 100755
--- a/src/hsl/phy/Makefile
+++ b/src/hsl/phy/Makefile
@@ -27,10 +27,16 @@
SRC_LIST = f1_phy.c
endif
-ifeq (ALL_CHIP, $(CHIP_TYPE))
- SRC_LIST = f1_phy.c f2_phy.c hsl_phy.c malibu_phy.c
+ifeq (TRUE, $(IN_MALIBU_PHY))
+ SRC_LIST = malibu_phy.c
endif
+ifeq (ALL_CHIP, $(CHIP_TYPE))
+ SRC_LIST = f1_phy.c f2_phy.c malibu_phy.c
+endif
+
+SRC_LIST += hsl_phy.c
+
ifeq (linux, $(OS))
ifeq (KSLIB, $(MODULE_TYPE))
ifneq (TRUE, $(KERNEL_MODE))
diff --git a/src/init/ssdk_init.c b/src/init/ssdk_init.c
index 7e1cc4f..50ab004 100755
--- a/src/init/ssdk_init.c
+++ b/src/init/ssdk_init.c
@@ -16,15 +16,33 @@
#include "sw.h"
#include "ssdk_init.h"
#include "fal_init.h"
+#ifdef IN_MISC
#include "fal_misc.h"
+#endif
+#ifdef IN_MIB
#include "fal_mib.h"
+#endif
+#ifdef IN_PORTCONTROL
#include "fal_port_ctrl.h"
+#endif
+#ifdef IN_PORTVLAN
#include "fal_portvlan.h"
+#endif
+#ifdef IN_FDB
#include "fal_fdb.h"
+#endif
+#ifdef IN_STP
#include "fal_stp.h"
+#endif
+#ifdef IN_IGMP
#include "fal_igmp.h"
+#endif
+#ifdef IN_QOS
#include "fal_qos.h"
+#endif
+#ifdef IN_LED
#include "fal_led.h"
+#endif
#include "hsl.h"
#include "hsl_dev.h"
#include "ssdk_init.h"
@@ -43,9 +61,15 @@
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/string.h>
+#if defined(ISIS) ||defined(ISISC) ||defined(GARUDA)
#include <f1_phy.h>
+#endif
+#if defined(ATHENA) ||defined(SHIVA) ||defined(HORUS)
#include <f2_phy.h>
+#endif
+#ifdef IN_MALIBU_PHY
#include <malibu_phy.h>
+#endif
#if defined(CONFIG_OF) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
#include <linux/switch.h>
#include <linux/of.h>
@@ -66,18 +90,22 @@
#include "ssdk_uci.h"
#endif
+#ifdef IN_IP
#if defined (CONFIG_NF_FLOW_COOKIE)
#include "fal_flowcookie.h"
#include <shortcut-fe/sfe.h>
#endif
+#endif
#ifdef IN_RFS
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
#include <linux/if_vlan.h>
#endif
#include <qca-rfs/rfs_dev.h>
+#ifdef IN_IP
#include "fal_rfs.h"
#endif
+#endif
#define ISIS_CHIP_ID 0x18
#define ISIS_CHIP_REG 0
@@ -119,11 +147,17 @@
static struct mutex switch_mdio_lock;
phy_identification_t phy_array[] =
{
+ #ifdef IN_MALIBU_PHY
{0x0, 0x004DD0B1, malibu_phy_init},
{0x0, 0x004DD0B2, malibu_phy_init},
+ #endif
+ #if defined(ISIS) ||defined(ISISC) ||defined(GARUDA)
{0x0, 0x004DD036, f1_phy_init},
{0x0, 0x004DD033, f1_phy_init},
+ #endif
+ #if defined(ATHENA) ||defined(SHIVA) ||defined(HORUS)
{0x0, 0x004DD042, f2_phy_init}
+ #endif
};
static void
@@ -275,41 +309,65 @@
/*fal_reset(dev_id);*/
/*enable cpu and disable mirror*/
+ #ifdef IN_MISC
fal_cpu_port_status_set(dev_id, A_TRUE);
/* setup MTU */
fal_frame_max_size_set(dev_id, 1518);
+ #endif
+ #ifdef IN_MIB
/* Enable MIB counters */
fal_mib_status_set(dev_id, A_TRUE);
+ #endif
+ #ifdef IN_IGMP
fal_igmp_mld_rp_set(dev_id, 0);
+ #endif
/*enable pppoe for dakota to support RSS*/
if (SSDK_CURRENT_CHIP_TYPE == CHIP_DESS)
+ #ifdef DESS
+ #ifdef IN_MISC
fal_pppoe_status_set(dev_id, A_TRUE);
+ #endif
+ #endif
for (i = 0; i < AR8327_NUM_PORTS; i++) {
/* forward multicast and broadcast frames to CPU */
+ #ifdef IN_MISC
fal_port_unk_uc_filter_set(dev_id, i, A_FALSE);
fal_port_unk_mc_filter_set(dev_id, i, A_FALSE);
fal_port_bc_filter_set(dev_id, i, A_FALSE);
+ #endif
+ #ifdef IN_PORTVLAN
fal_port_default_svid_set(dev_id, i, 0);
fal_port_default_cvid_set(dev_id, i, 0);
fal_port_1qmode_set(dev_id, i, FAL_1Q_DISABLE);
fal_port_egvlanmode_set(dev_id, i, FAL_EG_UNMODIFIED);
+ #endif
+ #ifdef IN_FDB
fal_fdb_port_learn_set(dev_id, i, A_TRUE);
+ #endif
+ #ifdef IN_STP
fal_stp_port_state_set(dev_id, 0, i, FAL_STP_FARWARDING);
+ #endif
+ #ifdef IN_PORTVLAN
fal_port_vlan_propagation_set(dev_id, i, FAL_VLAN_PROPAGATION_REPLACE);
-
+ #endif
+ #ifdef IN_IGMP
fal_port_igmps_status_set(dev_id, i, A_FALSE);
fal_port_igmp_mld_join_set(dev_id, i, A_FALSE);
fal_port_igmp_mld_leave_set(dev_id, i, A_FALSE);
fal_igmp_mld_entry_creat_set(dev_id, A_FALSE);
fal_igmp_mld_entry_v3_set(dev_id, A_FALSE);
+ #endif
if (SSDK_CURRENT_CHIP_TYPE == CHIP_SHIVA) {
return SW_OK;
} else if (SSDK_CURRENT_CHIP_TYPE == CHIP_DESS) {
+ #ifdef DESS
+ #ifdef IN_PORTCONTROL
fal_port_flowctrl_forcemode_set(dev_id, i, A_FALSE);
-
+ #endif
+ #ifdef IN_QOS
nr = 240; /*30*8*/
fal_qos_port_tx_buf_nr_set(dev_id, i, &nr);
nr = 48; /*6*8*/
@@ -322,9 +380,15 @@
fal_qos_queue_tx_buf_nr_set(dev_id, i, 2, &nr);
fal_qos_queue_tx_buf_nr_set(dev_id, i, 1, &nr);
fal_qos_queue_tx_buf_nr_set(dev_id, i, 0, &nr);
+ #endif
+ #endif
} else if (SSDK_CURRENT_CHIP_TYPE == CHIP_ISISC ||
SSDK_CURRENT_CHIP_TYPE == CHIP_ISIS) {
+ #if defined(ISISC) || defined(ISIS)
+ #ifdef IN_INTERFACECONTROL
fal_port_3az_status_set(dev_id, i, A_FALSE);
+ #endif
+ #ifdef IN_PORTCONTROL
fal_port_flowctrl_forcemode_set(dev_id, i, A_TRUE);
fal_port_flowctrl_set(dev_id, i, A_FALSE);
@@ -332,7 +396,9 @@
fal_port_flowctrl_set(dev_id, i, A_TRUE);
fal_port_flowctrl_forcemode_set(dev_id, i, A_FALSE);
}
+ #endif
if (i == 0 || i == 5 || i == 6) {
+ #ifdef IN_QOS
nr = 240; /*30*8*/
fal_qos_port_tx_buf_nr_set(dev_id, i, &nr);
nr = 48; /*6*8*/
@@ -354,7 +420,9 @@
fal_qos_queue_tx_buf_nr_set(dev_id, i, 1, &nr);
nr = 24; /*3*8*/
fal_qos_queue_tx_buf_nr_set(dev_id, i, 0, &nr);
+ #endif
} else {
+ #ifdef IN_QOS
nr = 200; /*25*8*/
fal_qos_port_tx_buf_nr_set(dev_id, i, &nr);
nr = 48; /*6*8*/
@@ -372,7 +440,9 @@
fal_qos_queue_tx_buf_nr_set(dev_id, i, 1, &nr);
nr = 24; /*3*8*/
fal_qos_queue_tx_buf_nr_set(dev_id, i, 0, &nr);
+ #endif
}
+ #endif
}
}
@@ -1143,7 +1213,7 @@
cancel_delayed_work_sync(&priv->qm_dwork);
}
-
+#ifdef DESS
static void
dess_rgmii_mac_work_task(struct work_struct *work)
{
@@ -1176,7 +1246,7 @@
{
cancel_delayed_work_sync(&priv->rgmii_dwork);
}
-
+#endif
int
qca_phy_id_chip(struct qca_phy_priv *priv)
{
@@ -1310,6 +1380,7 @@
printk("qca_phy_mib_work_start failed for %s\n", sw_dev->name);
return ret;
}
+ #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)
@@ -1321,6 +1392,7 @@
return ret;
}
}
+ #endif
return 0;
@@ -1840,7 +1912,7 @@
.probe = ssdk_probe,
};
#endif
-
+#ifdef DESS
static u32 phy_t_status = 0;
void ssdk_malibu_psgmii_and_dakota_dess_reset()
{
@@ -2090,7 +2162,7 @@
/* clear fdb entry */
fal_fdb_del_all(0,1);
}
-
+#endif
int
ssdk_plat_init(ssdk_init_cfg *cfg)
@@ -2104,6 +2176,7 @@
if(miibus_get())
return -ENODEV;
+ #ifdef DESS
if(ssdk_dt_global.switch_reg_access_mode == HSL_REG_LOCAL_BUS) {
/* Enable ess clock here */
if(!IS_ERR(ssdk_dt_global.ess_clk))
@@ -2149,6 +2222,7 @@
cfg->reg_func.psgmii_reg_set = qca_psgmii_reg_write;
cfg->reg_func.psgmii_reg_get = qca_psgmii_reg_read;
}
+ #endif
if(ssdk_dt_global.switch_reg_access_mode == HSL_REG_MDIO) {
if(driver_find(qca_phy_driver.name, &mdio_bus_type)){
@@ -2236,6 +2310,7 @@
void switch_cpuport_setup(void)
{
+ #ifdef IN_PORTCONTROL
//According to HW suggestion, enable CPU port flow control for Dakota
fal_port_flowctrl_forcemode_set(0, 0, A_TRUE);
fal_port_flowctrl_set(0, 0, A_TRUE);
@@ -2244,6 +2319,7 @@
fal_port_speed_set(0, 0, FAL_SPEED_1000);
fal_port_txmac_status_set(0, 0, A_TRUE);
fal_port_rxmac_status_set(0, 0, A_TRUE);
+ #endif
}
#if defined(CONFIG_OF) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
@@ -2409,7 +2485,9 @@
{
for(type = FAL_FLOW_LAN_TO_LAN; type <= FAL_FLOW_WAN_TO_WAN; type++)
{
+ #ifdef IN_IP
fal_default_flow_cmd_set(0, vrf_id, type, FAL_DEFAULT_FLOW_ADMIT_ALL);
+ #endif
}
}
@@ -2422,19 +2500,26 @@
{
if(cpu_bmp & (1 << port))
{
+ #ifdef IN_PORTVLAN
fal_portvlan_member_update(0, 0, lan_bmp|wan_bmp);
+ #endif
}
if(lan_bmp & (1 << port))
{
+ #ifdef IN_PORTVLAN
fal_portvlan_member_update(0, port, (lan_bmp|cpu_bmp)&(~(1<<port)));
+ #endif
}
if(wan_bmp & (1 << port))
{
+ #ifdef IN_PORTVLAN
fal_portvlan_member_update(0, port, (wan_bmp|cpu_bmp)&(~(1<<port)));
+ #endif
}
}
return 0;
}
+#ifdef DESS
static int ssdk_dess_led_init(ssdk_init_cfg *cfg)
{
a_uint32_t i,led_num, led_source_id,source_id;
@@ -2448,7 +2533,9 @@
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
fal_led_source_pattern_set(0, led_source_id,&pattern);
+ #endif
led_num = ((led_source_id-1)/3) + 3;
source_id = led_source_id%3;
#if defined(CONFIG_OF) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
@@ -2681,8 +2768,12 @@
qca_switch_init(0);
ssdk_portvlan_init(cfg->port_cfg.cpu_bmp, cfg->port_cfg.lan_bmp, cfg->port_cfg.wan_bmp);
+ #ifdef IN_PORTVLAN
fal_port_rxhdr_mode_set(0, 0, FAL_ALL_TYPE_FRAME_EN);
+ #endif
+ #ifdef IN_IP
fal_ip_route_status_set(0, A_TRUE);
+ #endif
ssdk_flow_default_act_init();
@@ -2691,7 +2782,9 @@
reg_value = (reg_value|0x1000000|0x8);
reg_value &= ~2;
qca_switch_reg_write(0, 0x0e38, (a_uint8_t *)®_value, 4);
+ #ifdef IN_IP
fal_ip_vrf_base_addr_set(0, 0, 0);
+ #endif
p_api = hsl_api_ptr_get (0);
if (p_api && p_api->port_flowctrl_thresh_set)
@@ -2710,6 +2803,7 @@
return 0;
}
+#endif
static void ssdk_cfg_default_init(ssdk_init_cfg *cfg)
{
@@ -2801,7 +2895,9 @@
if (op) {
if (!ssdk_intf_search(if_mac_entry, 8, &intf_entry, &index)) {
if (index != 0xffffffff) {
+ #ifdef IN_IP
rv = fal_ip_intf_entry_add(0, &intf_entry);
+ #endif
if (SW_OK == rv) {
if_mac_entry[index] = intf_entry;
}
@@ -2811,7 +2907,9 @@
else {
if (ssdk_intf_search(if_mac_entry, 8, &intf_entry, &index)) {
intf_entry.entry_id = if_mac_entry[index].entry_id;
+ #ifdef IN_IP
fal_ip_intf_entry_del(0, 1, &intf_entry);
+ #endif
memset(&if_mac_entry[index], 0, sizeof(fal_intf_mac_entry_t));
}
}
@@ -2821,7 +2919,9 @@
}
#endif
while(1) {
+ #ifdef IN_VLAN
if (SW_OK != fal_vlan_next(0, tmp_vid, &entry))
+ #endif
break;
tmp_vid = entry.vid;
if (tmp_vid != 0) {
@@ -2832,7 +2932,9 @@
if (op) {
if (!ssdk_intf_search(if_mac_entry, 8, &intf_entry, &index)) {
if (index != 0xffffffff) {
+ #ifdef IN_IP
rv = fal_ip_intf_entry_add(0, &intf_entry);
+ #endif
if (SW_OK == rv) {
if_mac_entry[index] = intf_entry;
}
@@ -2842,7 +2944,9 @@
else {
if (ssdk_intf_search(if_mac_entry, 8, &intf_entry, &index)) {
intf_entry.entry_id = if_mac_entry[index].entry_id;
+ #ifdef IN_IP
fal_ip_intf_entry_del(0, 1, &intf_entry);
+ #endif
memset(&if_mac_entry[index], 0, sizeof(fal_intf_mac_entry_t));
}
}
@@ -2854,7 +2958,9 @@
if (op) {
if (!ssdk_intf_search(if_mac_entry, 8, &intf_entry, &index)) {
if (index != 0xffffffff) {
+ #ifdef IN_IP
rv = fal_ip_intf_entry_add(0, &intf_entry);
+ #endif
if (SW_OK == rv) {
if_mac_entry[index] = intf_entry;
}
@@ -2864,7 +2970,9 @@
else {
if (ssdk_intf_search(if_mac_entry, 8, &intf_entry, &index)) {
intf_entry.entry_id = if_mac_entry[index].entry_id;
+ #ifdef IN_IP
fal_ip_intf_entry_del(0, 1, &intf_entry);
+ #endif
memset(&if_mac_entry[index], 0, sizeof(fal_intf_mac_entry_t));
}
}
@@ -2926,6 +3034,7 @@
if(rv)
goto out;
+ #ifdef DESS
if(ssdk_dt_global.switch_reg_access_mode == HSL_REG_LOCAL_BUS) {
/*Do Malibu self test to fix packet drop issue firstly*/
if ((cfg.chip_type == CHIP_DESS) && (ssdk_dt_global.mac_mode == PORT_WRAPPER_PSGMII)) {
@@ -2937,15 +3046,21 @@
qca_dess_hw_init(&cfg);
#if defined (CONFIG_NF_FLOW_COOKIE)
+ #ifdef IN_NAT
sfe_register_flow_cookie_cb(ssdk_flow_cookie_set);
#endif
+ #endif
#ifdef IN_RFS
memset(&rfs_dev, 0, sizeof(rfs_dev));
rfs_dev.name = NULL;
+ #ifdef IN_FDB
rfs_dev.mac_rule_cb = ssdk_rfs_mac_rule_set;
+ #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
rfs_ess_device_register(&rfs_dev);
#if defined(CONFIG_RFS_ACCEL)
ssdk_dev_notifier.notifier_call = ssdk_dev_event;
@@ -2960,6 +3075,7 @@
/* Setup Cpu port for Dakota platform. */
switch_cpuport_setup();
}
+ #endif
out:
if (rv == 0)
@@ -2984,10 +3100,13 @@
printk("qca-ssdk module exit failed! (code: %d)\n", rv);
if(ssdk_dt_global.switch_reg_access_mode == HSL_REG_LOCAL_BUS){
+ #ifdef DESS
ssdk_switch_unregister();
#if defined (CONFIG_NF_FLOW_COOKIE)
+ #ifdef IN_NAT
sfe_unregister_flow_cookie_cb(ssdk_flow_cookie_set);
#endif
+ #endif
#ifdef IN_RFS
rfs_ess_device_unregister(&rfs_dev);
unregister_inetaddr_notifier(&ssdk_inet_notifier);
@@ -2995,6 +3114,7 @@
unregister_netdevice_notifier(&ssdk_dev_notifier);
#endif
#endif
+ #endif
}
diff --git a/src/ref/ref_uci.c b/src/ref/ref_uci.c
old mode 100644
new mode 100755
index 89a3b52..418f010
--- a/src/ref/ref_uci.c
+++ b/src/ref/ref_uci.c
@@ -17,15 +17,33 @@
#include "sw.h"
#include "ssdk_init.h"
#include "fal_init.h"
+#ifdef IN_MISC
#include "fal_misc.h"
+#endif
+#ifdef IN_MIB
#include "fal_mib.h"
+#endif
+#ifdef IN_PORTCONTROL
#include "fal_port_ctrl.h"
+#endif
+#ifdef IN_PORTVLAN
#include "fal_portvlan.h"
+#endif
+#ifdef IN_FDB
#include "fal_fdb.h"
+#endif
+#ifdef IN_STP
#include "fal_stp.h"
+#endif
+#ifdef IN_IGMP
#include "fal_igmp.h"
+#endif
+#ifdef IN_QOS
#include "fal_qos.h"
+#endif
+#ifdef IN_ACL
#include "fal_acl.h"
+#endif
#include "hsl.h"
#include "hsl_dev.h"
#include "ssdk_init.h"
@@ -66,6 +84,8 @@
static char *priority_dflt_str = "no";
static char *param_dflt_str = " ";
+#ifdef IN_QOS
+#ifndef IN_QOS_MINI
static int
parse_qos_qtxbufsts(struct switch_val *val)
{
@@ -469,7 +489,67 @@
return rv;
}
+#endif
+#endif
+#ifdef IN_COSMAP
+static int
+parse_cos_mappri2q(struct switch_val *val)
+{
+ struct switch_ext *switch_ext_p, *switch_ext_tmp, *ext_value_p;
+ int rv = 0;
+ switch_ext_p = val->value.ext_val;
+ while(switch_ext_p) {
+ ext_value_p = switch_ext_p;
+
+ if(!strcmp(ext_value_p->option_name, "name")) {
+ switch_ext_p = switch_ext_p->next;
+ continue;
+ } else if(!strcmp(ext_value_p->option_name, "pri")) {
+ val_ptr[0] = ext_value_p->option_value;
+ } else if(!strcmp(ext_value_p->option_name, "queue")) {
+ val_ptr[1] = ext_value_p->option_value;
+ } else {
+ rv = -1;
+ break;
+ }
+
+ parameter_length++;
+ switch_ext_p = switch_ext_p->next;
+ }
+
+ return rv;
+}
+
+static int
+parse_cos_mappri2ehq(struct switch_val *val)
+{
+ struct switch_ext *switch_ext_p, *switch_ext_tmp, *ext_value_p;
+ int rv = 0;
+ switch_ext_p = val->value.ext_val;
+ while(switch_ext_p) {
+ ext_value_p = switch_ext_p;
+
+ if(!strcmp(ext_value_p->option_name, "name")) {
+ switch_ext_p = switch_ext_p->next;
+ continue;
+ } else if(!strcmp(ext_value_p->option_name, "pri")) {
+ val_ptr[0] = ext_value_p->option_value;
+ } else if(!strcmp(ext_value_p->option_name, "enhance_queue")) {
+ val_ptr[1] = ext_value_p->option_value;
+ } else {
+ rv = -1;
+ break;
+ }
+
+ parameter_length++;
+ switch_ext_p = switch_ext_p->next;
+ }
+
+ return rv;
+}
+
+#ifndef IN_COSMAP_MINI
static int
parse_cos_mapdscp2pri(struct switch_val *val)
{
@@ -695,62 +775,6 @@
}
static int
-parse_cos_mappri2q(struct switch_val *val)
-{
- struct switch_ext *switch_ext_p, *switch_ext_tmp, *ext_value_p;
- int rv = 0;
- switch_ext_p = val->value.ext_val;
- while(switch_ext_p) {
- ext_value_p = switch_ext_p;
-
- if(!strcmp(ext_value_p->option_name, "name")) {
- switch_ext_p = switch_ext_p->next;
- continue;
- } else if(!strcmp(ext_value_p->option_name, "pri")) {
- val_ptr[0] = ext_value_p->option_value;
- } else if(!strcmp(ext_value_p->option_name, "queue")) {
- val_ptr[1] = ext_value_p->option_value;
- } else {
- rv = -1;
- break;
- }
-
- parameter_length++;
- switch_ext_p = switch_ext_p->next;
- }
-
- return rv;
-}
-
-static int
-parse_cos_mappri2ehq(struct switch_val *val)
-{
- struct switch_ext *switch_ext_p, *switch_ext_tmp, *ext_value_p;
- int rv = 0;
- switch_ext_p = val->value.ext_val;
- while(switch_ext_p) {
- ext_value_p = switch_ext_p;
-
- if(!strcmp(ext_value_p->option_name, "name")) {
- switch_ext_p = switch_ext_p->next;
- continue;
- } else if(!strcmp(ext_value_p->option_name, "pri")) {
- val_ptr[0] = ext_value_p->option_value;
- } else if(!strcmp(ext_value_p->option_name, "enhance_queue")) {
- val_ptr[1] = ext_value_p->option_value;
- } else {
- rv = -1;
- break;
- }
-
- parameter_length++;
- switch_ext_p = switch_ext_p->next;
- }
-
- return rv;
-}
-
-static int
parse_cos_mapegremark(struct switch_val *val)
{
struct switch_ext *switch_ext_p, *switch_ext_tmp, *ext_value_p;
@@ -793,7 +817,10 @@
return rv;
}
+#endif
+#endif
+#ifdef IN_RATE
static int
parse_rate_portpolicer(struct switch_val *val)
{
@@ -1029,7 +1056,10 @@
return rv;
}
+#endif
+#ifdef IN_PORTCONTROL
+#ifndef IN_PORTCONTROL_MINI
static int
parse_port_duplex(struct switch_val *val)
{
@@ -1165,7 +1195,7 @@
return rv;
}
-
+#endif
static int
parse_port_txhdr(struct switch_val *val)
{
@@ -1249,7 +1279,7 @@
return rv;
}
-
+#ifndef IN_PORTCONTROL_MINI
static int
parse_port_flowctrl(struct switch_val *val)
{
@@ -1473,7 +1503,8 @@
return rv;
}
-
+#endif
+#ifndef IN_PORTCONTROL_MINI
static int
parse_port_bpstatus(struct switch_val *val)
{
@@ -1925,7 +1956,10 @@
return rv;
}
+#endif
+#endif
+#ifdef IN_PORTVLAN
static int
parse_portvlan_ingress(struct switch_val *val)
{
@@ -2091,7 +2125,62 @@
return rv;
}
+static int
+parse_portvlan_defaultsvid(struct switch_val *val)
+{
+ struct switch_ext *switch_ext_p, *switch_ext_tmp, *ext_value_p;
+ int rv = 0;
+ switch_ext_p = val->value.ext_val;
+ while(switch_ext_p) {
+ ext_value_p = switch_ext_p;
+ if(!strcmp(ext_value_p->option_name, "name")) {
+ switch_ext_p = switch_ext_p->next;
+ continue;
+ } else if(!strcmp(ext_value_p->option_name, "port_id")) {
+ val_ptr[0] = ext_value_p->option_value;
+ } else if(!strcmp(ext_value_p->option_name, "default_stag_vid")) {
+ val_ptr[1] = ext_value_p->option_value;
+ } else {
+ rv = -1;
+ break;
+ }
+
+ parameter_length++;
+ switch_ext_p = switch_ext_p->next;
+ }
+
+ return rv;
+}
+static int
+parse_portvlan_defaultcvid(struct switch_val *val)
+{
+ struct switch_ext *switch_ext_p, *switch_ext_tmp, *ext_value_p;
+ int rv = 0;
+ switch_ext_p = val->value.ext_val;
+ while(switch_ext_p) {
+ ext_value_p = switch_ext_p;
+
+ if(!strcmp(ext_value_p->option_name, "name")) {
+ switch_ext_p = switch_ext_p->next;
+ continue;
+ } else if(!strcmp(ext_value_p->option_name, "port_id")) {
+ val_ptr[0] = ext_value_p->option_value;
+ } else if(!strcmp(ext_value_p->option_name, "default_ctag_vid")) {
+ val_ptr[1] = ext_value_p->option_value;
+ } else {
+ rv = -1;
+ break;
+ }
+
+ parameter_length++;
+ switch_ext_p = switch_ext_p->next;
+ }
+
+ return rv;
+}
+
+#ifndef IN_PORTVLAN_MINI
static int
parse_portvlan_invlan(struct switch_val *val)
{
@@ -2176,61 +2265,7 @@
return rv;
}
-static int
-parse_portvlan_defaultsvid(struct switch_val *val)
-{
- struct switch_ext *switch_ext_p, *switch_ext_tmp, *ext_value_p;
- int rv = 0;
- switch_ext_p = val->value.ext_val;
- while(switch_ext_p) {
- ext_value_p = switch_ext_p;
- if(!strcmp(ext_value_p->option_name, "name")) {
- switch_ext_p = switch_ext_p->next;
- continue;
- } else if(!strcmp(ext_value_p->option_name, "port_id")) {
- val_ptr[0] = ext_value_p->option_value;
- } else if(!strcmp(ext_value_p->option_name, "default_stag_vid")) {
- val_ptr[1] = ext_value_p->option_value;
- } else {
- rv = -1;
- break;
- }
-
- parameter_length++;
- switch_ext_p = switch_ext_p->next;
- }
-
- return rv;
-}
-
-static int
-parse_portvlan_defaultcvid(struct switch_val *val)
-{
- struct switch_ext *switch_ext_p, *switch_ext_tmp, *ext_value_p;
- int rv = 0;
- switch_ext_p = val->value.ext_val;
- while(switch_ext_p) {
- ext_value_p = switch_ext_p;
-
- if(!strcmp(ext_value_p->option_name, "name")) {
- switch_ext_p = switch_ext_p->next;
- continue;
- } else if(!strcmp(ext_value_p->option_name, "port_id")) {
- val_ptr[0] = ext_value_p->option_value;
- } else if(!strcmp(ext_value_p->option_name, "default_ctag_vid")) {
- val_ptr[1] = ext_value_p->option_value;
- } else {
- rv = -1;
- break;
- }
-
- parameter_length++;
- switch_ext_p = switch_ext_p->next;
- }
-
- return rv;
-}
static int
parse_portvlan_vlanpropagation(struct switch_val *val)
@@ -2469,7 +2504,10 @@
return rv;
}
+#endif
+#endif
+#ifdef IN_VLAN
static int
parse_vlan_entry(struct switch_val *val)
{
@@ -2525,7 +2563,7 @@
return rv;
}
-
+#ifndef IN_VLAN_MINI
static int
parse_vlan_learnsts(struct switch_val *val)
{
@@ -2553,7 +2591,11 @@
return rv;
}
+#endif
+#endif
+#ifdef IN_FDB
+#ifndef IN_FDB_MINI
static int
parse_fdb_entry(struct switch_val *val)
{
@@ -2657,7 +2699,7 @@
return rv;
}
-
+#endif
static int
parse_fdb_portlearn(struct switch_val *val)
{
@@ -2685,7 +2727,7 @@
return rv;
}
-
+#ifndef IN_FDB_MINI
static int
parse_fdb_agectrl(struct switch_val *val)
{
@@ -2903,7 +2945,10 @@
return rv;
}
+#endif
+#endif
+#ifdef IN_IGMP
static int
parse_igmp_mode(struct switch_val *val)
{
@@ -3265,7 +3310,9 @@
return rv;
}
+#endif
+#ifdef IN_SEC
static int
parse_sec_mac(struct switch_val *val)
{
@@ -3489,7 +3536,10 @@
return rv;
}
+#endif
+#ifdef IN_MISC
+#ifndef IN_MISC_MINI
static int
parse_misc_framemaxsize(struct switch_val *val)
{
@@ -3515,7 +3565,7 @@
return rv;
}
-
+#endif
static int
parse_misc_ptunkucfilter(struct switch_val *val)
{
@@ -3599,7 +3649,7 @@
return rv;
}
-
+#ifndef IN_MISC_MINI
static int
parse_misc_autoneg(struct switch_val *val)
{
@@ -3625,7 +3675,7 @@
return rv;
}
-
+#endif
static int
parse_misc_cpuport(struct switch_val *val)
{
@@ -3651,7 +3701,7 @@
return rv;
}
-
+#ifndef IN_MISC_MINI
static int
parse_misc_pppoecmd(struct switch_val *val)
{
@@ -3757,7 +3807,7 @@
return rv;
}
-
+#endif
static int
parse_misc_eapolcmd(struct switch_val *val)
{
@@ -3811,7 +3861,7 @@
return rv;
}
-
+#ifndef IN_MISC_MINI
static int
parse_misc_rip(struct switch_val *val)
{
@@ -4059,8 +4109,10 @@
return rv;
}
+#endif
+#endif
-
+#ifdef IN_IP
static int
parse_ip_hostentry(struct switch_val *val)
{
@@ -4652,7 +4704,9 @@
return rv;
}
+#endif
+#ifdef IN_NAT
static int
parse_nat_natentry(struct switch_val *val)
{
@@ -5192,8 +5246,9 @@
return rv;
}
+#endif
-
+#ifdef IN_STP
static int
parse_stp_portstate(struct switch_val *val)
{
@@ -5223,7 +5278,9 @@
return rv;
}
+#endif
+#ifdef IN_MIRROR
static int
parse_mirror_analypt(struct switch_val *val)
{
@@ -5305,7 +5362,9 @@
return rv;
}
+#endif
+#ifdef IN_LEAKY
static int
parse_leaky_ucmode(struct switch_val *val)
{
@@ -5441,7 +5500,9 @@
return rv;
}
+#endif
+#ifdef IN_TRUNK
static int
parse_trunk_group(struct switch_val *val)
{
@@ -5497,7 +5558,9 @@
return rv;
}
+#endif
+#ifdef IN_MIB
static int
parse_mib_status(struct switch_val *val)
{
@@ -5549,7 +5612,9 @@
return rv;
}
+#endif
+#ifdef IN_ACL
static int
parse_acl_rule(struct switch_val *val)
{
@@ -6025,11 +6090,14 @@
return rv;
}
+#endif
+#ifdef IN_QOS
static int
parse_qos(const char *command_name, struct switch_val *val)
{
int rv = -1;
+ #ifndef IN_QOS_MINI
if(!strcmp(command_name, "QTxBufSts")) {
rv = parse_qos_qtxbufsts(val);
} else if(!strcmp(command_name, "QTxBufNr")) {
@@ -6058,16 +6126,25 @@
rv = parse_qos_ptfcprists(val);
} else if(!strcmp(command_name, "PtQuRemark")) {
rv = parse_qos_ptquremark(val);
- }
+ }
+ #endif
return rv;
}
+#endif
+#ifdef IN_COSMAP
static int
parse_cos(const char *command_name, struct switch_val *val)
{
int rv = -1;
- if(!strcmp(command_name, "Dscp2Pri")) {
+ if(!strcmp(command_name, "Pri2Q")) {
+ rv = parse_cos_mappri2q(val);
+ } else if(!strcmp(command_name, "Pri2Ehq")) {
+ rv = parse_cos_mappri2ehq(val);
+ }
+ #ifndef IN_COSMAP_MINI
+ else if(!strcmp(command_name, "Dscp2Pri")) {
rv = parse_cos_mapdscp2pri(val);
} else if(!strcmp(command_name, "Dscp2Dp")) {
rv = parse_cos_mapdscp2dp(val);
@@ -6083,17 +6160,16 @@
rv = parse_cos_mapup2ehpri(val);
} else if(!strcmp(command_name, "Up2ehDp")) {
rv = parse_cos_mapup2ehdp(val);
- } else if(!strcmp(command_name, "Pri2Q")) {
- rv = parse_cos_mappri2q(val);
- } else if(!strcmp(command_name, "Pri2Ehq")) {
- rv = parse_cos_mappri2ehq(val);
} else if(!strcmp(command_name, "EgRemark")) {
rv = parse_cos_mapegremark(val);
- }
+ }
+ #endif
return rv;
}
+#endif
+#ifdef IN_RATE
static int
parse_rate(const char *command_name, struct switch_val *val)
{
@@ -6114,12 +6190,22 @@
return rv;
}
+#endif
+#ifdef IN_PORTCONTROL
static int
parse_port(const char *command_name, struct switch_val *val)
{
int rv = -1;
- if(!strcmp(command_name, "Duplex")) {
+ if(!strcmp(command_name, "TxHdr")) {
+ rv = parse_port_txhdr(val);
+ } else if(!strcmp(command_name, "RxHdr")) {
+ rv = parse_port_rxhdr(val);
+ } else if(!strcmp(command_name, "HdrType")) {
+ rv = parse_port_hdrtype(val);
+ }
+ #ifndef IN_PORTCONTROL_MINI
+ else if(!strcmp(command_name, "Duplex")) {
rv = parse_port_duplex(val);
} else if(!strcmp(command_name, "Speed")) {
rv = parse_port_speed(val);
@@ -6129,12 +6215,6 @@
rv = parse_port_autonegenable(val);
} else if(!strcmp(command_name, "AutoNegRestart")) {
rv = parse_port_autonegrestart(val);
- } else if(!strcmp(command_name, "TxHdr")) {
- rv = parse_port_txhdr(val);
- } else if(!strcmp(command_name, "RxHdr")) {
- rv = parse_port_rxhdr(val);
- } else if(!strcmp(command_name, "HdrType")) {
- rv = parse_port_hdrtype(val);
} else if(!strcmp(command_name, "FlowCtrl")) {
rv = parse_port_flowctrl(val);
} else if(!strcmp(command_name, "FlowCtrlForceMode")) {
@@ -6186,10 +6266,13 @@
} else if(!strcmp(command_name, "Reset")) {
rv = parse_port_reset(val);
}
+ #endif
return rv;
}
+#endif
+#ifdef IN_PORTVLAN
static int
parse_portvlan(const char *command_name, struct switch_val *val)
{
@@ -6206,16 +6289,18 @@
rv = parse_portvlan_forcemode(val);
} else if(!strcmp(command_name, "SVlanTPID")) {
rv = parse_portvlan_svlantpid(val);
- } else if(!strcmp(command_name, "InVlan")) {
+ } else if(!strcmp(command_name, "DefaultSvid")) {
+ rv = parse_portvlan_defaultsvid(val);
+ } else if(!strcmp(command_name, "DefaultCvid")) {
+ rv = parse_portvlan_defaultcvid(val);
+ }
+ #ifndef IN_PORTVLAN_MINI
+ else if(!strcmp(command_name, "InVlan")) {
rv = parse_portvlan_invlan(val);
} else if(!strcmp(command_name, "TlsMode")) {
rv = parse_portvlan_tlsmode(val);
} else if(!strcmp(command_name, "PriPropagation")) {
rv = parse_portvlan_pripropagation(val);
- } else if(!strcmp(command_name, "DefaultSvid")) {
- rv = parse_portvlan_defaultsvid(val);
- } else if(!strcmp(command_name, "DefaultCvid")) {
- rv = parse_portvlan_defaultcvid(val);
} else if(!strcmp(command_name, "VlanPropagation")) {
rv = parse_portvlan_vlanpropagation(val);
} else if(!strcmp(command_name, "Translation")) {
@@ -6233,10 +6318,13 @@
} else if(!strcmp(command_name, "Ptvrfid")) {
rv = parse_portvlan_ptvrfid(val);
}
+ #endif
return rv;
}
+#endif
+#ifdef IN_VLAN
static int
parse_vlan(const char *command_name, struct switch_val *val)
{
@@ -6245,23 +6333,30 @@
rv = parse_vlan_entry(val);
} else if(!strcmp(command_name, "Member")) {
rv = parse_vlan_member(val);
- } else if(!strcmp(command_name, "LearnSts")) {
+ }
+ #ifndef IN_VLAN_MINI
+ else if(!strcmp(command_name, "LearnSts")) {
rv = parse_vlan_learnsts(val);
- }
+ }
+ #endif
return rv;
}
+#endif
+#ifdef IN_FDB
static int
parse_fdb(const char *command_name, struct switch_val *val)
{
int rv = -1;
- if(!strcmp(command_name, "Entry")) {
- rv = parse_fdb_entry(val);
- } else if(!strcmp(command_name, "Resventry")) {
- rv = parse_fdb_resventry(val);
- } else if(!strcmp(command_name, "PortLearn")) {
+ if(!strcmp(command_name, "PortLearn")) {
rv = parse_fdb_portlearn(val);
+ }
+ #ifndef IN_FDB_MINI
+ else if(!strcmp(command_name, "Resventry")) {
+ rv = parse_fdb_resventry(val);
+ } else if(!strcmp(command_name, "Entry")) {
+ rv = parse_fdb_entry(val);
} else if(!strcmp(command_name, "AgeCtrl")) {
rv = parse_fdb_agectrl(val);
} else if(!strcmp(command_name, "AgeTime")) {
@@ -6279,10 +6374,13 @@
} else if(!strcmp(command_name, "PtLearnstatic")) {
rv = parse_fdb_ptlearnstatic(val);
}
+ #endif
return rv;
}
+#endif
+#ifdef IN_IGMP
static int
parse_igmp(const char *command_name, struct switch_val *val)
{
@@ -6317,7 +6415,9 @@
return rv;
}
+#endif
+#ifdef IN_SEC
static int
parse_sec(const char *command_name, struct switch_val *val)
{
@@ -6342,23 +6442,33 @@
return rv;
}
+#endif
+#ifdef IN_MISC
static int
parse_misc(const char *command_name, struct switch_val *val)
{
int rv = -1;
- if(!strcmp(command_name, "FrameMaxSize")) {
- rv = parse_misc_framemaxsize(val);
+ if(!strcmp(command_name, "Eapolcmd")) {
+ rv = parse_misc_eapolcmd(val);
+ } else if(!strcmp(command_name, "Eapolstatus")) {
+ rv = parse_misc_eapolstatus(val);
+ } else if(!strcmp(command_name, "CpuPort")) {
+ rv = parse_misc_cpuport(val);
} else if(!strcmp(command_name, "PtUnkUcFilter")) {
rv = parse_misc_ptunkucfilter(val);
} else if(!strcmp(command_name, "PtUnkMcFilter")) {
rv = parse_misc_ptunkmcfilter(val);
} else if(!strcmp(command_name, "PtBcFilter")) {
rv = parse_misc_ptbcfilter(val);
+ }
+ #ifndef IN_MISC_MINI
+ else if(!strcmp(command_name, "CpuVid")) {
+ rv = parse_misc_cpuvid(val);
+ } else if(!strcmp(command_name, "FrameMaxSize")) {
+ rv = parse_misc_framemaxsize(val);
} else if(!strcmp(command_name, "AutoNeg")) {
rv = parse_misc_autoneg(val);
- } else if(!strcmp(command_name, "CpuPort")) {
- rv = parse_misc_cpuport(val);
} else if(!strcmp(command_name, "PppoeCmd")) {
rv = parse_misc_pppoecmd(val);
} else if(!strcmp(command_name, "Pppoe")) {
@@ -6367,10 +6477,6 @@
rv = parse_misc_ptdhcp(val);
} else if(!strcmp(command_name, "Arpcmd")) {
rv = parse_misc_arpcmd(val);
- } else if(!strcmp(command_name, "Eapolcmd")) {
- rv = parse_misc_eapolcmd(val);
- } else if(!strcmp(command_name, "Eapolstatus")) {
- rv = parse_misc_eapolstatus(val);
} else if(!strcmp(command_name, "Rip")) {
rv = parse_misc_rip(val);
} else if(!strcmp(command_name, "Ptarpreq")) {
@@ -6381,8 +6487,6 @@
rv = parse_misc_extendpppoe(val);
} else if(!strcmp(command_name, "Pppoeid")) {
rv = parse_misc_pppoeid(val);
- } else if(!strcmp(command_name, "CpuVid")) {
- rv = parse_misc_cpuvid(val);
} else if(!strcmp(command_name, "RtdPppoe")) {
rv = parse_misc_rtdpppoe(val);
} else if(!strcmp(command_name, "GloMacAddr")) {
@@ -6390,10 +6494,13 @@
} else if(!strcmp(command_name, "Framecrc")) {
rv = parse_misc_framecrc(val);
}
+ #endif
return rv;
}
+#endif
+#ifdef IN_IP
static int
parse_ip(const char *command_name, struct switch_val *val)
{
@@ -6440,7 +6547,9 @@
return rv;
}
+#endif
+#ifdef IN_NAT
static int
parse_nat(const char *command_name, struct switch_val *val)
{
@@ -6479,7 +6588,9 @@
return rv;
}
+#endif
+#ifdef IN_STP
static int
parse_stp(const char *command_name, struct switch_val *val)
{
@@ -6490,7 +6601,9 @@
return rv;
}
+#endif
+#ifdef IN_MIRROR
static int
parse_mirror(const char *command_name, struct switch_val *val)
{
@@ -6505,7 +6618,9 @@
return rv;
}
+#endif
+#ifdef IN_LEAKY
static int
parse_leaky(const char *command_name, struct switch_val *val)
{
@@ -6524,7 +6639,9 @@
return rv;
}
+#endif
+#ifdef IN_TRUNK
static int
parse_trunk(const char *command_name, struct switch_val *val)
{
@@ -6537,7 +6654,9 @@
return rv;
}
+#endif
+#ifdef IN_MIB
static int
parse_mib(const char *command_name, struct switch_val *val)
{
@@ -6550,7 +6669,9 @@
return rv;
}
+#endif
+#ifdef IN_ACL
static int
parse_acl(const char *command_name, struct switch_val *val)
{
@@ -6563,6 +6684,7 @@
return rv;
}
+#endif
static int name_transfer(char *name, char *module, char *cmd)
{
@@ -6614,41 +6736,77 @@
parameter_length = 0;
if(!strcmp(module_name, "Qos")) {
+#ifdef IN_QOS
rv = parse_qos(command_name, val);
+#endif
} else if(!strcmp(module_name, "Cosmap")) {
+#ifdef IN_COSMAP
rv = parse_cos(command_name, val);
+#endif
} else if(!strcmp(module_name, "Rate")) {
+#ifdef IN_RATE
rv = parse_rate(command_name, val);
+#endif
} else if(!strcmp(module_name, "Port")) {
+#ifdef IN_PORTCONTROL
rv = parse_port(command_name, val);
+#endif
} else if(!strcmp(module_name, "Portvlan")) {
+#ifdef IN_PORTVLAN
rv = parse_portvlan(command_name, val);
+#endif
} else if(!strcmp(module_name, "Vlan")) {
+#ifdef IN_VLAN
rv = parse_vlan(command_name, val);
+#endif
} else if(!strcmp(module_name, "Fdb")) {
+#ifdef IN_FDB
rv = parse_fdb(command_name, val);
+#endif
} else if(!strcmp(module_name, "Igmp")) {
+#ifdef IN_IGMP
rv = parse_igmp(command_name, val);
+#endif
} else if(!strcmp(module_name, "Sec")) {
+#ifdef IN_SEC
rv = parse_sec(command_name, val);
+#endif
} else if(!strcmp(module_name, "Misc")) {
+#ifdef IN_MISC
rv = parse_misc(command_name, val);
+#endif
} else if(!strcmp(module_name, "Ip")) {
+#ifdef IN_IP
rv = parse_ip(command_name, val);
+#endif
} else if(!strcmp(module_name, "Nat")) {
+#ifdef IN_NAT
rv = parse_nat(command_name, val);
+#endif
} else if(!strcmp(module_name, "Stp")) {
+#ifdef IN_STP
rv = parse_stp(command_name, val);
+#endif
} else if(!strcmp(module_name, "Mirror")) {
+#ifdef IN_MIRROR
rv = parse_mirror(command_name, val);
+#endif
} else if(!strcmp(module_name, "Leaky")) {
+#ifdef IN_LEAKY
rv = parse_leaky(command_name, val);
+#endif
} else if(!strcmp(module_name, "Trunk")) {
+#ifdef IN_TRUNK
rv = parse_trunk(command_name, val);
+#endif
} else if(!strcmp(module_name, "Mib")) {
+#ifdef IN_MIB
rv = parse_mib(command_name, val);
+#endif
} else if(!strcmp(module_name, "Acl")) {
+#ifdef IN_ACL
rv = parse_acl(command_name, val);
+#endif
}
if(!rv) {
diff --git a/src/shell_lib/shell.c b/src/shell_lib/shell.c
index 65f36c0..eae0059 100755
--- a/src/shell_lib/shell.c
+++ b/src/shell_lib/shell.c
@@ -120,7 +120,7 @@
return rv;
}
-
+#if 0
static sw_error_t
cmd_api_output(sw_api_param_t *pp, a_uint32_t nr_param, a_uint32_t * args)
{
@@ -170,7 +170,7 @@
}
return SW_OK;
}
-
+#endif
void
cmd_strtol(char *str, a_uint32_t * arg_val)
{
@@ -274,8 +274,10 @@
rv = cmd_api_func(sw_api.api_fp, sw_api.api_nr, arg_val);
SW_RTN_ON_ERROR(rv);
+ #if 0
rv = cmd_api_output(sw_api.api_pp, sw_api.api_nr, arg_val);
SW_RTN_ON_ERROR(rv);
+ #endif
return rv;
}
@@ -284,6 +286,7 @@
void
cmd_print_usage (int cmd_index, int cmd_index_sub)
{
+ #if 0
if(GCMD_NAME(cmd_index))
dprintf("usage: %s", GCMD_NAME(cmd_index));
@@ -293,6 +296,7 @@
if(GCMD_SUB_ACT(cmd_index, cmd_index_sub) && GCMD_SUB_USAGE(cmd_index, cmd_index_sub))
dprintf(" %s %s\n\n", GCMD_SUB_ACT(cmd_index, cmd_index_sub),
GCMD_SUB_USAGE(cmd_index, cmd_index_sub));
+ #endif
}
/*
main function
diff --git a/src/shell_lib/shell_config.c b/src/shell_lib/shell_config.c
index 15e6a8a..9e6bfba 100755
--- a/src/shell_lib/shell_config.c
+++ b/src/shell_lib/shell_config.c
@@ -17,7 +17,7 @@
#include "shell_config.h"
#include "shell_sw.h"
-
+#if 0
/*cmdline tree descript*/
struct cmd_des_t gcmd_des[] =
{
@@ -608,4 +608,647 @@
{NULL, NULL, {{NULL, NULL, NULL, NULL, (int)NULL, NULL}}} /*end of desc*/
};
+#else
+
+#ifdef IN_PORTCONTROL
+struct sub_cmd_des_t g_port_des[] =
+{
+ #ifndef IN_PORTCONTROL_MINI
+ {"duplex", "set", SW_API_PT_DUPLEX_SET, NULL},
+ {"speed", "set", SW_API_PT_SPEED_SET, NULL},
+ {"autoAdv", "set", SW_API_PT_AN_ADV_SET, NULL},
+ {"autoNeg", "enable", SW_API_PT_AN_ENABLE, NULL},
+ {"autoNeg", "restart", SW_API_PT_AN_RESTART, NULL},
+ {"autoNegenable", "set", SW_API_PT_AN_ENABLE, NULL},
+ {"autoNegrestart", "set", SW_API_PT_AN_RESTART, NULL},
+ {"header", "set", SW_API_PT_HDR_SET, NULL},
+ #endif
+ {"txhdr", "set", SW_API_PT_TXHDR_SET, NULL},
+ {"rxhdr", "set", SW_API_PT_RXHDR_SET, NULL},
+ {"hdrtype", "set", SW_API_HEADER_TYPE_SET, NULL},
+ #ifndef IN_PORTCONTROL_MINI
+ {"flowCtrl", "set", SW_API_PT_FLOWCTRL_SET, NULL},
+ {"flowCtrlforcemode", "set", SW_API_PT_FLOWCTRL_MODE_SET, NULL},
+ {"powersave", "set", SW_API_PT_POWERSAVE_SET, NULL},
+ {"hibernate", "set", SW_API_PT_HIBERNATE_SET, NULL},
+ {"cdt", "run", SW_API_PT_CDT, NULL},
+ {"txmacstatus", "set", SW_API_TXMAC_STATUS_SET, NULL},
+ {"rxmacstatus", "set", SW_API_RXMAC_STATUS_SET, NULL},
+ {"txfcstatus", "set", SW_API_TXFC_STATUS_SET, NULL},
+ {"rxfcstatus", "set", SW_API_RXFC_STATUS_SET, NULL},
+ {"bpstatus", "set", SW_API_BP_STATUS_SET, NULL},
+ {"linkforcemode", "set", SW_API_PT_LINK_MODE_SET, NULL},
+ {"macLoopback", "set", SW_API_PT_MAC_LOOPBACK_SET, NULL},
+ {"congedrop", "set", SW_API_PT_CONGESTION_DROP_SET, NULL},
+ {"ringfcthresh", "set", SW_API_PT_RING_FLOW_CTRL_THRES_SET, NULL},
+ {"Ieee8023az", "set", SW_API_PT_8023AZ_SET, NULL},
+ {"crossover", "set", SW_API_PT_MDIX_SET, NULL},
+ {"preferMedium", "set", SW_API_PT_COMBO_PREFER_MEDIUM_SET, NULL},
+ {"fiberMode", "set", SW_API_PT_COMBO_FIBER_MODE_SET, NULL},
+ {"localLoopback", "set", SW_API_PT_LOCAL_LOOPBACK_SET, NULL},
+ {"remoteLoopback", "set", SW_API_PT_REMOTE_LOOPBACK_SET, NULL},
+ {"reset", "set", SW_API_PT_RESET, NULL},
+ {"poweroff", "set", SW_API_PT_POWER_OFF, NULL},
+ {"poweron", "set", SW_API_PT_POWER_ON, NULL},
+ {"magicFrameMac", "set", SW_API_PT_MAGIC_FRAME_MAC_SET, NULL},
+ {"wolstatus", "set", SW_API_PT_WOL_STATUS_SET, NULL},
+ {"interfaceMode", "set", SW_API_PT_INTERFACE_MODE_SET, NULL},
+ {"counter", "set", SW_API_PT_COUNTER_SET, NULL},
+ #endif
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_VLAN
+struct sub_cmd_des_t g_vlan_des[] =
+{
+ {"entry", "set", SW_API_VLAN_ADD, NULL},
+ {"entry", "create", SW_API_VLAN_ADD, NULL},
+ {"entry", "del", SW_API_VLAN_DEL, NULL},
+ {"entry", "update", SW_API_VLAN_MEM_UPDATE, NULL},
+ {"entry", "append", SW_API_VLAN_APPEND, NULL},
+ {"entry", "flush", SW_API_VLAN_FLUSH, NULL},
+ {"fid", "set", SW_API_VLAN_FID_SET, NULL},
+ {"member", "set", SW_API_VLAN_MEMBER_ADD, NULL},
+ {"member", "add", SW_API_VLAN_MEMBER_ADD, NULL},
+ {"member", "del", SW_API_VLAN_MEMBER_DEL, NULL},
+ #ifndef IN_VLAN_MINI
+ {"learnsts", "set", SW_API_VLAN_LEARN_STATE_SET, NULL},
+ #endif
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_PORTVLAN
+struct sub_cmd_des_t g_portvlan_des[] =
+{
+ {"ingress", "set", SW_API_PT_ING_MODE_SET, NULL},
+ {"egress", "set", SW_API_PT_EG_MODE_SET, NULL},
+ {"member", "set", SW_API_PT_VLAN_MEM_UPDATE, NULL},
+ {"member", "add", SW_API_PT_VLAN_MEM_ADD, NULL},
+ {"member", "del", SW_API_PT_VLAN_MEM_DEL, NULL},
+ {"member", "update", SW_API_PT_VLAN_MEM_UPDATE, NULL},
+ {"defaultVid", "set", SW_API_PT_DEF_VID_SET, NULL},
+ {"forceVid", "set", SW_API_PT_FORCE_DEF_VID_SET, NULL},
+ {"forceMode", "set", SW_API_PT_FORCE_PORTVLAN_SET, NULL},
+ {"nestVlan", "set", SW_API_PT_NESTVLAN_SET, NULL},
+ {"sVlanTPID", "set", SW_API_NESTVLAN_TPID_SET, NULL},
+ {"invlan", "set", SW_API_PT_IN_VLAN_MODE_SET, NULL},
+ #ifndef IN_PORTVLAN_MINI
+ {"tlsMode", "set", SW_API_PT_TLS_SET, NULL},
+ {"priPropagation", "set", SW_API_PT_PRI_PROPAGATION_SET, NULL},
+ #endif
+ {"defaultSVid", "set", SW_API_PT_DEF_SVID_SET, NULL},
+ {"defaultCVid", "set", SW_API_PT_DEF_CVID_SET, NULL},
+ #ifndef IN_PORTVLAN_MINI
+ {"vlanPropagation", "set", SW_API_PT_VLAN_PROPAGATION_SET, NULL},
+ {"translation", "set", SW_API_PT_VLAN_TRANS_ADD, NULL},
+ {"translation", "add", SW_API_PT_VLAN_TRANS_ADD, NULL},
+ {"translation", "del", SW_API_PT_VLAN_TRANS_DEL, NULL},
+ {"qinqMode", "set", SW_API_QINQ_MODE_SET, NULL},
+ {"qinqRole", "set", SW_API_PT_QINQ_ROLE_SET, NULL},
+ {"macvlanxlt", "set", SW_API_PT_MAC_VLAN_XLT_SET, NULL},
+ {"netiso", "set", SW_API_NETISOLATE_SET, NULL},
+ {"egbypass", "set", SW_API_EG_FLTR_BYPASS_EN_SET, NULL},
+ {"ptvrfid", "set", SW_API_PT_VRF_ID_SET, NULL},
+ #endif
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_FDB
+struct sub_cmd_des_t g_fdb_des[] =
+{
+#ifndef IN_FDB_MINI
+ {"entry", "set", SW_API_FDB_ADD, NULL},
+ {"entry", "add", SW_API_FDB_ADD, NULL},
+ {"entry", "del", SW_API_FDB_DELMAC, NULL},
+ {"entry", "flush", SW_API_FDB_DELALL, NULL},
+ {"entry", "transfer", SW_API_FDB_TRANSFER, NULL},
+ {"portEntry", "flush", SW_API_FDB_DELPORT, NULL},
+ {"firstEntry", "find", SW_API_FDB_FIRST, NULL},
+ {"nextEntry", "find", SW_API_FDB_NEXT, NULL},
+#endif
+ {"portLearn", "set", SW_API_FDB_PT_LEARN_SET, NULL},
+#ifndef IN_FDB_MINI
+ {"ageCtrl", "set", SW_API_FDB_AGE_CTRL_SET, NULL},
+ {"vlansmode", "set", SW_API_FDB_VLAN_IVL_SVL_SET, NULL},
+ {"ageTime", "set", SW_API_FDB_AGE_TIME_SET, NULL},
+ {"ptlearnlimit", "set", SW_API_PT_FDB_LEARN_LIMIT_SET, NULL},
+ {"ptlearnexceedcmd", "set", SW_API_PT_FDB_LEARN_EXCEED_CMD_SET, NULL},
+ {"learnlimit", "set", SW_API_FDB_LEARN_LIMIT_SET, NULL},
+ {"learnexceedcmd", "set", SW_API_FDB_LEARN_EXCEED_CMD_SET, NULL},
+ {"resventry", "set", SW_API_FDB_RESV_ADD, NULL},
+ {"resventry", "add", SW_API_FDB_RESV_ADD, NULL},
+ {"resventry", "del", SW_API_FDB_RESV_DEL, NULL},
+ {"ptLearnstatic", "set", SW_API_FDB_PT_LEARN_STATIC_SET, NULL},
+ {"port", "add", SW_API_FDB_PORT_ADD, NULL},
+ {"port", "del", SW_API_FDB_PORT_DEL, NULL},
+#endif
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_ACL
+struct sub_cmd_des_t g_acl_des[] =
+{
+ {"list", "create", SW_API_ACL_LIST_CREAT, NULL},
+ {"list", "destroy", SW_API_ACL_LIST_DESTROY, NULL},
+ {"list", "bind", SW_API_ACL_LIST_BIND, NULL},
+ {"list", "unbind", SW_API_ACL_LIST_UNBIND, NULL},
+ {"rule", "add", SW_API_ACL_RULE_ADD, NULL},
+ {"rule", "del", SW_API_ACL_RULE_DELETE, NULL},
+ {"rule", "active", SW_API_ACL_RULE_ACTIVE, NULL},
+ {"rule", "deactive", SW_API_ACL_RULE_DEACTIVE, NULL},
+ {"srcfiltersts", "set", SW_API_ACL_RULE_SRC_FILTER_STS_SET, NULL},
+ {"status", "set", SW_API_ACL_STATUS_SET, NULL},
+ {"udfprofile", "set", SW_API_ACL_PT_UDF_PROFILE_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_QOS
+struct sub_cmd_des_t g_qos_des[] =
+{
+#ifndef IN_QOS_MINI
+#ifndef ISISC
+ {"schMode", "set", SW_API_QOS_SCH_MODE_SET, NULL},
+#endif
+ {"qTxBufSts", "set", SW_API_QOS_QU_TX_BUF_ST_SET, NULL},
+#ifdef ISISC
+ {"qTxBufNr", "set", SW_API_QOS_QU_TX_BUF_NR_SET, NULL},
+#else
+ {"qTxBufNr", "set", SW_API_QOS_QU_TX_BUF_NR_SET, NULL},
+#endif
+ {"ptTxBufSts", "set", SW_API_QOS_PT_TX_BUF_ST_SET, NULL},
+ {"ptRedEn", "set", SW_API_QOS_PT_RED_EN_SET, NULL},
+#ifdef ISISC
+ {"ptTxBufNr", "set", SW_API_QOS_PT_TX_BUF_NR_SET, NULL},
+#else
+ {"ptTxBufNr", "set", SW_API_QOS_PT_TX_BUF_NR_SET, NULL},
+#endif
+#ifdef ISISC
+ {"ptRxBufNr", "set", SW_API_QOS_PT_RX_BUF_NR_SET, NULL},
+#else
+ {"ptRxBufNr", "set", SW_API_QOS_PT_RX_BUF_NR_SET, NULL},
+#endif
+#ifndef ISISC
+ {"up2q", "set", SW_API_COSMAP_UP_QU_SET, NULL},
+ {"dscp2q", "set", SW_API_COSMAP_DSCP_QU_SET, NULL},
+#endif
+#endif
+#ifdef ISISC
+ {"ptMode", "set", SW_API_QOS_PT_MODE_SET, NULL},
+ {"ptModePri", "set", SW_API_QOS_PT_MODE_PRI_SET, NULL},
+#else
+ {"ptMode", "set", SW_API_QOS_PT_MODE_SET, NULL},
+ {"ptModePri", "set", SW_API_QOS_PT_MODE_PRI_SET, NULL},
+#endif
+#ifndef IN_QOS_MINI
+#ifndef ISISC
+ {"ptDefaultUp", "set", SW_API_QOS_PORT_DEF_UP_SET, NULL},
+#endif
+ {"ptschMode", "set", SW_API_QOS_PORT_SCH_MODE_SET, NULL},
+ {"ptDefaultSpri", "set", SW_API_QOS_PT_DEF_SPRI_SET, NULL},
+ {"ptDefaultCpri", "set", SW_API_QOS_PT_DEF_CPRI_SET, NULL},
+ {"ptFSpriSts", "set", SW_API_QOS_PT_FORCE_SPRI_ST_SET, NULL},
+ {"ptFCpriSts", "set", SW_API_QOS_PT_FORCE_CPRI_ST_SET, NULL},
+ {"ptQuRemark", "set", SW_API_QOS_QUEUE_REMARK_SET, NULL},
+#endif
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_IGMP
+struct sub_cmd_des_t g_igmp_des[] =
+{
+ {"mode", "set", SW_API_PT_IGMPS_MODE_SET, NULL},
+ {"cmd", "set", SW_API_IGMP_MLD_CMD_SET, NULL},
+ {"portJoin", "set", SW_API_IGMP_PT_JOIN_SET, NULL},
+ {"portLeave", "set", SW_API_IGMP_PT_LEAVE_SET, NULL},
+ {"rp", "set", SW_API_IGMP_RP_SET, NULL},
+ {"createStatus", "set", SW_API_IGMP_ENTRY_CREAT_SET, NULL},
+ {"static", "set", SW_API_IGMP_ENTRY_STATIC_SET, NULL},
+ {"leaky", "set", SW_API_IGMP_ENTRY_LEAKY_SET, NULL},
+ {"version3", "set", SW_API_IGMP_ENTRY_V3_SET, NULL},
+ {"queue", "set", SW_API_IGMP_ENTRY_QUEUE_SET, NULL},
+ {"ptlearnlimit", "set", SW_API_PT_IGMP_LEARN_LIMIT_SET, NULL},
+ {"ptlearnexceedcmd", "set", SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET, NULL},
+ {"multi", "set", SW_API_IGMP_SG_ENTRY_SET, NULL},
+ {"multi", "clear", SW_API_IGMP_SG_ENTRY_CLEAR, NULL},
+ {"multi", "show", SW_API_IGMP_SG_ENTRY_SHOW, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_LEAKY
+struct sub_cmd_des_t g_leaky_des[] =
+{
+ {"ucMode", "set", SW_API_UC_LEAKY_MODE_SET, NULL},
+ {"mcMode", "set", SW_API_MC_LEAKY_MODE_SET, NULL},
+ {"arpMode", "set", SW_API_ARP_LEAKY_MODE_SET, NULL},
+ {"ptUcMode", "set", SW_API_PT_UC_LEAKY_MODE_SET, NULL},
+ {"ptMcMode", "set", SW_API_PT_MC_LEAKY_MODE_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_MIRROR
+struct sub_cmd_des_t g_mirror_des[] =
+{
+ {"analyPt", "set", SW_API_MIRROR_ANALY_PT_SET, NULL},
+ {"ptIngress", "set", SW_API_MIRROR_IN_PT_SET, NULL},
+ {"ptEgress", "set", SW_API_MIRROR_EG_PT_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_RATE
+struct sub_cmd_des_t g_rate_des[] =
+{
+#ifndef ISISC
+ {"qEgress", "set", SW_API_RATE_QU_EGRL_SET, NULL},
+ {"ptEgress", "set", SW_API_RATE_PT_EGRL_SET, NULL},
+ {"ptIngress", "set", SW_API_RATE_PT_INRL_SET, NULL},
+ {"stormCtrl", "set", SW_API_STORM_CTRL_FRAME_SET, NULL},
+ {"stormCtrlRate", SW_API_STORM_CTRL_RATE_SET, NULL},
+#endif
+ {"portpolicer", "set", SW_API_RATE_PORT_POLICER_SET, NULL},
+ {"portshaper", "set", SW_API_RATE_PORT_SHAPER_SET, NULL},
+ {"queueshaper", "set", SW_API_RATE_QUEUE_SHAPER_SET, NULL},
+ {"aclpolicer", "set", SW_API_RATE_ACL_POLICER_SET, NULL},
+ {"ptAddRateByte", SW_API_RATE_PT_ADDRATEBYTE_SET, NULL},
+ {"ptgolflowen", "set", SW_API_RATE_PT_GOL_FLOW_EN_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_SEC
+#ifdef ISISC
+struct sub_cmd_des_t g_sec_des[] =
+{
+ {"mac", "set", SW_API_SEC_MAC_SET, NULL},
+ {"ip", "set", SW_API_SEC_IP_SET, NULL},
+ {"ip4", "set", SW_API_SEC_IP4_SET, NULL},
+ {"ip6", "set", SW_API_SEC_IP6_SET, NULL},
+ {"tcp", "set", SW_API_SEC_TCP_SET, NULL},
+ {"udp", "set", SW_API_SEC_UDP_SET, NULL},
+ {"icmp4", "set", SW_API_SEC_ICMP4_SET, NULL},
+ {"icmp6", "set", SW_API_SEC_ICMP6_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+#endif
+
+#ifdef IN_STP
+struct sub_cmd_des_t g_stp_des[] =
+{
+ {"portState", "set", SW_API_STP_PT_STATE_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_MIB
+struct sub_cmd_des_t g_mib_des[] =
+{
+ {"status", "set", SW_API_MIB_STATUS_SET, NULL},
+ {"counters", "flush", SW_API_PT_MIB_FLUSH_COUNTERS, NULL},
+ {"cpuKeep", "set", SW_API_MIB_CPU_KEEP_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_LED
+struct sub_cmd_des_t g_led_des[] =
+{
+ {"ctrlpattern", "set", SW_API_LED_PATTERN_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+
+#ifdef IN_COSMAP
+struct sub_cmd_des_t g_cosmap_des[] =
+{
+#ifndef IN_COSMAP_MINI
+ {"dscp2pri", "set", SW_API_COSMAP_DSCP_TO_PRI_SET, NULL},
+ {"dscp2dp", "set", SW_API_COSMAP_DSCP_TO_DP_SET, NULL},
+ {"up2pri", "set", SW_API_COSMAP_UP_TO_PRI_SET, NULL},
+ {"up2dp", "set", SW_API_COSMAP_UP_TO_DP_SET, NULL},
+ {"dscp2ehpri", "set", SW_API_COSMAP_DSCP_TO_EHPRI_SET, NULL},
+ {"dscp2ehdp", "set", SW_API_COSMAP_DSCP_TO_EHDP_SET, NULL},
+
+ {"up2ehpri", "set", SW_API_COSMAP_UP_TO_EHPRI_SET, NULL},
+ {"up2ehdp", "set", SW_API_COSMAP_UP_TO_EHDP_SET, NULL},
+#endif
+ {"pri2q", "set", SW_API_COSMAP_PRI_TO_QU_SET, NULL},
+ {"pri2ehq", "set", SW_API_COSMAP_PRI_TO_EHQU_SET, NULL},
+#ifndef IN_COSMAP_MINI
+ {"egRemark", "set", SW_API_COSMAP_EG_REMARK_SET, NULL},
+#endif
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_MISC
+struct sub_cmd_des_t g_misc_des[] =
+{
+#ifndef ISISC
+ {"arp", "set", SW_API_ARP_STATUS_SET, NULL},
+#endif
+ {"frameMaxSize", "set", SW_API_FRAME_MAX_SIZE_SET, NULL},
+#ifndef ISISC
+ {"ptUnkSaCmd", "set", SW_API_PT_UNK_SA_CMD_SET, NULL},
+#endif
+ {"ptUnkUcFilter", "set", SW_API_PT_UNK_UC_FILTER_SET, NULL},
+ {"ptUnkMcFilter", "set", SW_API_PT_UNK_MC_FILTER_SET, NULL},
+ {"ptBcFilter", "set", SW_API_PT_BC_FILTER_SET, NULL},
+ {"cpuPort", "set", SW_API_CPU_PORT_STATUS_SET, NULL},
+#ifndef ISISC
+ {"bctoCpu", "set", SW_API_BC_TO_CPU_PORT_SET, NULL},
+#endif
+#ifdef ISISC
+#ifndef IN_MISC_MINI
+ {"PppoeCmd", "set", SW_API_PPPOE_CMD_SET, NULL},
+#endif
+#else
+ {"PppoeCmd", "set", SW_API_PPPOE_CMD_SET, NULL},
+#endif
+#ifndef IN_MISC_MINI
+ {"Pppoe", "set", SW_API_PPPOE_STATUS_SET, NULL},
+ {"ptDhcp", "set", SW_API_PT_DHCP_SET, NULL},
+#ifdef ISISC
+ {"arpcmd", "set", SW_API_ARP_CMD_SET, NULL},
+#else
+ {"arpcmd", "set", SW_API_ARP_CMD_SET, NULL},
+#endif
+#endif
+ {"eapolcmd", "set", SW_API_EAPOL_CMD_SET, NULL},
+ {"eapolstatus", "set", SW_API_EAPOL_STATUS_SET, NULL},
+#ifndef IN_MISC_MINI
+#ifndef ISISC
+ {"pppoesession", "add", SW_API_PPPOE_SESSION_ADD, NULL},
+ {"pppoesession", "del", SW_API_PPPOE_SESSION_DEL, NULL},
+#endif
+ {"rip", "set", SW_API_RIPV1_STATUS_SET, NULL},
+ {"ptarpreq", "set", SW_API_PT_ARP_REQ_STATUS_SET, NULL},
+ {"ptarpack", "set", SW_API_PT_ARP_ACK_STATUS_SET, NULL},
+ {"extendpppoe", "set", SW_API_PPPOE_SESSION_TABLE_ADD, NULL},
+ {"extendpppoe", "add", SW_API_PPPOE_SESSION_TABLE_ADD, NULL},
+ {"extendpppoe", "del", SW_API_PPPOE_SESSION_TABLE_DEL, NULL},
+ {"pppoeid", "set", SW_API_PPPOE_SESSION_ID_SET, NULL},
+ {"intrmask", "set", SW_API_INTR_MASK_SET, NULL},
+ {"intrstatus", "clear", SW_API_INTR_STATUS_CLEAR, NULL},
+ {"intrportlinkmask", "set", SW_API_INTR_PORT_LINK_MASK_SET, NULL},
+ {"intrmaskmaclinkchg", "set", SW_API_INTR_MASK_MAC_LINKCHG_SET, NULL},
+ {"intrstatusmaclinkchg", "clear", SW_API_INTR_STATUS_MAC_LINKCHG_CLEAR, NULL},
+ {"cpuVid", "set", SW_API_CPU_VID_EN_SET, NULL},
+ {"rtdPppoe", "set", SW_API_RTD_PPPOE_EN_SET, NULL},
+ {"glomacaddr", "set", SW_API_GLOBAL_MACADDR_SET, NULL},
+ {"lldp", "set", SW_API_LLDP_STATUS_SET, NULL},
+ {"framecrc", "set", SW_API_FRAME_CRC_RESERVE_SET, NULL},
+#endif
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_IP
+struct sub_cmd_des_t g_ip_des[] =
+{
+ {"hostentry", "set", SW_API_IP_HOST_ADD, NULL},
+ {"hostentry", "add", SW_API_IP_HOST_ADD, NULL},
+ {"hostentry", "del", SW_API_IP_HOST_DEL, NULL},
+ {"hostentry", "next", SW_API_IP_HOST_NEXT, NULL},
+ {"hostentry", "bindcnt", SW_API_IP_HOST_COUNTER_BIND, NULL},
+ {"hostentry", "bindpppoe", SW_API_IP_HOST_PPPOE_BIND, NULL},
+ {"ptarplearn", "set", SW_API_IP_PT_ARP_LEARN_SET, NULL},
+ {"arplearn", "set", SW_API_IP_ARP_LEARN_SET, NULL},
+ {"ptipsrcguard", "set", SW_API_IP_SOURCE_GUARD_SET, NULL},
+ {"ptarpsrcguard", "set", SW_API_IP_ARP_GUARD_SET, NULL},
+ {"routestatus", "set", SW_API_IP_ROUTE_STATUS_SET, NULL},
+ {"intfentry", "set", SW_API_IP_INTF_ENTRY_ADD, NULL},
+ {"intfentry", "add", SW_API_IP_INTF_ENTRY_ADD, NULL},
+ {"intfentry", "del", SW_API_IP_INTF_ENTRY_DEL, NULL},
+ {"ipunksrc", "set", SW_API_IP_UNK_SOURCE_CMD_SET, NULL},
+ {"arpunksrc", "set", SW_API_ARP_UNK_SOURCE_CMD_SET, NULL},
+ {"ipagetime", "set", SW_API_IP_AGE_TIME_SET, NULL},
+ {"wcmphashmode", "set", SW_API_WCMP_HASH_MODE_SET, NULL},
+ {"wcmpentry", "set", SW_API_IP_WCMP_ENTRY_SET, NULL},
+ {"vrfbaseaddr", "set", SW_API_IP_VRF_BASE_ADDR_SET, NULL},
+ {"vrfbasemask", "set", SW_API_IP_VRF_BASE_MASK_SET, NULL},
+ {"defaultroute", "set", SW_API_IP_DEFAULT_ROUTE_SET, NULL},
+ {"hostroute", "set", SW_API_IP_HOST_ROUTE_SET, NULL},
+ {"rfsip4", "set", SW_API_IP_RFS_IP4_SET, NULL},
+ {"rfsip6", "set", SW_API_IP_RFS_IP6_SET, NULL},
+ {"defaultflowcmd", "set", SW_API_IP_DEFAULT_FLOW_CMD_SET, NULL},
+ {"defaultrtflowcmd", "set", SW_API_IP_DEFAULT_RT_FLOW_CMD_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_NAT
+struct sub_cmd_des_t g_nat_des[] =
+{
+ {"natentry", "set", SW_API_NAT_ADD, NULL},
+ {"natentry", "add", SW_API_NAT_ADD, NULL},
+ {"natentry", "del", SW_API_NAT_DEL, NULL},
+ {"natentry", "next", SW_API_NAT_NEXT, NULL},
+ {"natentry", "bindcnt", SW_API_NAT_COUNTER_BIND, NULL},
+ {"naptentry", "set", SW_API_NAPT_ADD, NULL},
+ {"naptentry", "add", SW_API_NAPT_ADD, NULL},
+ {"naptentry", "del", SW_API_NAPT_DEL, NULL},
+ {"naptentry", "next", SW_API_NAPT_NEXT, NULL},
+ {"naptentry", "bindcnt", SW_API_NAPT_COUNTER_BIND, NULL},
+ {"natstatus", "set", SW_API_NAT_STATUS_SET, NULL},
+ {"naptstatus", "set", SW_API_NAPT_STATUS_SET, NULL},
+ {"nathash", "set", SW_API_NAT_HASH_MODE_SET, NULL},
+ {"naptmode", "set", SW_API_NAPT_MODE_SET, NULL},
+ {"prvbaseaddr", "set", SW_API_PRV_BASE_ADDR_SET, NULL},
+ {"prvaddrmode", "set", SW_API_PRV_ADDR_MODE_SET, NULL},
+ {"pubaddr", "set", SW_API_PUB_ADDR_ENTRY_ADD, NULL},
+ {"pubaddr", "add", SW_API_PUB_ADDR_ENTRY_ADD, NULL},
+ {"pubaddr", "del", SW_API_PUB_ADDR_ENTRY_DEL, NULL},
+ {"natunksess", "set", SW_API_NAT_UNK_SESSION_CMD_SET, NULL},
+ {"prvbasemask", "set", SW_API_PRV_BASE_MASK_SET, NULL},
+ {"global", "set", SW_API_NAT_GLOBAL_SET, NULL},
+ {"flowentry", "set", SW_API_FLOW_ADD, NULL},
+ {"flowentry", "add", SW_API_FLOW_ADD, NULL},
+ {"flowentry", "del", SW_API_FLOW_DEL, NULL},
+ {"flowentry", "next", SW_API_FLOW_NEXT, NULL},
+ {"flowcookie", "set", SW_API_FLOW_COOKIE_SET, NULL},
+ {"flowrfs", "set", SW_API_FLOW_RFS_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_TRUNK
+struct sub_cmd_des_t g_trunk_des[] =
+{
+ {"group", "set", SW_API_TRUNK_GROUP_SET, NULL},
+ {"hashmode", "set", SW_API_TRUNK_HASH_SET, NULL},
+ {"mansa", "set", SW_API_TRUNK_MAN_SA_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+#ifdef IN_INTERFACECONTROL
+struct sub_cmd_des_t g_interfacecontrol_des[] =
+{
+ {"macmode", "set", SW_API_MAC_MODE_SET, NULL},
+ {"pt3azstatus", "set", SW_API_PORT_3AZ_STATUS_SET, NULL},
+ {"phymode", "set", SW_API_PHY_MODE_SET, NULL},
+ {"fx100ctrl", "set", SW_API_FX100_CTRL_SET, NULL},
+ {"mac06exch", "set", SW_API_MAC06_EXCH_SET, NULL},
+ {NULL, NULL, (int)NULL, NULL},/*end of desc*/
+};
+#endif
+
+struct cmd_des_t gcmd_des[] =
+{
+ /*port ctrl*/
+#ifdef IN_PORTCONTROL
+ {
+ "port", g_port_des,
+ },
+#endif
+
+ /*vlan*/
+#ifdef IN_VLAN
+ {
+ "vlan", g_vlan_des,
+ },
+#endif
+
+ /*portvlan*/
+#ifdef IN_PORTVLAN
+ {
+ "portVlan", g_portvlan_des,
+ },
+#endif
+
+ /*fdb*/
+#ifdef IN_FDB
+ {
+ "fdb", g_fdb_des,
+ },
+#endif
+
+ /*acl*/
+#ifdef IN_ACL
+ {
+ "acl", g_acl_des,
+ },
+#endif
+
+ /*qos*/
+#ifdef IN_QOS
+ {
+ "qos", g_qos_des,
+ },
+#endif
+
+ /*igmp*/
+#ifdef IN_IGMP
+ {
+ "igmp", g_igmp_des,
+ },
+#endif
+
+ /*leaky*/
+#ifdef IN_LEAKY
+ {
+ "leaky", g_leaky_des,
+ },
+#endif
+
+ /*mirror*/
+#ifdef IN_MIRROR
+ {
+ "mirror", g_mirror_des,
+ },
+#endif
+
+ /*rate*/
+#ifdef IN_RATE
+ {
+ "rate", g_rate_des,
+ },
+#endif
+
+#ifdef IN_SEC
+#ifdef ISISC
+ {
+ "sec", g_sec_des,
+ },
+#endif
+#endif
+
+ /*stp*/
+#ifdef IN_STP
+ {
+ "stp", g_stp_des,
+ },
+#endif
+
+ /*mib*/
+#ifdef IN_MIB
+ {
+ "mib", g_mib_des,
+ },
+#endif
+
+ /* led */
+#ifdef IN_LED
+ {
+ "led", g_led_des,
+ },
+#endif
+
+ /* cosmap */
+#ifdef IN_COSMAP
+ {
+ "cosmap", g_cosmap_des,
+ },
+#endif
+
+ /*misc*/
+#ifdef IN_MISC
+ {
+ "misc", g_misc_des,
+ },
+#endif
+
+ /* IP */
+#ifdef IN_IP
+ {
+ "ip", g_ip_des,
+ },
+#endif
+
+ /* NAT */
+#ifdef IN_NAT
+ {
+ "nat", g_nat_des,
+ },
+#endif
+
+ /*Trunk*/
+#ifdef IN_TRUNK
+ {
+ "trunk", g_trunk_des,
+ },
+#endif
+
+ /*Interface Control*/
+#ifdef IN_INTERFACECONTROL
+ {
+ "interface", g_interfacecontrol_des,
+ },
+#endif
+
+ {NULL, NULL} /*end of desc*/
+};
+
+
+#endif
diff --git a/src/shell_lib/shell_io.c b/src/shell_lib/shell_io.c
index 675830a..e15186a 100755
--- a/src/shell_lib/shell_io.c
+++ b/src/shell_lib/shell_io.c
@@ -100,40 +100,81 @@
SW_TYPE_DEF(SW_INT32, NULL, NULL),
SW_TYPE_DEF(SW_UINT64, NULL, NULL),
SW_TYPE_DEF(SW_INT64, NULL, NULL),
+ #ifdef IN_PORTCONTROL
+ #ifndef IN_PORTCONTROL_MINI
SW_TYPE_DEF(SW_CAP, cmd_data_check_capable, NULL),
SW_TYPE_DEF(SW_DUPLEX, cmd_data_check_duplex, NULL),
SW_TYPE_DEF(SW_SPEED, cmd_data_check_speed, NULL),
+ #endif
+ #endif
+ #ifdef IN_PORTVLAN
SW_TYPE_DEF(SW_1QMODE, cmd_data_check_1qmode, NULL),
SW_TYPE_DEF(SW_EGMODE, cmd_data_check_egmode, NULL),
+ #endif
+ #ifdef IN_MIB
SW_TYPE_DEF(SW_MIB, NULL, NULL),
+ #endif
+ #ifdef IN_VLAN
SW_TYPE_DEF(SW_VLAN, cmd_data_check_vlan, NULL),
+ #endif
SW_TYPE_DEF(SW_PBMP, cmd_data_check_pbmp, NULL),
SW_TYPE_DEF(SW_ENABLE, cmd_data_check_enable, NULL),
SW_TYPE_DEF(SW_MACADDR, cmd_data_check_macaddr, NULL),
+ #ifdef IN_FDB
SW_TYPE_DEF(SW_FDBENTRY, cmd_data_check_fdbentry, NULL),
+ #endif
+ #ifdef IN_QOS
+ #ifndef IN_QOS_MINI
SW_TYPE_DEF(SW_SCH, cmd_data_check_qos_sch, NULL),
SW_TYPE_DEF(SW_QOS, cmd_data_check_qos_pt, NULL),
- SW_TYPE_DEF(SW_STORM, cmd_data_check_storm, NULL),
+ #endif
+ #endif
+ #ifdef IN_RATE
+ SW_TYPE_DEF(SW_STORM, cmd_data_check_storm, NULL),
+ #endif
+ #ifdef IN_STP
SW_TYPE_DEF(SW_STP, cmd_data_check_stp_state, NULL),
+ #endif
+ #ifdef IN_LEAKY
SW_TYPE_DEF(SW_LEAKY, cmd_data_check_leaky, NULL),
+ #endif
SW_TYPE_DEF(SW_MACCMD, cmd_data_check_maccmd, NULL),
+ #ifdef IN_IP
SW_TYPE_DEF(SW_FLOWCMD, cmd_data_check_flowcmd, NULL),
SW_TYPE_DEF(SW_FLOWTYPE, cmd_data_check_flowtype, NULL),
+ #endif
SW_TYPE_DEF(SW_UINT_A, cmd_data_check_uinta, NULL),
+ #ifdef IN_ACL
SW_TYPE_DEF(SW_ACLRULE, NULL, NULL),
+ #endif
+ #ifdef IN_LED
SW_TYPE_DEF(SW_LEDPATTERN, cmd_data_check_ledpattern, NULL),
+ #endif
+ #ifdef IN_PORTVLAN
SW_TYPE_DEF(SW_INVLAN, cmd_data_check_invlan_mode, NULL),
+ #ifndef IN_PORTVLAN_MINI
SW_TYPE_DEF(SW_VLANPROPAGATION, cmd_data_check_vlan_propagation, NULL),
SW_TYPE_DEF(SW_VLANTRANSLATION, cmd_data_check_vlan_translation, NULL),
SW_TYPE_DEF(SW_QINQMODE, cmd_data_check_qinq_mode, NULL),
SW_TYPE_DEF(SW_QINQROLE, cmd_data_check_qinq_role, NULL),
+ #endif
+ #endif
SW_TYPE_DEF(SW_CABLESTATUS, NULL, NULL),
SW_TYPE_DEF(SW_CABLELEN, NULL, NULL),
SW_TYPE_DEF(SW_SSDK_CFG, NULL, NULL),
+ #ifdef IN_PORTCONTROL
SW_TYPE_DEF(SW_HDRMODE, cmd_data_check_hdrmode, NULL),
+ #endif
+ #ifdef IN_FDB
SW_TYPE_DEF(SW_FDBOPRATION, cmd_data_check_fdboperation, NULL),
+ #endif
+ #ifdef IN_MISC
+ #ifndef IN_MISC_MINI
SW_TYPE_DEF(SW_PPPOE, cmd_data_check_pppoe, NULL),
+ #endif
+ #endif
SW_TYPE_DEF(SW_ACL_UDF_TYPE, NULL, NULL),
+ #if defined(IN_IP) || defined(IN_NAT)
SW_TYPE_DEF(SW_IP_HOSTENTRY, cmd_data_check_host_entry, NULL),
SW_TYPE_DEF(SW_ARP_LEARNMODE, cmd_data_check_arp_learn_mode, NULL),
SW_TYPE_DEF(SW_IP_GUARDMODE, cmd_data_check_ip_guard_mode, NULL),
@@ -147,14 +188,22 @@
SW_TYPE_DEF(SW_IP6ADDR, cmd_data_check_ip6addr, NULL),
SW_TYPE_DEF(SW_INTFMACENTRY, cmd_data_check_intf_mac_entry, NULL),
SW_TYPE_DEF(SW_PUBADDRENTRY, cmd_data_check_pub_addr_entry, NULL),
+ #endif
+ #ifdef IN_RATE
SW_TYPE_DEF(SW_INGPOLICER, cmd_data_check_port_policer, NULL),
SW_TYPE_DEF(SW_EGSHAPER, cmd_data_check_egress_shaper, NULL),
SW_TYPE_DEF(SW_ACLPOLICER, cmd_data_check_acl_policer, NULL),
+ #endif
SW_TYPE_DEF(SW_MACCONFIG, NULL, NULL),
SW_TYPE_DEF(SW_PHYCONFIG, NULL, NULL),
+ #ifdef IN_FDB
SW_TYPE_DEF(SW_FDBSMODE, cmd_data_check_fdb_smode, NULL),
+ #endif
SW_TYPE_DEF(SW_FX100CONFIG, NULL, NULL),
+ #ifdef IN_IGMP
SW_TYPE_DEF(SW_SGENTRY, cmd_data_check_multi, NULL),
+ #endif
+ #ifdef IN_SEC
SW_TYPE_DEF(SW_SEC_MAC, cmd_data_check_sec_mac, NULL),
SW_TYPE_DEF(SW_SEC_IP, cmd_data_check_sec_ip, NULL),
SW_TYPE_DEF(SW_SEC_IP4, cmd_data_check_sec_ip4, NULL),
@@ -163,16 +212,27 @@
SW_TYPE_DEF(SW_SEC_UDP, cmd_data_check_sec_udp, NULL),
SW_TYPE_DEF(SW_SEC_ICMP4, cmd_data_check_sec_icmp4, NULL),
SW_TYPE_DEF(SW_SEC_ICMP6, cmd_data_check_sec_icmp6, NULL),
+ #endif
+ #ifdef IN_COSMAP
SW_TYPE_DEF(SW_REMARKENTRY, cmd_data_check_remark_entry, NULL),
+ #endif
+ #ifdef IN_IP
SW_TYPE_DEF(SW_DEFAULT_ROUTE_ENTRY, cmd_data_check_default_route_entry, NULL),
SW_TYPE_DEF(SW_HOST_ROUTE_ENTRY, cmd_data_check_host_route_entry, NULL),
SW_TYPE_DEF(SW_IP_RFS_IP4, cmd_data_check_ip4_rfs_entry, NULL),
SW_TYPE_DEF(SW_IP_RFS_IP6, cmd_data_check_ip6_rfs_entry, NULL),
+ #endif
+ #ifdef IN_PORTCONTROL
+ #ifndef IN_PORTCONTROL_MINI
SW_TYPE_DEF(SW_CROSSOVER_MODE, cmd_data_check_crossover_mode, NULL),
SW_TYPE_DEF(SW_CROSSOVER_STATUS, cmd_data_check_crossover_status, NULL),
SW_TYPE_DEF(SW_PREFER_MEDIUM, cmd_data_check_prefer_medium, NULL),
SW_TYPE_DEF(SW_FIBER_MODE, cmd_data_check_fiber_mode, NULL),
+ #endif
+ #endif
+ #ifdef IN_INTERFACECONTROL
SW_TYPE_DEF(SW_INTERFACE_MODE, cmd_data_check_interface_mode, NULL),
+ #endif
SW_TYPE_DEF(SW_COUNTER_INFO, NULL, NULL),
};
@@ -381,7 +441,8 @@
return SW_OK;
}
-
+#ifdef IN_PORTCONTROL
+#ifndef IN_PORTCONTROL_MINI
/*port ctrl*/
sw_error_t
cmd_data_check_duplex(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size)
@@ -514,7 +575,9 @@
return SW_OK;
}
-
+#endif
+#endif
+#ifdef IN_INTERFACECONTROL
sw_error_t
cmd_data_check_interface_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size)
{
@@ -539,7 +602,9 @@
return SW_OK;
}
+#endif
/*portvlan*/
+#ifdef IN_PORTVLAN
sw_error_t
cmd_data_check_1qmode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size)
{
@@ -607,8 +672,9 @@
return SW_OK;
}
-
+#endif
/*vlan*/
+#ifdef IN_VLAN
sw_error_t
cmd_data_check_vlan(char *cmdstr, fal_vlan_t * val, a_uint32_t size)
{
@@ -695,8 +761,10 @@
*val = entry;
return SW_OK;
}
-
+#endif
/*qos*/
+#ifdef IN_QOS
+#ifndef IN_QOS_MINI
sw_error_t
cmd_data_check_qos_sch(char *cmdstr, fal_sch_mode_t * val, a_uint32_t size)
{
@@ -761,9 +829,11 @@
return SW_OK;
}
-
+#endif
+#endif
/*rate*/
+#ifdef IN_RATE
sw_error_t
cmd_data_check_storm(char *cmdstr, fal_storm_type_t * val, a_uint32_t size)
{
@@ -789,9 +859,10 @@
return SW_OK;
}
-
+#endif
/*stp*/
+#ifdef IN_STP
sw_error_t
cmd_data_check_stp_state(char *cmdstr, fal_stp_state_t * val, a_uint32_t size)
{
@@ -825,9 +896,9 @@
return SW_OK;
}
+#endif
-
-
+#ifdef IN_LEAKY
/*general*/
sw_error_t
cmd_data_check_leaky(char *cmdstr, fal_leaky_ctrl_mode_t * val, a_uint32_t size)
@@ -850,7 +921,7 @@
return SW_OK;
}
-
+#endif
sw_error_t
cmd_data_check_uinta(char *cmdstr, a_uint32_t * val, a_uint32_t size)
@@ -922,6 +993,7 @@
}
/*flow*/
+#ifdef IN_IP
sw_error_t
cmd_data_check_flowcmd(char *cmdstr, fal_default_flow_cmd_t * val, a_uint32_t size)
{
@@ -990,7 +1062,7 @@
return SW_OK;
}
-
+#endif
sw_error_t
cmd_data_check_confirm(char *cmdstr, a_bool_t def, a_bool_t * val,
a_uint32_t size)
@@ -1108,7 +1180,7 @@
*(fal_mac_addr_t *) val = mac;
return SW_OK;
}
-
+#ifdef IN_FDB
sw_error_t
cmd_data_check_fdbentry(char *info, void *val, a_uint32_t size)
{
@@ -1235,7 +1307,7 @@
return SW_OK;
}
-
+#endif
sw_error_t
cmd_data_check_integer(char *cmd_str, a_uint32_t * arg_val, a_uint32_t max_val,
a_uint32_t min_val)
@@ -1282,7 +1354,7 @@
*arg_val = tmp;
return SW_OK;
}
-
+#ifdef IN_ACL
sw_error_t
cmd_data_check_ruletype(char *cmd_str, fal_acl_rule_type_t * arg_val,
a_uint32_t size)
@@ -1315,7 +1387,7 @@
return SW_OK;
}
-
+#endif
sw_error_t
cmd_data_check_ip4addr(char *cmdstr, void * val, a_uint32_t size)
{
@@ -1395,7 +1467,7 @@
return SW_OK;
}
-
+#ifdef IN_IGMP
sw_error_t
cmd_data_check_multi(char *info, void *val, a_uint32_t size)
{
@@ -1475,6 +1547,7 @@
return SW_OK;
}
+#endif
sw_error_t
cmd_data_check_ip6addr(char *cmdstr, void * val, a_uint32_t size)
@@ -1681,7 +1754,7 @@
return SW_OK;
}
-
+#ifdef IN_LED
sw_error_t
cmd_data_check_blinkfreq(char *cmd_str, led_blink_freq_t * arg_val,
a_uint32_t size)
@@ -1868,9 +1941,10 @@
return SW_OK;
}
-
+#endif
/*Shiva*/
+#ifdef IN_PORTVLAN
sw_error_t
cmd_data_check_invlan_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size)
{
@@ -1897,7 +1971,7 @@
return SW_OK;
}
-
+#ifndef IN_PORTVLAN_MINI
sw_error_t
cmd_data_check_vlan_propagation(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size)
{
@@ -2055,8 +2129,10 @@
return SW_OK;
}
+#endif
+#endif
-
+#ifdef IN_PORTCONTROL
sw_error_t
cmd_data_check_hdrmode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size)
{
@@ -2083,7 +2159,8 @@
return SW_OK;
}
-
+#endif
+#ifdef IN_FDB
sw_error_t
cmd_data_check_fdboperation(char *cmd_str, void * val, a_uint32_t size)
{
@@ -2116,7 +2193,9 @@
*(fal_fdb_op_t *) val = entry;
return SW_OK;
}
-
+#endif
+#ifdef IN_MISC
+#ifndef IN_MISC_MINI
sw_error_t
cmd_data_check_pppoe(char *cmd_str, void * val, a_uint32_t size)
{
@@ -2163,8 +2242,10 @@
*(fal_pppoe_session_t*)val = entry;
return SW_OK;
}
+#endif
+#endif
-
+#if defined(IN_IP) || defined(IN_NAT)
sw_error_t
cmd_data_check_host_entry(char *cmd_str, void * val, a_uint32_t size)
{
@@ -2881,8 +2962,9 @@
*(fal_nat_pub_addr_t *)val = entry;
return SW_OK;
}
+#endif
-
+#ifdef IN_RATE
sw_error_t
cmd_data_check_egress_shaper(char *cmd_str, void * val, a_uint32_t size)
{
@@ -3190,8 +3272,8 @@
*(fal_port_policer_t *)val = entry;
return SW_OK;
}
-
-
+#endif
+#if 0
sw_error_t
cmd_data_check_mac_mode(char *cmd_str, fal_interface_mac_mode_t * arg_val,
a_uint32_t size)
@@ -3270,8 +3352,8 @@
return SW_OK;
}
-
-
+#endif
+#ifdef IN_FDB
sw_error_t
cmd_data_check_fdb_smode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size)
{
@@ -3289,8 +3371,8 @@
return SW_OK;
}
-
-
+#endif
+#ifdef IN_SEC
sw_error_t
cmd_data_check_sec_mac(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size)
{
@@ -3515,7 +3597,8 @@
return SW_OK;
}
-
+#endif
+#ifdef IN_COSMAP
sw_error_t
cmd_data_check_remark_entry(char *info, void *val, a_uint32_t size)
{
@@ -3608,7 +3691,8 @@
*/
return SW_OK;
}
-
+#endif
+#ifdef IN_IP
sw_error_t
cmd_data_check_default_route_entry(char *cmd_str, void * val, a_uint32_t size)
{
@@ -3910,7 +3994,8 @@
*(fal_ip4_rfs_t *)val = entry;
return SW_OK;
}
-
+#endif
+#if 0
sw_error_t
cmd_data_check_fdb_rfs(char *cmd_str, void * val, a_uint32_t size)
{
@@ -3948,8 +4033,8 @@
*(fal_fdb_rfs_t *)val = entry;
return SW_OK;
}
-
-
+#endif
+#ifdef IN_NAT
sw_error_t
cmd_data_check_flow_cookie(char *cmd_str, void * val, a_uint32_t size)
{
@@ -4065,7 +4150,8 @@
*(fal_flow_rfs_t *)val = entry;
return SW_OK;
}
-
+#endif
+#ifdef IN_IP
sw_error_t
cmd_data_check_ip6_rfs_entry(char *cmd_str, void * val, a_uint32_t size)
{
@@ -4108,3 +4194,4 @@
*(fal_ip6_rfs_t *)val = entry;
return SW_OK;
}
+#endif