Lines Matching refs:ds
29 struct dsa_switch *ds = bus->priv; in dsa_slave_phy_read() local
31 if (ds->phys_mii_mask & (1 << addr)) in dsa_slave_phy_read()
32 return ds->ops->phy_read(ds, addr, reg); in dsa_slave_phy_read()
39 struct dsa_switch *ds = bus->priv; in dsa_slave_phy_write() local
41 if (ds->phys_mii_mask & (1 << addr)) in dsa_slave_phy_write()
42 return ds->ops->phy_write(ds, addr, reg, val); in dsa_slave_phy_write()
47 void dsa_slave_mii_bus_init(struct dsa_switch *ds) in dsa_slave_mii_bus_init() argument
49 ds->slave_mii_bus->priv = (void *)ds; in dsa_slave_mii_bus_init()
50 ds->slave_mii_bus->name = "dsa slave smi"; in dsa_slave_mii_bus_init()
51 ds->slave_mii_bus->read = dsa_slave_phy_read; in dsa_slave_mii_bus_init()
52 ds->slave_mii_bus->write = dsa_slave_phy_write; in dsa_slave_mii_bus_init()
53 snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d.%d", in dsa_slave_mii_bus_init()
54 ds->dst->index, ds->index); in dsa_slave_mii_bus_init()
55 ds->slave_mii_bus->parent = ds->dev; in dsa_slave_mii_bus_init()
56 ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask; in dsa_slave_mii_bus_init()
256 struct dsa_switch *ds = p->dp->ds; in dsa_slave_ioctl() local
262 if (ds->ops->port_hwtstamp_get) in dsa_slave_ioctl()
263 return ds->ops->port_hwtstamp_get(ds, port, ifr); in dsa_slave_ioctl()
266 if (ds->ops->port_hwtstamp_set) in dsa_slave_ioctl()
267 return ds->ops->port_hwtstamp_set(ds, port, ifr); in dsa_slave_ioctl()
522 struct dsa_switch *ds = dp->ds; in dsa_slave_get_port_parent_id() local
523 struct dsa_switch_tree *dst = ds->dst; in dsa_slave_get_port_parent_id()
529 if (dp->ds->devlink) in dsa_slave_get_port_parent_id()
554 struct dsa_switch *ds = p->dp->ds; in dsa_skb_tx_timestamp() local
559 if (!ds->ops->port_txtstamp) in dsa_skb_tx_timestamp()
562 ds->ops->port_txtstamp(ds, p->dp->index, skb); in dsa_skb_tx_timestamp()
655 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs_len() local
657 if (ds->ops->get_regs_len) in dsa_slave_get_regs_len()
658 return ds->ops->get_regs_len(ds, dp->index); in dsa_slave_get_regs_len()
667 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs() local
669 if (ds->ops->get_regs) in dsa_slave_get_regs()
670 ds->ops->get_regs(ds, dp->index, regs, _p); in dsa_slave_get_regs()
683 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom_len() local
685 if (ds->cd && ds->cd->eeprom_len) in dsa_slave_get_eeprom_len()
686 return ds->cd->eeprom_len; in dsa_slave_get_eeprom_len()
688 if (ds->ops->get_eeprom_len) in dsa_slave_get_eeprom_len()
689 return ds->ops->get_eeprom_len(ds); in dsa_slave_get_eeprom_len()
698 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom() local
700 if (ds->ops->get_eeprom) in dsa_slave_get_eeprom()
701 return ds->ops->get_eeprom(ds, eeprom, data); in dsa_slave_get_eeprom()
710 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eeprom() local
712 if (ds->ops->set_eeprom) in dsa_slave_set_eeprom()
713 return ds->ops->set_eeprom(ds, eeprom, data); in dsa_slave_set_eeprom()
722 struct dsa_switch *ds = dp->ds; in dsa_slave_get_strings() local
731 if (ds->ops->get_strings) in dsa_slave_get_strings()
732 ds->ops->get_strings(ds, dp->index, stringset, in dsa_slave_get_strings()
745 struct dsa_switch *ds = dp->ds; in dsa_slave_get_ethtool_stats() local
766 if (ds->ops->get_ethtool_stats) in dsa_slave_get_ethtool_stats()
767 ds->ops->get_ethtool_stats(ds, dp->index, data + 4); in dsa_slave_get_ethtool_stats()
773 struct dsa_switch *ds = dp->ds; in dsa_slave_get_sset_count() local
778 if (ds->ops->get_sset_count) { in dsa_slave_get_sset_count()
779 count = ds->ops->get_sset_count(ds, dp->index, sset); in dsa_slave_get_sset_count()
796 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eth_phy_stats() local
798 if (ds->ops->get_eth_phy_stats) in dsa_slave_get_eth_phy_stats()
799 ds->ops->get_eth_phy_stats(ds, dp->index, phy_stats); in dsa_slave_get_eth_phy_stats()
806 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eth_mac_stats() local
808 if (ds->ops->get_eth_mac_stats) in dsa_slave_get_eth_mac_stats()
809 ds->ops->get_eth_mac_stats(ds, dp->index, mac_stats); in dsa_slave_get_eth_mac_stats()
817 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eth_ctrl_stats() local
819 if (ds->ops->get_eth_ctrl_stats) in dsa_slave_get_eth_ctrl_stats()
820 ds->ops->get_eth_ctrl_stats(ds, dp->index, ctrl_stats); in dsa_slave_get_eth_ctrl_stats()
827 struct dsa_switch *ds = dp->ds; in dsa_slave_net_selftest() local
829 if (ds->ops->self_test) { in dsa_slave_net_selftest()
830 ds->ops->self_test(ds, dp->index, etest, buf); in dsa_slave_net_selftest()
840 struct dsa_switch *ds = dp->ds; in dsa_slave_get_wol() local
844 if (ds->ops->get_wol) in dsa_slave_get_wol()
845 ds->ops->get_wol(ds, dp->index, w); in dsa_slave_get_wol()
851 struct dsa_switch *ds = dp->ds; in dsa_slave_set_wol() local
856 if (ds->ops->set_wol) in dsa_slave_set_wol()
857 ret = ds->ops->set_wol(ds, dp->index, w); in dsa_slave_set_wol()
865 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eee() local
872 if (!ds->ops->set_mac_eee) in dsa_slave_set_eee()
875 ret = ds->ops->set_mac_eee(ds, dp->index, e); in dsa_slave_set_eee()
885 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eee() local
892 if (!ds->ops->get_mac_eee) in dsa_slave_get_eee()
895 ret = ds->ops->get_mac_eee(ds, dp->index, e); in dsa_slave_get_eee()
985 if (dp->ds->devlink) in dsa_slave_get_phys_port_name()
1016 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_matchall_mirred() local
1021 if (!ds->ops->port_mirror_add) in dsa_slave_add_cls_matchall_mirred()
1049 err = ds->ops->port_mirror_add(ds, dp->index, mirror, ingress); in dsa_slave_add_cls_matchall_mirred()
1070 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_matchall_police() local
1074 if (!ds->ops->port_policer_add) { in dsa_slave_add_cls_matchall_police()
1110 err = ds->ops->port_policer_add(ds, dp->index, policer); in dsa_slave_add_cls_matchall_police()
1143 struct dsa_switch *ds = dp->ds; in dsa_slave_del_cls_matchall() local
1153 if (ds->ops->port_mirror_del) in dsa_slave_del_cls_matchall()
1154 ds->ops->port_mirror_del(ds, dp->index, in dsa_slave_del_cls_matchall()
1158 if (ds->ops->port_policer_del) in dsa_slave_del_cls_matchall()
1159 ds->ops->port_policer_del(ds, dp->index); in dsa_slave_del_cls_matchall()
1191 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_flower() local
1194 if (!ds->ops->cls_flower_add) in dsa_slave_add_cls_flower()
1197 return ds->ops->cls_flower_add(ds, port, cls, ingress); in dsa_slave_add_cls_flower()
1205 struct dsa_switch *ds = dp->ds; in dsa_slave_del_cls_flower() local
1208 if (!ds->ops->cls_flower_del) in dsa_slave_del_cls_flower()
1211 return ds->ops->cls_flower_del(ds, port, cls, ingress); in dsa_slave_del_cls_flower()
1219 struct dsa_switch *ds = dp->ds; in dsa_slave_stats_cls_flower() local
1222 if (!ds->ops->cls_flower_stats) in dsa_slave_stats_cls_flower()
1225 return ds->ops->cls_flower_stats(ds, port, cls, ingress); in dsa_slave_stats_cls_flower()
1316 static int dsa_slave_setup_ft_block(struct dsa_switch *ds, int port, in dsa_slave_setup_ft_block() argument
1319 struct dsa_port *cpu_dp = dsa_to_port(ds, port)->cpu_dp; in dsa_slave_setup_ft_block()
1332 struct dsa_switch *ds = dp->ds; in dsa_slave_setup_tc() local
1338 return dsa_slave_setup_ft_block(ds, dp->index, type_data); in dsa_slave_setup_tc()
1343 if (!ds->ops->port_setup_tc) in dsa_slave_setup_tc()
1346 return ds->ops->port_setup_tc(ds, dp->index, type, type_data); in dsa_slave_setup_tc()
1353 struct dsa_switch *ds = dp->ds; in dsa_slave_get_rxnfc() local
1355 if (!ds->ops->get_rxnfc) in dsa_slave_get_rxnfc()
1358 return ds->ops->get_rxnfc(ds, dp->index, nfc, rule_locs); in dsa_slave_get_rxnfc()
1365 struct dsa_switch *ds = dp->ds; in dsa_slave_set_rxnfc() local
1367 if (!ds->ops->set_rxnfc) in dsa_slave_set_rxnfc()
1370 return ds->ops->set_rxnfc(ds, dp->index, nfc); in dsa_slave_set_rxnfc()
1377 struct dsa_switch *ds = p->dp->ds; in dsa_slave_get_ts_info() local
1379 if (!ds->ops->get_ts_info) in dsa_slave_get_ts_info()
1382 return ds->ops->get_ts_info(ds, p->dp->index, ts); in dsa_slave_get_ts_info()
1564 if (!dp->ds->mtu_enforcement_ingress) in dsa_bridge_mtu_normalization()
1586 if (!other_dp->ds->mtu_enforcement_ingress) in dsa_bridge_mtu_normalization()
1628 struct dsa_switch *ds = p->dp->ds; in dsa_slave_change_mtu() local
1639 if (!ds->ops->port_change_mtu) in dsa_slave_change_mtu()
1642 list_for_each_entry(dp_iter, &ds->dst->ports, list) { in dsa_slave_change_mtu()
1667 cpu_dp = dsa_to_port(ds, port)->cpu_dp; in dsa_slave_change_mtu()
1750 return dp->ds->devlink ? &dp->devlink_port : NULL; in dsa_slave_get_devlink_port()
1757 struct dsa_switch *ds = dp->ds; in dsa_slave_get_stats64() local
1759 if (ds->ops->get_stats64) in dsa_slave_get_stats64()
1760 ds->ops->get_stats64(ds, dp->index, s); in dsa_slave_get_stats64()
1810 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up) in dsa_port_phylink_mac_change() argument
1812 const struct dsa_port *dp = dsa_to_port(ds, port); in dsa_port_phylink_mac_change()
1823 struct dsa_switch *ds = dp->ds; in dsa_slave_phylink_fixed_state() local
1828 ds->ops->phylink_fixed_state(ds, dp->index, state); in dsa_slave_phylink_fixed_state()
1836 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_connect() local
1838 slave_dev->phydev = mdiobus_get_phy(ds->slave_mii_bus, addr); in dsa_slave_phy_connect()
1853 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_setup() local
1869 if (ds->ops->phylink_fixed_state) { in dsa_slave_phy_setup()
1874 if (ds->ops->phylink_get_interfaces) in dsa_slave_phy_setup()
1875 ds->ops->phylink_get_interfaces(ds, dp->index, in dsa_slave_phy_setup()
1886 if (ds->ops->get_phy_flags) in dsa_slave_phy_setup()
1887 phy_flags = ds->ops->get_phy_flags(ds, dp->index); in dsa_slave_phy_setup()
1890 if (ret == -ENODEV && ds->slave_mii_bus) { in dsa_slave_phy_setup()
1911 const struct dsa_switch *ds = dp->ds; in dsa_slave_setup_tagger() local
1929 if (ds->needs_standalone_vlan_filtering) in dsa_slave_setup_tagger()
1978 struct dsa_switch *ds = port->ds; in dsa_slave_create() local
1984 if (!ds->num_tx_queues) in dsa_slave_create()
1985 ds->num_tx_queues = 1; in dsa_slave_create()
1989 ds->num_tx_queues, 1); in dsa_slave_create()
2000 if (ds->ops->port_max_mtu) in dsa_slave_create()
2001 slave_dev->max_mtu = ds->ops->port_max_mtu(ds, port->index); in dsa_slave_create()
2007 SET_NETDEV_DEV(slave_dev, port->ds->dev); in dsa_slave_create()
2031 dev_warn(ds->dev, "nonfatal error %d setting MTU to %d on port %d\n", in dsa_slave_create()
2040 ret, ds->dst->index, ds->index, port->index); in dsa_slave_create()
2298 struct dsa_switch *ds; in dsa_slave_prechangeupper_sanity_check() local
2306 ds = dp->ds; in dsa_slave_prechangeupper_sanity_check()
2308 if (ds->ops->port_prechangeupper) { in dsa_slave_prechangeupper_sanity_check()
2309 err = ds->ops->port_prechangeupper(ds, dp->index, info); in dsa_slave_prechangeupper_sanity_check()
2372 dst = cpu_dp->ds->dst; in dsa_slave_netdevice_event()
2396 struct dsa_switch *ds = switchdev_work->ds; in dsa_fdb_offload_notify() local
2399 if (!dsa_is_user_port(ds, switchdev_work->port)) in dsa_fdb_offload_notify()
2405 dp = dsa_to_port(ds, switchdev_work->port); in dsa_fdb_offload_notify()
2414 struct dsa_switch *ds = switchdev_work->ds; in dsa_slave_switchdev_event_work() local
2418 dp = dsa_to_port(ds, switchdev_work->port); in dsa_slave_switchdev_event_work()
2429 dev_err(ds->dev, in dsa_slave_switchdev_event_work()
2446 dev_err(ds->dev, in dsa_slave_switchdev_event_work()
2462 struct dsa_switch_tree *dst = dp->ds->dst; in dsa_foreign_dev_check()
2482 struct dsa_switch *ds = dp->ds; in dsa_slave_fdb_event() local
2487 if (!ds->ops->port_fdb_add || !ds->ops->port_fdb_del) in dsa_slave_fdb_event()
2498 !ds->assisted_learning_on_cpu_port) in dsa_slave_fdb_event()
2517 switchdev_work->ds = ds; in dsa_slave_fdb_event()