Lines Matching refs:ds
471 static int mv88e6xxx_phy_is_internal(struct dsa_switch *ds, int port) in mv88e6xxx_phy_is_internal() argument
473 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_phy_is_internal()
557 static void mv88e6xxx_validate(struct dsa_switch *ds, int port, in mv88e6xxx_validate() argument
562 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_validate()
582 static int mv88e6xxx_link_state(struct dsa_switch *ds, int port, in mv88e6xxx_link_state() argument
585 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_link_state()
598 static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port, in mv88e6xxx_mac_config() argument
602 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_mac_config()
605 if ((mode == MLO_AN_PHY) && mv88e6xxx_phy_is_internal(ds, port)) in mv88e6xxx_mac_config()
612 } else if (!mv88e6xxx_phy_is_internal(ds, port)) { in mv88e6xxx_mac_config()
629 dev_err(ds->dev, "p%d: failed to configure MAC\n", port); in mv88e6xxx_mac_config()
632 static void mv88e6xxx_mac_link_force(struct dsa_switch *ds, int port, int link) in mv88e6xxx_mac_link_force() argument
634 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_mac_link_force()
645 static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port, in mv88e6xxx_mac_link_down() argument
650 mv88e6xxx_mac_link_force(ds, port, LINK_FORCED_DOWN); in mv88e6xxx_mac_link_down()
653 static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port, in mv88e6xxx_mac_link_up() argument
658 mv88e6xxx_mac_link_force(ds, port, LINK_FORCED_UP); in mv88e6xxx_mac_link_up()
828 static void mv88e6xxx_get_strings(struct dsa_switch *ds, int port, in mv88e6xxx_get_strings() argument
831 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_get_strings()
884 static int mv88e6xxx_get_sset_count(struct dsa_switch *ds, int port, int sset) in mv88e6xxx_get_sset_count() argument
886 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_get_sset_count()
998 static void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, int port, in mv88e6xxx_get_ethtool_stats() argument
1001 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_get_ethtool_stats()
1016 static int mv88e6xxx_get_regs_len(struct dsa_switch *ds, int port) in mv88e6xxx_get_regs_len() argument
1021 static void mv88e6xxx_get_regs(struct dsa_switch *ds, int port, in mv88e6xxx_get_regs() argument
1024 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_get_regs()
1046 static int mv88e6xxx_get_mac_eee(struct dsa_switch *ds, int port, in mv88e6xxx_get_mac_eee() argument
1053 static int mv88e6xxx_set_mac_eee(struct dsa_switch *ds, int port, in mv88e6xxx_set_mac_eee() argument
1062 struct dsa_switch *ds = NULL; in mv88e6xxx_port_vlan() local
1068 ds = chip->ds->dst->ds[dev]; in mv88e6xxx_port_vlan()
1071 if (!ds || port >= ds->num_ports) in mv88e6xxx_port_vlan()
1075 if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)) in mv88e6xxx_port_vlan()
1078 br = ds->ports[port].bridge_dev; in mv88e6xxx_port_vlan()
1085 if (dsa_is_cpu_port(chip->ds, i) || in mv88e6xxx_port_vlan()
1086 dsa_is_dsa_port(chip->ds, i) || in mv88e6xxx_port_vlan()
1087 (br && dsa_to_port(chip->ds, i)->bridge_dev == br)) in mv88e6xxx_port_vlan()
1095 u16 output_ports = mv88e6xxx_port_vlan(chip, chip->ds->index, port); in mv88e6xxx_port_vlan_map()
1103 static void mv88e6xxx_port_stp_state_set(struct dsa_switch *ds, int port, in mv88e6xxx_port_stp_state_set() argument
1106 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_stp_state_set()
1114 dev_err(ds->dev, "p%d: failed to update state\n", port); in mv88e6xxx_port_stp_state_set()
1148 if (chip->ds->rtable[target] != DSA_RTABLE_NONE) in mv88e6xxx_devmap_setup()
1149 port = chip->ds->rtable[target]; in mv88e6xxx_devmap_setup()
1163 err = mv88e6xxx_g1_set_device_number(chip, chip->ds->index); in mv88e6xxx_devmap_setup()
1259 if (dev != chip->ds->index) in mv88e6xxx_pvt_map()
1291 static void mv88e6xxx_port_fast_age(struct dsa_switch *ds, int port) in mv88e6xxx_port_fast_age() argument
1293 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_fast_age()
1301 dev_err(ds->dev, "p%d: failed to flush ATU\n", port); in mv88e6xxx_port_fast_age()
1373 static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port, in mv88e6xxx_port_check_hw_vlan() argument
1376 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_check_hw_vlan()
1381 if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port)) in mv88e6xxx_port_check_hw_vlan()
1402 if (dsa_is_dsa_port(ds, i) || dsa_is_cpu_port(ds, i)) in mv88e6xxx_port_check_hw_vlan()
1405 if (!ds->ports[i].slave) in mv88e6xxx_port_check_hw_vlan()
1412 if (dsa_to_port(ds, i)->bridge_dev == in mv88e6xxx_port_check_hw_vlan()
1413 ds->ports[port].bridge_dev) in mv88e6xxx_port_check_hw_vlan()
1416 if (!dsa_to_port(ds, i)->bridge_dev) in mv88e6xxx_port_check_hw_vlan()
1419 dev_err(ds->dev, "p%d: hw VLAN %d already used by port %d in %s\n", in mv88e6xxx_port_check_hw_vlan()
1421 netdev_name(dsa_to_port(ds, i)->bridge_dev)); in mv88e6xxx_port_check_hw_vlan()
1429 static int mv88e6xxx_port_vlan_filtering(struct dsa_switch *ds, int port, in mv88e6xxx_port_vlan_filtering() argument
1432 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_vlan_filtering()
1448 mv88e6xxx_port_vlan_prepare(struct dsa_switch *ds, int port, in mv88e6xxx_port_vlan_prepare() argument
1451 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_vlan_prepare()
1461 err = mv88e6xxx_port_check_hw_vlan(ds, port, vlan->vid_begin, in mv88e6xxx_port_vlan_prepare()
1657 static int mv88e6xxx_get_rxnfc(struct dsa_switch *ds, int port, in mv88e6xxx_get_rxnfc() argument
1661 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_get_rxnfc()
1704 static int mv88e6xxx_set_rxnfc(struct dsa_switch *ds, int port, in mv88e6xxx_set_rxnfc() argument
1708 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_set_rxnfc()
1814 static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port, in mv88e6xxx_port_vlan_add() argument
1817 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_vlan_add()
1826 if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port)) in mv88e6xxx_port_vlan_add()
1837 dev_err(ds->dev, "p%d: failed to add VLAN %d%c\n", port, in mv88e6xxx_port_vlan_add()
1841 dev_err(ds->dev, "p%d: failed to set PVID %d\n", port, in mv88e6xxx_port_vlan_add()
1889 static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port, in mv88e6xxx_port_vlan_del() argument
1892 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_vlan_del()
1923 static int mv88e6xxx_port_fdb_add(struct dsa_switch *ds, int port, in mv88e6xxx_port_fdb_add() argument
1926 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_fdb_add()
1937 static int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port, in mv88e6xxx_port_fdb_del() argument
1940 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_fdb_del()
2022 static int mv88e6xxx_port_fdb_dump(struct dsa_switch *ds, int port, in mv88e6xxx_port_fdb_dump() argument
2025 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_fdb_dump()
2038 struct dsa_switch *ds; in mv88e6xxx_bridge_map() local
2045 if (chip->ds->ports[port].bridge_dev == br) { in mv88e6xxx_bridge_map()
2057 ds = chip->ds->dst->ds[dev]; in mv88e6xxx_bridge_map()
2058 if (!ds) in mv88e6xxx_bridge_map()
2061 for (port = 0; port < ds->num_ports; ++port) { in mv88e6xxx_bridge_map()
2062 if (ds->ports[port].bridge_dev == br) { in mv88e6xxx_bridge_map()
2073 static int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port, in mv88e6xxx_port_bridge_join() argument
2076 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_bridge_join()
2086 static void mv88e6xxx_port_bridge_leave(struct dsa_switch *ds, int port, in mv88e6xxx_port_bridge_leave() argument
2089 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_bridge_leave()
2094 dev_err(ds->dev, "failed to remap in-chip Port VLAN\n"); in mv88e6xxx_port_bridge_leave()
2098 static int mv88e6xxx_crosschip_bridge_join(struct dsa_switch *ds, int dev, in mv88e6xxx_crosschip_bridge_join() argument
2101 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_crosschip_bridge_join()
2114 static void mv88e6xxx_crosschip_bridge_leave(struct dsa_switch *ds, int dev, in mv88e6xxx_crosschip_bridge_leave() argument
2117 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_crosschip_bridge_leave()
2124 dev_err(ds->dev, "failed to remap cross-chip Port VLAN\n"); in mv88e6xxx_crosschip_bridge_leave()
2228 if (dsa_is_dsa_port(chip->ds, port)) in mv88e6xxx_setup_port_mode()
2231 if (dsa_is_user_port(chip->ds, port)) in mv88e6xxx_setup_port_mode()
2246 bool message = dsa_is_dsa_port(chip->ds, port); in mv88e6xxx_setup_message_port()
2253 struct dsa_switch *ds = chip->ds; in mv88e6xxx_setup_egress_floods() local
2257 flood = dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port); in mv88e6xxx_setup_egress_floods()
2359 struct dsa_switch *ds = chip->ds; in mv88e6xxx_setup_upstream_port() local
2363 upstream_port = dsa_upstream_port(ds, port); in mv88e6xxx_setup_upstream_port()
2392 struct dsa_switch *ds = chip->ds; in mv88e6xxx_setup_port() local
2403 if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)) in mv88e6xxx_setup_port()
2477 if (dsa_is_cpu_port(ds, port)) in mv88e6xxx_setup_port()
2545 static int mv88e6xxx_port_enable(struct dsa_switch *ds, int port, in mv88e6xxx_port_enable() argument
2548 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_enable()
2558 static void mv88e6xxx_port_disable(struct dsa_switch *ds, int port) in mv88e6xxx_port_disable() argument
2560 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_disable()
2568 static int mv88e6xxx_set_ageing_time(struct dsa_switch *ds, in mv88e6xxx_set_ageing_time() argument
2571 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_set_ageing_time()
2644 static int mv88e6xxx_setup(struct dsa_switch *ds) in mv88e6xxx_setup() argument
2646 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_setup()
2651 chip->ds = ds; in mv88e6xxx_setup()
2652 ds->slave_mii_bus = mv88e6xxx_default_mdio_bus(chip); in mv88e6xxx_setup()
2675 if (dsa_is_unused_port(ds, i)) in mv88e6xxx_setup()
2933 static int mv88e6xxx_get_eeprom_len(struct dsa_switch *ds) in mv88e6xxx_get_eeprom_len() argument
2935 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_get_eeprom_len()
2940 static int mv88e6xxx_get_eeprom(struct dsa_switch *ds, in mv88e6xxx_get_eeprom() argument
2943 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_get_eeprom()
2961 static int mv88e6xxx_set_eeprom(struct dsa_switch *ds, in mv88e6xxx_set_eeprom() argument
2964 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_set_eeprom()
4873 static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds, in mv88e6xxx_get_tag_protocol() argument
4876 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_get_tag_protocol()
4881 static int mv88e6xxx_port_mdb_prepare(struct dsa_switch *ds, int port, in mv88e6xxx_port_mdb_prepare() argument
4891 static void mv88e6xxx_port_mdb_add(struct dsa_switch *ds, int port, in mv88e6xxx_port_mdb_add() argument
4894 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_mdb_add()
4899 dev_err(ds->dev, "p%d: failed to load multicast MAC address\n", in mv88e6xxx_port_mdb_add()
4904 static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port, in mv88e6xxx_port_mdb_del() argument
4907 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_mdb_del()
4917 static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port, in mv88e6xxx_port_egress_floods() argument
4920 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_port_egress_floods()
4983 struct dsa_switch *ds; in mv88e6xxx_register_switch() local
4985 ds = dsa_switch_alloc(dev, mv88e6xxx_num_ports(chip)); in mv88e6xxx_register_switch()
4986 if (!ds) in mv88e6xxx_register_switch()
4989 ds->priv = chip; in mv88e6xxx_register_switch()
4990 ds->dev = dev; in mv88e6xxx_register_switch()
4991 ds->ops = &mv88e6xxx_switch_ops; in mv88e6xxx_register_switch()
4992 ds->ageing_time_min = chip->info->age_time_coeff; in mv88e6xxx_register_switch()
4993 ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; in mv88e6xxx_register_switch()
4995 dev_set_drvdata(dev, ds); in mv88e6xxx_register_switch()
4997 return dsa_register_switch(ds); in mv88e6xxx_register_switch()
5002 dsa_unregister_switch(chip->ds); in mv88e6xxx_unregister_switch()
5180 struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev); in mv88e6xxx_remove() local
5181 struct mv88e6xxx_chip *chip = ds->priv; in mv88e6xxx_remove()