Lines Matching refs:ds
34 struct dsa_switch *ds = felix->ds; in felix_tag_8021q_rxvlan_add() local
45 upstream = dsa_upstream_port(ds, port); in felix_tag_8021q_rxvlan_add()
80 struct dsa_switch *ds = felix->ds; in felix_tag_8021q_txvlan_add() local
100 upstream = dsa_upstream_port(ds, port); in felix_tag_8021q_txvlan_add()
146 static int felix_tag_8021q_vlan_add(struct dsa_switch *ds, int port, u16 vid, in felix_tag_8021q_vlan_add() argument
151 struct ocelot *ocelot = ds->priv; in felix_tag_8021q_vlan_add()
219 static int felix_tag_8021q_vlan_del(struct dsa_switch *ds, int port, u16 vid) in felix_tag_8021q_vlan_del() argument
221 struct ocelot *ocelot = ds->priv; in felix_tag_8021q_vlan_del()
269 unsigned long user_ports = dsa_user_ports(felix->ds); in felix_setup_mmio_filtering()
273 struct dsa_switch *ds = felix->ds; in felix_setup_mmio_filtering() local
287 if (dsa_is_cpu_port(ds, port)) { in felix_setup_mmio_filtering()
392 static int felix_setup_tag_8021q(struct dsa_switch *ds, int cpu) in felix_setup_tag_8021q() argument
394 struct ocelot *ocelot = ds->priv; in felix_setup_tag_8021q()
401 for (port = 0; port < ds->num_ports; port++) { in felix_setup_tag_8021q()
402 if (dsa_is_unused_port(ds, port)) in felix_setup_tag_8021q()
429 err = dsa_tag_8021q_register(ds, htons(ETH_P_8021AD)); in felix_setup_tag_8021q()
440 dsa_tag_8021q_unregister(ds); in felix_setup_tag_8021q()
444 static void felix_teardown_tag_8021q(struct dsa_switch *ds, int cpu) in felix_teardown_tag_8021q() argument
446 struct ocelot *ocelot = ds->priv; in felix_teardown_tag_8021q()
452 dev_err(ds->dev, "felix_teardown_mmio_filtering returned %d", in felix_teardown_tag_8021q()
455 dsa_tag_8021q_unregister(ds); in felix_teardown_tag_8021q()
457 for (port = 0; port < ds->num_ports; port++) { in felix_teardown_tag_8021q()
458 if (dsa_is_unused_port(ds, port)) in felix_teardown_tag_8021q()
516 static int felix_setup_tag_npi(struct dsa_switch *ds, int cpu) in felix_setup_tag_npi() argument
518 struct ocelot *ocelot = ds->priv; in felix_setup_tag_npi()
542 static void felix_teardown_tag_npi(struct dsa_switch *ds, int cpu) in felix_teardown_tag_npi() argument
544 struct ocelot *ocelot = ds->priv; in felix_teardown_tag_npi()
549 static int felix_set_tag_protocol(struct dsa_switch *ds, int cpu, in felix_set_tag_protocol() argument
557 err = felix_setup_tag_npi(ds, cpu); in felix_set_tag_protocol()
560 err = felix_setup_tag_8021q(ds, cpu); in felix_set_tag_protocol()
569 static void felix_del_tag_protocol(struct dsa_switch *ds, int cpu, in felix_del_tag_protocol() argument
575 felix_teardown_tag_npi(ds, cpu); in felix_del_tag_protocol()
578 felix_teardown_tag_8021q(ds, cpu); in felix_del_tag_protocol()
589 static int felix_change_tag_protocol(struct dsa_switch *ds, int cpu, in felix_change_tag_protocol() argument
592 struct ocelot *ocelot = ds->priv; in felix_change_tag_protocol()
602 felix_del_tag_protocol(ds, cpu, old_proto); in felix_change_tag_protocol()
604 err = felix_set_tag_protocol(ds, cpu, proto); in felix_change_tag_protocol()
606 felix_set_tag_protocol(ds, cpu, old_proto); in felix_change_tag_protocol()
615 static enum dsa_tag_protocol felix_get_tag_protocol(struct dsa_switch *ds, in felix_get_tag_protocol() argument
619 struct ocelot *ocelot = ds->priv; in felix_get_tag_protocol()
625 static int felix_set_ageing_time(struct dsa_switch *ds, in felix_set_ageing_time() argument
628 struct ocelot *ocelot = ds->priv; in felix_set_ageing_time()
635 static int felix_fdb_dump(struct dsa_switch *ds, int port, in felix_fdb_dump() argument
638 struct ocelot *ocelot = ds->priv; in felix_fdb_dump()
643 static int felix_fdb_add(struct dsa_switch *ds, int port, in felix_fdb_add() argument
646 struct ocelot *ocelot = ds->priv; in felix_fdb_add()
651 static int felix_fdb_del(struct dsa_switch *ds, int port, in felix_fdb_del() argument
654 struct ocelot *ocelot = ds->priv; in felix_fdb_del()
659 static int felix_mdb_add(struct dsa_switch *ds, int port, in felix_mdb_add() argument
662 struct ocelot *ocelot = ds->priv; in felix_mdb_add()
667 static int felix_mdb_del(struct dsa_switch *ds, int port, in felix_mdb_del() argument
670 struct ocelot *ocelot = ds->priv; in felix_mdb_del()
675 static void felix_bridge_stp_state_set(struct dsa_switch *ds, int port, in felix_bridge_stp_state_set() argument
678 struct ocelot *ocelot = ds->priv; in felix_bridge_stp_state_set()
683 static int felix_pre_bridge_flags(struct dsa_switch *ds, int port, in felix_pre_bridge_flags() argument
687 struct ocelot *ocelot = ds->priv; in felix_pre_bridge_flags()
692 static int felix_bridge_flags(struct dsa_switch *ds, int port, in felix_bridge_flags() argument
696 struct ocelot *ocelot = ds->priv; in felix_bridge_flags()
703 static int felix_bridge_join(struct dsa_switch *ds, int port, in felix_bridge_join() argument
706 struct ocelot *ocelot = ds->priv; in felix_bridge_join()
713 static void felix_bridge_leave(struct dsa_switch *ds, int port, in felix_bridge_leave() argument
716 struct ocelot *ocelot = ds->priv; in felix_bridge_leave()
721 static int felix_lag_join(struct dsa_switch *ds, int port, in felix_lag_join() argument
725 struct ocelot *ocelot = ds->priv; in felix_lag_join()
730 static int felix_lag_leave(struct dsa_switch *ds, int port, in felix_lag_leave() argument
733 struct ocelot *ocelot = ds->priv; in felix_lag_leave()
740 static int felix_lag_change(struct dsa_switch *ds, int port) in felix_lag_change() argument
742 struct dsa_port *dp = dsa_to_port(ds, port); in felix_lag_change()
743 struct ocelot *ocelot = ds->priv; in felix_lag_change()
750 static int felix_vlan_prepare(struct dsa_switch *ds, int port, in felix_vlan_prepare() argument
754 struct ocelot *ocelot = ds->priv; in felix_vlan_prepare()
774 static int felix_vlan_filtering(struct dsa_switch *ds, int port, bool enabled, in felix_vlan_filtering() argument
777 struct ocelot *ocelot = ds->priv; in felix_vlan_filtering()
782 static int felix_vlan_add(struct dsa_switch *ds, int port, in felix_vlan_add() argument
786 struct ocelot *ocelot = ds->priv; in felix_vlan_add()
790 err = felix_vlan_prepare(ds, port, vlan, extack); in felix_vlan_add()
799 static int felix_vlan_del(struct dsa_switch *ds, int port, in felix_vlan_del() argument
802 struct ocelot *ocelot = ds->priv; in felix_vlan_del()
807 static void felix_phylink_validate(struct dsa_switch *ds, int port, in felix_phylink_validate() argument
811 struct ocelot *ocelot = ds->priv; in felix_phylink_validate()
818 static void felix_phylink_mac_config(struct dsa_switch *ds, int port, in felix_phylink_mac_config() argument
822 struct ocelot *ocelot = ds->priv; in felix_phylink_mac_config()
824 struct dsa_port *dp = dsa_to_port(ds, port); in felix_phylink_mac_config()
830 static void felix_phylink_mac_link_down(struct dsa_switch *ds, int port, in felix_phylink_mac_link_down() argument
834 struct ocelot *ocelot = ds->priv; in felix_phylink_mac_link_down()
840 static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port, in felix_phylink_mac_link_up() argument
847 struct ocelot *ocelot = ds->priv; in felix_phylink_mac_link_up()
879 static void felix_get_strings(struct dsa_switch *ds, int port, in felix_get_strings() argument
882 struct ocelot *ocelot = ds->priv; in felix_get_strings()
887 static void felix_get_ethtool_stats(struct dsa_switch *ds, int port, u64 *data) in felix_get_ethtool_stats() argument
889 struct ocelot *ocelot = ds->priv; in felix_get_ethtool_stats()
894 static int felix_get_sset_count(struct dsa_switch *ds, int port, int sset) in felix_get_sset_count() argument
896 struct ocelot *ocelot = ds->priv; in felix_get_sset_count()
901 static int felix_get_ts_info(struct dsa_switch *ds, int port, in felix_get_ts_info() argument
904 struct ocelot *ocelot = ds->priv; in felix_get_ts_info()
998 ocelot->devlink = felix->ds->devlink; in felix_init_structs()
1118 struct dsa_switch *ds = xmit_work->dp->ds; in felix_port_deferred_xmit() local
1121 struct ocelot *ocelot = ds->priv; in felix_port_deferred_xmit()
1146 static int felix_port_setup_tagger_data(struct dsa_switch *ds, int port) in felix_port_setup_tagger_data() argument
1148 struct dsa_port *dp = dsa_to_port(ds, port); in felix_port_setup_tagger_data()
1149 struct ocelot *ocelot = ds->priv; in felix_port_setup_tagger_data()
1168 static void felix_port_teardown_tagger_data(struct dsa_switch *ds, int port) in felix_port_teardown_tagger_data() argument
1170 struct dsa_port *dp = dsa_to_port(ds, port); in felix_port_teardown_tagger_data()
1185 static int felix_setup(struct dsa_switch *ds) in felix_setup() argument
1187 struct ocelot *ocelot = ds->priv; in felix_setup()
1191 err = felix_init_structs(felix, ds->num_ports); in felix_setup()
1214 for (port = 0; port < ds->num_ports; port++) { in felix_setup()
1215 if (dsa_is_unused_port(ds, port)) in felix_setup()
1225 err = felix_port_setup_tagger_data(ds, port); in felix_setup()
1227 dev_err(ds->dev, in felix_setup()
1238 for (port = 0; port < ds->num_ports; port++) { in felix_setup()
1239 if (!dsa_is_cpu_port(ds, port)) in felix_setup()
1245 felix_set_tag_protocol(ds, port, felix->tag_proto); in felix_setup()
1249 ds->mtu_enforcement_ingress = true; in felix_setup()
1250 ds->assisted_learning_on_cpu_port = true; in felix_setup()
1256 if (dsa_is_unused_port(ds, port)) in felix_setup()
1259 felix_port_teardown_tagger_data(ds, port); in felix_setup()
1276 static void felix_teardown(struct dsa_switch *ds) in felix_teardown() argument
1278 struct ocelot *ocelot = ds->priv; in felix_teardown()
1282 for (port = 0; port < ds->num_ports; port++) { in felix_teardown()
1283 if (!dsa_is_cpu_port(ds, port)) in felix_teardown()
1286 felix_del_tag_protocol(ds, port, felix->tag_proto); in felix_teardown()
1291 if (dsa_is_unused_port(ds, port)) in felix_teardown()
1294 felix_port_teardown_tagger_data(ds, port); in felix_teardown()
1308 static int felix_hwtstamp_get(struct dsa_switch *ds, int port, in felix_hwtstamp_get() argument
1311 struct ocelot *ocelot = ds->priv; in felix_hwtstamp_get()
1316 static int felix_hwtstamp_set(struct dsa_switch *ds, int port, in felix_hwtstamp_set() argument
1319 struct ocelot *ocelot = ds->priv; in felix_hwtstamp_set()
1373 static bool felix_rxtstamp(struct dsa_switch *ds, int port, in felix_rxtstamp() argument
1378 struct ocelot *ocelot = ds->priv; in felix_rxtstamp()
1408 static void felix_txtstamp(struct dsa_switch *ds, int port, in felix_txtstamp() argument
1411 struct ocelot *ocelot = ds->priv; in felix_txtstamp()
1418 dev_err_ratelimited(ds->dev, in felix_txtstamp()
1428 static int felix_change_mtu(struct dsa_switch *ds, int port, int new_mtu) in felix_change_mtu() argument
1430 struct ocelot *ocelot = ds->priv; in felix_change_mtu()
1437 static int felix_get_max_mtu(struct dsa_switch *ds, int port) in felix_get_max_mtu() argument
1439 struct ocelot *ocelot = ds->priv; in felix_get_max_mtu()
1444 static int felix_cls_flower_add(struct dsa_switch *ds, int port, in felix_cls_flower_add() argument
1447 struct ocelot *ocelot = ds->priv; in felix_cls_flower_add()
1452 static int felix_cls_flower_del(struct dsa_switch *ds, int port, in felix_cls_flower_del() argument
1455 struct ocelot *ocelot = ds->priv; in felix_cls_flower_del()
1460 static int felix_cls_flower_stats(struct dsa_switch *ds, int port, in felix_cls_flower_stats() argument
1463 struct ocelot *ocelot = ds->priv; in felix_cls_flower_stats()
1468 static int felix_port_policer_add(struct dsa_switch *ds, int port, in felix_port_policer_add() argument
1471 struct ocelot *ocelot = ds->priv; in felix_port_policer_add()
1480 static void felix_port_policer_del(struct dsa_switch *ds, int port) in felix_port_policer_del() argument
1482 struct ocelot *ocelot = ds->priv; in felix_port_policer_del()
1487 static int felix_port_setup_tc(struct dsa_switch *ds, int port, in felix_port_setup_tc() argument
1491 struct ocelot *ocelot = ds->priv; in felix_port_setup_tc()
1495 return felix->info->port_setup_tc(ds, port, type, type_data); in felix_port_setup_tc()
1500 static int felix_sb_pool_get(struct dsa_switch *ds, unsigned int sb_index, in felix_sb_pool_get() argument
1504 struct ocelot *ocelot = ds->priv; in felix_sb_pool_get()
1509 static int felix_sb_pool_set(struct dsa_switch *ds, unsigned int sb_index, in felix_sb_pool_set() argument
1514 struct ocelot *ocelot = ds->priv; in felix_sb_pool_set()
1520 static int felix_sb_port_pool_get(struct dsa_switch *ds, int port, in felix_sb_port_pool_get() argument
1524 struct ocelot *ocelot = ds->priv; in felix_sb_port_pool_get()
1530 static int felix_sb_port_pool_set(struct dsa_switch *ds, int port, in felix_sb_port_pool_set() argument
1534 struct ocelot *ocelot = ds->priv; in felix_sb_port_pool_set()
1540 static int felix_sb_tc_pool_bind_get(struct dsa_switch *ds, int port, in felix_sb_tc_pool_bind_get() argument
1545 struct ocelot *ocelot = ds->priv; in felix_sb_tc_pool_bind_get()
1552 static int felix_sb_tc_pool_bind_set(struct dsa_switch *ds, int port, in felix_sb_tc_pool_bind_set() argument
1558 struct ocelot *ocelot = ds->priv; in felix_sb_tc_pool_bind_set()
1565 static int felix_sb_occ_snapshot(struct dsa_switch *ds, in felix_sb_occ_snapshot() argument
1568 struct ocelot *ocelot = ds->priv; in felix_sb_occ_snapshot()
1573 static int felix_sb_occ_max_clear(struct dsa_switch *ds, in felix_sb_occ_max_clear() argument
1576 struct ocelot *ocelot = ds->priv; in felix_sb_occ_max_clear()
1581 static int felix_sb_occ_port_pool_get(struct dsa_switch *ds, int port, in felix_sb_occ_port_pool_get() argument
1585 struct ocelot *ocelot = ds->priv; in felix_sb_occ_port_pool_get()
1591 static int felix_sb_occ_tc_port_bind_get(struct dsa_switch *ds, int port, in felix_sb_occ_tc_port_bind_get() argument
1596 struct ocelot *ocelot = ds->priv; in felix_sb_occ_tc_port_bind_get()
1602 static int felix_mrp_add(struct dsa_switch *ds, int port, in felix_mrp_add() argument
1605 struct ocelot *ocelot = ds->priv; in felix_mrp_add()
1610 static int felix_mrp_del(struct dsa_switch *ds, int port, in felix_mrp_del() argument
1613 struct ocelot *ocelot = ds->priv; in felix_mrp_del()
1619 felix_mrp_add_ring_role(struct dsa_switch *ds, int port, in felix_mrp_add_ring_role() argument
1622 struct ocelot *ocelot = ds->priv; in felix_mrp_add_ring_role()
1628 felix_mrp_del_ring_role(struct dsa_switch *ds, int port, in felix_mrp_del_ring_role() argument
1631 struct ocelot *ocelot = ds->priv; in felix_mrp_del_ring_role()
1699 struct dsa_switch *ds = felix->ds; in felix_port_to_netdev() local
1701 if (!dsa_is_user_port(ds, port)) in felix_port_to_netdev()
1704 return dsa_to_port(ds, port)->slave; in felix_port_to_netdev()