Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Microchip KSZ9477 series Header file
0004  *
0005  * Copyright (C) 2017-2022 Microchip Technology Inc.
0006  */
0007 
0008 #ifndef __KSZ9477_H
0009 #define __KSZ9477_H
0010 
0011 #include <net/dsa.h>
0012 #include "ksz_common.h"
0013 
0014 int ksz9477_setup(struct dsa_switch *ds);
0015 u32 ksz9477_get_port_addr(int port, int offset);
0016 void ksz9477_cfg_port_member(struct ksz_device *dev, int port, u8 member);
0017 void ksz9477_flush_dyn_mac_table(struct ksz_device *dev, int port);
0018 void ksz9477_port_setup(struct ksz_device *dev, int port, bool cpu_port);
0019 void ksz9477_r_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 *data);
0020 void ksz9477_w_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 val);
0021 void ksz9477_r_mib_cnt(struct ksz_device *dev, int port, u16 addr, u64 *cnt);
0022 void ksz9477_r_mib_pkt(struct ksz_device *dev, int port, u16 addr,
0023                u64 *dropped, u64 *cnt);
0024 void ksz9477_freeze_mib(struct ksz_device *dev, int port, bool freeze);
0025 void ksz9477_port_init_cnt(struct ksz_device *dev, int port);
0026 int ksz9477_port_vlan_filtering(struct ksz_device *dev, int port,
0027                 bool flag, struct netlink_ext_ack *extack);
0028 int ksz9477_port_vlan_add(struct ksz_device *dev, int port,
0029               const struct switchdev_obj_port_vlan *vlan,
0030               struct netlink_ext_ack *extack);
0031 int ksz9477_port_vlan_del(struct ksz_device *dev, int port,
0032               const struct switchdev_obj_port_vlan *vlan);
0033 int ksz9477_port_mirror_add(struct ksz_device *dev, int port,
0034                 struct dsa_mall_mirror_tc_entry *mirror,
0035                 bool ingress, struct netlink_ext_ack *extack);
0036 void ksz9477_port_mirror_del(struct ksz_device *dev, int port,
0037                  struct dsa_mall_mirror_tc_entry *mirror);
0038 int ksz9477_get_stp_reg(void);
0039 void ksz9477_get_caps(struct ksz_device *dev, int port,
0040               struct phylink_config *config);
0041 int ksz9477_fdb_dump(struct ksz_device *dev, int port,
0042              dsa_fdb_dump_cb_t *cb, void *data);
0043 int ksz9477_fdb_add(struct ksz_device *dev, int port,
0044             const unsigned char *addr, u16 vid, struct dsa_db db);
0045 int ksz9477_fdb_del(struct ksz_device *dev, int port,
0046             const unsigned char *addr, u16 vid, struct dsa_db db);
0047 int ksz9477_mdb_add(struct ksz_device *dev, int port,
0048             const struct switchdev_obj_port_mdb *mdb, struct dsa_db db);
0049 int ksz9477_mdb_del(struct ksz_device *dev, int port,
0050             const struct switchdev_obj_port_mdb *mdb, struct dsa_db db);
0051 int ksz9477_change_mtu(struct ksz_device *dev, int port, int mtu);
0052 int ksz9477_max_mtu(struct ksz_device *dev, int port);
0053 void ksz9477_config_cpu_port(struct dsa_switch *ds);
0054 int ksz9477_enable_stp_addr(struct ksz_device *dev);
0055 int ksz9477_reset_switch(struct ksz_device *dev);
0056 int ksz9477_dsa_init(struct ksz_device *dev);
0057 int ksz9477_switch_init(struct ksz_device *dev);
0058 void ksz9477_switch_exit(struct ksz_device *dev);
0059 
0060 #endif