1 // SPDX-License-Identifier: GPL-2.0
3 * DPAA2 Ethernet Switch declarations
5 * Copyright 2014-2016 Freescale Semiconductor Inc.
6 * Copyright 2017-2018 NXP
13 #include <linux/netdevice.h>
14 #include <linux/etherdevice.h>
15 #include <linux/rtnetlink.h>
16 #include <linux/if_vlan.h>
17 #include <uapi/linux/if_bridge.h>
18 #include <net/switchdev.h>
19 #include <linux/if_bridge.h>
23 /* Number of IRQs supported */
24 #define DPSW_IRQ_NUM 2
26 #define ETHSW_VLAN_MEMBER 1
27 #define ETHSW_VLAN_UNTAGGED 2
28 #define ETHSW_VLAN_PVID 4
29 #define ETHSW_VLAN_GLOBAL 8
31 /* Maximum Frame Length supported by HW (currently 10k) */
32 #define DPAA2_MFL (10 * 1024)
33 #define ETHSW_MAX_FRAME_LENGTH (DPAA2_MFL - VLAN_ETH_HLEN - ETH_FCS_LEN)
34 #define ETHSW_L2_MAX_FRM(mtu) ((mtu) + VLAN_ETH_HLEN + ETH_FCS_LEN)
36 extern const struct ethtool_ops ethsw_port_ethtool_ops;
40 /* Per port private data */
41 struct ethsw_port_priv {
42 struct net_device *netdev;
44 struct ethsw_core *ethsw_data;
49 u8 vlans[VLAN_VID_MASK + 1];
51 struct net_device *bridge_dev;
57 struct fsl_mc_io *mc_io;
59 struct dpsw_attr sw_attr;
61 struct ethsw_port_priv **ports;
63 u8 vlans[VLAN_VID_MASK + 1];
67 #endif /* __ETHSW_H */