Lines Matching full:dp

33 	struct dsa_port *dp = dsa_slave_to_port(dev);  in dsa_slave_standalone_event_work()  local
35 struct dsa_switch *ds = dp->ds; in dsa_slave_standalone_event_work()
41 err = dsa_port_standalone_host_fdb_add(dp, addr, vid); in dsa_slave_standalone_event_work()
45 dp->index, addr, vid, err); in dsa_slave_standalone_event_work()
51 err = dsa_port_standalone_host_fdb_del(dp, addr, vid); in dsa_slave_standalone_event_work()
55 dp->index, addr, vid, err); in dsa_slave_standalone_event_work()
63 err = dsa_port_standalone_host_mdb_add(dp, &mdb); in dsa_slave_standalone_event_work()
67 dp->index, addr, vid, err); in dsa_slave_standalone_event_work()
75 err = dsa_port_standalone_host_mdb_del(dp, &mdb); in dsa_slave_standalone_event_work()
79 dp->index, addr, vid, err); in dsa_slave_standalone_event_work()
115 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_sync_uc() local
119 if (!dsa_switch_supports_uc_filtering(dp->ds)) in dsa_slave_sync_uc()
129 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_unsync_uc() local
133 if (!dsa_switch_supports_uc_filtering(dp->ds)) in dsa_slave_unsync_uc()
143 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_sync_mc() local
147 if (!dsa_switch_supports_mc_filtering(dp->ds)) in dsa_slave_sync_mc()
157 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_unsync_mc() local
161 if (!dsa_switch_supports_mc_filtering(dp->ds)) in dsa_slave_unsync_mc()
169 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_sync_ha() local
170 struct dsa_switch *ds = dp->ds; in dsa_slave_sync_ha()
190 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_unsync_ha() local
191 struct dsa_switch *ds = dp->ds; in dsa_slave_unsync_ha()
252 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_open() local
253 struct dsa_switch *ds = dp->ds; in dsa_slave_open()
263 err = dsa_port_standalone_host_fdb_add(dp, dev->dev_addr, 0); in dsa_slave_open()
274 err = dsa_port_enable_rt(dp, dev->phydev); in dsa_slave_open()
285 dsa_port_standalone_host_fdb_del(dp, dev->dev_addr, 0); in dsa_slave_open()
293 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_close() local
294 struct dsa_switch *ds = dp->ds; in dsa_slave_close()
296 dsa_port_disable_rt(dp); in dsa_slave_close()
302 dsa_port_standalone_host_fdb_del(dp, dev->dev_addr, 0); in dsa_slave_close()
310 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_manage_host_flood() local
313 dsa_port_set_host_flood(dp, uc, mc); in dsa_slave_manage_host_flood()
319 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_change_rx_flags() local
320 struct dsa_switch *ds = dp->ds; in dsa_slave_change_rx_flags()
343 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_mac_address() local
344 struct dsa_switch *ds = dp->ds; in dsa_slave_set_mac_address()
358 err = dsa_port_standalone_host_fdb_add(dp, addr->sa_data, 0); in dsa_slave_set_mac_address()
373 dsa_port_standalone_host_fdb_del(dp, dev->dev_addr, 0); in dsa_slave_set_mac_address()
382 dsa_port_standalone_host_fdb_del(dp, addr->sa_data, 0); in dsa_slave_set_mac_address()
443 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_fdb_dump() local
452 err = dsa_port_fdb_dump(dp, dsa_slave_port_fdb_do_dump, &dump); in dsa_slave_fdb_dump()
461 struct dsa_switch *ds = p->dp->ds; in dsa_slave_ioctl()
462 int port = p->dp->index; in dsa_slave_ioctl()
476 return phylink_mii_ioctl(p->dp->pl, ifr, cmd); in dsa_slave_ioctl()
483 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_port_attr_set() local
486 if (ctx && ctx != dp) in dsa_slave_port_attr_set()
491 if (!dsa_port_offloads_bridge_port(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
494 ret = dsa_port_set_state(dp, attr->u.stp_state, true); in dsa_slave_port_attr_set()
497 if (!dsa_port_offloads_bridge_port(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
500 ret = dsa_port_set_mst_state(dp, &attr->u.mst_state, extack); in dsa_slave_port_attr_set()
503 if (!dsa_port_offloads_bridge_dev(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
506 ret = dsa_port_vlan_filtering(dp, attr->u.vlan_filtering, in dsa_slave_port_attr_set()
510 if (!dsa_port_offloads_bridge_dev(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
513 ret = dsa_port_ageing_time(dp, attr->u.ageing_time); in dsa_slave_port_attr_set()
516 if (!dsa_port_offloads_bridge_dev(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
519 ret = dsa_port_mst_enable(dp, attr->u.mst, extack); in dsa_slave_port_attr_set()
522 if (!dsa_port_offloads_bridge_port(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
525 ret = dsa_port_pre_bridge_flags(dp, attr->u.brport_flags, in dsa_slave_port_attr_set()
529 if (!dsa_port_offloads_bridge_port(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
532 ret = dsa_port_bridge_flags(dp, attr->u.brport_flags, extack); in dsa_slave_port_attr_set()
535 if (!dsa_port_offloads_bridge_dev(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
538 ret = dsa_port_vlan_msti(dp, &attr->u.vlan_msti); in dsa_slave_port_attr_set()
574 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_vlan_add() local
578 if (dsa_port_skip_vlan_configuration(dp)) { in dsa_slave_vlan_add()
588 if (br_vlan_enabled(dsa_port_bridge_dev_get(dp))) { in dsa_slave_vlan_add()
599 return dsa_port_vlan_add(dp, vlan, extack); in dsa_slave_vlan_add()
609 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_host_vlan_add() local
613 if (!dp->bridge) in dsa_slave_host_vlan_add()
616 if (dsa_port_skip_vlan_configuration(dp)) { in dsa_slave_host_vlan_add()
628 return dsa_port_host_vlan_add(dp, &vlan, extack); in dsa_slave_host_vlan_add()
635 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_port_obj_add() local
638 if (ctx && ctx != dp) in dsa_slave_port_obj_add()
643 if (!dsa_port_offloads_bridge_port(dp, obj->orig_dev)) in dsa_slave_port_obj_add()
646 err = dsa_port_mdb_add(dp, SWITCHDEV_OBJ_PORT_MDB(obj)); in dsa_slave_port_obj_add()
649 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_add()
652 err = dsa_port_bridge_host_mdb_add(dp, SWITCHDEV_OBJ_PORT_MDB(obj)); in dsa_slave_port_obj_add()
655 if (dsa_port_offloads_bridge_port(dp, obj->orig_dev)) in dsa_slave_port_obj_add()
661 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_add()
664 err = dsa_port_mrp_add(dp, SWITCHDEV_OBJ_MRP(obj)); in dsa_slave_port_obj_add()
667 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_add()
670 err = dsa_port_mrp_add_ring_role(dp, in dsa_slave_port_obj_add()
684 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_vlan_del() local
687 if (dsa_port_skip_vlan_configuration(dp)) in dsa_slave_vlan_del()
692 return dsa_port_vlan_del(dp, vlan); in dsa_slave_vlan_del()
698 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_host_vlan_del() local
702 if (!dp->bridge) in dsa_slave_host_vlan_del()
705 if (dsa_port_skip_vlan_configuration(dp)) in dsa_slave_host_vlan_del()
710 return dsa_port_host_vlan_del(dp, vlan); in dsa_slave_host_vlan_del()
716 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_port_obj_del() local
719 if (ctx && ctx != dp) in dsa_slave_port_obj_del()
724 if (!dsa_port_offloads_bridge_port(dp, obj->orig_dev)) in dsa_slave_port_obj_del()
727 err = dsa_port_mdb_del(dp, SWITCHDEV_OBJ_PORT_MDB(obj)); in dsa_slave_port_obj_del()
730 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_del()
733 err = dsa_port_bridge_host_mdb_del(dp, SWITCHDEV_OBJ_PORT_MDB(obj)); in dsa_slave_port_obj_del()
736 if (dsa_port_offloads_bridge_port(dp, obj->orig_dev)) in dsa_slave_port_obj_del()
742 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_del()
745 err = dsa_port_mrp_del(dp, SWITCHDEV_OBJ_MRP(obj)); in dsa_slave_port_obj_del()
748 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_del()
751 err = dsa_port_mrp_del_ring_role(dp, in dsa_slave_port_obj_del()
778 struct dsa_switch *ds = p->dp->ds; in dsa_skb_tx_timestamp()
786 ds->ops->port_txtstamp(ds, p->dp->index, skb); in dsa_skb_tx_timestamp()
878 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_regs_len() local
879 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs_len()
882 return ds->ops->get_regs_len(ds, dp->index); in dsa_slave_get_regs_len()
890 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_regs() local
891 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs()
894 ds->ops->get_regs(ds, dp->index, regs, _p); in dsa_slave_get_regs()
899 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_nway_reset() local
901 return phylink_ethtool_nway_reset(dp->pl); in dsa_slave_nway_reset()
906 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_eeprom_len() local
907 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom_len()
921 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_eeprom() local
922 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom()
933 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_eeprom() local
934 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eeprom()
945 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_strings() local
946 struct dsa_switch *ds = dp->ds; in dsa_slave_get_strings()
956 ds->ops->get_strings(ds, dp->index, stringset, in dsa_slave_get_strings()
968 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_ethtool_stats() local
969 struct dsa_switch *ds = dp->ds; in dsa_slave_get_ethtool_stats()
991 ds->ops->get_ethtool_stats(ds, dp->index, data + 4); in dsa_slave_get_ethtool_stats()
996 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_sset_count() local
997 struct dsa_switch *ds = dp->ds; in dsa_slave_get_sset_count()
1003 count = ds->ops->get_sset_count(ds, dp->index, sset); in dsa_slave_get_sset_count()
1019 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_eth_phy_stats() local
1020 struct dsa_switch *ds = dp->ds; 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()
1029 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_eth_mac_stats() local
1030 struct dsa_switch *ds = dp->ds; 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()
1040 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_eth_ctrl_stats() local
1041 struct dsa_switch *ds = dp->ds; 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()
1052 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_rmon_stats() local
1053 struct dsa_switch *ds = dp->ds; in dsa_slave_get_rmon_stats()
1056 ds->ops->get_rmon_stats(ds, dp->index, rmon_stats, ranges); in dsa_slave_get_rmon_stats()
1062 struct dsa_port *dp = dsa_slave_to_port(ndev); in dsa_slave_net_selftest() local
1063 struct dsa_switch *ds = dp->ds; in dsa_slave_net_selftest()
1066 ds->ops->self_test(ds, dp->index, etest, buf); in dsa_slave_net_selftest()
1075 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_wol() local
1076 struct dsa_switch *ds = dp->ds; in dsa_slave_get_wol()
1078 phylink_ethtool_get_wol(dp->pl, w); in dsa_slave_get_wol()
1081 ds->ops->get_wol(ds, dp->index, w); in dsa_slave_get_wol()
1086 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_wol() local
1087 struct dsa_switch *ds = dp->ds; in dsa_slave_set_wol()
1090 phylink_ethtool_set_wol(dp->pl, w); in dsa_slave_set_wol()
1093 ret = ds->ops->set_wol(ds, dp->index, w); in dsa_slave_set_wol()
1100 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_eee() local
1101 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eee()
1105 if (!dev->phydev || !dp->pl) in dsa_slave_set_eee()
1111 ret = ds->ops->set_mac_eee(ds, dp->index, e); in dsa_slave_set_eee()
1115 return phylink_ethtool_set_eee(dp->pl, e); in dsa_slave_set_eee()
1120 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_eee() local
1121 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eee()
1125 if (!dev->phydev || !dp->pl) in dsa_slave_get_eee()
1131 ret = ds->ops->get_mac_eee(ds, dp->index, e); in dsa_slave_get_eee()
1135 return phylink_ethtool_get_eee(dp->pl, e); in dsa_slave_get_eee()
1141 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_link_ksettings() local
1143 return phylink_ethtool_ksettings_get(dp->pl, cmd); in dsa_slave_get_link_ksettings()
1149 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_link_ksettings() local
1151 return phylink_ethtool_ksettings_set(dp->pl, cmd); in dsa_slave_set_link_ksettings()
1157 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_pause_stats() local
1158 struct dsa_switch *ds = dp->ds; in dsa_slave_get_pause_stats()
1161 ds->ops->get_pause_stats(ds, dp->index, pause_stats); in dsa_slave_get_pause_stats()
1167 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_pauseparam() local
1169 phylink_ethtool_get_pauseparam(dp->pl, pause); in dsa_slave_get_pauseparam()
1175 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_pauseparam() local
1177 return phylink_ethtool_set_pauseparam(dp->pl, pause); in dsa_slave_set_pauseparam()
1241 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_add_cls_matchall_mirred() local
1245 struct dsa_switch *ds = dp->ds; 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()
1295 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_add_cls_matchall_police() local
1299 struct dsa_switch *ds = dp->ds; 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()
1370 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_del_cls_matchall() local
1372 struct dsa_switch *ds = dp->ds; in dsa_slave_del_cls_matchall()
1383 ds->ops->port_mirror_del(ds, dp->index, in dsa_slave_del_cls_matchall()
1388 ds->ops->port_policer_del(ds, dp->index); in dsa_slave_del_cls_matchall()
1419 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_add_cls_flower() local
1420 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_flower()
1421 int port = dp->index; in dsa_slave_add_cls_flower()
1433 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_del_cls_flower() local
1434 struct dsa_switch *ds = dp->ds; in dsa_slave_del_cls_flower()
1435 int port = dp->index; in dsa_slave_del_cls_flower()
1447 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_stats_cls_flower() local
1448 struct dsa_switch *ds = dp->ds; in dsa_slave_stats_cls_flower()
1449 int port = dp->index; in dsa_slave_stats_cls_flower()
1559 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_setup_tc() local
1560 struct dsa_switch *ds = dp->ds; in dsa_slave_setup_tc()
1566 return dsa_slave_setup_ft_block(ds, dp->index, type_data); in dsa_slave_setup_tc()
1574 return ds->ops->port_setup_tc(ds, dp->index, type, type_data); in dsa_slave_setup_tc()
1580 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_rxnfc() local
1581 struct dsa_switch *ds = dp->ds; in dsa_slave_get_rxnfc()
1586 return ds->ops->get_rxnfc(ds, dp->index, nfc, rule_locs); in dsa_slave_get_rxnfc()
1592 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_set_rxnfc() local
1593 struct dsa_switch *ds = dp->ds; 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()
1610 return ds->ops->get_ts_info(ds, p->dp->index, ts); in dsa_slave_get_ts_info()
1616 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_vlan_rx_add_vid() local
1627 ret = dsa_port_vlan_add(dp, &vlan, &extack); in dsa_slave_vlan_rx_add_vid()
1635 ret = dsa_port_host_vlan_add(dp, &vlan, &extack); in dsa_slave_vlan_rx_add_vid()
1638 netdev_err(dev, "CPU port %d: %s\n", dp->cpu_dp->index, in dsa_slave_vlan_rx_add_vid()
1649 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_vlan_rx_kill_vid() local
1657 err = dsa_port_vlan_del(dp, &vlan); in dsa_slave_vlan_rx_kill_vid()
1661 return dsa_port_host_vlan_del(dp, &vlan); in dsa_slave_vlan_rx_kill_vid()
1777 static void dsa_bridge_mtu_normalization(struct dsa_port *dp) in dsa_bridge_mtu_normalization() argument
1785 if (!dp->ds->mtu_enforcement_ingress) in dsa_bridge_mtu_normalization()
1788 if (!dp->bridge) in dsa_bridge_mtu_normalization()
1804 if (!dsa_port_bridge_same(dp, other_dp)) in dsa_bridge_mtu_normalization()
1830 err = dsa_hw_port_list_set_mtu(&hw_port_list, dp->slave->mtu); in dsa_bridge_mtu_normalization()
1847 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_change_mtu() local
1848 struct dsa_port *cpu_dp = dp->cpu_dp; in dsa_slave_change_mtu()
1849 struct dsa_switch *ds = dp->ds; in dsa_slave_change_mtu()
1874 if (dp == other_dp) in dsa_slave_change_mtu()
1908 err = ds->ops->port_change_mtu(ds, dp->index, new_mtu); in dsa_slave_change_mtu()
1914 dsa_bridge_mtu_normalization(dp); in dsa_slave_change_mtu()
1932 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_dcbnl_set_default_prio() local
1933 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_set_default_prio()
1935 int err, port = dp->index; in dsa_slave_dcbnl_set_default_prio()
1959 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_dcbnl_add_dscp_prio() local
1960 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_add_dscp_prio()
1962 int err, port = dp->index; in dsa_slave_dcbnl_add_dscp_prio()
2012 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_dcbnl_del_default_prio() local
2013 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_del_default_prio()
2015 int err, port = dp->index; in dsa_slave_dcbnl_del_default_prio()
2039 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_dcbnl_del_dscp_prio() local
2040 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_del_dscp_prio()
2041 int err, port = dp->index; in dsa_slave_dcbnl_del_dscp_prio()
2084 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_dcbnl_init() local
2085 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_init()
2086 int port = dp->index; in dsa_slave_dcbnl_init()
2170 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_devlink_port() local
2172 return &dp->devlink_port; in dsa_slave_get_devlink_port()
2178 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_get_stats64() local
2179 struct dsa_switch *ds = dp->ds; in dsa_slave_get_stats64()
2182 ds->ops->get_stats64(ds, dp->index, s); in dsa_slave_get_stats64()
2190 struct dsa_port *dp = dsa_slave_to_port(ctx->dev); in dsa_slave_fill_forward_path() local
2191 struct net_device *master = dsa_port_to_master(dp); in dsa_slave_fill_forward_path()
2192 struct dsa_port *cpu_dp = dp->cpu_dp; in dsa_slave_fill_forward_path()
2197 path->dsa.port = dp->index; in dsa_slave_fill_forward_path()
2233 const struct dsa_port *dp = dsa_to_port(ds, port); in dsa_port_phylink_mac_change() local
2235 if (dp->pl) in dsa_port_phylink_mac_change()
2236 phylink_mac_change(dp->pl, up); in dsa_port_phylink_mac_change()
2243 struct dsa_port *dp = container_of(config, struct dsa_port, pl_config); in dsa_slave_phylink_fixed_state() local
2244 struct dsa_switch *ds = dp->ds; in dsa_slave_phylink_fixed_state()
2249 ds->ops->phylink_fixed_state(ds, dp->index, state); in dsa_slave_phylink_fixed_state()
2256 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_phy_connect() local
2257 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_connect()
2267 return phylink_connect_phy(dp->pl, slave_dev->phydev); in dsa_slave_phy_connect()
2272 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_phy_setup() local
2273 struct device_node *port_dn = dp->dn; in dsa_slave_phy_setup()
2274 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_setup()
2278 dp->pl_config.dev = &slave_dev->dev; in dsa_slave_phy_setup()
2279 dp->pl_config.type = PHYLINK_NETDEV; in dsa_slave_phy_setup()
2286 dp->pl_config.get_fixed_state = dsa_slave_phylink_fixed_state; in dsa_slave_phy_setup()
2287 dp->pl_config.poll_fixed_state = true; in dsa_slave_phy_setup()
2290 ret = dsa_port_phylink_create(dp); in dsa_slave_phy_setup()
2295 phy_flags = ds->ops->get_phy_flags(ds, dp->index); in dsa_slave_phy_setup()
2297 ret = phylink_of_phy_connect(dp->pl, port_dn, phy_flags); in dsa_slave_phy_setup()
2302 ret = dsa_slave_phy_connect(slave_dev, dp->index, phy_flags); in dsa_slave_phy_setup()
2307 dsa_port_phylink_destroy(dp); in dsa_slave_phy_setup()
2315 struct dsa_port *dp = dsa_slave_to_port(slave); in dsa_slave_setup_tagger() local
2316 struct net_device *master = dsa_port_to_master(dp); in dsa_slave_setup_tagger()
2318 const struct dsa_port *cpu_dp = dp->cpu_dp; in dsa_slave_setup_tagger()
2319 const struct dsa_switch *ds = dp->ds; in dsa_slave_setup_tagger()
2343 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_suspend() local
2351 phylink_stop(dp->pl); in dsa_slave_suspend()
2359 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_resume() local
2367 phylink_start(dp->pl); in dsa_slave_resume()
2423 p->dp = port; in dsa_slave_create()
2477 phylink_disconnect_phy(p->dp->pl); in dsa_slave_create()
2479 dsa_port_phylink_destroy(p->dp); in dsa_slave_create()
2492 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_destroy() local
2499 phylink_disconnect_phy(dp->pl); in dsa_slave_destroy()
2502 dsa_port_phylink_destroy(dp); in dsa_slave_destroy()
2512 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_change_master() local
2513 struct dsa_switch *ds = dp->ds; in dsa_slave_change_master()
2558 err = dsa_port_change_master(dp, master, extack); in dsa_slave_change_master()
2573 if (is_zero_ether_addr(dp->mac)) in dsa_slave_change_master()
2594 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_changeupper() local
2605 err = dsa_port_bridge_join(dp, info->upper_dev, extack); in dsa_slave_changeupper()
2607 dsa_bridge_mtu_normalization(dp); in dsa_slave_changeupper()
2616 dsa_port_bridge_leave(dp, info->upper_dev); in dsa_slave_changeupper()
2621 err = dsa_port_lag_join(dp, info->upper_dev, in dsa_slave_changeupper()
2630 dsa_port_lag_leave(dp, info->upper_dev); in dsa_slave_changeupper()
2635 err = dsa_port_hsr_join(dp, info->upper_dev); in dsa_slave_changeupper()
2643 dsa_port_hsr_leave(dp, info->upper_dev); in dsa_slave_changeupper()
2654 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_prechangeupper() local
2660 dsa_port_pre_bridge_leave(dp, info->upper_dev); in dsa_slave_prechangeupper()
2662 dsa_port_pre_lag_leave(dp, info->upper_dev); in dsa_slave_prechangeupper()
2677 struct dsa_port *dp; in dsa_slave_lag_changeupper() local
2686 dp = dsa_slave_to_port(lower); in dsa_slave_lag_changeupper()
2687 if (!dp->lag) in dsa_slave_lag_changeupper()
2709 struct dsa_port *dp; in dsa_slave_lag_prechangeupper() local
2718 dp = dsa_slave_to_port(lower); in dsa_slave_lag_prechangeupper()
2719 if (!dp->lag) in dsa_slave_lag_prechangeupper()
2737 struct dsa_port *dp; in dsa_prevent_bridging_8021q_upper() local
2748 dp = dsa_slave_to_port(slave); in dsa_prevent_bridging_8021q_upper()
2749 br = dsa_port_bridge_dev_get(dp); in dsa_prevent_bridging_8021q_upper()
2768 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_check_8021q_upper() local
2769 struct net_device *br = dsa_port_bridge_dev_get(dp); in dsa_slave_check_8021q_upper()
2800 struct dsa_port *dp; in dsa_slave_prechangeupper_sanity_check() local
2806 dp = dsa_slave_to_port(dev); in dsa_slave_prechangeupper_sanity_check()
2807 ds = dp->ds; in dsa_slave_prechangeupper_sanity_check()
2810 err = ds->ops->port_prechangeupper(ds, dp->index, info); in dsa_slave_prechangeupper_sanity_check()
2966 struct dsa_port *dp; in dsa_tree_migrate_ports_from_lag_master() local
2969 dsa_tree_for_each_user_port(dp, dst) { in dsa_tree_migrate_ports_from_lag_master()
2970 if (dsa_port_to_master(dp) != lag_dev) in dsa_tree_migrate_ports_from_lag_master()
2973 err = dsa_slave_change_master(dp->slave, new_master, NULL); in dsa_tree_migrate_ports_from_lag_master()
2975 netdev_err(dp->slave, in dsa_tree_migrate_ports_from_lag_master()
2989 struct dsa_port *dp; in dsa_master_lag_join() local
2996 dsa_tree_for_each_user_port(dp, dst) { in dsa_master_lag_join()
2997 if (dsa_port_to_master(dp) != master) in dsa_master_lag_join()
3000 err = dsa_slave_change_master(dp->slave, lag_dev, extack); in dsa_master_lag_join()
3008 dsa_tree_for_each_user_port_continue_reverse(dp, dst) { in dsa_master_lag_join()
3009 if (dsa_port_to_master(dp) != lag_dev) in dsa_master_lag_join()
3012 err = dsa_slave_change_master(dp->slave, master, NULL); in dsa_master_lag_join()
3014 netdev_err(dp->slave, in dsa_master_lag_join()
3028 struct dsa_port *dp, *cpu_dp = lag_dev->dsa_ptr; in dsa_master_lag_leave() local
3045 dsa_tree_for_each_user_port(dp, dst) in dsa_master_lag_leave()
3046 if (dsa_port_to_master(dp) == lag_dev) in dsa_master_lag_leave()
3047 dp->cpu_dp = new_cpu_dp; in dsa_master_lag_leave()
3147 struct dsa_port *dp; in dsa_slave_netdevice_event() local
3151 dp = dsa_slave_to_port(dev); in dsa_slave_netdevice_event()
3153 err = dsa_port_lag_change(dp, info->lower_state_info); in dsa_slave_netdevice_event()
3160 dp = dev->dsa_ptr; in dsa_slave_netdevice_event()
3162 err = dsa_port_lag_change(dp, info->lower_state_info); in dsa_slave_netdevice_event()
3198 struct dsa_port *dp, *cpu_dp; in dsa_slave_netdevice_event() local
3210 list_for_each_entry(dp, &dst->ports, list) { in dsa_slave_netdevice_event()
3211 if (!dsa_port_is_user(dp)) in dsa_slave_netdevice_event()
3214 if (dp->cpu_dp != cpu_dp) in dsa_slave_netdevice_event()
3217 list_add(&dp->slave->close_list, &close_list); in dsa_slave_netdevice_event()
3251 struct dsa_port *dp; in dsa_slave_switchdev_event_work() local
3254 dp = dsa_slave_to_port(dev); in dsa_slave_switchdev_event_work()
3255 ds = dp->ds; in dsa_slave_switchdev_event_work()
3260 err = dsa_port_bridge_host_fdb_add(dp, addr, vid); in dsa_slave_switchdev_event_work()
3261 else if (dp->lag) in dsa_slave_switchdev_event_work()
3262 err = dsa_port_lag_fdb_add(dp, addr, vid); in dsa_slave_switchdev_event_work()
3264 err = dsa_port_fdb_add(dp, addr, vid); in dsa_slave_switchdev_event_work()
3268 dp->index, addr, vid, err); in dsa_slave_switchdev_event_work()
3276 err = dsa_port_bridge_host_fdb_del(dp, addr, vid); in dsa_slave_switchdev_event_work()
3277 else if (dp->lag) in dsa_slave_switchdev_event_work()
3278 err = dsa_port_lag_fdb_del(dp, addr, vid); in dsa_slave_switchdev_event_work()
3280 err = dsa_port_fdb_del(dp, addr, vid); in dsa_slave_switchdev_event_work()
3284 dp->index, addr, vid, err); in dsa_slave_switchdev_event_work()
3296 const struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_foreign_dev_check() local
3297 struct dsa_switch_tree *dst = dp->ds->dst; in dsa_foreign_dev_check()
3315 struct dsa_port *dp = dsa_slave_to_port(dev); in dsa_slave_fdb_event() local
3317 struct dsa_switch *ds = dp->ds; in dsa_slave_fdb_event()
3319 if (ctx && ctx != dp) in dsa_slave_fdb_event()
3322 if (!dp->bridge) in dsa_slave_fdb_event()
3326 if (dsa_port_offloads_bridge_port(dp, orig_dev)) in dsa_slave_fdb_event()
3347 if (dp->lag && !host_addr) { in dsa_slave_fdb_event()