• Home
  • Raw
  • Download

Lines Matching full:ds

282 	dev_dbg(dev->ds->dev, "VID: %d, members: 0x%04x, untag: 0x%04x\n",  in b53_set_vlan_entry()
495 void b53_imp_vlan_setup(struct dsa_switch *ds, int cpu_port) in b53_imp_vlan_setup() argument
497 struct b53_device *dev = ds->priv; in b53_imp_vlan_setup()
526 int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy) in b53_enable_port() argument
528 struct b53_device *dev = ds->priv; in b53_enable_port()
533 if (!dsa_is_user_port(ds, port)) in b53_enable_port()
536 cpu_port = dsa_to_port(ds, port)->cpu_dp->index; in b53_enable_port()
538 b53_br_egress_floods(ds, port, true, true); in b53_enable_port()
559 b53_imp_vlan_setup(ds, cpu_port); in b53_enable_port()
563 b53_eee_enable_set(ds, port, true); in b53_enable_port()
569 void b53_disable_port(struct dsa_switch *ds, int port) in b53_disable_port() argument
571 struct b53_device *dev = ds->priv; in b53_disable_port()
584 void b53_brcm_hdr_setup(struct dsa_switch *ds, int port) in b53_brcm_hdr_setup() argument
586 struct b53_device *dev = ds->priv; in b53_brcm_hdr_setup()
670 b53_brcm_hdr_setup(dev->ds, port); in b53_enable_cpu_port()
672 b53_br_egress_floods(dev->ds, port, true, true); in b53_enable_cpu_port()
693 int b53_configure_vlan(struct dsa_switch *ds) in b53_configure_vlan() argument
695 struct b53_device *dev = ds->priv; in b53_configure_vlan()
711 b53_enable_vlan(dev, dev->vlan_enabled, ds->vlan_filtering); in b53_configure_vlan()
810 static int b53_phy_read16(struct dsa_switch *ds, int addr, int reg) in b53_phy_read16() argument
812 struct b53_device *priv = ds->priv; in b53_phy_read16()
825 static int b53_phy_write16(struct dsa_switch *ds, int addr, int reg, u16 val) in b53_phy_write16() argument
827 struct b53_device *priv = ds->priv; in b53_phy_write16()
851 b53_configure_vlan(priv->ds); in b53_apply_config()
895 static struct phy_device *b53_get_phy_device(struct dsa_switch *ds, int port) in b53_get_phy_device() argument
905 return mdiobus_get_phy(ds->slave_mii_bus, port); in b53_get_phy_device()
908 void b53_get_strings(struct dsa_switch *ds, int port, u32 stringset, in b53_get_strings() argument
911 struct b53_device *dev = ds->priv; in b53_get_strings()
922 phydev = b53_get_phy_device(ds, port); in b53_get_strings()
931 void b53_get_ethtool_stats(struct dsa_switch *ds, int port, uint64_t *data) in b53_get_ethtool_stats() argument
933 struct b53_device *dev = ds->priv; in b53_get_ethtool_stats()
964 void b53_get_ethtool_phy_stats(struct dsa_switch *ds, int port, uint64_t *data) in b53_get_ethtool_phy_stats() argument
968 phydev = b53_get_phy_device(ds, port); in b53_get_ethtool_phy_stats()
976 int b53_get_sset_count(struct dsa_switch *ds, int port, int sset) in b53_get_sset_count() argument
978 struct b53_device *dev = ds->priv; in b53_get_sset_count()
984 phydev = b53_get_phy_device(ds, port); in b53_get_sset_count()
1015 int b53_setup_devlink_resources(struct dsa_switch *ds) in b53_setup_devlink_resources() argument
1018 struct b53_device *dev = ds->priv; in b53_setup_devlink_resources()
1025 err = dsa_devlink_resource_register(ds, "VLAN", dev->num_vlans, in b53_setup_devlink_resources()
1032 dsa_devlink_resource_occ_get_register(ds, in b53_setup_devlink_resources()
1038 dsa_devlink_resources_unregister(ds); in b53_setup_devlink_resources()
1043 static int b53_setup(struct dsa_switch *ds) in b53_setup() argument
1045 struct b53_device *dev = ds->priv; in b53_setup()
1051 dev_err(ds->dev, "failed to reset switch\n"); in b53_setup()
1059 dev_err(ds->dev, "failed to apply configuration\n"); in b53_setup()
1067 if (dsa_is_cpu_port(ds, port)) in b53_setup()
1070 b53_disable_port(ds, port); in b53_setup()
1073 return b53_setup_devlink_resources(ds); in b53_setup()
1076 static void b53_teardown(struct dsa_switch *ds) in b53_teardown() argument
1078 dsa_devlink_resources_unregister(ds); in b53_teardown()
1151 static void b53_adjust_link(struct dsa_switch *ds, int port, in b53_adjust_link() argument
1154 struct b53_device *dev = ds->priv; in b53_adjust_link()
1211 dev_info(ds->dev, "Configured port %d for %s\n", port, in b53_adjust_link()
1228 dev_err(ds->dev, in b53_adjust_link()
1242 p->eee_enabled = b53_eee_init(ds, port, phydev); in b53_adjust_link()
1245 void b53_port_event(struct dsa_switch *ds, int port) in b53_port_event() argument
1247 struct b53_device *dev = ds->priv; in b53_port_event()
1253 dsa_port_phylink_mac_change(ds, port, link); in b53_port_event()
1257 void b53_phylink_validate(struct dsa_switch *ds, int port, in b53_phylink_validate() argument
1261 struct b53_device *dev = ds->priv; in b53_phylink_validate()
1300 int b53_phylink_mac_link_state(struct dsa_switch *ds, int port, in b53_phylink_mac_link_state() argument
1303 struct b53_device *dev = ds->priv; in b53_phylink_mac_link_state()
1315 void b53_phylink_mac_config(struct dsa_switch *ds, int port, in b53_phylink_mac_config() argument
1319 struct b53_device *dev = ds->priv; in b53_phylink_mac_config()
1331 void b53_phylink_mac_an_restart(struct dsa_switch *ds, int port) in b53_phylink_mac_an_restart() argument
1333 struct b53_device *dev = ds->priv; in b53_phylink_mac_an_restart()
1340 void b53_phylink_mac_link_down(struct dsa_switch *ds, int port, in b53_phylink_mac_link_down() argument
1344 struct b53_device *dev = ds->priv; in b53_phylink_mac_link_down()
1360 void b53_phylink_mac_link_up(struct dsa_switch *ds, int port, in b53_phylink_mac_link_up() argument
1367 struct b53_device *dev = ds->priv; in b53_phylink_mac_link_up()
1385 int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering, in b53_vlan_filtering() argument
1388 struct b53_device *dev = ds->priv; in b53_vlan_filtering()
1399 int b53_vlan_prepare(struct dsa_switch *ds, int port, in b53_vlan_prepare() argument
1402 struct b53_device *dev = ds->priv; in b53_vlan_prepare()
1418 b53_enable_vlan(dev, true, ds->vlan_filtering); in b53_vlan_prepare()
1424 void b53_vlan_add(struct dsa_switch *ds, int port, in b53_vlan_add() argument
1427 struct b53_device *dev = ds->priv; in b53_vlan_add()
1442 if (untagged && !dsa_is_cpu_port(ds, port)) in b53_vlan_add()
1451 if (pvid && !dsa_is_cpu_port(ds, port)) { in b53_vlan_add()
1459 int b53_vlan_del(struct dsa_switch *ds, int port, in b53_vlan_del() argument
1462 struct b53_device *dev = ds->priv; in b53_vlan_del()
1480 if (untagged && !dsa_is_cpu_port(ds, port)) in b53_vlan_del()
1655 int b53_fdb_add(struct dsa_switch *ds, int port, in b53_fdb_add() argument
1658 struct b53_device *priv = ds->priv; in b53_fdb_add()
1670 int b53_fdb_del(struct dsa_switch *ds, int port, in b53_fdb_del() argument
1673 struct b53_device *priv = ds->priv; in b53_fdb_del()
1723 int b53_fdb_dump(struct dsa_switch *ds, int port, in b53_fdb_dump() argument
1726 struct b53_device *priv = ds->priv; in b53_fdb_dump()
1762 int b53_mdb_prepare(struct dsa_switch *ds, int port, in b53_mdb_prepare() argument
1765 struct b53_device *priv = ds->priv; in b53_mdb_prepare()
1777 void b53_mdb_add(struct dsa_switch *ds, int port, in b53_mdb_add() argument
1780 struct b53_device *priv = ds->priv; in b53_mdb_add()
1785 dev_err(ds->dev, "failed to add MDB entry\n"); in b53_mdb_add()
1789 int b53_mdb_del(struct dsa_switch *ds, int port, in b53_mdb_del() argument
1792 struct b53_device *priv = ds->priv; in b53_mdb_del()
1797 dev_err(ds->dev, "failed to delete MDB entry\n"); in b53_mdb_del()
1803 int b53_br_join(struct dsa_switch *ds, int port, struct net_device *br) in b53_br_join() argument
1805 struct b53_device *dev = ds->priv; in b53_br_join()
1806 s8 cpu_port = dsa_to_port(ds, port)->cpu_dp->index; in b53_br_join()
1830 if (dsa_to_port(ds, i)->bridge_dev != br) in b53_br_join()
1856 void b53_br_leave(struct dsa_switch *ds, int port, struct net_device *br) in b53_br_leave() argument
1858 struct b53_device *dev = ds->priv; in b53_br_leave()
1860 s8 cpu_port = dsa_to_port(ds, port)->cpu_dp->index; in b53_br_leave()
1868 if (dsa_to_port(ds, i)->bridge_dev != br) in b53_br_leave()
1903 void b53_br_set_stp_state(struct dsa_switch *ds, int port, u8 state) in b53_br_set_stp_state() argument
1905 struct b53_device *dev = ds->priv; in b53_br_set_stp_state()
1926 dev_err(ds->dev, "invalid STP state: %d\n", state); in b53_br_set_stp_state()
1937 void b53_br_fast_age(struct dsa_switch *ds, int port) in b53_br_fast_age() argument
1939 struct b53_device *dev = ds->priv; in b53_br_fast_age()
1942 dev_err(ds->dev, "fast ageing failed\n"); in b53_br_fast_age()
1946 int b53_br_egress_floods(struct dsa_switch *ds, int port, in b53_br_egress_floods() argument
1949 struct b53_device *dev = ds->priv; in b53_br_egress_floods()
1978 static bool b53_possible_cpu_port(struct dsa_switch *ds, int port) in b53_possible_cpu_port() argument
1993 static bool b53_can_enable_brcm_tags(struct dsa_switch *ds, int port, in b53_can_enable_brcm_tags() argument
1996 bool ret = b53_possible_cpu_port(ds, port); in b53_can_enable_brcm_tags()
1999 dev_warn(ds->dev, "Port %d is not Broadcom tag capable\n", in b53_can_enable_brcm_tags()
2007 dev_warn(ds->dev, in b53_can_enable_brcm_tags()
2019 enum dsa_tag_protocol b53_get_tag_protocol(struct dsa_switch *ds, int port, in b53_get_tag_protocol() argument
2022 struct b53_device *dev = ds->priv; in b53_get_tag_protocol()
2028 !b53_can_enable_brcm_tags(ds, port, mprot)) { in b53_get_tag_protocol()
2047 int b53_mirror_add(struct dsa_switch *ds, int port, in b53_mirror_add() argument
2050 struct b53_device *dev = ds->priv; in b53_mirror_add()
2072 void b53_mirror_del(struct dsa_switch *ds, int port, in b53_mirror_del() argument
2075 struct b53_device *dev = ds->priv; in b53_mirror_del()
2111 void b53_eee_enable_set(struct dsa_switch *ds, int port, bool enable) in b53_eee_enable_set() argument
2113 struct b53_device *dev = ds->priv; in b53_eee_enable_set()
2128 int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy) in b53_eee_init() argument
2136 b53_eee_enable_set(ds, port, true); in b53_eee_init()
2142 int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e) in b53_get_mac_eee() argument
2144 struct b53_device *dev = ds->priv; in b53_get_mac_eee()
2159 int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e) in b53_set_mac_eee() argument
2161 struct b53_device *dev = ds->priv; in b53_set_mac_eee()
2168 b53_eee_enable_set(ds, port, e->eee_enabled); in b53_set_mac_eee()
2174 static int b53_change_mtu(struct dsa_switch *ds, int port, int mtu) in b53_change_mtu() argument
2176 struct b53_device *dev = ds->priv; in b53_change_mtu()
2189 static int b53_get_max_mtu(struct dsa_switch *ds, int port) in b53_get_max_mtu() argument
2583 dev->ds->num_ports = min_t(unsigned int, dev->num_ports, DSA_MAX_PORTS); in b53_switch_init()
2588 if (!(dev->ds->phys_mii_mask & BIT(i)) && in b53_switch_init()
2589 !b53_possible_cpu_port(dev->ds, i)) in b53_switch_init()
2590 dev->ds->phys_mii_mask |= BIT(i); in b53_switch_init()
2621 struct dsa_switch *ds; in b53_switch_alloc() local
2624 ds = devm_kzalloc(base, sizeof(*ds), GFP_KERNEL); in b53_switch_alloc()
2625 if (!ds) in b53_switch_alloc()
2628 ds->dev = base; in b53_switch_alloc()
2634 ds->priv = dev; in b53_switch_alloc()
2637 dev->ds = ds; in b53_switch_alloc()
2640 ds->ops = &b53_switch_ops; in b53_switch_alloc()
2641 ds->configure_vlan_while_not_filtering = true; in b53_switch_alloc()
2642 ds->untag_bridge_pvid = true; in b53_switch_alloc()
2643 dev->vlan_enabled = ds->configure_vlan_while_not_filtering; in b53_switch_alloc()
2649 ds->vlan_filtering_is_global = true; in b53_switch_alloc()
2744 return dsa_register_switch(dev->ds); in b53_switch_register()