| .. | .. |
|---|
| 1 | | -// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | 2 | /* |
|---|
| 3 | 3 | * DPAA2 Ethernet Switch declarations |
|---|
| 4 | 4 | * |
|---|
| .. | .. |
|---|
| 23 | 23 | /* Number of IRQs supported */ |
|---|
| 24 | 24 | #define DPSW_IRQ_NUM 2 |
|---|
| 25 | 25 | |
|---|
| 26 | +/* Port is member of VLAN */ |
|---|
| 26 | 27 | #define ETHSW_VLAN_MEMBER 1 |
|---|
| 28 | +/* VLAN to be treated as untagged on egress */ |
|---|
| 27 | 29 | #define ETHSW_VLAN_UNTAGGED 2 |
|---|
| 30 | +/* Untagged frames will be assigned to this VLAN */ |
|---|
| 28 | 31 | #define ETHSW_VLAN_PVID 4 |
|---|
| 32 | +/* VLAN configured on the switch */ |
|---|
| 29 | 33 | #define ETHSW_VLAN_GLOBAL 8 |
|---|
| 30 | 34 | |
|---|
| 31 | 35 | /* Maximum Frame Length supported by HW (currently 10k) */ |
|---|
| .. | .. |
|---|
| 33 | 37 | #define ETHSW_MAX_FRAME_LENGTH (DPAA2_MFL - VLAN_ETH_HLEN - ETH_FCS_LEN) |
|---|
| 34 | 38 | #define ETHSW_L2_MAX_FRM(mtu) ((mtu) + VLAN_ETH_HLEN + ETH_FCS_LEN) |
|---|
| 35 | 39 | |
|---|
| 36 | | -extern const struct ethtool_ops ethsw_port_ethtool_ops; |
|---|
| 40 | +#define ETHSW_FEATURE_MAC_ADDR BIT(0) |
|---|
| 41 | + |
|---|
| 42 | +extern const struct ethtool_ops dpaa2_switch_port_ethtool_ops; |
|---|
| 37 | 43 | |
|---|
| 38 | 44 | struct ethsw_core; |
|---|
| 39 | 45 | |
|---|
| .. | .. |
|---|
| 57 | 63 | struct fsl_mc_io *mc_io; |
|---|
| 58 | 64 | u16 dpsw_handle; |
|---|
| 59 | 65 | struct dpsw_attr sw_attr; |
|---|
| 66 | + u16 major, minor; |
|---|
| 67 | + unsigned long features; |
|---|
| 60 | 68 | int dev_id; |
|---|
| 61 | 69 | struct ethsw_port_priv **ports; |
|---|
| 62 | 70 | |
|---|
| 63 | 71 | u8 vlans[VLAN_VID_MASK + 1]; |
|---|
| 64 | 72 | bool learning; |
|---|
| 73 | + |
|---|
| 74 | + struct notifier_block port_nb; |
|---|
| 75 | + struct notifier_block port_switchdev_nb; |
|---|
| 76 | + struct notifier_block port_switchdevb_nb; |
|---|
| 77 | + struct workqueue_struct *workqueue; |
|---|
| 65 | 78 | }; |
|---|
| 66 | 79 | |
|---|
| 67 | 80 | #endif /* __ETHSW_H */ |
|---|