Lines Matching full: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()
389 static int felix_setup_tag_8021q(struct dsa_switch *ds, int cpu) in felix_setup_tag_8021q() argument
391 struct ocelot *ocelot = ds->priv; in felix_setup_tag_8021q()
398 for (port = 0; port < ds->num_ports; port++) { in felix_setup_tag_8021q()
399 if (dsa_is_unused_port(ds, port)) in felix_setup_tag_8021q()
426 err = dsa_tag_8021q_register(ds, htons(ETH_P_8021AD)); in felix_setup_tag_8021q()
437 dsa_tag_8021q_unregister(ds); in felix_setup_tag_8021q()
441 static void felix_teardown_tag_8021q(struct dsa_switch *ds, int cpu) in felix_teardown_tag_8021q() argument
443 struct ocelot *ocelot = ds->priv; in felix_teardown_tag_8021q()
449 dev_err(ds->dev, "felix_teardown_mmio_filtering returned %d", in felix_teardown_tag_8021q()
452 dsa_tag_8021q_unregister(ds); in felix_teardown_tag_8021q()
454 for (port = 0; port < ds->num_ports; port++) { in felix_teardown_tag_8021q()
455 if (dsa_is_unused_port(ds, port)) in felix_teardown_tag_8021q()
513 static int felix_setup_tag_npi(struct dsa_switch *ds, int cpu) in felix_setup_tag_npi() argument
515 struct ocelot *ocelot = ds->priv; in felix_setup_tag_npi()
539 static void felix_teardown_tag_npi(struct dsa_switch *ds, int cpu) in felix_teardown_tag_npi() argument
541 struct ocelot *ocelot = ds->priv; in felix_teardown_tag_npi()
546 static int felix_set_tag_protocol(struct dsa_switch *ds, int cpu, in felix_set_tag_protocol() argument
554 err = felix_setup_tag_npi(ds, cpu); in felix_set_tag_protocol()
557 err = felix_setup_tag_8021q(ds, cpu); in felix_set_tag_protocol()
566 static void felix_del_tag_protocol(struct dsa_switch *ds, int cpu, in felix_del_tag_protocol() argument
572 felix_teardown_tag_npi(ds, cpu); in felix_del_tag_protocol()
575 felix_teardown_tag_8021q(ds, cpu); in felix_del_tag_protocol()
586 static int felix_change_tag_protocol(struct dsa_switch *ds, int cpu, in felix_change_tag_protocol() argument
589 struct ocelot *ocelot = ds->priv; in felix_change_tag_protocol()
599 felix_del_tag_protocol(ds, cpu, old_proto); in felix_change_tag_protocol()
601 err = felix_set_tag_protocol(ds, cpu, proto); in felix_change_tag_protocol()
603 felix_set_tag_protocol(ds, cpu, old_proto); in felix_change_tag_protocol()
612 static enum dsa_tag_protocol felix_get_tag_protocol(struct dsa_switch *ds, in felix_get_tag_protocol() argument
616 struct ocelot *ocelot = ds->priv; in felix_get_tag_protocol()
622 static int felix_set_ageing_time(struct dsa_switch *ds, in felix_set_ageing_time() argument
625 struct ocelot *ocelot = ds->priv; in felix_set_ageing_time()
632 static int felix_fdb_dump(struct dsa_switch *ds, int port, in felix_fdb_dump() argument
635 struct ocelot *ocelot = ds->priv; in felix_fdb_dump()
640 static int felix_fdb_add(struct dsa_switch *ds, int port, in felix_fdb_add() argument
643 struct ocelot *ocelot = ds->priv; in felix_fdb_add()
648 static int felix_fdb_del(struct dsa_switch *ds, int port, in felix_fdb_del() argument
651 struct ocelot *ocelot = ds->priv; in felix_fdb_del()
656 static int felix_mdb_add(struct dsa_switch *ds, int port, in felix_mdb_add() argument
659 struct ocelot *ocelot = ds->priv; in felix_mdb_add()
664 static int felix_mdb_del(struct dsa_switch *ds, int port, in felix_mdb_del() argument
667 struct ocelot *ocelot = ds->priv; in felix_mdb_del()
672 static void felix_bridge_stp_state_set(struct dsa_switch *ds, int port, in felix_bridge_stp_state_set() argument
675 struct ocelot *ocelot = ds->priv; in felix_bridge_stp_state_set()
680 static int felix_pre_bridge_flags(struct dsa_switch *ds, int port, in felix_pre_bridge_flags() argument
684 struct ocelot *ocelot = ds->priv; in felix_pre_bridge_flags()
689 static int felix_bridge_flags(struct dsa_switch *ds, int port, in felix_bridge_flags() argument
693 struct ocelot *ocelot = ds->priv; in felix_bridge_flags()
700 static int felix_bridge_join(struct dsa_switch *ds, int port, in felix_bridge_join() argument
703 struct ocelot *ocelot = ds->priv; in felix_bridge_join()
710 static void felix_bridge_leave(struct dsa_switch *ds, int port, in felix_bridge_leave() argument
713 struct ocelot *ocelot = ds->priv; in felix_bridge_leave()
718 static int felix_lag_join(struct dsa_switch *ds, int port, in felix_lag_join() argument
722 struct ocelot *ocelot = ds->priv; in felix_lag_join()
727 static int felix_lag_leave(struct dsa_switch *ds, int port, in felix_lag_leave() argument
730 struct ocelot *ocelot = ds->priv; in felix_lag_leave()
737 static int felix_lag_change(struct dsa_switch *ds, int port) in felix_lag_change() argument
739 struct dsa_port *dp = dsa_to_port(ds, port); in felix_lag_change()
740 struct ocelot *ocelot = ds->priv; in felix_lag_change()
747 static int felix_vlan_prepare(struct dsa_switch *ds, int port, in felix_vlan_prepare() argument
751 struct ocelot *ocelot = ds->priv; in felix_vlan_prepare()
771 static int felix_vlan_filtering(struct dsa_switch *ds, int port, bool enabled, in felix_vlan_filtering() argument
774 struct ocelot *ocelot = ds->priv; in felix_vlan_filtering()
779 static int felix_vlan_add(struct dsa_switch *ds, int port, in felix_vlan_add() argument
783 struct ocelot *ocelot = ds->priv; in felix_vlan_add()
787 err = felix_vlan_prepare(ds, port, vlan, extack); in felix_vlan_add()
796 static int felix_vlan_del(struct dsa_switch *ds, int port, in felix_vlan_del() argument
799 struct ocelot *ocelot = ds->priv; in felix_vlan_del()
804 static void felix_phylink_validate(struct dsa_switch *ds, int port, in felix_phylink_validate() argument
808 struct ocelot *ocelot = ds->priv; in felix_phylink_validate()
815 static void felix_phylink_mac_config(struct dsa_switch *ds, int port, in felix_phylink_mac_config() argument
819 struct ocelot *ocelot = ds->priv; in felix_phylink_mac_config()
821 struct dsa_port *dp = dsa_to_port(ds, port); in felix_phylink_mac_config()
827 static void felix_phylink_mac_link_down(struct dsa_switch *ds, int port, in felix_phylink_mac_link_down() argument
831 struct ocelot *ocelot = ds->priv; in felix_phylink_mac_link_down()
837 static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port, in felix_phylink_mac_link_up() argument
844 struct ocelot *ocelot = ds->priv; in felix_phylink_mac_link_up()
876 static void felix_get_strings(struct dsa_switch *ds, int port, in felix_get_strings() argument
879 struct ocelot *ocelot = ds->priv; in felix_get_strings()
884 static void felix_get_ethtool_stats(struct dsa_switch *ds, int port, u64 *data) in felix_get_ethtool_stats() argument
886 struct ocelot *ocelot = ds->priv; in felix_get_ethtool_stats()
891 static int felix_get_sset_count(struct dsa_switch *ds, int port, int sset) in felix_get_sset_count() argument
893 struct ocelot *ocelot = ds->priv; in felix_get_sset_count()
898 static int felix_get_ts_info(struct dsa_switch *ds, int port, in felix_get_ts_info() argument
901 struct ocelot *ocelot = ds->priv; in felix_get_ts_info()
993 ocelot->devlink = felix->ds->devlink; in felix_init_structs()
1113 struct dsa_switch *ds = xmit_work->dp->ds; in felix_port_deferred_xmit() local
1116 struct ocelot *ocelot = ds->priv; in felix_port_deferred_xmit()
1141 static int felix_port_setup_tagger_data(struct dsa_switch *ds, int port) in felix_port_setup_tagger_data() argument
1143 struct dsa_port *dp = dsa_to_port(ds, port); in felix_port_setup_tagger_data()
1144 struct ocelot *ocelot = ds->priv; in felix_port_setup_tagger_data()
1163 static void felix_port_teardown_tagger_data(struct dsa_switch *ds, int port) in felix_port_teardown_tagger_data() argument
1165 struct dsa_port *dp = dsa_to_port(ds, port); in felix_port_teardown_tagger_data()
1180 static int felix_setup(struct dsa_switch *ds) in felix_setup() argument
1182 struct ocelot *ocelot = ds->priv; in felix_setup()
1186 err = felix_init_structs(felix, ds->num_ports); in felix_setup()
1209 for (port = 0; port < ds->num_ports; port++) { in felix_setup()
1210 if (dsa_is_unused_port(ds, port)) in felix_setup()
1220 err = felix_port_setup_tagger_data(ds, port); in felix_setup()
1222 dev_err(ds->dev, in felix_setup()
1233 for (port = 0; port < ds->num_ports; port++) { in felix_setup()
1234 if (!dsa_is_cpu_port(ds, port)) in felix_setup()
1240 felix_set_tag_protocol(ds, port, felix->tag_proto); in felix_setup()
1244 ds->mtu_enforcement_ingress = true; in felix_setup()
1245 ds->assisted_learning_on_cpu_port = true; in felix_setup()
1251 if (dsa_is_unused_port(ds, port)) in felix_setup()
1254 felix_port_teardown_tagger_data(ds, port); in felix_setup()
1271 static void felix_teardown(struct dsa_switch *ds) in felix_teardown() argument
1273 struct ocelot *ocelot = ds->priv; in felix_teardown()
1277 for (port = 0; port < ds->num_ports; port++) { in felix_teardown()
1278 if (!dsa_is_cpu_port(ds, port)) in felix_teardown()
1281 felix_del_tag_protocol(ds, port, felix->tag_proto); in felix_teardown()
1286 if (dsa_is_unused_port(ds, port)) in felix_teardown()
1289 felix_port_teardown_tagger_data(ds, port); in felix_teardown()
1303 static int felix_hwtstamp_get(struct dsa_switch *ds, int port, in felix_hwtstamp_get() argument
1306 struct ocelot *ocelot = ds->priv; in felix_hwtstamp_get()
1311 static int felix_hwtstamp_set(struct dsa_switch *ds, int port, in felix_hwtstamp_set() argument
1314 struct ocelot *ocelot = ds->priv; in felix_hwtstamp_set()
1368 static bool felix_rxtstamp(struct dsa_switch *ds, int port, in felix_rxtstamp() argument
1373 struct ocelot *ocelot = ds->priv; in felix_rxtstamp()
1406 static void felix_txtstamp(struct dsa_switch *ds, int port, in felix_txtstamp() argument
1409 struct ocelot *ocelot = ds->priv; in felix_txtstamp()
1416 dev_err_ratelimited(ds->dev, in felix_txtstamp()
1426 static int felix_change_mtu(struct dsa_switch *ds, int port, int new_mtu) in felix_change_mtu() argument
1428 struct ocelot *ocelot = ds->priv; in felix_change_mtu()
1435 static int felix_get_max_mtu(struct dsa_switch *ds, int port) in felix_get_max_mtu() argument
1437 struct ocelot *ocelot = ds->priv; in felix_get_max_mtu()
1442 static int felix_cls_flower_add(struct dsa_switch *ds, int port, in felix_cls_flower_add() argument
1445 struct ocelot *ocelot = ds->priv; in felix_cls_flower_add()
1450 static int felix_cls_flower_del(struct dsa_switch *ds, int port, in felix_cls_flower_del() argument
1453 struct ocelot *ocelot = ds->priv; in felix_cls_flower_del()
1458 static int felix_cls_flower_stats(struct dsa_switch *ds, int port, in felix_cls_flower_stats() argument
1461 struct ocelot *ocelot = ds->priv; in felix_cls_flower_stats()
1466 static int felix_port_policer_add(struct dsa_switch *ds, int port, in felix_port_policer_add() argument
1469 struct ocelot *ocelot = ds->priv; in felix_port_policer_add()
1478 static void felix_port_policer_del(struct dsa_switch *ds, int port) in felix_port_policer_del() argument
1480 struct ocelot *ocelot = ds->priv; in felix_port_policer_del()
1485 static int felix_port_setup_tc(struct dsa_switch *ds, int port, in felix_port_setup_tc() argument
1489 struct ocelot *ocelot = ds->priv; in felix_port_setup_tc()
1493 return felix->info->port_setup_tc(ds, port, type, type_data); in felix_port_setup_tc()
1498 static int felix_sb_pool_get(struct dsa_switch *ds, unsigned int sb_index, in felix_sb_pool_get() argument
1502 struct ocelot *ocelot = ds->priv; in felix_sb_pool_get()
1507 static int felix_sb_pool_set(struct dsa_switch *ds, unsigned int sb_index, in felix_sb_pool_set() argument
1512 struct ocelot *ocelot = ds->priv; in felix_sb_pool_set()
1518 static int felix_sb_port_pool_get(struct dsa_switch *ds, int port, in felix_sb_port_pool_get() argument
1522 struct ocelot *ocelot = ds->priv; in felix_sb_port_pool_get()
1528 static int felix_sb_port_pool_set(struct dsa_switch *ds, int port, in felix_sb_port_pool_set() argument
1532 struct ocelot *ocelot = ds->priv; in felix_sb_port_pool_set()
1538 static int felix_sb_tc_pool_bind_get(struct dsa_switch *ds, int port, in felix_sb_tc_pool_bind_get() argument
1543 struct ocelot *ocelot = ds->priv; in felix_sb_tc_pool_bind_get()
1550 static int felix_sb_tc_pool_bind_set(struct dsa_switch *ds, int port, in felix_sb_tc_pool_bind_set() argument
1556 struct ocelot *ocelot = ds->priv; in felix_sb_tc_pool_bind_set()
1563 static int felix_sb_occ_snapshot(struct dsa_switch *ds, in felix_sb_occ_snapshot() argument
1566 struct ocelot *ocelot = ds->priv; in felix_sb_occ_snapshot()
1571 static int felix_sb_occ_max_clear(struct dsa_switch *ds, in felix_sb_occ_max_clear() argument
1574 struct ocelot *ocelot = ds->priv; in felix_sb_occ_max_clear()
1579 static int felix_sb_occ_port_pool_get(struct dsa_switch *ds, int port, in felix_sb_occ_port_pool_get() argument
1583 struct ocelot *ocelot = ds->priv; in felix_sb_occ_port_pool_get()
1589 static int felix_sb_occ_tc_port_bind_get(struct dsa_switch *ds, int port, in felix_sb_occ_tc_port_bind_get() argument
1594 struct ocelot *ocelot = ds->priv; in felix_sb_occ_tc_port_bind_get()
1600 static int felix_mrp_add(struct dsa_switch *ds, int port, in felix_mrp_add() argument
1603 struct ocelot *ocelot = ds->priv; in felix_mrp_add()
1608 static int felix_mrp_del(struct dsa_switch *ds, int port, in felix_mrp_del() argument
1611 struct ocelot *ocelot = ds->priv; in felix_mrp_del()
1617 felix_mrp_add_ring_role(struct dsa_switch *ds, int port, in felix_mrp_add_ring_role() argument
1620 struct ocelot *ocelot = ds->priv; in felix_mrp_add_ring_role()
1626 felix_mrp_del_ring_role(struct dsa_switch *ds, int port, in felix_mrp_del_ring_role() argument
1629 struct ocelot *ocelot = ds->priv; in felix_mrp_del_ring_role()
1697 struct dsa_switch *ds = felix->ds; in felix_port_to_netdev() local
1699 if (!dsa_is_user_port(ds, port)) in felix_port_to_netdev()
1702 return dsa_to_port(ds, port)->slave; in felix_port_to_netdev()