return 0;
}
-static int ksz8_port_mirror_add(struct ksz_device *dev, int port,
+static int ksz8_port_mirror_add(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror,
bool ingress, struct netlink_ext_ack *extack)
{
+ struct ksz_device *dev = ds->priv;
int offset = P_MIRROR_CTRL;
if (ksz_is_ksz8463(dev))
return 0;
}
-static void ksz8_port_mirror_del(struct ksz_device *dev, int port,
+static void ksz8_port_mirror_del(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror)
{
+ struct ksz_device *dev = ds->priv;
int offset = P_MIRROR_CTRL;
u8 data;
.r_mib_stat64 = ksz88xx_r_mib_stats64,
.freeze_mib = ksz8_freeze_mib,
.port_init_cnt = ksz8_port_init_cnt,
- .mirror_add = ksz8_port_mirror_add,
- .mirror_del = ksz8_port_mirror_del,
.get_caps = ksz8_get_caps,
.config_cpu_port = ksz8_config_cpu_port,
.enable_stp_addr = ksz8_enable_stp_addr,
.r_mib_stat64 = ksz_r_mib_stats64,
.freeze_mib = ksz8_freeze_mib,
.port_init_cnt = ksz8_port_init_cnt,
- .mirror_add = ksz8_port_mirror_add,
- .mirror_del = ksz8_port_mirror_del,
.get_caps = ksz8_get_caps,
.config_cpu_port = ksz8_config_cpu_port,
.enable_stp_addr = ksz8_enable_stp_addr,
.r_mib_stat64 = ksz88xx_r_mib_stats64,
.freeze_mib = ksz8_freeze_mib,
.port_init_cnt = ksz8_port_init_cnt,
- .mirror_add = ksz8_port_mirror_add,
- .mirror_del = ksz8_port_mirror_del,
.get_caps = ksz8_get_caps,
.config_cpu_port = ksz8_config_cpu_port,
.enable_stp_addr = ksz8_enable_stp_addr,
.port_fdb_del = ksz8_fdb_del,
.port_mdb_add = ksz8_mdb_add,
.port_mdb_del = ksz8_mdb_del,
- .port_mirror_add = ksz_port_mirror_add,
- .port_mirror_del = ksz_port_mirror_del,
+ .port_mirror_add = ksz8_port_mirror_add,
+ .port_mirror_del = ksz8_port_mirror_del,
.get_stats64 = ksz_get_stats64,
.get_pause_stats = ksz_get_pause_stats,
.port_change_mtu = ksz8_change_mtu,
.port_fdb_del = ksz8_fdb_del,
.port_mdb_add = ksz8_mdb_add,
.port_mdb_del = ksz8_mdb_del,
- .port_mirror_add = ksz_port_mirror_add,
- .port_mirror_del = ksz_port_mirror_del,
+ .port_mirror_add = ksz8_port_mirror_add,
+ .port_mirror_del = ksz8_port_mirror_del,
.get_stats64 = ksz_get_stats64,
.get_pause_stats = ksz_get_pause_stats,
.port_change_mtu = ksz8_change_mtu,
.port_fdb_del = ksz8_fdb_del,
.port_mdb_add = ksz8_mdb_add,
.port_mdb_del = ksz8_mdb_del,
- .port_mirror_add = ksz_port_mirror_add,
- .port_mirror_del = ksz_port_mirror_del,
+ .port_mirror_add = ksz8_port_mirror_add,
+ .port_mirror_del = ksz8_port_mirror_del,
.get_stats64 = ksz_get_stats64,
.get_pause_stats = ksz_get_pause_stats,
.port_change_mtu = ksz8_change_mtu,
return ret;
}
-int ksz9477_port_mirror_add(struct ksz_device *dev, int port,
+int ksz9477_port_mirror_add(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror,
bool ingress, struct netlink_ext_ack *extack)
{
+ struct ksz_device *dev = ds->priv;
u8 data;
int p;
return 0;
}
-void ksz9477_port_mirror_del(struct ksz_device *dev, int port,
+void ksz9477_port_mirror_del(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror)
{
+ struct ksz_device *dev = ds->priv;
bool in_use = false;
u8 data;
int p;
.r_mib_stat64 = ksz_r_mib_stats64,
.freeze_mib = ksz9477_freeze_mib,
.port_init_cnt = ksz9477_port_init_cnt,
- .mirror_add = ksz9477_port_mirror_add,
- .mirror_del = ksz9477_port_mirror_del,
.get_caps = ksz9477_get_caps,
.pme_write8 = ksz_write8,
.pme_pread8 = ksz_pread8,
.port_fdb_del = ksz9477_fdb_del,
.port_mdb_add = ksz9477_mdb_add,
.port_mdb_del = ksz9477_mdb_del,
- .port_mirror_add = ksz_port_mirror_add,
- .port_mirror_del = ksz_port_mirror_del,
+ .port_mirror_add = ksz9477_port_mirror_add,
+ .port_mirror_del = ksz9477_port_mirror_del,
.get_stats64 = ksz_get_stats64,
.get_pause_stats = ksz_get_pause_stats,
.port_change_mtu = ksz9477_change_mtu,
struct netlink_ext_ack *extack);
int ksz9477_port_vlan_del(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_vlan *vlan);
-int ksz9477_port_mirror_add(struct ksz_device *dev, int port,
+int ksz9477_port_mirror_add(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror,
bool ingress, struct netlink_ext_ack *extack);
-void ksz9477_port_mirror_del(struct ksz_device *dev, int port,
+void ksz9477_port_mirror_del(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror);
int ksz9477_errata_monitor(struct ksz_device *dev, int port,
u64 tx_late_col);
return 0;
}
-int ksz_port_mirror_add(struct dsa_switch *ds, int port,
- struct dsa_mall_mirror_tc_entry *mirror,
- bool ingress, struct netlink_ext_ack *extack)
-{
- struct ksz_device *dev = ds->priv;
-
- if (!dev->dev_ops->mirror_add)
- return -EOPNOTSUPP;
-
- return dev->dev_ops->mirror_add(dev, port, mirror, ingress, extack);
-}
-
-void ksz_port_mirror_del(struct dsa_switch *ds, int port,
- struct dsa_mall_mirror_tc_entry *mirror)
-{
- struct ksz_device *dev = ds->priv;
-
- if (dev->dev_ops->mirror_del)
- dev->dev_ops->mirror_del(dev, port, mirror);
-}
-
int ksz_max_mtu(struct dsa_switch *ds, int port)
{
struct ksz_device *dev = ds->priv;
void (*r_mib_pkt)(struct ksz_device *dev, int port, u16 addr,
u64 *dropped, u64 *cnt);
void (*r_mib_stat64)(struct ksz_device *dev, int port);
- int (*mirror_add)(struct ksz_device *dev, int port,
- struct dsa_mall_mirror_tc_entry *mirror,
- bool ingress, struct netlink_ext_ack *extack);
- void (*mirror_del)(struct ksz_device *dev, int port,
- struct dsa_mall_mirror_tc_entry *mirror);
void (*get_caps)(struct ksz_device *dev, int port,
struct phylink_config *config);
int (*pme_write8)(struct ksz_device *dev, u32 reg, u8 value);
unsigned int mode,
phy_interface_t interface);
-int ksz_port_mirror_add(struct dsa_switch *ds, int port,
- struct dsa_mall_mirror_tc_entry *mirror,
- bool ingress, struct netlink_ext_ack *extack);
-void ksz_port_mirror_del(struct dsa_switch *ds, int port,
- struct dsa_mall_mirror_tc_entry *mirror);
int ksz_max_mtu(struct dsa_switch *ds, int port);
bool ksz_support_eee(struct dsa_switch *ds, int port);
.r_mib_stat64 = ksz_r_mib_stats64,
.freeze_mib = ksz9477_freeze_mib,
.port_init_cnt = ksz9477_port_init_cnt,
- .mirror_add = ksz9477_port_mirror_add,
- .mirror_del = ksz9477_port_mirror_del,
.get_caps = lan937x_phylink_get_caps,
.setup_rgmii_delay = lan937x_setup_rgmii_delay,
.config_cpu_port = lan937x_config_cpu_port,
.port_fdb_del = ksz9477_fdb_del,
.port_mdb_add = ksz9477_mdb_add,
.port_mdb_del = ksz9477_mdb_del,
- .port_mirror_add = ksz_port_mirror_add,
- .port_mirror_del = ksz_port_mirror_del,
+ .port_mirror_add = ksz9477_port_mirror_add,
+ .port_mirror_del = ksz9477_port_mirror_del,
.get_stats64 = ksz_get_stats64,
.get_pause_stats = ksz_get_pause_stats,
.port_change_mtu = lan937x_change_mtu,