Lines Matching refs:ds
28 struct dsa_switch *ds = bus->priv;
30 if (ds->phys_mii_mask & (1 << addr))
31 return ds->ops->phy_read(ds, addr, reg);
38 struct dsa_switch *ds = bus->priv;
40 if (ds->phys_mii_mask & (1 << addr))
41 return ds->ops->phy_write(ds, addr, reg, val);
46 void dsa_slave_mii_bus_init(struct dsa_switch *ds)
48 ds->slave_mii_bus->priv = (void *)ds;
49 ds->slave_mii_bus->name = "dsa slave smi";
50 ds->slave_mii_bus->read = dsa_slave_phy_read;
51 ds->slave_mii_bus->write = dsa_slave_phy_write;
52 snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d.%d",
53 ds->dst->index, ds->index);
54 ds->slave_mii_bus->parent = ds->dev;
55 ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask;
252 struct dsa_switch *ds = p->dp->ds;
258 if (ds->ops->port_hwtstamp_get)
259 return ds->ops->port_hwtstamp_get(ds, port, ifr);
262 if (ds->ops->port_hwtstamp_set)
263 return ds->ops->port_hwtstamp_set(ds, port, ifr);
478 struct dsa_switch *ds = dp->ds;
479 struct dsa_switch_tree *dst = ds->dst;
485 if (dp->ds->devlink)
510 struct dsa_switch *ds = p->dp->ds;
518 if (!ds->ops->port_txtstamp)
527 if (ds->ops->port_txtstamp(ds, p->dp->index, clone, type))
630 struct dsa_switch *ds = dp->ds;
632 if (ds->ops->get_regs_len)
633 return ds->ops->get_regs_len(ds, dp->index);
642 struct dsa_switch *ds = dp->ds;
644 if (ds->ops->get_regs)
645 ds->ops->get_regs(ds, dp->index, regs, _p);
658 struct dsa_switch *ds = dp->ds;
660 if (ds->cd && ds->cd->eeprom_len)
661 return ds->cd->eeprom_len;
663 if (ds->ops->get_eeprom_len)
664 return ds->ops->get_eeprom_len(ds);
673 struct dsa_switch *ds = dp->ds;
675 if (ds->ops->get_eeprom)
676 return ds->ops->get_eeprom(ds, eeprom, data);
685 struct dsa_switch *ds = dp->ds;
687 if (ds->ops->set_eeprom)
688 return ds->ops->set_eeprom(ds, eeprom, data);
697 struct dsa_switch *ds = dp->ds;
706 if (ds->ops->get_strings)
707 ds->ops->get_strings(ds, dp->index, stringset,
718 struct dsa_switch *ds = dp->ds;
739 if (ds->ops->get_ethtool_stats)
740 ds->ops->get_ethtool_stats(ds, dp->index, data + 4);
746 struct dsa_switch *ds = dp->ds;
751 if (ds->ops->get_sset_count) {
752 count = ds->ops->get_sset_count(ds, dp->index, sset);
766 struct dsa_switch *ds = dp->ds;
770 if (ds->ops->get_wol)
771 ds->ops->get_wol(ds, dp->index, w);
777 struct dsa_switch *ds = dp->ds;
782 if (ds->ops->set_wol)
783 ret = ds->ops->set_wol(ds, dp->index, w);
791 struct dsa_switch *ds = dp->ds;
798 if (!ds->ops->set_mac_eee)
801 ret = ds->ops->set_mac_eee(ds, dp->index, e);
811 struct dsa_switch *ds = dp->ds;
818 if (!ds->ops->get_mac_eee)
821 ret = ds->ops->get_mac_eee(ds, dp->index, e);
911 if (dp->ds->devlink)
942 struct dsa_switch *ds = dp->ds;
947 if (!ds->ops->port_mirror_add)
975 err = ds->ops->port_mirror_add(ds, dp->index, mirror, ingress);
996 struct dsa_switch *ds = dp->ds;
1000 if (!ds->ops->port_policer_add) {
1036 err = ds->ops->port_policer_add(ds, dp->index, policer);
1069 struct dsa_switch *ds = dp->ds;
1079 if (ds->ops->port_mirror_del)
1080 ds->ops->port_mirror_del(ds, dp->index,
1084 if (ds->ops->port_policer_del)
1085 ds->ops->port_policer_del(ds, dp->index);
1117 struct dsa_switch *ds = dp->ds;
1120 if (!ds->ops->cls_flower_add)
1123 return ds->ops->cls_flower_add(ds, port, cls, ingress);
1131 struct dsa_switch *ds = dp->ds;
1134 if (!ds->ops->cls_flower_del)
1137 return ds->ops->cls_flower_del(ds, port, cls, ingress);
1145 struct dsa_switch *ds = dp->ds;
1148 if (!ds->ops->cls_flower_stats)
1151 return ds->ops->cls_flower_stats(ds, port, cls, ingress);
1246 struct dsa_switch *ds = dp->ds;
1251 if (!ds->ops->port_setup_tc)
1254 return ds->ops->port_setup_tc(ds, dp->index, type, type_data);
1270 struct dsa_switch *ds = dp->ds;
1272 if (!ds->ops->get_rxnfc)
1275 return ds->ops->get_rxnfc(ds, dp->index, nfc, rule_locs);
1282 struct dsa_switch *ds = dp->ds;
1284 if (!ds->ops->set_rxnfc)
1287 return ds->ops->set_rxnfc(ds, dp->index, nfc);
1294 struct dsa_switch *ds = p->dp->ds;
1296 if (!ds->ops->get_ts_info)
1299 return ds->ops->get_ts_info(ds, p->dp->index, ts);
1418 if (!dp->ds->mtu_enforcement_ingress)
1440 if (!other_dp->ds->mtu_enforcement_ingress)
1482 struct dsa_switch *ds = p->dp->ds;
1492 if (!ds->ops->port_change_mtu)
1495 for (i = 0; i < ds->num_ports; i++) {
1498 if (!dsa_is_user_port(ds, i))
1505 if (!dsa_to_port(ds, i)->slave)
1514 slave_mtu = dsa_to_port(ds, i)->slave->mtu;
1520 cpu_dp = dsa_to_port(ds, port)->cpu_dp;
1619 return dp->ds->devlink ? &dp->devlink_port : NULL;
1653 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up)
1655 const struct dsa_port *dp = dsa_to_port(ds, port);
1666 struct dsa_switch *ds = dp->ds;
1671 ds->ops->phylink_fixed_state(ds, dp->index, state);
1678 struct dsa_switch *ds = dp->ds;
1680 slave_dev->phydev = mdiobus_get_phy(ds->slave_mii_bus, addr);
1693 struct dsa_switch *ds = dp->ds;
1709 if (ds->ops->phylink_fixed_state) {
1722 if (ds->ops->get_phy_flags)
1723 phy_flags = ds->ops->get_phy_flags(ds, dp->index);
1726 if (ret == -ENODEV && ds->slave_mii_bus) {
1787 .switch_number = dp->ds->index,
1800 struct dsa_switch *ds = port->ds;
1806 if (!ds->num_tx_queues)
1807 ds->num_tx_queues = 1;
1811 ds->num_tx_queues, 1);
1816 if (ds->ops->port_vlan_add && ds->ops->port_vlan_del)
1827 if (ds->ops->port_max_mtu)
1828 slave_dev->max_mtu = ds->ops->port_max_mtu(ds, port->index);
1844 SET_NETDEV_DEV(slave_dev, port->ds->dev);
1868 dev_warn(ds->dev, "nonfatal error %d setting MTU on port %d\n",
1877 ret, ds->dst->index, ds->index, port->index);