Lines Matching refs:ds

35 	struct dsa_switch *ds = dp->ds;  in dsa_slave_standalone_event_work()  local
43 dev_err(ds->dev, in dsa_slave_standalone_event_work()
53 dev_err(ds->dev, in dsa_slave_standalone_event_work()
65 dev_err(ds->dev, in dsa_slave_standalone_event_work()
77 dev_err(ds->dev, in dsa_slave_standalone_event_work()
119 if (!dsa_switch_supports_uc_filtering(dp->ds)) in dsa_slave_sync_uc()
133 if (!dsa_switch_supports_uc_filtering(dp->ds)) in dsa_slave_unsync_uc()
147 if (!dsa_switch_supports_mc_filtering(dp->ds)) in dsa_slave_sync_mc()
161 if (!dsa_switch_supports_mc_filtering(dp->ds)) in dsa_slave_unsync_mc()
170 struct dsa_switch *ds = dp->ds; in dsa_slave_sync_ha() local
183 if (dsa_switch_supports_uc_filtering(ds) || in dsa_slave_sync_ha()
184 dsa_switch_supports_mc_filtering(ds)) in dsa_slave_sync_ha()
191 struct dsa_switch *ds = dp->ds; in dsa_slave_unsync_ha() local
204 if (dsa_switch_supports_uc_filtering(ds) || in dsa_slave_unsync_ha()
205 dsa_switch_supports_mc_filtering(ds)) in dsa_slave_unsync_ha()
212 struct dsa_switch *ds = bus->priv; in dsa_slave_phy_read() local
214 if (ds->phys_mii_mask & (1 << addr)) in dsa_slave_phy_read()
215 return ds->ops->phy_read(ds, addr, reg); in dsa_slave_phy_read()
222 struct dsa_switch *ds = bus->priv; in dsa_slave_phy_write() local
224 if (ds->phys_mii_mask & (1 << addr)) in dsa_slave_phy_write()
225 return ds->ops->phy_write(ds, addr, reg, val); in dsa_slave_phy_write()
230 void dsa_slave_mii_bus_init(struct dsa_switch *ds) in dsa_slave_mii_bus_init() argument
232 ds->slave_mii_bus->priv = (void *)ds; in dsa_slave_mii_bus_init()
233 ds->slave_mii_bus->name = "dsa slave smi"; in dsa_slave_mii_bus_init()
234 ds->slave_mii_bus->read = dsa_slave_phy_read; in dsa_slave_mii_bus_init()
235 ds->slave_mii_bus->write = dsa_slave_phy_write; in dsa_slave_mii_bus_init()
236 snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d.%d", in dsa_slave_mii_bus_init()
237 ds->dst->index, ds->index); in dsa_slave_mii_bus_init()
238 ds->slave_mii_bus->parent = ds->dev; in dsa_slave_mii_bus_init()
239 ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask; in dsa_slave_mii_bus_init()
253 struct dsa_switch *ds = dp->ds; in dsa_slave_open() local
262 if (dsa_switch_supports_uc_filtering(ds)) { in dsa_slave_open()
284 if (dsa_switch_supports_uc_filtering(ds)) in dsa_slave_open()
294 struct dsa_switch *ds = dp->ds; in dsa_slave_close() local
301 if (dsa_switch_supports_uc_filtering(ds)) in dsa_slave_close()
320 struct dsa_switch *ds = dp->ds; in dsa_slave_change_rx_flags() local
329 if (dsa_switch_supports_uc_filtering(ds) && in dsa_slave_change_rx_flags()
330 dsa_switch_supports_mc_filtering(ds)) in dsa_slave_change_rx_flags()
344 struct dsa_switch *ds = dp->ds; in dsa_slave_set_mac_address() local
357 if (dsa_switch_supports_uc_filtering(ds)) { in dsa_slave_set_mac_address()
372 if (dsa_switch_supports_uc_filtering(ds)) in dsa_slave_set_mac_address()
381 if (dsa_switch_supports_uc_filtering(ds)) in dsa_slave_set_mac_address()
461 struct dsa_switch *ds = p->dp->ds; in dsa_slave_ioctl() local
467 if (ds->ops->port_hwtstamp_get) in dsa_slave_ioctl()
468 return ds->ops->port_hwtstamp_get(ds, port, ifr); in dsa_slave_ioctl()
471 if (ds->ops->port_hwtstamp_set) in dsa_slave_ioctl()
472 return ds->ops->port_hwtstamp_set(ds, port, ifr); in dsa_slave_ioctl()
778 struct dsa_switch *ds = p->dp->ds; in dsa_skb_tx_timestamp() local
783 if (!ds->ops->port_txtstamp) in dsa_skb_tx_timestamp()
786 ds->ops->port_txtstamp(ds, p->dp->index, skb); in dsa_skb_tx_timestamp()
879 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs_len() local
881 if (ds->ops->get_regs_len) in dsa_slave_get_regs_len()
882 return ds->ops->get_regs_len(ds, dp->index); in dsa_slave_get_regs_len()
891 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs() local
893 if (ds->ops->get_regs) in dsa_slave_get_regs()
894 ds->ops->get_regs(ds, dp->index, regs, _p); in dsa_slave_get_regs()
907 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom_len() local
909 if (ds->cd && ds->cd->eeprom_len) in dsa_slave_get_eeprom_len()
910 return ds->cd->eeprom_len; in dsa_slave_get_eeprom_len()
912 if (ds->ops->get_eeprom_len) in dsa_slave_get_eeprom_len()
913 return ds->ops->get_eeprom_len(ds); in dsa_slave_get_eeprom_len()
922 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom() local
924 if (ds->ops->get_eeprom) in dsa_slave_get_eeprom()
925 return ds->ops->get_eeprom(ds, eeprom, data); in dsa_slave_get_eeprom()
934 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eeprom() local
936 if (ds->ops->set_eeprom) in dsa_slave_set_eeprom()
937 return ds->ops->set_eeprom(ds, eeprom, data); in dsa_slave_set_eeprom()
946 struct dsa_switch *ds = dp->ds; in dsa_slave_get_strings() local
955 if (ds->ops->get_strings) in dsa_slave_get_strings()
956 ds->ops->get_strings(ds, dp->index, stringset, in dsa_slave_get_strings()
969 struct dsa_switch *ds = dp->ds; in dsa_slave_get_ethtool_stats() local
990 if (ds->ops->get_ethtool_stats) in dsa_slave_get_ethtool_stats()
991 ds->ops->get_ethtool_stats(ds, dp->index, data + 4); in dsa_slave_get_ethtool_stats()
997 struct dsa_switch *ds = dp->ds; in dsa_slave_get_sset_count() local
1002 if (ds->ops->get_sset_count) { in dsa_slave_get_sset_count()
1003 count = ds->ops->get_sset_count(ds, dp->index, sset); in dsa_slave_get_sset_count()
1020 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eth_phy_stats() local
1022 if (ds->ops->get_eth_phy_stats) in dsa_slave_get_eth_phy_stats()
1023 ds->ops->get_eth_phy_stats(ds, dp->index, phy_stats); in dsa_slave_get_eth_phy_stats()
1030 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eth_mac_stats() local
1032 if (ds->ops->get_eth_mac_stats) in dsa_slave_get_eth_mac_stats()
1033 ds->ops->get_eth_mac_stats(ds, dp->index, mac_stats); in dsa_slave_get_eth_mac_stats()
1041 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eth_ctrl_stats() local
1043 if (ds->ops->get_eth_ctrl_stats) in dsa_slave_get_eth_ctrl_stats()
1044 ds->ops->get_eth_ctrl_stats(ds, dp->index, ctrl_stats); in dsa_slave_get_eth_ctrl_stats()
1053 struct dsa_switch *ds = dp->ds; in dsa_slave_get_rmon_stats() local
1055 if (ds->ops->get_rmon_stats) in dsa_slave_get_rmon_stats()
1056 ds->ops->get_rmon_stats(ds, dp->index, rmon_stats, ranges); in dsa_slave_get_rmon_stats()
1063 struct dsa_switch *ds = dp->ds; in dsa_slave_net_selftest() local
1065 if (ds->ops->self_test) { in dsa_slave_net_selftest()
1066 ds->ops->self_test(ds, dp->index, etest, buf); in dsa_slave_net_selftest()
1076 struct dsa_switch *ds = dp->ds; in dsa_slave_get_wol() local
1080 if (ds->ops->get_wol) in dsa_slave_get_wol()
1081 ds->ops->get_wol(ds, dp->index, w); in dsa_slave_get_wol()
1087 struct dsa_switch *ds = dp->ds; in dsa_slave_set_wol() local
1092 if (ds->ops->set_wol) in dsa_slave_set_wol()
1093 ret = ds->ops->set_wol(ds, dp->index, w); in dsa_slave_set_wol()
1101 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eee() local
1108 if (!ds->ops->set_mac_eee) in dsa_slave_set_eee()
1111 ret = ds->ops->set_mac_eee(ds, dp->index, e); in dsa_slave_set_eee()
1121 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eee() local
1128 if (!ds->ops->get_mac_eee) in dsa_slave_get_eee()
1131 ret = ds->ops->get_mac_eee(ds, dp->index, e); in dsa_slave_get_eee()
1158 struct dsa_switch *ds = dp->ds; in dsa_slave_get_pause_stats() local
1160 if (ds->ops->get_pause_stats) in dsa_slave_get_pause_stats()
1161 ds->ops->get_pause_stats(ds, dp->index, pause_stats); in dsa_slave_get_pause_stats()
1245 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_matchall_mirred() local
1250 if (!ds->ops->port_mirror_add) in dsa_slave_add_cls_matchall_mirred()
1278 err = ds->ops->port_mirror_add(ds, dp->index, mirror, ingress, extack); in dsa_slave_add_cls_matchall_mirred()
1299 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_matchall_police() local
1303 if (!ds->ops->port_policer_add) { in dsa_slave_add_cls_matchall_police()
1339 err = ds->ops->port_policer_add(ds, dp->index, policer); in dsa_slave_add_cls_matchall_police()
1372 struct dsa_switch *ds = dp->ds; in dsa_slave_del_cls_matchall() local
1382 if (ds->ops->port_mirror_del) in dsa_slave_del_cls_matchall()
1383 ds->ops->port_mirror_del(ds, dp->index, in dsa_slave_del_cls_matchall()
1387 if (ds->ops->port_policer_del) in dsa_slave_del_cls_matchall()
1388 ds->ops->port_policer_del(ds, dp->index); in dsa_slave_del_cls_matchall()
1420 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_flower() local
1423 if (!ds->ops->cls_flower_add) in dsa_slave_add_cls_flower()
1426 return ds->ops->cls_flower_add(ds, port, cls, ingress); in dsa_slave_add_cls_flower()
1434 struct dsa_switch *ds = dp->ds; in dsa_slave_del_cls_flower() local
1437 if (!ds->ops->cls_flower_del) in dsa_slave_del_cls_flower()
1440 return ds->ops->cls_flower_del(ds, port, cls, ingress); in dsa_slave_del_cls_flower()
1448 struct dsa_switch *ds = dp->ds; in dsa_slave_stats_cls_flower() local
1451 if (!ds->ops->cls_flower_stats) in dsa_slave_stats_cls_flower()
1454 return ds->ops->cls_flower_stats(ds, port, cls, ingress); in dsa_slave_stats_cls_flower()
1545 static int dsa_slave_setup_ft_block(struct dsa_switch *ds, int port, in dsa_slave_setup_ft_block() argument
1548 struct net_device *master = dsa_port_to_master(dsa_to_port(ds, port)); in dsa_slave_setup_ft_block()
1560 struct dsa_switch *ds = dp->ds; in dsa_slave_setup_tc() local
1566 return dsa_slave_setup_ft_block(ds, dp->index, type_data); in dsa_slave_setup_tc()
1571 if (!ds->ops->port_setup_tc) in dsa_slave_setup_tc()
1574 return ds->ops->port_setup_tc(ds, dp->index, type, type_data); in dsa_slave_setup_tc()
1581 struct dsa_switch *ds = dp->ds; in dsa_slave_get_rxnfc() local
1583 if (!ds->ops->get_rxnfc) in dsa_slave_get_rxnfc()
1586 return ds->ops->get_rxnfc(ds, dp->index, nfc, rule_locs); in dsa_slave_get_rxnfc()
1593 struct dsa_switch *ds = dp->ds; in dsa_slave_set_rxnfc() local
1595 if (!ds->ops->set_rxnfc) in dsa_slave_set_rxnfc()
1598 return ds->ops->set_rxnfc(ds, dp->index, nfc); in dsa_slave_set_rxnfc()
1605 struct dsa_switch *ds = p->dp->ds; in dsa_slave_get_ts_info() local
1607 if (!ds->ops->get_ts_info) in dsa_slave_get_ts_info()
1610 return ds->ops->get_ts_info(ds, p->dp->index, ts); in dsa_slave_get_ts_info()
1785 if (!dp->ds->mtu_enforcement_ingress) in dsa_bridge_mtu_normalization()
1807 if (!other_dp->ds->mtu_enforcement_ingress) in dsa_bridge_mtu_normalization()
1849 struct dsa_switch *ds = dp->ds; in dsa_slave_change_mtu() local
1858 if (!ds->ops->port_change_mtu) in dsa_slave_change_mtu()
1861 dsa_tree_for_each_user_port(other_dp, ds->dst) { in dsa_slave_change_mtu()
1908 err = ds->ops->port_change_mtu(ds, dp->index, new_mtu); in dsa_slave_change_mtu()
1933 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_set_default_prio() local
1937 if (!ds->ops->port_set_default_prio) in dsa_slave_dcbnl_set_default_prio()
1947 err = ds->ops->port_set_default_prio(ds, port, new_prio); in dsa_slave_dcbnl_set_default_prio()
1960 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_add_dscp_prio() local
1965 if (!ds->ops->port_add_dscp_prio) in dsa_slave_dcbnl_add_dscp_prio()
1981 err = ds->ops->port_add_dscp_prio(ds, port, dscp, new_prio); in dsa_slave_dcbnl_add_dscp_prio()
2013 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_del_default_prio() local
2017 if (!ds->ops->port_set_default_prio) in dsa_slave_dcbnl_del_default_prio()
2027 err = ds->ops->port_set_default_prio(ds, port, new_prio); in dsa_slave_dcbnl_del_default_prio()
2040 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_del_dscp_prio() local
2044 if (!ds->ops->port_del_dscp_prio) in dsa_slave_dcbnl_del_dscp_prio()
2051 err = ds->ops->port_del_dscp_prio(ds, port, dscp, app->priority); in dsa_slave_dcbnl_del_dscp_prio()
2085 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_init() local
2089 if (ds->ops->port_get_default_prio) { in dsa_slave_dcbnl_init()
2090 int prio = ds->ops->port_get_default_prio(ds, port); in dsa_slave_dcbnl_init()
2105 if (ds->ops->port_get_dscp_prio) { in dsa_slave_dcbnl_init()
2115 prio = ds->ops->port_get_dscp_prio(ds, port, protocol); in dsa_slave_dcbnl_init()
2179 struct dsa_switch *ds = dp->ds; in dsa_slave_get_stats64() local
2181 if (ds->ops->get_stats64) in dsa_slave_get_stats64()
2182 ds->ops->get_stats64(ds, dp->index, s); in dsa_slave_get_stats64()
2231 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up) in dsa_port_phylink_mac_change() argument
2233 const struct dsa_port *dp = dsa_to_port(ds, port); in dsa_port_phylink_mac_change()
2244 struct dsa_switch *ds = dp->ds; in dsa_slave_phylink_fixed_state() local
2249 ds->ops->phylink_fixed_state(ds, dp->index, state); in dsa_slave_phylink_fixed_state()
2257 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_connect() local
2259 slave_dev->phydev = mdiobus_get_phy(ds->slave_mii_bus, addr); in dsa_slave_phy_connect()
2274 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_setup() local
2285 if (ds->ops->phylink_fixed_state) { in dsa_slave_phy_setup()
2294 if (ds->ops->get_phy_flags) in dsa_slave_phy_setup()
2295 phy_flags = ds->ops->get_phy_flags(ds, dp->index); in dsa_slave_phy_setup()
2298 if (ret == -ENODEV && ds->slave_mii_bus) { in dsa_slave_phy_setup()
2319 const struct dsa_switch *ds = dp->ds; in dsa_slave_setup_tagger() local
2337 if (ds->needs_standalone_vlan_filtering) in dsa_slave_setup_tagger()
2376 struct dsa_switch *ds = port->ds; in dsa_slave_create() local
2382 if (!ds->num_tx_queues) in dsa_slave_create()
2383 ds->num_tx_queues = 1; in dsa_slave_create()
2387 ds->num_tx_queues, 1); in dsa_slave_create()
2401 if (dsa_switch_supports_uc_filtering(ds)) in dsa_slave_create()
2404 if (ds->ops->port_max_mtu) in dsa_slave_create()
2405 slave_dev->max_mtu = ds->ops->port_max_mtu(ds, port->index); in dsa_slave_create()
2408 SET_NETDEV_DEV(slave_dev, port->ds->dev); in dsa_slave_create()
2434 ret, ds->dst->index, ds->index, port->index); in dsa_slave_create()
2442 dev_warn(ds->dev, "nonfatal error %d setting MTU to %d on port %d\n", in dsa_slave_create()
2513 struct dsa_switch *ds = dp->ds; in dsa_slave_change_master() local
2521 if (!ds->ops->port_change_master) { in dsa_slave_change_master()
2799 struct dsa_switch *ds; in dsa_slave_prechangeupper_sanity_check() local
2807 ds = dp->ds; in dsa_slave_prechangeupper_sanity_check()
2809 if (ds->ops->port_prechangeupper) { in dsa_slave_prechangeupper_sanity_check()
2810 err = ds->ops->port_prechangeupper(ds, dp->index, info); in dsa_slave_prechangeupper_sanity_check()
3175 struct dsa_switch_tree *dst = cpu_dp->ds->dst; in dsa_slave_netdevice_event()
3206 dst = cpu_dp->ds->dst; in dsa_slave_netdevice_event()
3250 struct dsa_switch *ds; in dsa_slave_switchdev_event_work() local
3255 ds = dp->ds; in dsa_slave_switchdev_event_work()
3266 dev_err(ds->dev, in dsa_slave_switchdev_event_work()
3282 dev_err(ds->dev, in dsa_slave_switchdev_event_work()
3297 struct dsa_switch_tree *dst = dp->ds->dst; in dsa_foreign_dev_check()
3317 struct dsa_switch *ds = dp->ds; in dsa_slave_fdb_event() local
3333 if (!ds->assisted_learning_on_cpu_port) in dsa_slave_fdb_event()
3348 if (!ds->ops->lag_fdb_add || !ds->ops->lag_fdb_del) in dsa_slave_fdb_event()
3351 if (!ds->ops->port_fdb_add || !ds->ops->port_fdb_del) in dsa_slave_fdb_event()