drivers: dsa_nxp_imx_netc: add Qbv capability

add Qbv capability for dsa_nxp_imx_netc

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
diff --git a/drivers/ethernet/dsa/dsa_nxp_imx_netc.c b/drivers/ethernet/dsa/dsa_nxp_imx_netc.c
index 2417524..8ad2541 100644
--- a/drivers/ethernet/dsa/dsa_nxp_imx_netc.c
+++ b/drivers/ethernet/dsa/dsa_nxp_imx_netc.c
@@ -415,6 +415,19 @@
 	return ret;
 }
 
+static enum ethernet_hw_caps dsa_port_get_capabilities(const struct device *dev)
+{
+	uint32_t caps = 0;
+
+	ARG_UNUSED(dev);
+
+#ifdef CONFIG_NET_QBV
+	caps |= ETHERNET_QBV;
+#endif
+
+	return caps;
+}
+
 static struct dsa_api dsa_netc_api = {
 	.port_init = dsa_netc_port_init,
 	.port_generate_random_mac = dsa_netc_port_generate_random_mac,
@@ -424,6 +437,7 @@
 	.port_txtstamp = dsa_netc_port_txtstamp,
 #endif
 	.connect_tag_protocol = dsa_netc_connect_tag_protocol,
+	.get_capabilities = dsa_port_get_capabilities,
 	.set_config = dsa_netc_set_config,
 	.get_config = dsa_netc_get_config,
 };
diff --git a/include/zephyr/net/dsa_core.h b/include/zephyr/net/dsa_core.h
index 3e437dc..cf5b7a7 100644
--- a/include/zephyr/net/dsa_core.h
+++ b/include/zephyr/net/dsa_core.h
@@ -130,6 +130,9 @@
 	/** Connect the switch to the tag protocol */
 	int (*connect_tag_protocol)(struct dsa_switch_context *dsa_switch_ctx, int tag_proto);
 
+	/** Get the device capabilities */
+	enum ethernet_hw_caps (*get_capabilities)(const struct device *dev);
+
 	/** Set specific hardware configuration */
 	int (*set_config)(const struct device *dev,
 			  enum ethernet_config_type type,
diff --git a/subsys/net/l2/ethernet/dsa/dsa_port.c b/subsys/net/l2/ethernet/dsa/dsa_port.c
index df7c332..828961c 100644
--- a/subsys/net/l2/ethernet/dsa/dsa_port.c
+++ b/subsys/net/l2/ethernet/dsa/dsa_port.c
@@ -133,6 +133,7 @@
 
 enum ethernet_hw_caps dsa_port_get_capabilities(const struct device *dev)
 {
+	struct dsa_switch_context *dsa_switch_ctx = dev->data;
 	uint32_t caps = 0;
 
 #ifdef CONFIG_NET_L2_PTP
@@ -140,6 +141,11 @@
 		caps |= ETHERNET_PTP;
 	}
 #endif
+
+	if (dsa_switch_ctx->dapi->get_capabilities) {
+		caps |= dsa_switch_ctx->dapi->get_capabilities(dev);
+	}
+
 	return caps;
 }