Lines Matching refs:ds
68 static bool dsa_switch_supports_uc_filtering(struct dsa_switch *ds)
70 return ds->ops->port_fdb_add && ds->ops->port_fdb_del &&
71 ds->fdb_isolation && !ds->vlan_filtering_is_global &&
72 !ds->needs_standalone_vlan_filtering;
75 static bool dsa_switch_supports_mc_filtering(struct dsa_switch *ds)
77 return ds->ops->port_mdb_add && ds->ops->port_mdb_del &&
78 ds->fdb_isolation && !ds->vlan_filtering_is_global &&
79 !ds->needs_standalone_vlan_filtering;
90 struct dsa_switch *ds = dp->ds;
98 dev_err(ds->dev,
108 dev_err(ds->dev,
120 dev_err(ds->dev,
132 dev_err(ds->dev,
209 if (!dsa_switch_supports_uc_filtering(dp->ds))
229 if (!dsa_switch_supports_uc_filtering(dp->ds))
249 if (!dsa_switch_supports_mc_filtering(dp->ds))
269 if (!dsa_switch_supports_mc_filtering(dp->ds))
279 struct dsa_switch *ds = dp->ds;
292 if (dsa_switch_supports_uc_filtering(ds) ||
293 dsa_switch_supports_mc_filtering(ds))
300 struct dsa_switch *ds = dp->ds;
313 if (dsa_switch_supports_uc_filtering(ds) ||
314 dsa_switch_supports_mc_filtering(ds))
321 struct dsa_switch *ds = bus->priv;
323 if (ds->phys_mii_mask & (1 << addr))
324 return ds->ops->phy_read(ds, addr, reg);
331 struct dsa_switch *ds = bus->priv;
333 if (ds->phys_mii_mask & (1 << addr))
334 return ds->ops->phy_write(ds, addr, reg, val);
339 void dsa_slave_mii_bus_init(struct dsa_switch *ds)
341 ds->slave_mii_bus->priv = (void *)ds;
342 ds->slave_mii_bus->name = "dsa slave smi";
343 ds->slave_mii_bus->read = dsa_slave_phy_read;
344 ds->slave_mii_bus->write = dsa_slave_phy_write;
345 snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d.%d",
346 ds->dst->index, ds->index);
347 ds->slave_mii_bus->parent = ds->dev;
348 ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask;
362 struct dsa_switch *ds = dp->ds;
371 if (dsa_switch_supports_uc_filtering(ds)) {
393 if (dsa_switch_supports_uc_filtering(ds))
403 struct dsa_switch *ds = dp->ds;
410 if (dsa_switch_supports_uc_filtering(ds))
429 struct dsa_switch *ds = dp->ds;
438 if (dsa_switch_supports_uc_filtering(ds) &&
439 dsa_switch_supports_mc_filtering(ds))
453 struct dsa_switch *ds = dp->ds;
466 if (dsa_switch_supports_uc_filtering(ds)) {
481 if (dsa_switch_supports_uc_filtering(ds))
490 if (dsa_switch_supports_uc_filtering(ds))
570 struct dsa_switch *ds = p->dp->ds;
576 if (ds->ops->port_hwtstamp_get)
577 return ds->ops->port_hwtstamp_get(ds, port, ifr);
580 if (ds->ops->port_hwtstamp_set)
581 return ds->ops->port_hwtstamp_set(ds, port, ifr);
887 struct dsa_switch *ds = p->dp->ds;
892 if (!ds->ops->port_txtstamp)
895 ds->ops->port_txtstamp(ds, p->dp->index, skb);
988 struct dsa_switch *ds = dp->ds;
990 if (ds->ops->get_regs_len)
991 return ds->ops->get_regs_len(ds, dp->index);
1000 struct dsa_switch *ds = dp->ds;
1002 if (ds->ops->get_regs)
1003 ds->ops->get_regs(ds, dp->index, regs, _p);
1016 struct dsa_switch *ds = dp->ds;
1018 if (ds->cd && ds->cd->eeprom_len)
1019 return ds->cd->eeprom_len;
1021 if (ds->ops->get_eeprom_len)
1022 return ds->ops->get_eeprom_len(ds);
1031 struct dsa_switch *ds = dp->ds;
1033 if (ds->ops->get_eeprom)
1034 return ds->ops->get_eeprom(ds, eeprom, data);
1043 struct dsa_switch *ds = dp->ds;
1045 if (ds->ops->set_eeprom)
1046 return ds->ops->set_eeprom(ds, eeprom, data);
1055 struct dsa_switch *ds = dp->ds;
1064 if (ds->ops->get_strings)
1065 ds->ops->get_strings(ds, dp->index, stringset,
1078 struct dsa_switch *ds = dp->ds;
1099 if (ds->ops->get_ethtool_stats)
1100 ds->ops->get_ethtool_stats(ds, dp->index, data + 4);
1106 struct dsa_switch *ds = dp->ds;
1111 if (ds->ops->get_sset_count) {
1112 count = ds->ops->get_sset_count(ds, dp->index, sset);
1129 struct dsa_switch *ds = dp->ds;
1131 if (ds->ops->get_eth_phy_stats)
1132 ds->ops->get_eth_phy_stats(ds, dp->index, phy_stats);
1139 struct dsa_switch *ds = dp->ds;
1141 if (ds->ops->get_eth_mac_stats)
1142 ds->ops->get_eth_mac_stats(ds, dp->index, mac_stats);
1150 struct dsa_switch *ds = dp->ds;
1152 if (ds->ops->get_eth_ctrl_stats)
1153 ds->ops->get_eth_ctrl_stats(ds, dp->index, ctrl_stats);
1162 struct dsa_switch *ds = dp->ds;
1164 if (ds->ops->get_rmon_stats)
1165 ds->ops->get_rmon_stats(ds, dp->index, rmon_stats, ranges);
1172 struct dsa_switch *ds = dp->ds;
1174 if (ds->ops->self_test) {
1175 ds->ops->self_test(ds, dp->index, etest, buf);
1186 struct dsa_switch *ds = dp->ds;
1188 if (!ds->ops->get_mm)
1191 return ds->ops->get_mm(ds, dp->index, state);
1198 struct dsa_switch *ds = dp->ds;
1200 if (!ds->ops->set_mm)
1203 return ds->ops->set_mm(ds, dp->index, cfg, extack);
1210 struct dsa_switch *ds = dp->ds;
1212 if (ds->ops->get_mm_stats)
1213 ds->ops->get_mm_stats(ds, dp->index, stats);
1219 struct dsa_switch *ds = dp->ds;
1223 if (ds->ops->get_wol)
1224 ds->ops->get_wol(ds, dp->index, w);
1230 struct dsa_switch *ds = dp->ds;
1235 if (ds->ops->set_wol)
1236 ret = ds->ops->set_wol(ds, dp->index, w);
1244 struct dsa_switch *ds = dp->ds;
1251 if (!ds->ops->set_mac_eee)
1254 ret = ds->ops->set_mac_eee(ds, dp->index, e);
1264 struct dsa_switch *ds = dp->ds;
1271 if (!ds->ops->get_mac_eee)
1274 ret = ds->ops->get_mac_eee(ds, dp->index, e);
1301 struct dsa_switch *ds = dp->ds;
1303 if (ds->ops->get_pause_stats)
1304 ds->ops->get_pause_stats(ds, dp->index, pause_stats);
1388 struct dsa_switch *ds = dp->ds;
1393 if (!ds->ops->port_mirror_add)
1421 err = ds->ops->port_mirror_add(ds, dp->index, mirror, ingress, extack);
1442 struct dsa_switch *ds = dp->ds;
1446 if (!ds->ops->port_policer_add) {
1482 err = ds->ops->port_policer_add(ds, dp->index, policer);
1515 struct dsa_switch *ds = dp->ds;
1525 if (ds->ops->port_mirror_del)
1526 ds->ops->port_mirror_del(ds, dp->index,
1530 if (ds->ops->port_policer_del)
1531 ds->ops->port_policer_del(ds, dp->index);
1563 struct dsa_switch *ds = dp->ds;
1566 if (!ds->ops->cls_flower_add)
1569 return ds->ops->cls_flower_add(ds, port, cls, ingress);
1577 struct dsa_switch *ds = dp->ds;
1580 if (!ds->ops->cls_flower_del)
1583 return ds->ops->cls_flower_del(ds, port, cls, ingress);
1591 struct dsa_switch *ds = dp->ds;
1594 if (!ds->ops->cls_flower_stats)
1597 return ds->ops->cls_flower_stats(ds, port, cls, ingress);
1688 static int dsa_slave_setup_ft_block(struct dsa_switch *ds, int port,
1691 struct net_device *master = dsa_port_to_master(dsa_to_port(ds, port));
1703 struct dsa_switch *ds = dp->ds;
1709 return dsa_slave_setup_ft_block(ds, dp->index, type_data);
1714 if (!ds->ops->port_setup_tc)
1717 return ds->ops->port_setup_tc(ds, dp->index, type, type_data);
1724 struct dsa_switch *ds = dp->ds;
1726 if (!ds->ops->get_rxnfc)
1729 return ds->ops->get_rxnfc(ds, dp->index, nfc, rule_locs);
1736 struct dsa_switch *ds = dp->ds;
1738 if (!ds->ops->set_rxnfc)
1741 return ds->ops->set_rxnfc(ds, dp->index, nfc);
1748 struct dsa_switch *ds = p->dp->ds;
1750 if (!ds->ops->get_ts_info)
1753 return ds->ops->get_ts_info(ds, p->dp->index, ts);
1767 struct dsa_switch *ds = dp->ds;
1789 if (!dsa_switch_supports_uc_filtering(ds) &&
1790 !dsa_switch_supports_mc_filtering(ds))
1804 if (dsa_switch_supports_mc_filtering(ds)) {
1811 if (dsa_switch_supports_uc_filtering(ds)) {
1840 struct dsa_switch *ds = dp->ds;
1853 if (!dsa_switch_supports_uc_filtering(ds) &&
1854 !dsa_switch_supports_mc_filtering(ds))
1868 if (dsa_switch_supports_mc_filtering(ds)) {
1875 if (dsa_switch_supports_uc_filtering(ds)) {
1908 * If ds->vlan_filtering_is_global = true, then standalone ports which share
1915 * - if ds->needs_standalone_vlan_filtering = true, OR if
1916 * (ds->vlan_filtering_is_global = true AND there are bridges spanning
1924 * - if ds->configure_vlan_while_not_filtering = true (default):
2010 if (!dp->ds->mtu_enforcement_ingress)
2032 if (!other_dp->ds->mtu_enforcement_ingress)
2074 struct dsa_switch *ds = dp->ds;
2084 if (!ds->ops->port_change_mtu)
2087 dsa_tree_for_each_user_port(other_dp, ds->dst) {
2135 err = ds->ops->port_change_mtu(ds, dp->index, new_mtu);
2159 struct dsa_switch *ds = dp->ds;
2163 if (!ds->ops->port_set_default_prio)
2173 err = ds->ops->port_set_default_prio(ds, port, new_prio);
2186 struct dsa_switch *ds = dp->ds;
2191 if (!ds->ops->port_add_dscp_prio)
2207 err = ds->ops->port_add_dscp_prio(ds, port, dscp, new_prio);
2239 struct dsa_switch *ds = dp->ds;
2243 if (!ds->ops->port_set_default_prio)
2253 err = ds->ops->port_set_default_prio(ds, port, new_prio);
2266 struct dsa_switch *ds = dp->ds;
2270 if (!ds->ops->port_del_dscp_prio)
2277 err = ds->ops->port_del_dscp_prio(ds, port, dscp, app->priority);
2311 struct dsa_switch *ds = dp->ds;
2315 if (ds->ops->port_get_default_prio) {
2316 int prio = ds->ops->port_get_default_prio(ds, port);
2331 if (ds->ops->port_get_dscp_prio) {
2341 prio = ds->ops->port_get_dscp_prio(ds, port, protocol);
2401 struct dsa_switch *ds = dp->ds;
2403 if (ds->ops->get_stats64)
2404 ds->ops->get_stats64(ds, dp->index, s);
2452 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up)
2454 const struct dsa_port *dp = dsa_to_port(ds, port);
2465 struct dsa_switch *ds = dp->ds;
2470 ds->ops->phylink_fixed_state(ds, dp->index, state);
2478 struct dsa_switch *ds = dp->ds;
2480 slave_dev->phydev = mdiobus_get_phy(ds->slave_mii_bus, addr);
2495 struct dsa_switch *ds = dp->ds;
2506 if (ds->ops->phylink_fixed_state) {
2515 if (ds->ops->get_phy_flags)
2516 phy_flags = ds->ops->get_phy_flags(ds, dp->index);
2519 if (ret == -ENODEV && ds->slave_mii_bus) {
2540 const struct dsa_switch *ds = dp->ds;
2558 if (ds->needs_standalone_vlan_filtering)
2597 struct dsa_switch *ds = port->ds;
2604 if (!ds->num_tx_queues)
2605 ds->num_tx_queues = 1;
2617 ds->num_tx_queues, 1);
2631 if (dsa_switch_supports_uc_filtering(ds))
2634 if (ds->ops->port_max_mtu)
2635 slave_dev->max_mtu = ds->ops->port_max_mtu(ds, port->index);
2638 SET_NETDEV_DEV(slave_dev, port->ds->dev);
2665 ret, ds->dst->index, ds->index, port->index);
2673 dev_warn(ds->dev, "nonfatal error %d setting MTU to %d on port %d\n",
2744 struct dsa_switch *ds = dp->ds;
2752 if (!ds->ops->port_change_master) {
3029 struct dsa_switch *ds;
3037 ds = dp->ds;
3039 if (ds->ops->port_prechangeupper) {
3040 err = ds->ops->port_prechangeupper(ds, dp->index, info);
3405 struct dsa_switch_tree *dst = cpu_dp->ds->dst;
3436 dst = cpu_dp->ds->dst;
3480 struct dsa_switch *ds;
3485 ds = dp->ds;
3496 dev_err(ds->dev,
3512 dev_err(ds->dev,
3527 struct dsa_switch_tree *dst = dp->ds->dst;
3547 struct dsa_switch *ds = dp->ds;
3563 if (!ds->assisted_learning_on_cpu_port)
3578 if (!ds->ops->lag_fdb_add || !ds->ops->lag_fdb_del)
3581 if (!ds->ops->port_fdb_add || !ds->ops->port_fdb_del)