Lines Matching refs:ds
31 return dsa_tree_notify(dp->ds->dst, e, v); in dsa_port_notify()
53 struct dsa_switch *ds = dp->ds; in dsa_port_fast_age() local
55 if (!ds->ops->port_fast_age) in dsa_port_fast_age()
58 ds->ops->port_fast_age(ds, dp->index); in dsa_port_fast_age()
66 struct dsa_switch *ds = dp->ds; in dsa_port_vlan_fast_age() local
69 if (!ds->ops->port_vlan_fast_age) in dsa_port_vlan_fast_age()
72 err = ds->ops->port_vlan_fast_age(ds, dp->index, vid); in dsa_port_vlan_fast_age()
103 struct dsa_switch *ds = dp->ds; in dsa_port_can_configure_learning() local
106 if (!ds->ops->port_bridge_flags || !ds->ops->port_pre_bridge_flags) in dsa_port_can_configure_learning()
109 err = ds->ops->port_pre_bridge_flags(ds, dp->index, flags, NULL); in dsa_port_can_configure_learning()
115 struct dsa_switch *ds = dp->ds; in dsa_port_supports_hwtstamp() local
118 if (!ds->ops->port_hwtstamp_get || !ds->ops->port_hwtstamp_set) in dsa_port_supports_hwtstamp()
125 err = ds->ops->port_hwtstamp_get(ds, dp->index, ifr); in dsa_port_supports_hwtstamp()
131 struct dsa_switch *ds = dp->ds; in dsa_port_set_state() local
134 if (!ds->ops->port_stp_state_set) in dsa_port_set_state()
137 ds->ops->port_stp_state_set(ds, port, state); in dsa_port_set_state()
165 struct dsa_switch *ds = dp->ds; in dsa_port_set_state_now() local
170 dev_err(ds->dev, "port %d failed to set STP state %u: %pe\n", in dsa_port_set_state_now()
179 struct dsa_switch *ds = dp->ds; in dsa_port_set_mst_state() local
183 if (!ds->ops->port_mst_state_set) in dsa_port_set_mst_state()
191 err = ds->ops->port_mst_state_set(ds, dp->index, state); in dsa_port_set_mst_state()
213 struct dsa_switch *ds = dp->ds; in dsa_port_enable_rt() local
217 if (ds->ops->port_enable) { in dsa_port_enable_rt()
218 err = ds->ops->port_enable(ds, port, phy); in dsa_port_enable_rt()
245 struct dsa_switch *ds = dp->ds; in dsa_port_disable_rt() local
254 if (ds->ops->port_disable) in dsa_port_disable_rt()
255 ds->ops->port_disable(ds, port); in dsa_port_disable_rt()
270 struct dsa_switch *ds = dp->ds; in dsa_port_reset_vlan_filtering() local
275 if (ds->needs_standalone_vlan_filtering && in dsa_port_reset_vlan_filtering()
279 } else if (!ds->needs_standalone_vlan_filtering && in dsa_port_reset_vlan_filtering()
293 if (change_vlan_filtering && ds->vlan_filtering_is_global) { in dsa_port_reset_vlan_filtering()
294 dsa_switch_for_each_port(other_dp, ds) { in dsa_port_reset_vlan_filtering()
309 dev_err(ds->dev, "port %d: %s\n", dp->index, in dsa_port_reset_vlan_filtering()
313 dev_err(ds->dev, in dsa_port_reset_vlan_filtering()
358 dev_err(dp->ds->dev, in dsa_port_clear_brport_flags()
422 struct dsa_switch *ds = dp->ds; in dsa_port_bridge_create() local
425 bridge = dsa_tree_bridge_find(ds->dst, br); in dsa_port_bridge_create()
440 bridge->num = dsa_bridge_num_get(br, ds->max_num_bridges); in dsa_port_bridge_create()
441 if (ds->max_num_bridges && !bridge->num) { in dsa_port_bridge_create()
471 struct dsa_switch *ds = dp->ds; in dsa_port_supports_mst() local
473 return ds->ops->vlan_msti_set && in dsa_port_supports_mst()
474 ds->ops->port_mst_state_set && in dsa_port_supports_mst()
475 ds->ops->port_vlan_fast_age && in dsa_port_supports_mst()
572 dev_err(dp->ds->dev, in dsa_port_bridge_leave()
608 struct dsa_switch *ds = dp->ds; in dsa_port_lag_create() local
611 lag = dsa_tree_lag_find(ds->dst, lag_dev); in dsa_port_lag_create()
626 dsa_lag_map(ds->dst, lag); in dsa_port_lag_create()
643 dsa_lag_unmap(dp->ds->dst, lag); in dsa_port_lag_destroy()
717 dev_err(dp->ds->dev, in dsa_port_lag_leave()
727 struct dsa_switch *ds = dp->ds; in dsa_port_can_apply_vlan_filtering() local
763 if (!ds->vlan_filtering_is_global) in dsa_port_can_apply_vlan_filtering()
771 dsa_switch_for_each_port(other_dp, ds) { in dsa_port_can_apply_vlan_filtering()
793 struct dsa_switch *ds = dp->ds; in dsa_port_vlan_filtering() local
797 if (!ds->ops->port_vlan_filtering) in dsa_port_vlan_filtering()
813 err = ds->ops->port_vlan_filtering(ds, dp->index, vlan_filtering, in dsa_port_vlan_filtering()
818 if (ds->vlan_filtering_is_global) { in dsa_port_vlan_filtering()
821 ds->vlan_filtering = vlan_filtering; in dsa_port_vlan_filtering()
823 dsa_switch_for_each_user_port(other_dp, ds) { in dsa_port_vlan_filtering()
849 ds->ops->port_vlan_filtering(ds, dp->index, old_vlan_filtering, NULL); in dsa_port_vlan_filtering()
851 if (ds->vlan_filtering_is_global) in dsa_port_vlan_filtering()
852 ds->vlan_filtering = old_vlan_filtering; in dsa_port_vlan_filtering()
865 struct dsa_switch *ds = dp->ds; in dsa_port_skip_vlan_configuration() local
870 return !ds->configure_vlan_while_not_filtering && !br_vlan_enabled(br); in dsa_port_skip_vlan_configuration()
906 struct dsa_switch *ds = dp->ds; in dsa_port_pre_bridge_flags() local
908 if (!ds->ops->port_pre_bridge_flags) in dsa_port_pre_bridge_flags()
911 return ds->ops->port_pre_bridge_flags(ds, dp->index, flags, extack); in dsa_port_pre_bridge_flags()
918 struct dsa_switch *ds = dp->ds; in dsa_port_bridge_flags() local
921 if (!ds->ops->port_bridge_flags) in dsa_port_bridge_flags()
924 err = ds->ops->port_bridge_flags(ds, dp->index, flags, extack); in dsa_port_bridge_flags()
947 struct dsa_switch *ds = dp->ds; in dsa_port_set_host_flood() local
949 if (ds->ops->port_set_host_flood) in dsa_port_set_host_flood()
950 ds->ops->port_set_host_flood(ds, dp->index, uc, mc); in dsa_port_set_host_flood()
956 struct dsa_switch *ds = dp->ds; in dsa_port_vlan_msti() local
958 if (!ds->ops->vlan_msti_set) in dsa_port_vlan_msti()
961 return ds->ops->vlan_msti_set(ds, *dp->bridge, msti); in dsa_port_vlan_msti()
991 if (!dp->ds->fdb_isolation) in dsa_port_fdb_add()
1010 if (!dp->ds->fdb_isolation) in dsa_port_fdb_del()
1027 if (!dp->ds->fdb_isolation) in dsa_port_host_fdb_add()
1078 if (!dp->ds->fdb_isolation) in dsa_port_host_fdb_del()
1127 if (!dp->ds->fdb_isolation) in dsa_port_lag_fdb_add()
1146 if (!dp->ds->fdb_isolation) in dsa_port_lag_fdb_del()
1154 struct dsa_switch *ds = dp->ds; in dsa_port_fdb_dump() local
1157 if (!ds->ops->port_fdb_dump) in dsa_port_fdb_dump()
1160 return ds->ops->port_fdb_dump(ds, port, cb, data); in dsa_port_fdb_dump()
1175 if (!dp->ds->fdb_isolation) in dsa_port_mdb_add()
1193 if (!dp->ds->fdb_isolation) in dsa_port_mdb_del()
1209 if (!dp->ds->fdb_isolation) in dsa_port_host_mdb_add()
1253 if (!dp->ds->fdb_isolation) in dsa_port_host_mdb_del()
1354 struct dsa_switch *ds = dp->ds; in dsa_port_mrp_add() local
1356 if (!ds->ops->port_mrp_add) in dsa_port_mrp_add()
1359 return ds->ops->port_mrp_add(ds, dp->index, mrp); in dsa_port_mrp_add()
1365 struct dsa_switch *ds = dp->ds; in dsa_port_mrp_del() local
1367 if (!ds->ops->port_mrp_del) in dsa_port_mrp_del()
1370 return ds->ops->port_mrp_del(ds, dp->index, mrp); in dsa_port_mrp_del()
1376 struct dsa_switch *ds = dp->ds; in dsa_port_mrp_add_ring_role() local
1378 if (!ds->ops->port_mrp_add_ring_role) in dsa_port_mrp_add_ring_role()
1381 return ds->ops->port_mrp_add_ring_role(ds, dp->index, mrp); in dsa_port_mrp_add_ring_role()
1387 struct dsa_switch *ds = dp->ds; in dsa_port_mrp_del_ring_role() local
1389 if (!ds->ops->port_mrp_del_ring_role) in dsa_port_mrp_del_ring_role()
1392 return ds->ops->port_mrp_del_ring_role(ds, dp->index, mrp); in dsa_port_mrp_del_ring_role()
1400 struct dsa_switch *ds = dp->ds; in dsa_port_assign_master() local
1403 err = ds->ops->port_change_master(ds, port, master, extack); in dsa_port_assign_master()
1405 dev_err(ds->dev, "port %d failed to assign master %s: %pe\n", in dsa_port_assign_master()
1431 struct dsa_switch *ds = dp->ds; in dsa_port_change_master() local
1506 dev_err(ds->dev, in dsa_port_change_master()
1516 dev_err(ds->dev, in dsa_port_change_master()
1556 struct dsa_switch *ds = dp->ds; in dsa_port_phylink_validate() local
1558 if (!ds->ops->phylink_validate) { in dsa_port_phylink_validate()
1564 ds->ops->phylink_validate(ds, dp->index, supported, state); in dsa_port_phylink_validate()
1571 struct dsa_switch *ds = dp->ds; in dsa_port_phylink_mac_pcs_get_state() local
1575 if (!ds->ops->phylink_mac_link_state) { in dsa_port_phylink_mac_pcs_get_state()
1580 err = ds->ops->phylink_mac_link_state(ds, dp->index, state); in dsa_port_phylink_mac_pcs_get_state()
1582 dev_err(ds->dev, "p%d: phylink_mac_link_state() failed: %d\n", in dsa_port_phylink_mac_pcs_get_state()
1594 struct dsa_switch *ds = dp->ds; in dsa_port_phylink_mac_select_pcs() local
1596 if (ds->ops->phylink_mac_select_pcs) in dsa_port_phylink_mac_select_pcs()
1597 pcs = ds->ops->phylink_mac_select_pcs(ds, dp->index, interface); in dsa_port_phylink_mac_select_pcs()
1607 struct dsa_switch *ds = dp->ds; in dsa_port_phylink_mac_config() local
1609 if (!ds->ops->phylink_mac_config) in dsa_port_phylink_mac_config()
1612 ds->ops->phylink_mac_config(ds, dp->index, mode, state); in dsa_port_phylink_mac_config()
1618 struct dsa_switch *ds = dp->ds; in dsa_port_phylink_mac_an_restart() local
1620 if (!ds->ops->phylink_mac_an_restart) in dsa_port_phylink_mac_an_restart()
1623 ds->ops->phylink_mac_an_restart(ds, dp->index); in dsa_port_phylink_mac_an_restart()
1632 struct dsa_switch *ds = dp->ds; in dsa_port_phylink_mac_link_down() local
1637 if (!ds->ops->phylink_mac_link_down) { in dsa_port_phylink_mac_link_down()
1638 if (ds->ops->adjust_link && phydev) in dsa_port_phylink_mac_link_down()
1639 ds->ops->adjust_link(ds, dp->index, phydev); in dsa_port_phylink_mac_link_down()
1643 ds->ops->phylink_mac_link_down(ds, dp->index, mode, interface); in dsa_port_phylink_mac_link_down()
1654 struct dsa_switch *ds = dp->ds; in dsa_port_phylink_mac_link_up() local
1656 if (!ds->ops->phylink_mac_link_up) { in dsa_port_phylink_mac_link_up()
1657 if (ds->ops->adjust_link && phydev) in dsa_port_phylink_mac_link_up()
1658 ds->ops->adjust_link(ds, dp->index, phydev); in dsa_port_phylink_mac_link_up()
1662 ds->ops->phylink_mac_link_up(ds, dp->index, mode, interface, phydev, in dsa_port_phylink_mac_link_up()
1678 struct dsa_switch *ds = dp->ds; in dsa_port_phylink_create() local
1690 if (ds->ops->phylink_mac_link_state || in dsa_port_phylink_create()
1691 ds->ops->phylink_mac_an_restart) in dsa_port_phylink_create()
1694 if (ds->ops->phylink_get_caps) in dsa_port_phylink_create()
1695 ds->ops->phylink_get_caps(ds, dp->index, &dp->pl_config); in dsa_port_phylink_create()
1717 struct dsa_switch *ds = dp->ds; in dsa_shared_port_setup_phy_of() local
1743 if (ds->ops->adjust_link) in dsa_shared_port_setup_phy_of()
1744 ds->ops->adjust_link(ds, port, phydev); in dsa_shared_port_setup_phy_of()
1746 dev_dbg(ds->dev, "enabled port's phy: %s", phydev_name(phydev)); in dsa_shared_port_setup_phy_of()
1756 struct dsa_switch *ds = dp->ds; in dsa_shared_port_fixed_link_register_of() local
1764 dev_err(ds->dev, in dsa_shared_port_fixed_link_register_of()
1779 if (ds->ops->adjust_link) in dsa_shared_port_fixed_link_register_of()
1780 ds->ops->adjust_link(ds, port, phydev); in dsa_shared_port_fixed_link_register_of()
1789 struct dsa_switch *ds = dp->ds; in dsa_shared_port_phylink_register() local
1793 dp->pl_config.dev = ds->dev; in dsa_shared_port_phylink_register()
1932 struct dsa_switch *ds = dp->ds; in dsa_shared_port_validate_of() local
1940 dev_err(ds->dev, in dsa_shared_port_validate_of()
1959 dev_err(ds->dev, in dsa_shared_port_validate_of()
1966 struct dsa_switch *ds = dp->ds; in dsa_shared_port_link_register_of() local
1975 !of_device_compatible_match(ds->dev->of_node, in dsa_shared_port_link_register_of()
1979 if (!ds->ops->adjust_link) { in dsa_shared_port_link_register_of()
1981 dev_warn(ds->dev, in dsa_shared_port_link_register_of()
1985 if (ds->ops->phylink_mac_link_down) in dsa_shared_port_link_register_of()
1986 ds->ops->phylink_mac_link_down(ds, port, in dsa_shared_port_link_register_of()
1994 dev_warn(ds->dev, in dsa_shared_port_link_register_of()
2005 struct dsa_switch *ds = dp->ds; in dsa_shared_port_link_unregister_of() local
2007 if (!ds->ops->adjust_link && dp->pl) { in dsa_shared_port_link_unregister_of()
2023 struct dsa_switch *ds = dp->ds; in dsa_port_hsr_join() local
2026 if (!ds->ops->port_hsr_join) in dsa_port_hsr_join()
2031 err = ds->ops->port_hsr_join(ds, dp->index, hsr); in dsa_port_hsr_join()
2040 struct dsa_switch *ds = dp->ds; in dsa_port_hsr_leave() local
2045 if (ds->ops->port_hsr_leave) { in dsa_port_hsr_leave()
2046 err = ds->ops->port_hsr_leave(ds, dp->index, hsr); in dsa_port_hsr_leave()
2048 dev_err(dp->ds->dev, in dsa_port_hsr_leave()
2080 dev_err(dp->ds->dev, in dsa_port_tag_8021q_vlan_del()