[qca-ssdk-shell]: add port promismode set/get api.
Change-Id: I49f86a65f11095274ee163d3c7f780204eccbe2b
Signed-off-by: Liu Zhongjian <zhongjia@codeaurora.org>
diff --git a/include/api/api_desc.h b/include/api/api_desc.h
index 12f88b6..0225849 100755
--- a/include/api/api_desc.h
+++ b/include/api/api_desc.h
@@ -469,6 +469,16 @@
SW_PARAM_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \
SW_PARAM_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_GET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "Status"),
+#define SW_API_PT_PROMISC_MODE_SET_DESC \
+ SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
+ SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\
+ SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"),
+
+#define SW_API_PT_PROMISC_MODE_GET_DESC \
+ SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\
+ SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\
+ SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"),
+
#define SW_API_VLAN_ADD_DESC \
SW_PARAM_DEF(SW_API_VLAN_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
SW_PARAM_DEF(SW_API_VLAN_ADD, SW_UINT32, 4, SW_PARAM_IN, "Vlan Id"),
diff --git a/include/api/sw_ioctl.h b/include/api/sw_ioctl.h
index 63c6eb4..feee915 100755
--- a/include/api/sw_ioctl.h
+++ b/include/api/sw_ioctl.h
@@ -119,6 +119,9 @@
#define SW_API_PT_INTERFACE_MODE_APPLY (74 + SW_API_PORT_OFFSET)
#define SW_API_PT_INTERFACE_3AZ_STATUS_SET (75 + SW_API_PORT_OFFSET)
#define SW_API_PT_INTERFACE_3AZ_STATUS_GET (76 + SW_API_PORT_OFFSET)
+#define SW_API_PT_PROMISC_MODE_SET (77 + SW_API_PORT_OFFSET)
+#define SW_API_PT_PROMISC_MODE_GET (78 + SW_API_PORT_OFFSET)
+
/*vlan*/
#define SW_API_VLAN_OFFSET 110
diff --git a/include/fal/fal_api.h b/include/fal/fal_api.h
index c1afe26..73b9c2b 100755
--- a/include/fal/fal_api.h
+++ b/include/fal/fal_api.h
@@ -118,7 +118,9 @@
SW_API_DEF(SW_API_PT_FRAME_MAX_SIZE_GET, fal_port_max_frame_size_get), \
SW_API_DEF(SW_API_PT_FRAME_MAX_SIZE_SET, fal_port_max_frame_size_set), \
SW_API_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_SET, fal_port_interface_3az_status_set), \
- SW_API_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_GET, fal_port_interface_3az_status_get),
+ SW_API_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_GET, fal_port_interface_3az_status_get), \
+ SW_API_DEF(SW_API_PT_PROMISC_MODE_SET, fal_port_promisc_mode_set), \
+ SW_API_DEF(SW_API_PT_PROMISC_MODE_GET, fal_port_promisc_mode_get),
/*qca808x_start*/\
/*end of PORTCONTROL_API*/
#define PORTCONTROL_API_PARAM \
@@ -218,6 +220,8 @@
SW_API_DESC(SW_API_PT_FRAME_MAX_SIZE_SET) \
SW_API_DESC(SW_API_PT_INTERFACE_3AZ_STATUS_SET) \
SW_API_DESC(SW_API_PT_INTERFACE_3AZ_STATUS_GET)\
+ SW_API_DESC(SW_API_PT_PROMISC_MODE_SET) \
+ SW_API_DESC(SW_API_PT_PROMISC_MODE_GET) \
/*qca808x_start*/\
/*end of PORTCONTROL_API_PARAM*/
#else
diff --git a/include/fal/fal_port_ctrl.h b/include/fal/fal_port_ctrl.h
index 1e525d2..6f98b01 100755
--- a/include/fal/fal_port_ctrl.h
+++ b/include/fal/fal_port_ctrl.h
@@ -332,6 +332,8 @@
FUNC_ADPT_PORT_INTERFACE_MODE_APPLY,
FUNC_ADPT_PORT_INTERFACE_3AZ_STATUS_SET,
FUNC_ADPT_PORT_INTERFACE_3AZ_STATUS_GET,
+ FUNC_ADPT_PORT_PROMISC_MODE_SET,
+ FUNC_ADPT_PORT_PROMISC_MODE_GET,
FUNC_ADPT_PORT_FLOWCTRL_FORCEMODE_SET,
FUNC_ADPT_PORT_FLOWCTRL_FORCEMODE_GET,
};
@@ -699,6 +701,10 @@
sw_error_t
fal_port_interface_3az_status_get(a_uint32_t dev_id, fal_port_t port_id,
a_bool_t * enable);
+ sw_error_t
+ fal_port_promisc_mode_set(a_uint32_t dev_id,fal_port_t port_id,a_bool_t enable);
+ sw_error_t
+ fal_port_promisc_mode_get(a_uint32_t dev_id,fal_port_t port_id,a_bool_t *enable);
/*qca808x_start*/
#ifdef __cplusplus
}
diff --git a/src/fal_uk/fal_port_ctrl.c b/src/fal_uk/fal_port_ctrl.c
index 49e8c43..58a516b 100755
--- a/src/fal_uk/fal_port_ctrl.c
+++ b/src/fal_uk/fal_port_ctrl.c
@@ -861,4 +861,24 @@
return rv;
}
+sw_error_t
+fal_port_promisc_mode_set(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t enable)
+{
+ sw_error_t rv;
+ rv = sw_uk_exec(SW_API_PT_PROMISC_MODE_SET, dev_id, port_id, enable);
+
+ return rv;
+}
+
+sw_error_t
+fal_port_promisc_mode_get(a_uint32_t dev_id, fal_port_t port_id,
+ a_bool_t *enable)
+{
+ sw_error_t rv;
+
+ rv = sw_uk_exec(SW_API_PT_PROMISC_MODE_GET, dev_id, port_id, enable);
+
+ return rv;
+}
diff --git a/src/shell/shell_config.c b/src/shell/shell_config.c
index c059fe7..e071a10 100755
--- a/src/shell/shell_config.c
+++ b/src/shell/shell_config.c
@@ -109,6 +109,8 @@
/*qca808x_end*/
{"interface3az", "set", "set interface and phy 3az info", "<port_id> <enable/disable>", SW_API_PT_INTERFACE_3AZ_STATUS_SET, NULL},
{"interface3az", "get", "get interface and phy 3az info", "<port_id>", SW_API_PT_INTERFACE_3AZ_STATUS_GET, NULL},
+ {"promiscmode", "set", "set port promisc mode", "<port_id> <enable|disable>", SW_API_PT_PROMISC_MODE_SET, NULL},
+ {"promiscmode", "get", "get port promisc mode", "<port_id>", SW_API_PT_PROMISC_MODE_GET, NULL},
{"mtu", "set", "set port mtu value", "", SW_API_PT_MTU_SET, NULL},
{"mtu", "get", "get port mtu value", "", SW_API_PT_MTU_GET, NULL},
{"mru", "set", "set port mru value", "", SW_API_PT_MRU_SET, NULL},
diff --git a/src/shell/shell_module_ctrl.c b/src/shell/shell_module_ctrl.c
old mode 100644
new mode 100755
index a4a2817..2245255
--- a/src/shell/shell_module_ctrl.c
+++ b/src/shell/shell_module_ctrl.c
@@ -632,6 +632,8 @@
"FUNC_ADPT_PORT_INTERFACE_MODE_APPLY",
"FUNC_ADPT_PORT_INTERFACE_3AZ_STATUS_SET",
"FUNC_ADPT_PORT_INTERFACE_3AZ_STATUS_GET",
+ "FUNC_ADPT_PORT_PROMISC_MODE_SET",
+ "FUNC_ADPT_PORT_PROMISC_MODE_GET",
"FUNC_ADPT_PORT_FLOWCTRL_FORCEMODE_SET",
"FUNC_ADPT_PORT_FLOWCTRL_FORCEMODE_GET",
};