Commit | Line | Data |
---|---|---|
6c84a589 FF |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | #ifndef DSA_LOOP_H | |
3 | #define DSA_LOOP_H | |
4 | ||
5 | #include <linux/types.h> | |
6 | #include <linux/ethtool.h> | |
7 | #include <net/dsa.h> | |
8 | ||
9 | struct dsa_loop_vlan { | |
10 | u16 members; | |
11 | u16 untagged; | |
12 | }; | |
13 | ||
14 | struct dsa_loop_mib_entry { | |
15 | char name[ETH_GSTRING_LEN]; | |
16 | unsigned long val; | |
17 | }; | |
18 | ||
19 | enum dsa_loop_mib_counters { | |
20 | DSA_LOOP_PHY_READ_OK, | |
21 | DSA_LOOP_PHY_READ_ERR, | |
22 | DSA_LOOP_PHY_WRITE_OK, | |
23 | DSA_LOOP_PHY_WRITE_ERR, | |
24 | __DSA_LOOP_CNT_MAX, | |
25 | }; | |
26 | ||
27 | struct dsa_loop_port { | |
28 | struct dsa_loop_mib_entry mib[__DSA_LOOP_CNT_MAX]; | |
29 | u16 pvid; | |
30 | }; | |
31 | ||
32 | struct dsa_loop_priv { | |
33 | struct mii_bus *bus; | |
34 | unsigned int port_base; | |
35 | struct dsa_loop_vlan vlans[VLAN_N_VID]; | |
36 | struct net_device *netdev; | |
37 | struct dsa_loop_port ports[DSA_MAX_PORTS]; | |
38 | }; | |
39 | ||
40 | #endif /* DSA_LOOP_H */ |