Lines Matching refs:ds

283 	dev_dbg(dev->ds->dev, "VID: %d, members: 0x%04x, untag: 0x%04x\n",  in b53_set_vlan_entry()
483 void b53_imp_vlan_setup(struct dsa_switch *ds, int cpu_port) in b53_imp_vlan_setup() argument
485 struct b53_device *dev = ds->priv; in b53_imp_vlan_setup()
501 int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy) in b53_enable_port() argument
503 struct b53_device *dev = ds->priv; in b53_enable_port()
504 unsigned int cpu_port = ds->ports[port].cpu_dp->index; in b53_enable_port()
520 b53_imp_vlan_setup(ds, cpu_port); in b53_enable_port()
524 b53_eee_enable_set(ds, port, true); in b53_enable_port()
530 void b53_disable_port(struct dsa_switch *ds, int port, struct phy_device *phy) in b53_disable_port() argument
532 struct b53_device *dev = ds->priv; in b53_disable_port()
542 void b53_brcm_hdr_setup(struct dsa_switch *ds, int port) in b53_brcm_hdr_setup() argument
544 bool tag_en = !(ds->ops->get_tag_protocol(ds, port) == in b53_brcm_hdr_setup()
546 struct b53_device *dev = ds->priv; in b53_brcm_hdr_setup()
613 b53_brcm_hdr_setup(dev->ds, port); in b53_enable_cpu_port()
625 int b53_configure_vlan(struct dsa_switch *ds) in b53_configure_vlan() argument
627 struct b53_device *dev = ds->priv; in b53_configure_vlan()
725 static int b53_phy_read16(struct dsa_switch *ds, int addr, int reg) in b53_phy_read16() argument
727 struct b53_device *priv = ds->priv; in b53_phy_read16()
740 static int b53_phy_write16(struct dsa_switch *ds, int addr, int reg, u16 val) in b53_phy_write16() argument
742 struct b53_device *priv = ds->priv; in b53_phy_write16()
766 b53_configure_vlan(priv->ds); in b53_apply_config()
810 static struct phy_device *b53_get_phy_device(struct dsa_switch *ds, int port) in b53_get_phy_device() argument
820 return mdiobus_get_phy(ds->slave_mii_bus, port); in b53_get_phy_device()
823 void b53_get_strings(struct dsa_switch *ds, int port, u32 stringset, in b53_get_strings() argument
826 struct b53_device *dev = ds->priv; in b53_get_strings()
837 phydev = b53_get_phy_device(ds, port); in b53_get_strings()
846 void b53_get_ethtool_stats(struct dsa_switch *ds, int port, uint64_t *data) in b53_get_ethtool_stats() argument
848 struct b53_device *dev = ds->priv; in b53_get_ethtool_stats()
879 void b53_get_ethtool_phy_stats(struct dsa_switch *ds, int port, uint64_t *data) in b53_get_ethtool_phy_stats() argument
883 phydev = b53_get_phy_device(ds, port); in b53_get_ethtool_phy_stats()
891 int b53_get_sset_count(struct dsa_switch *ds, int port, int sset) in b53_get_sset_count() argument
893 struct b53_device *dev = ds->priv; in b53_get_sset_count()
899 phydev = b53_get_phy_device(ds, port); in b53_get_sset_count()
910 static int b53_setup(struct dsa_switch *ds) in b53_setup() argument
912 struct b53_device *dev = ds->priv; in b53_setup()
918 dev_err(ds->dev, "failed to reset switch\n"); in b53_setup()
926 dev_err(ds->dev, "failed to apply configuration\n"); in b53_setup()
932 if (dsa_is_cpu_port(ds, port)) in b53_setup()
934 else if (dsa_is_unused_port(ds, port)) in b53_setup()
935 b53_disable_port(ds, port, NULL); in b53_setup()
941 static void b53_adjust_link(struct dsa_switch *ds, int port, in b53_adjust_link() argument
944 struct b53_device *dev = ds->priv; in b53_adjust_link()
981 dev_err(ds->dev, "unknown speed: %d\n", phydev->speed); in b53_adjust_link()
1031 dev_info(ds->dev, "Configured port %d for %s\n", port, in b53_adjust_link()
1048 dev_err(ds->dev, in b53_adjust_link()
1069 p->eee_enabled = b53_eee_init(ds, port, phydev); in b53_adjust_link()
1072 int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering) in b53_vlan_filtering() argument
1078 int b53_vlan_prepare(struct dsa_switch *ds, int port, in b53_vlan_prepare() argument
1081 struct b53_device *dev = ds->priv; in b53_vlan_prepare()
1095 void b53_vlan_add(struct dsa_switch *ds, int port, in b53_vlan_add() argument
1098 struct b53_device *dev = ds->priv; in b53_vlan_add()
1110 if (untagged && !dsa_is_cpu_port(ds, port)) in b53_vlan_add()
1127 int b53_vlan_del(struct dsa_switch *ds, int port, in b53_vlan_del() argument
1130 struct b53_device *dev = ds->priv; in b53_vlan_del()
1152 if (untagged && !dsa_is_cpu_port(ds, port)) in b53_vlan_del()
1283 int b53_fdb_add(struct dsa_switch *ds, int port, in b53_fdb_add() argument
1286 struct b53_device *priv = ds->priv; in b53_fdb_add()
1298 int b53_fdb_del(struct dsa_switch *ds, int port, in b53_fdb_del() argument
1301 struct b53_device *priv = ds->priv; in b53_fdb_del()
1351 int b53_fdb_dump(struct dsa_switch *ds, int port, in b53_fdb_dump() argument
1354 struct b53_device *priv = ds->priv; in b53_fdb_dump()
1390 int b53_br_join(struct dsa_switch *ds, int port, struct net_device *br) in b53_br_join() argument
1392 struct b53_device *dev = ds->priv; in b53_br_join()
1393 s8 cpu_port = ds->ports[port].cpu_dp->index; in b53_br_join()
1411 if (dsa_to_port(ds, i)->bridge_dev != br) in b53_br_join()
1435 void b53_br_leave(struct dsa_switch *ds, int port, struct net_device *br) in b53_br_leave() argument
1437 struct b53_device *dev = ds->priv; in b53_br_leave()
1439 s8 cpu_port = ds->ports[port].cpu_dp->index; in b53_br_leave()
1447 if (dsa_to_port(ds, i)->bridge_dev != br) in b53_br_leave()
1484 void b53_br_set_stp_state(struct dsa_switch *ds, int port, u8 state) in b53_br_set_stp_state() argument
1486 struct b53_device *dev = ds->priv; in b53_br_set_stp_state()
1507 dev_err(ds->dev, "invalid STP state: %d\n", state); in b53_br_set_stp_state()
1518 void b53_br_fast_age(struct dsa_switch *ds, int port) in b53_br_fast_age() argument
1520 struct b53_device *dev = ds->priv; in b53_br_fast_age()
1523 dev_err(ds->dev, "fast ageing failed\n"); in b53_br_fast_age()
1527 static bool b53_possible_cpu_port(struct dsa_switch *ds, int port) in b53_possible_cpu_port() argument
1542 static bool b53_can_enable_brcm_tags(struct dsa_switch *ds, int port) in b53_can_enable_brcm_tags() argument
1544 bool ret = b53_possible_cpu_port(ds, port); in b53_can_enable_brcm_tags()
1547 dev_warn(ds->dev, "Port %d is not Broadcom tag capable\n", in b53_can_enable_brcm_tags()
1552 enum dsa_tag_protocol b53_get_tag_protocol(struct dsa_switch *ds, int port) in b53_get_tag_protocol() argument
1554 struct b53_device *dev = ds->priv; in b53_get_tag_protocol()
1562 !b53_can_enable_brcm_tags(ds, port)) in b53_get_tag_protocol()
1575 int b53_mirror_add(struct dsa_switch *ds, int port, in b53_mirror_add() argument
1578 struct b53_device *dev = ds->priv; in b53_mirror_add()
1601 void b53_mirror_del(struct dsa_switch *ds, int port, in b53_mirror_del() argument
1604 struct b53_device *dev = ds->priv; in b53_mirror_del()
1640 void b53_eee_enable_set(struct dsa_switch *ds, int port, bool enable) in b53_eee_enable_set() argument
1642 struct b53_device *dev = ds->priv; in b53_eee_enable_set()
1657 int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy) in b53_eee_init() argument
1665 b53_eee_enable_set(ds, port, true); in b53_eee_init()
1671 int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e) in b53_get_mac_eee() argument
1673 struct b53_device *dev = ds->priv; in b53_get_mac_eee()
1688 int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e) in b53_set_mac_eee() argument
1690 struct b53_device *dev = ds->priv; in b53_set_mac_eee()
1697 b53_eee_enable_set(ds, port, e->eee_enabled); in b53_set_mac_eee()
2041 if (!(dev->ds->phys_mii_mask & BIT(i)) && in b53_switch_init()
2042 !b53_possible_cpu_port(dev->ds, i)) in b53_switch_init()
2043 dev->ds->phys_mii_mask |= BIT(i); in b53_switch_init()
2074 struct dsa_switch *ds; in b53_switch_alloc() local
2077 ds = dsa_switch_alloc(base, DSA_MAX_PORTS); in b53_switch_alloc()
2078 if (!ds) in b53_switch_alloc()
2085 ds->priv = dev; in b53_switch_alloc()
2088 dev->ds = ds; in b53_switch_alloc()
2091 ds->ops = &b53_switch_ops; in b53_switch_alloc()
2183 return dsa_register_switch(dev->ds); in b53_switch_register()