Lines Matching refs:ds

30 	struct dsa_switch *ds = bus->priv;  in dsa_slave_phy_read()  local
32 if (ds->phys_mii_mask & (1 << addr)) in dsa_slave_phy_read()
33 return ds->ops->phy_read(ds, addr, reg); in dsa_slave_phy_read()
40 struct dsa_switch *ds = bus->priv; in dsa_slave_phy_write() local
42 if (ds->phys_mii_mask & (1 << addr)) in dsa_slave_phy_write()
43 return ds->ops->phy_write(ds, addr, reg, val); in dsa_slave_phy_write()
48 void dsa_slave_mii_bus_init(struct dsa_switch *ds) in dsa_slave_mii_bus_init() argument
50 ds->slave_mii_bus->priv = (void *)ds; in dsa_slave_mii_bus_init()
51 ds->slave_mii_bus->name = "dsa slave smi"; in dsa_slave_mii_bus_init()
52 ds->slave_mii_bus->read = dsa_slave_phy_read; in dsa_slave_mii_bus_init()
53 ds->slave_mii_bus->write = dsa_slave_phy_write; in dsa_slave_mii_bus_init()
54 snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d.%d", in dsa_slave_mii_bus_init()
55 ds->dst->index, ds->index); in dsa_slave_mii_bus_init()
56 ds->slave_mii_bus->parent = ds->dev; in dsa_slave_mii_bus_init()
57 ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask; in dsa_slave_mii_bus_init()
261 struct dsa_switch *ds = p->dp->ds; in dsa_slave_ioctl() local
267 if (ds->ops->port_hwtstamp_get) in dsa_slave_ioctl()
268 return ds->ops->port_hwtstamp_get(ds, port, ifr); in dsa_slave_ioctl()
271 if (ds->ops->port_hwtstamp_set) in dsa_slave_ioctl()
272 return ds->ops->port_hwtstamp_set(ds, port, ifr); in dsa_slave_ioctl()
435 struct dsa_switch *ds = dp->ds; in dsa_slave_get_port_parent_id() local
436 struct dsa_switch_tree *dst = ds->dst; in dsa_slave_get_port_parent_id()
442 if (dp->ds->devlink) in dsa_slave_get_port_parent_id()
468 struct dsa_switch *ds = p->dp->ds; in dsa_skb_tx_timestamp() local
476 if (!ds->ops->port_txtstamp) in dsa_skb_tx_timestamp()
485 if (ds->ops->port_txtstamp(ds, p->dp->index, clone, type)) in dsa_skb_tx_timestamp()
557 struct dsa_switch *ds = dp->ds; in dsa_port_xmit_work() local
560 if (unlikely(!ds->ops->port_deferred_xmit)) in dsa_port_xmit_work()
564 ds->ops->port_deferred_xmit(ds, dp->index, skb); in dsa_port_xmit_work()
580 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs_len() local
582 if (ds->ops->get_regs_len) in dsa_slave_get_regs_len()
583 return ds->ops->get_regs_len(ds, dp->index); in dsa_slave_get_regs_len()
592 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs() local
594 if (ds->ops->get_regs) in dsa_slave_get_regs()
595 ds->ops->get_regs(ds, dp->index, regs, _p); in dsa_slave_get_regs()
608 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom_len() local
610 if (ds->cd && ds->cd->eeprom_len) in dsa_slave_get_eeprom_len()
611 return ds->cd->eeprom_len; in dsa_slave_get_eeprom_len()
613 if (ds->ops->get_eeprom_len) in dsa_slave_get_eeprom_len()
614 return ds->ops->get_eeprom_len(ds); in dsa_slave_get_eeprom_len()
623 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom() local
625 if (ds->ops->get_eeprom) in dsa_slave_get_eeprom()
626 return ds->ops->get_eeprom(ds, eeprom, data); in dsa_slave_get_eeprom()
635 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eeprom() local
637 if (ds->ops->set_eeprom) in dsa_slave_set_eeprom()
638 return ds->ops->set_eeprom(ds, eeprom, data); in dsa_slave_set_eeprom()
647 struct dsa_switch *ds = dp->ds; in dsa_slave_get_strings() local
656 if (ds->ops->get_strings) in dsa_slave_get_strings()
657 ds->ops->get_strings(ds, dp->index, stringset, in dsa_slave_get_strings()
668 struct dsa_switch *ds = dp->ds; in dsa_slave_get_ethtool_stats() local
689 if (ds->ops->get_ethtool_stats) in dsa_slave_get_ethtool_stats()
690 ds->ops->get_ethtool_stats(ds, dp->index, data + 4); in dsa_slave_get_ethtool_stats()
696 struct dsa_switch *ds = dp->ds; in dsa_slave_get_sset_count() local
702 if (ds->ops->get_sset_count) in dsa_slave_get_sset_count()
703 count += ds->ops->get_sset_count(ds, dp->index, sset); in dsa_slave_get_sset_count()
714 struct dsa_switch *ds = dp->ds; in dsa_slave_get_wol() local
718 if (ds->ops->get_wol) in dsa_slave_get_wol()
719 ds->ops->get_wol(ds, dp->index, w); in dsa_slave_get_wol()
725 struct dsa_switch *ds = dp->ds; in dsa_slave_set_wol() local
730 if (ds->ops->set_wol) in dsa_slave_set_wol()
731 ret = ds->ops->set_wol(ds, dp->index, w); in dsa_slave_set_wol()
739 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eee() local
746 if (!ds->ops->set_mac_eee) in dsa_slave_set_eee()
749 ret = ds->ops->set_mac_eee(ds, dp->index, e); in dsa_slave_set_eee()
759 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eee() local
766 if (!ds->ops->get_mac_eee) in dsa_slave_get_eee()
769 ret = ds->ops->get_mac_eee(ds, dp->index, e); in dsa_slave_get_eee()
843 if (dp->ds->devlink) in dsa_slave_get_phys_port_name()
873 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_matchall() local
878 if (!ds->ops->port_mirror_add) in dsa_slave_add_cls_matchall()
908 err = ds->ops->port_mirror_add(ds, dp->index, mirror, ingress); in dsa_slave_add_cls_matchall()
925 struct dsa_switch *ds = dp->ds; in dsa_slave_del_cls_matchall() local
927 if (!ds->ops->port_mirror_del) in dsa_slave_del_cls_matchall()
938 ds->ops->port_mirror_del(ds, dp->index, &mall_tc_entry->mirror); in dsa_slave_del_cls_matchall()
1039 struct dsa_switch *ds = dp->ds; in dsa_slave_setup_tc() local
1044 if (!ds->ops->port_setup_tc) in dsa_slave_setup_tc()
1047 return ds->ops->port_setup_tc(ds, dp->index, type, type_data); in dsa_slave_setup_tc()
1082 struct dsa_switch *ds = dp->ds; in dsa_slave_get_rxnfc() local
1084 if (!ds->ops->get_rxnfc) in dsa_slave_get_rxnfc()
1087 return ds->ops->get_rxnfc(ds, dp->index, nfc, rule_locs); in dsa_slave_get_rxnfc()
1094 struct dsa_switch *ds = dp->ds; in dsa_slave_set_rxnfc() local
1096 if (!ds->ops->set_rxnfc) in dsa_slave_set_rxnfc()
1099 return ds->ops->set_rxnfc(ds, dp->index, nfc); in dsa_slave_set_rxnfc()
1106 struct dsa_switch *ds = p->dp->ds; in dsa_slave_get_ts_info() local
1108 if (!ds->ops->get_ts_info) in dsa_slave_get_ts_info()
1111 return ds->ops->get_ts_info(ds, p->dp->index, ts); in dsa_slave_get_ts_info()
1225 return dp->ds->devlink ? &dp->devlink_port : NULL; in dsa_slave_get_devlink_port()
1258 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up) in dsa_port_phylink_mac_change() argument
1260 const struct dsa_port *dp = dsa_to_port(ds, port); in dsa_port_phylink_mac_change()
1270 struct dsa_switch *ds = dp->ds; in dsa_slave_phylink_fixed_state() local
1275 ds->ops->phylink_fixed_state(ds, dp->index, state); in dsa_slave_phylink_fixed_state()
1282 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_connect() local
1284 slave_dev->phydev = mdiobus_get_phy(ds->slave_mii_bus, addr); in dsa_slave_phy_connect()
1297 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_setup() local
1320 if (ds->ops->phylink_fixed_state) in dsa_slave_phy_setup()
1323 if (ds->ops->get_phy_flags) in dsa_slave_phy_setup()
1324 phy_flags = ds->ops->get_phy_flags(ds, dp->index); in dsa_slave_phy_setup()
1327 if (ret == -ENODEV && ds->slave_mii_bus) { in dsa_slave_phy_setup()
1384 .switch_number = dp->ds->index, in dsa_slave_notify()
1397 struct dsa_switch *ds = port->ds; in dsa_slave_create() local
1403 if (!ds->num_tx_queues) in dsa_slave_create()
1404 ds->num_tx_queues = 1; in dsa_slave_create()
1408 ds->num_tx_queues, 1); in dsa_slave_create()
1413 if (ds->ops->port_vlan_add && ds->ops->port_vlan_del) in dsa_slave_create()
1427 SET_NETDEV_DEV(slave_dev, port->ds->dev); in dsa_slave_create()