Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef DSA_LOOP_H
0003 #define DSA_LOOP_H
0004 
0005 #include <linux/if_vlan.h>
0006 #include <linux/types.h>
0007 #include <linux/ethtool.h>
0008 #include <net/dsa.h>
0009 
0010 struct dsa_loop_vlan {
0011     u16 members;
0012     u16 untagged;
0013 };
0014 
0015 struct dsa_loop_mib_entry {
0016     char name[ETH_GSTRING_LEN];
0017     unsigned long val;
0018 };
0019 
0020 enum dsa_loop_mib_counters {
0021     DSA_LOOP_PHY_READ_OK,
0022     DSA_LOOP_PHY_READ_ERR,
0023     DSA_LOOP_PHY_WRITE_OK,
0024     DSA_LOOP_PHY_WRITE_ERR,
0025     __DSA_LOOP_CNT_MAX,
0026 };
0027 
0028 struct dsa_loop_port {
0029     struct dsa_loop_mib_entry mib[__DSA_LOOP_CNT_MAX];
0030     u16 pvid;
0031     int mtu;
0032 };
0033 
0034 struct dsa_loop_priv {
0035     struct mii_bus  *bus;
0036     unsigned int    port_base;
0037     struct dsa_loop_vlan vlans[VLAN_N_VID];
0038     struct net_device *netdev;
0039     struct dsa_loop_port ports[DSA_MAX_PORTS];
0040 };
0041 
0042 #endif /* DSA_LOOP_H */