summaryrefslogtreecommitdiff
path: root/drivers/staging/fsl-dpaa2/ethsw/ethsw.h
diff options
context:
space:
mode:
authorIoana Ciornei <ioana.ciornei@nxp.com>2021-03-10 15:14:41 +0300
committerDavid S. Miller <davem@davemloft.net>2021-03-11 00:30:35 +0300
commit26d419f36a23acfaf38cd5e95a539701b2bb4559 (patch)
tree59e03af5663df62b768638d134a073b0826401bb /drivers/staging/fsl-dpaa2/ethsw/ethsw.h
parent5dda9a7921c7574ba02939eb3552145aa02c44d9 (diff)
downloadlinux-26d419f36a23acfaf38cd5e95a539701b2bb4559.tar.xz
staging: dpaa2-switch: get control interface attributes
Introduce a new structure to hold all necessary info related to an RX queue for the control interface and populate the FQ IDs. We only have one Rx queue and one Tx confirmation queue on the control interface, both shared by all the switch ports. Also, increase the minimum version of the object supported by the driver since for a basic switch driver support we'll be in need for some ABIs added in the latest version of firmware. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/staging/fsl-dpaa2/ethsw/ethsw.h')
-rw-r--r--drivers/staging/fsl-dpaa2/ethsw/ethsw.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.h b/drivers/staging/fsl-dpaa2/ethsw/ethsw.h
index 448f60755eea..24a203c42f5f 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.h
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.h
@@ -3,7 +3,7 @@
* DPAA2 Ethernet Switch declarations
*
* Copyright 2014-2016 Freescale Semiconductor Inc.
- * Copyright 2017-2018 NXP
+ * Copyright 2017-2021 NXP
*
*/
@@ -39,10 +39,19 @@
#define ETHSW_FEATURE_MAC_ADDR BIT(0)
+/* Number of receive queues (one RX and one TX_CONF) */
+#define DPAA2_SWITCH_RX_NUM_FQS 2
+
extern const struct ethtool_ops dpaa2_switch_port_ethtool_ops;
struct ethsw_core;
+struct dpaa2_switch_fq {
+ struct ethsw_core *ethsw;
+ enum dpsw_queue_type type;
+ u32 fqid;
+};
+
/* Per port private data */
struct ethsw_port_priv {
struct net_device *netdev;
@@ -74,6 +83,17 @@ struct ethsw_core {
struct notifier_block port_switchdev_nb;
struct notifier_block port_switchdevb_nb;
struct workqueue_struct *workqueue;
+
+ struct dpaa2_switch_fq fq[DPAA2_SWITCH_RX_NUM_FQS];
};
+static inline bool dpaa2_switch_supports_cpu_traffic(struct ethsw_core *ethsw)
+{
+ if (ethsw->sw_attr.options & DPSW_OPT_CTRL_IF_DIS) {
+ dev_err(ethsw->dev, "Control Interface is disabled, cannot probe\n");
+ return false;
+ }
+
+ return true;
+}
#endif /* __ETHSW_H */