Lines Matching full:ds
45 static int felix_cpu_port_for_conduit(struct dsa_switch *ds, in felix_cpu_port_for_conduit() argument
48 struct ocelot *ocelot = ds->priv; in felix_cpu_port_for_conduit()
101 static int felix_tag_8021q_vlan_add_rx(struct dsa_switch *ds, int port, in felix_tag_8021q_vlan_add_rx() argument
106 struct ocelot *ocelot = ds->priv; in felix_tag_8021q_vlan_add_rx()
150 static int felix_tag_8021q_vlan_del_rx(struct dsa_switch *ds, int port, in felix_tag_8021q_vlan_del_rx() argument
155 struct ocelot *ocelot = ds->priv; in felix_tag_8021q_vlan_del_rx()
172 static int felix_tag_8021q_vlan_add_tx(struct dsa_switch *ds, int port, in felix_tag_8021q_vlan_add_tx() argument
176 unsigned long cpu_ports = dsa_cpu_ports(ds); in felix_tag_8021q_vlan_add_tx()
177 struct ocelot *ocelot = ds->priv; in felix_tag_8021q_vlan_add_tx()
239 static int felix_tag_8021q_vlan_del_tx(struct dsa_switch *ds, int port, u16 vid) in felix_tag_8021q_vlan_del_tx() argument
244 struct ocelot *ocelot = ds->priv; in felix_tag_8021q_vlan_del_tx()
270 static int felix_tag_8021q_vlan_add(struct dsa_switch *ds, int port, u16 vid, in felix_tag_8021q_vlan_add() argument
273 struct dsa_port *dp = dsa_to_port(ds, port); in felix_tag_8021q_vlan_add()
284 dsa_switch_for_each_cpu_port(cpu_dp, ds) { in felix_tag_8021q_vlan_add()
285 err = felix_tag_8021q_vlan_add_rx(ds, port, cpu_dp->index, vid, in felix_tag_8021q_vlan_add()
291 err = felix_tag_8021q_vlan_add_tx(ds, port, vid); in felix_tag_8021q_vlan_add()
298 dsa_switch_for_each_cpu_port(cpu_dp, ds) in felix_tag_8021q_vlan_add()
299 felix_tag_8021q_vlan_del_rx(ds, port, cpu_dp->index, vid); in felix_tag_8021q_vlan_add()
304 static int felix_tag_8021q_vlan_del(struct dsa_switch *ds, int port, u16 vid) in felix_tag_8021q_vlan_del() argument
306 struct dsa_port *dp = dsa_to_port(ds, port); in felix_tag_8021q_vlan_del()
313 dsa_switch_for_each_cpu_port(cpu_dp, ds) { in felix_tag_8021q_vlan_del()
314 err = felix_tag_8021q_vlan_del_rx(ds, port, cpu_dp->index, vid); in felix_tag_8021q_vlan_del()
319 err = felix_tag_8021q_vlan_del_tx(ds, port, vid); in felix_tag_8021q_vlan_del()
326 dsa_switch_for_each_cpu_port(cpu_dp, ds) in felix_tag_8021q_vlan_del()
327 felix_tag_8021q_vlan_add_rx(ds, port, cpu_dp->index, vid, in felix_tag_8021q_vlan_del()
333 static int felix_update_tag_8021q_rx_rules(struct dsa_switch *ds, int port, in felix_update_tag_8021q_rx_rules() argument
338 struct ocelot *ocelot = ds->priv; in felix_update_tag_8021q_rx_rules()
345 dsa_switch_for_each_cpu_port(cpu_dp, ds) { in felix_update_tag_8021q_rx_rules()
362 static int felix_trap_get_cpu_port(struct dsa_switch *ds, in felix_trap_get_cpu_port() argument
372 dp = dsa_to_port(ds, first_port); in felix_trap_get_cpu_port()
381 static int felix_update_trapping_destinations(struct dsa_switch *ds, in felix_update_trapping_destinations() argument
384 struct ocelot *ocelot = ds->priv; in felix_update_trapping_destinations()
413 port_mask = BIT(felix_trap_get_cpu_port(ds, trap)); in felix_update_trapping_destinations()
484 static int felix_tag_npi_setup(struct dsa_switch *ds) in felix_tag_npi_setup() argument
487 struct ocelot *ocelot = ds->priv; in felix_tag_npi_setup()
489 dsa_switch_for_each_user_port(dp, ds) { in felix_tag_npi_setup()
491 dev_err(ds->dev, "Multiple NPI ports not supported\n"); in felix_tag_npi_setup()
506 static void felix_tag_npi_teardown(struct dsa_switch *ds) in felix_tag_npi_teardown() argument
508 struct ocelot *ocelot = ds->priv; in felix_tag_npi_teardown()
513 static unsigned long felix_tag_npi_get_host_fwd_mask(struct dsa_switch *ds) in felix_tag_npi_get_host_fwd_mask() argument
515 struct ocelot *ocelot = ds->priv; in felix_tag_npi_get_host_fwd_mask()
520 static int felix_tag_npi_change_conduit(struct dsa_switch *ds, int port, in felix_tag_npi_change_conduit() argument
524 struct dsa_port *dp = dsa_to_port(ds, port), *other_dp; in felix_tag_npi_change_conduit()
525 struct ocelot *ocelot = ds->priv; in felix_tag_npi_change_conduit()
537 dsa_switch_for_each_user_port(other_dp, ds) { in felix_tag_npi_change_conduit()
549 felix_npi_port_init(ocelot, felix_cpu_port_for_conduit(ds, conduit)); in felix_tag_npi_change_conduit()
568 static int felix_tag_8021q_setup(struct dsa_switch *ds) in felix_tag_8021q_setup() argument
570 struct ocelot *ocelot = ds->priv; in felix_tag_8021q_setup()
574 err = dsa_tag_8021q_register(ds, htons(ETH_P_8021AD)); in felix_tag_8021q_setup()
578 dsa_switch_for_each_cpu_port(dp, ds) in felix_tag_8021q_setup()
581 dsa_switch_for_each_user_port(dp, ds) in felix_tag_8021q_setup()
585 dsa_switch_for_each_available_port(dp, ds) in felix_tag_8021q_setup()
619 ds->untag_vlan_aware_bridge_pvid = true; in felix_tag_8021q_setup()
624 static void felix_tag_8021q_teardown(struct dsa_switch *ds) in felix_tag_8021q_teardown() argument
626 struct ocelot *ocelot = ds->priv; in felix_tag_8021q_teardown()
629 dsa_switch_for_each_available_port(dp, ds) in felix_tag_8021q_teardown()
638 dsa_switch_for_each_user_port(dp, ds) in felix_tag_8021q_teardown()
641 dsa_switch_for_each_cpu_port(dp, ds) in felix_tag_8021q_teardown()
644 dsa_tag_8021q_unregister(ds); in felix_tag_8021q_teardown()
646 ds->untag_vlan_aware_bridge_pvid = false; in felix_tag_8021q_teardown()
649 static unsigned long felix_tag_8021q_get_host_fwd_mask(struct dsa_switch *ds) in felix_tag_8021q_get_host_fwd_mask() argument
651 return dsa_cpu_ports(ds); in felix_tag_8021q_get_host_fwd_mask()
654 static int felix_tag_8021q_change_conduit(struct dsa_switch *ds, int port, in felix_tag_8021q_change_conduit() argument
658 int cpu = felix_cpu_port_for_conduit(ds, conduit); in felix_tag_8021q_change_conduit()
659 struct ocelot *ocelot = ds->priv; in felix_tag_8021q_change_conduit()
664 return felix_update_trapping_destinations(ds, true); in felix_tag_8021q_change_conduit()
674 static void felix_set_host_flood(struct dsa_switch *ds, unsigned long mask, in felix_set_host_flood() argument
677 struct ocelot *ocelot = ds->priv; in felix_set_host_flood()
693 felix_migrate_host_flood(struct dsa_switch *ds, in felix_migrate_host_flood() argument
697 struct ocelot *ocelot = ds->priv; in felix_migrate_host_flood()
702 mask = old_proto_ops->get_host_fwd_mask(ds); in felix_migrate_host_flood()
703 felix_set_host_flood(ds, mask, false, false, false); in felix_migrate_host_flood()
706 mask = proto_ops->get_host_fwd_mask(ds); in felix_migrate_host_flood()
707 felix_set_host_flood(ds, mask, !!felix->host_flood_uc_mask, in felix_migrate_host_flood()
711 static int felix_migrate_mdbs(struct dsa_switch *ds, in felix_migrate_mdbs() argument
715 struct ocelot *ocelot = ds->priv; in felix_migrate_mdbs()
721 from = old_proto_ops->get_host_fwd_mask(ds); in felix_migrate_mdbs()
722 to = proto_ops->get_host_fwd_mask(ds); in felix_migrate_mdbs()
733 felix_tag_proto_setup_shared(struct dsa_switch *ds, in felix_tag_proto_setup_shared() argument
740 err = felix_migrate_mdbs(ds, proto_ops, old_proto_ops); in felix_tag_proto_setup_shared()
744 felix_update_trapping_destinations(ds, using_tag_8021q); in felix_tag_proto_setup_shared()
746 felix_migrate_host_flood(ds, proto_ops, old_proto_ops); in felix_tag_proto_setup_shared()
755 static int felix_change_tag_protocol(struct dsa_switch *ds, in felix_change_tag_protocol() argument
759 struct ocelot *ocelot = ds->priv; in felix_change_tag_protocol()
780 err = proto_ops->setup(ds); in felix_change_tag_protocol()
784 err = felix_tag_proto_setup_shared(ds, proto_ops, old_proto_ops); in felix_change_tag_protocol()
789 old_proto_ops->teardown(ds); in felix_change_tag_protocol()
797 proto_ops->teardown(ds); in felix_change_tag_protocol()
802 static enum dsa_tag_protocol felix_get_tag_protocol(struct dsa_switch *ds, in felix_get_tag_protocol() argument
806 struct ocelot *ocelot = ds->priv; in felix_get_tag_protocol()
812 static void felix_port_set_host_flood(struct dsa_switch *ds, int port, in felix_port_set_host_flood() argument
815 struct ocelot *ocelot = ds->priv; in felix_port_set_host_flood()
829 mask = felix->tag_proto_ops->get_host_fwd_mask(ds); in felix_port_set_host_flood()
830 felix_set_host_flood(ds, mask, !!felix->host_flood_uc_mask, in felix_port_set_host_flood()
834 static int felix_port_change_conduit(struct dsa_switch *ds, int port, in felix_port_change_conduit() argument
838 struct ocelot *ocelot = ds->priv; in felix_port_change_conduit()
841 return felix->tag_proto_ops->change_conduit(ds, port, conduit, extack); in felix_port_change_conduit()
844 static int felix_set_ageing_time(struct dsa_switch *ds, in felix_set_ageing_time() argument
847 struct ocelot *ocelot = ds->priv; in felix_set_ageing_time()
854 static void felix_port_fast_age(struct dsa_switch *ds, int port) in felix_port_fast_age() argument
856 struct ocelot *ocelot = ds->priv; in felix_port_fast_age()
861 dev_err(ds->dev, "Flushing MAC table on port %d returned %pe\n", in felix_port_fast_age()
865 static int felix_fdb_dump(struct dsa_switch *ds, int port, in felix_fdb_dump() argument
868 struct ocelot *ocelot = ds->priv; in felix_fdb_dump()
873 static int felix_fdb_add(struct dsa_switch *ds, int port, in felix_fdb_add() argument
878 struct dsa_port *dp = dsa_to_port(ds, port); in felix_fdb_add()
879 struct ocelot *ocelot = ds->priv; in felix_fdb_add()
885 dsa_fdb_present_in_other_db(ds, port, addr, vid, db)) in felix_fdb_add()
894 static int felix_fdb_del(struct dsa_switch *ds, int port, in felix_fdb_del() argument
899 struct dsa_port *dp = dsa_to_port(ds, port); in felix_fdb_del()
900 struct ocelot *ocelot = ds->priv; in felix_fdb_del()
906 dsa_fdb_present_in_other_db(ds, port, addr, vid, db)) in felix_fdb_del()
915 static int felix_lag_fdb_add(struct dsa_switch *ds, struct dsa_lag lag, in felix_lag_fdb_add() argument
920 struct ocelot *ocelot = ds->priv; in felix_lag_fdb_add()
928 static int felix_lag_fdb_del(struct dsa_switch *ds, struct dsa_lag lag, in felix_lag_fdb_del() argument
933 struct ocelot *ocelot = ds->priv; in felix_lag_fdb_del()
941 static int felix_mdb_add(struct dsa_switch *ds, int port, in felix_mdb_add() argument
946 struct ocelot *ocelot = ds->priv; in felix_mdb_add()
951 if (dsa_is_cpu_port(ds, port) && !bridge_dev && in felix_mdb_add()
952 dsa_mdb_present_in_other_db(ds, port, mdb, db)) in felix_mdb_add()
961 static int felix_mdb_del(struct dsa_switch *ds, int port, in felix_mdb_del() argument
966 struct ocelot *ocelot = ds->priv; in felix_mdb_del()
971 if (dsa_is_cpu_port(ds, port) && !bridge_dev && in felix_mdb_del()
972 dsa_mdb_present_in_other_db(ds, port, mdb, db)) in felix_mdb_del()
981 static void felix_bridge_stp_state_set(struct dsa_switch *ds, int port, in felix_bridge_stp_state_set() argument
984 struct ocelot *ocelot = ds->priv; in felix_bridge_stp_state_set()
989 static int felix_pre_bridge_flags(struct dsa_switch *ds, int port, in felix_pre_bridge_flags() argument
993 struct ocelot *ocelot = ds->priv; in felix_pre_bridge_flags()
998 static int felix_bridge_flags(struct dsa_switch *ds, int port, in felix_bridge_flags() argument
1002 struct ocelot *ocelot = ds->priv; in felix_bridge_flags()
1012 static int felix_bridge_join(struct dsa_switch *ds, int port, in felix_bridge_join() argument
1016 struct ocelot *ocelot = ds->priv; in felix_bridge_join()
1022 static void felix_bridge_leave(struct dsa_switch *ds, int port, in felix_bridge_leave() argument
1025 struct ocelot *ocelot = ds->priv; in felix_bridge_leave()
1030 static int felix_lag_join(struct dsa_switch *ds, int port, in felix_lag_join() argument
1035 struct ocelot *ocelot = ds->priv; in felix_lag_join()
1043 if (!dsa_is_cpu_port(ds, port)) in felix_lag_join()
1046 return felix_port_change_conduit(ds, port, lag.dev, extack); in felix_lag_join()
1049 static int felix_lag_leave(struct dsa_switch *ds, int port, in felix_lag_leave() argument
1052 struct ocelot *ocelot = ds->priv; in felix_lag_leave()
1057 if (!dsa_is_cpu_port(ds, port)) in felix_lag_leave()
1060 return felix_port_change_conduit(ds, port, lag.dev, NULL); in felix_lag_leave()
1063 static int felix_lag_change(struct dsa_switch *ds, int port) in felix_lag_change() argument
1065 struct dsa_port *dp = dsa_to_port(ds, port); in felix_lag_change()
1066 struct ocelot *ocelot = ds->priv; in felix_lag_change()
1073 static int felix_vlan_prepare(struct dsa_switch *ds, int port, in felix_vlan_prepare() argument
1077 struct ocelot *ocelot = ds->priv; in felix_vlan_prepare()
1097 static int felix_vlan_filtering(struct dsa_switch *ds, int port, bool enabled, in felix_vlan_filtering() argument
1100 struct ocelot *ocelot = ds->priv; in felix_vlan_filtering()
1112 err = felix_update_tag_8021q_rx_rules(ds, port, enabled); in felix_vlan_filtering()
1120 static int felix_vlan_add(struct dsa_switch *ds, int port, in felix_vlan_add() argument
1124 struct ocelot *ocelot = ds->priv; in felix_vlan_add()
1128 err = felix_vlan_prepare(ds, port, vlan, extack); in felix_vlan_add()
1137 static int felix_vlan_del(struct dsa_switch *ds, int port, in felix_vlan_del() argument
1140 struct ocelot *ocelot = ds->priv; in felix_vlan_del()
1145 static void felix_phylink_get_caps(struct dsa_switch *ds, int port, in felix_phylink_get_caps() argument
1148 struct ocelot *ocelot = ds->priv; in felix_phylink_get_caps()
1163 struct ocelot *ocelot = dp->ds->priv; in felix_phylink_mac_config()
1178 struct ocelot *ocelot = dp->ds->priv; in felix_phylink_mac_select_pcs()
1196 struct ocelot *ocelot = dp->ds->priv; in felix_phylink_mac_link_down()
1214 struct ocelot *ocelot = dp->ds->priv; in felix_phylink_mac_link_up()
1228 static int felix_port_enable(struct dsa_switch *ds, int port, in felix_port_enable() argument
1231 struct dsa_port *dp = dsa_to_port(ds, port); in felix_port_enable()
1232 struct ocelot *ocelot = ds->priv; in felix_port_enable()
1240 if (felix_cpu_port_for_conduit(ds, conduit) != ocelot->npi) { in felix_port_enable()
1241 dev_err(ds->dev, "Multiple conduits are not allowed\n"); in felix_port_enable()
1270 static void felix_get_stats64(struct dsa_switch *ds, int port, in felix_get_stats64() argument
1273 struct ocelot *ocelot = ds->priv; in felix_get_stats64()
1278 static void felix_get_pause_stats(struct dsa_switch *ds, int port, in felix_get_pause_stats() argument
1281 struct ocelot *ocelot = ds->priv; in felix_get_pause_stats()
1286 static void felix_get_rmon_stats(struct dsa_switch *ds, int port, in felix_get_rmon_stats() argument
1290 struct ocelot *ocelot = ds->priv; in felix_get_rmon_stats()
1295 static void felix_get_eth_ctrl_stats(struct dsa_switch *ds, int port, in felix_get_eth_ctrl_stats() argument
1298 struct ocelot *ocelot = ds->priv; in felix_get_eth_ctrl_stats()
1303 static void felix_get_eth_mac_stats(struct dsa_switch *ds, int port, in felix_get_eth_mac_stats() argument
1306 struct ocelot *ocelot = ds->priv; in felix_get_eth_mac_stats()
1311 static void felix_get_eth_phy_stats(struct dsa_switch *ds, int port, in felix_get_eth_phy_stats() argument
1314 struct ocelot *ocelot = ds->priv; in felix_get_eth_phy_stats()
1319 static void felix_get_ts_stats(struct dsa_switch *ds, int port, in felix_get_ts_stats() argument
1322 struct ocelot *ocelot = ds->priv; in felix_get_ts_stats()
1327 static void felix_get_strings(struct dsa_switch *ds, int port, in felix_get_strings() argument
1330 struct ocelot *ocelot = ds->priv; in felix_get_strings()
1335 static void felix_get_ethtool_stats(struct dsa_switch *ds, int port, u64 *data) in felix_get_ethtool_stats() argument
1337 struct ocelot *ocelot = ds->priv; in felix_get_ethtool_stats()
1342 static int felix_get_sset_count(struct dsa_switch *ds, int port, int sset) in felix_get_sset_count() argument
1344 struct ocelot *ocelot = ds->priv; in felix_get_sset_count()
1349 static int felix_get_ts_info(struct dsa_switch *ds, int port, in felix_get_ts_info() argument
1352 struct ocelot *ocelot = ds->priv; in felix_get_ts_info()
1518 ocelot->devlink = felix->ds->devlink; in felix_init_structs()
1624 struct dsa_switch *ds = xmit_work->dp->ds; in felix_port_deferred_xmit() local
1627 struct ocelot *ocelot = ds->priv; in felix_port_deferred_xmit()
1657 static int felix_connect_tag_protocol(struct dsa_switch *ds, in felix_connect_tag_protocol() argument
1664 tagger_data = ocelot_8021q_tagger_data(ds); in felix_connect_tag_protocol()
1675 static int felix_setup(struct dsa_switch *ds) in felix_setup() argument
1677 struct ocelot *ocelot = ds->priv; in felix_setup()
1682 err = felix_init_structs(felix, ds->num_ports); in felix_setup()
1702 dsa_switch_for_each_available_port(dp, ds) { in felix_setup()
1731 felix_change_tag_protocol(ds, felix->tag_proto); in felix_setup()
1733 ds->mtu_enforcement_ingress = true; in felix_setup()
1734 ds->assisted_learning_on_cpu_port = true; in felix_setup()
1735 ds->fdb_isolation = true; in felix_setup()
1736 ds->max_num_bridges = ds->num_ports; in felix_setup()
1741 dsa_switch_for_each_available_port(dp, ds) in felix_setup()
1754 static void felix_teardown(struct dsa_switch *ds) in felix_teardown() argument
1756 struct ocelot *ocelot = ds->priv; in felix_teardown()
1762 felix->tag_proto_ops->teardown(ds); in felix_teardown()
1765 dsa_switch_for_each_available_port(dp, ds) in felix_teardown()
1776 static int felix_hwtstamp_get(struct dsa_switch *ds, int port, in felix_hwtstamp_get() argument
1779 struct ocelot *ocelot = ds->priv; in felix_hwtstamp_get()
1784 static int felix_hwtstamp_set(struct dsa_switch *ds, int port, in felix_hwtstamp_set() argument
1787 struct ocelot *ocelot = ds->priv; in felix_hwtstamp_set()
1798 return felix_update_trapping_destinations(ds, using_tag_8021q); in felix_hwtstamp_set()
1855 static bool felix_rxtstamp(struct dsa_switch *ds, int port, in felix_rxtstamp() argument
1860 struct ocelot *ocelot = ds->priv; in felix_rxtstamp()
1902 static void felix_txtstamp(struct dsa_switch *ds, int port, in felix_txtstamp() argument
1905 struct ocelot *ocelot = ds->priv; in felix_txtstamp()
1912 dev_err_ratelimited(ds->dev, in felix_txtstamp()
1922 static int felix_change_mtu(struct dsa_switch *ds, int port, int new_mtu) in felix_change_mtu() argument
1924 struct ocelot *ocelot = ds->priv; in felix_change_mtu()
1939 static int felix_get_max_mtu(struct dsa_switch *ds, int port) in felix_get_max_mtu() argument
1941 struct ocelot *ocelot = ds->priv; in felix_get_max_mtu()
1946 static int felix_cls_flower_add(struct dsa_switch *ds, int port, in felix_cls_flower_add() argument
1949 struct ocelot *ocelot = ds->priv; in felix_cls_flower_add()
1960 return felix_update_trapping_destinations(ds, using_tag_8021q); in felix_cls_flower_add()
1963 static int felix_cls_flower_del(struct dsa_switch *ds, int port, in felix_cls_flower_del() argument
1966 struct ocelot *ocelot = ds->priv; in felix_cls_flower_del()
1971 static int felix_cls_flower_stats(struct dsa_switch *ds, int port, in felix_cls_flower_stats() argument
1974 struct ocelot *ocelot = ds->priv; in felix_cls_flower_stats()
1979 static int felix_port_policer_add(struct dsa_switch *ds, int port, in felix_port_policer_add() argument
1982 struct ocelot *ocelot = ds->priv; in felix_port_policer_add()
1991 static void felix_port_policer_del(struct dsa_switch *ds, int port) in felix_port_policer_del() argument
1993 struct ocelot *ocelot = ds->priv; in felix_port_policer_del()
1998 static int felix_port_mirror_add(struct dsa_switch *ds, int port, in felix_port_mirror_add() argument
2002 struct ocelot *ocelot = ds->priv; in felix_port_mirror_add()
2008 static void felix_port_mirror_del(struct dsa_switch *ds, int port, in felix_port_mirror_del() argument
2011 struct ocelot *ocelot = ds->priv; in felix_port_mirror_del()
2016 static int felix_port_setup_tc(struct dsa_switch *ds, int port, in felix_port_setup_tc() argument
2020 struct ocelot *ocelot = ds->priv; in felix_port_setup_tc()
2024 return felix->info->port_setup_tc(ds, port, type, type_data); in felix_port_setup_tc()
2029 static int felix_sb_pool_get(struct dsa_switch *ds, unsigned int sb_index, in felix_sb_pool_get() argument
2033 struct ocelot *ocelot = ds->priv; in felix_sb_pool_get()
2038 static int felix_sb_pool_set(struct dsa_switch *ds, unsigned int sb_index, in felix_sb_pool_set() argument
2043 struct ocelot *ocelot = ds->priv; in felix_sb_pool_set()
2049 static int felix_sb_port_pool_get(struct dsa_switch *ds, int port, in felix_sb_port_pool_get() argument
2053 struct ocelot *ocelot = ds->priv; in felix_sb_port_pool_get()
2059 static int felix_sb_port_pool_set(struct dsa_switch *ds, int port, in felix_sb_port_pool_set() argument
2063 struct ocelot *ocelot = ds->priv; in felix_sb_port_pool_set()
2069 static int felix_sb_tc_pool_bind_get(struct dsa_switch *ds, int port, in felix_sb_tc_pool_bind_get() argument
2074 struct ocelot *ocelot = ds->priv; in felix_sb_tc_pool_bind_get()
2081 static int felix_sb_tc_pool_bind_set(struct dsa_switch *ds, int port, in felix_sb_tc_pool_bind_set() argument
2087 struct ocelot *ocelot = ds->priv; in felix_sb_tc_pool_bind_set()
2094 static int felix_sb_occ_snapshot(struct dsa_switch *ds, in felix_sb_occ_snapshot() argument
2097 struct ocelot *ocelot = ds->priv; in felix_sb_occ_snapshot()
2102 static int felix_sb_occ_max_clear(struct dsa_switch *ds, in felix_sb_occ_max_clear() argument
2105 struct ocelot *ocelot = ds->priv; in felix_sb_occ_max_clear()
2110 static int felix_sb_occ_port_pool_get(struct dsa_switch *ds, int port, in felix_sb_occ_port_pool_get() argument
2114 struct ocelot *ocelot = ds->priv; in felix_sb_occ_port_pool_get()
2120 static int felix_sb_occ_tc_port_bind_get(struct dsa_switch *ds, int port, in felix_sb_occ_tc_port_bind_get() argument
2125 struct ocelot *ocelot = ds->priv; in felix_sb_occ_tc_port_bind_get()
2131 static int felix_mrp_add(struct dsa_switch *ds, int port, in felix_mrp_add() argument
2134 struct ocelot *ocelot = ds->priv; in felix_mrp_add()
2139 static int felix_mrp_del(struct dsa_switch *ds, int port, in felix_mrp_del() argument
2142 struct ocelot *ocelot = ds->priv; in felix_mrp_del()
2148 felix_mrp_add_ring_role(struct dsa_switch *ds, int port, in felix_mrp_add_ring_role() argument
2151 struct ocelot *ocelot = ds->priv; in felix_mrp_add_ring_role()
2157 felix_mrp_del_ring_role(struct dsa_switch *ds, int port, in felix_mrp_del_ring_role() argument
2160 struct ocelot *ocelot = ds->priv; in felix_mrp_del_ring_role()
2165 static int felix_port_get_default_prio(struct dsa_switch *ds, int port) in felix_port_get_default_prio() argument
2167 struct ocelot *ocelot = ds->priv; in felix_port_get_default_prio()
2172 static int felix_port_set_default_prio(struct dsa_switch *ds, int port, in felix_port_set_default_prio() argument
2175 struct ocelot *ocelot = ds->priv; in felix_port_set_default_prio()
2180 static int felix_port_get_dscp_prio(struct dsa_switch *ds, int port, u8 dscp) in felix_port_get_dscp_prio() argument
2182 struct ocelot *ocelot = ds->priv; in felix_port_get_dscp_prio()
2187 static int felix_port_add_dscp_prio(struct dsa_switch *ds, int port, u8 dscp, in felix_port_add_dscp_prio() argument
2190 struct ocelot *ocelot = ds->priv; in felix_port_add_dscp_prio()
2195 static int felix_port_del_dscp_prio(struct dsa_switch *ds, int port, u8 dscp, in felix_port_del_dscp_prio() argument
2198 struct ocelot *ocelot = ds->priv; in felix_port_del_dscp_prio()
2203 static int felix_get_mm(struct dsa_switch *ds, int port, in felix_get_mm() argument
2206 struct ocelot *ocelot = ds->priv; in felix_get_mm()
2211 static int felix_set_mm(struct dsa_switch *ds, int port, in felix_set_mm() argument
2215 struct ocelot *ocelot = ds->priv; in felix_set_mm()
2220 static void felix_get_mm_stats(struct dsa_switch *ds, int port, in felix_get_mm_stats() argument
2223 struct ocelot *ocelot = ds->priv; in felix_get_mm_stats()
2322 struct dsa_switch *ds; in felix_register_switch() local
2331 ds = devm_kzalloc(dev, sizeof(*ds), GFP_KERNEL); in felix_register_switch()
2332 if (!ds) in felix_register_switch()
2345 felix->ds = ds; in felix_register_switch()
2348 ds->dev = dev; in felix_register_switch()
2349 ds->num_ports = info->num_ports; in felix_register_switch()
2350 ds->num_tx_queues = OCELOT_NUM_TC; in felix_register_switch()
2351 ds->ops = &felix_switch_ops; in felix_register_switch()
2352 ds->phylink_mac_ops = &felix_phylink_mac_ops; in felix_register_switch()
2353 ds->priv = ocelot; in felix_register_switch()
2355 err = dsa_register_switch(ds); in felix_register_switch()
2366 struct dsa_switch *ds = felix->ds; in felix_port_to_netdev() local
2368 if (!dsa_is_user_port(ds, port)) in felix_port_to_netdev()
2371 return dsa_to_port(ds, port)->user; in felix_port_to_netdev()