Lines Matching refs:dsa_switch
84 struct dsa_switch;
248 struct dsa_switch *ds;
315 struct dsa_switch { struct
426 static inline struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p) in dsa_to_port() argument
458 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p) in dsa_is_unused_port()
463 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p) in dsa_is_cpu_port()
468 static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p) in dsa_is_dsa_port()
473 static inline bool dsa_is_user_port(struct dsa_switch *ds, int p) in dsa_is_user_port()
506 static inline u32 dsa_user_ports(struct dsa_switch *ds) in dsa_user_ports()
518 static inline unsigned int dsa_routing_port(struct dsa_switch *ds, int device) in dsa_routing_port()
531 static inline unsigned int dsa_towards_port(struct dsa_switch *ds, int device, in dsa_towards_port()
541 static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port) in dsa_upstream_port()
553 static inline bool dsa_is_upstream_port(struct dsa_switch *ds, int port) in dsa_is_upstream_port()
565 static inline bool dsa_switch_is_upstream_of(struct dsa_switch *upstream_ds, in dsa_switch_is_upstream_of()
566 struct dsa_switch *downstream_ds) in dsa_switch_is_upstream_of()
580 const struct dsa_switch *ds = dp->ds; in dsa_port_is_vlan_filtering()
612 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
615 int (*change_tag_protocol)(struct dsa_switch *ds, int port,
619 int (*setup)(struct dsa_switch *ds);
620 void (*teardown)(struct dsa_switch *ds);
625 int (*port_setup)(struct dsa_switch *ds, int port);
626 void (*port_teardown)(struct dsa_switch *ds, int port);
628 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
633 int (*phy_read)(struct dsa_switch *ds, int port, int regnum);
634 int (*phy_write)(struct dsa_switch *ds, int port,
640 void (*adjust_link)(struct dsa_switch *ds, int port,
642 void (*fixed_link_update)(struct dsa_switch *ds, int port,
648 void (*phylink_get_interfaces)(struct dsa_switch *ds, int port,
650 void (*phylink_validate)(struct dsa_switch *ds, int port,
653 int (*phylink_mac_link_state)(struct dsa_switch *ds, int port,
655 void (*phylink_mac_config)(struct dsa_switch *ds, int port,
658 void (*phylink_mac_an_restart)(struct dsa_switch *ds, int port);
659 void (*phylink_mac_link_down)(struct dsa_switch *ds, int port,
662 void (*phylink_mac_link_up)(struct dsa_switch *ds, int port,
668 void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
673 void (*get_strings)(struct dsa_switch *ds, int port,
675 void (*get_ethtool_stats)(struct dsa_switch *ds,
677 int (*get_sset_count)(struct dsa_switch *ds, int port, int sset);
678 void (*get_ethtool_phy_stats)(struct dsa_switch *ds,
680 void (*get_eth_phy_stats)(struct dsa_switch *ds, int port,
682 void (*get_eth_mac_stats)(struct dsa_switch *ds, int port,
684 void (*get_eth_ctrl_stats)(struct dsa_switch *ds, int port,
686 void (*get_stats64)(struct dsa_switch *ds, int port,
688 void (*self_test)(struct dsa_switch *ds, int port,
694 void (*get_wol)(struct dsa_switch *ds, int port,
696 int (*set_wol)(struct dsa_switch *ds, int port,
702 int (*get_ts_info)(struct dsa_switch *ds, int port,
708 int (*suspend)(struct dsa_switch *ds);
709 int (*resume)(struct dsa_switch *ds);
714 int (*port_enable)(struct dsa_switch *ds, int port,
716 void (*port_disable)(struct dsa_switch *ds, int port);
721 int (*set_mac_eee)(struct dsa_switch *ds, int port,
723 int (*get_mac_eee)(struct dsa_switch *ds, int port,
727 int (*get_eeprom_len)(struct dsa_switch *ds);
728 int (*get_eeprom)(struct dsa_switch *ds,
730 int (*set_eeprom)(struct dsa_switch *ds,
736 int (*get_regs_len)(struct dsa_switch *ds, int port);
737 void (*get_regs)(struct dsa_switch *ds, int port,
743 int (*port_prechangeupper)(struct dsa_switch *ds, int port,
749 int (*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
750 int (*port_bridge_join)(struct dsa_switch *ds, int port,
752 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
755 int (*port_bridge_tx_fwd_offload)(struct dsa_switch *ds, int port,
759 void (*port_bridge_tx_fwd_unoffload)(struct dsa_switch *ds, int port,
762 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
764 void (*port_fast_age)(struct dsa_switch *ds, int port);
765 int (*port_pre_bridge_flags)(struct dsa_switch *ds, int port,
768 int (*port_bridge_flags)(struct dsa_switch *ds, int port,
775 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
778 int (*port_vlan_add)(struct dsa_switch *ds, int port,
781 int (*port_vlan_del)(struct dsa_switch *ds, int port,
786 int (*port_fdb_add)(struct dsa_switch *ds, int port,
788 int (*port_fdb_del)(struct dsa_switch *ds, int port,
790 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
796 int (*port_mdb_add)(struct dsa_switch *ds, int port,
798 int (*port_mdb_del)(struct dsa_switch *ds, int port,
803 int (*get_rxnfc)(struct dsa_switch *ds, int port,
805 int (*set_rxnfc)(struct dsa_switch *ds, int port,
811 int (*cls_flower_add)(struct dsa_switch *ds, int port,
813 int (*cls_flower_del)(struct dsa_switch *ds, int port,
815 int (*cls_flower_stats)(struct dsa_switch *ds, int port,
817 int (*port_mirror_add)(struct dsa_switch *ds, int port,
820 void (*port_mirror_del)(struct dsa_switch *ds, int port,
822 int (*port_policer_add)(struct dsa_switch *ds, int port,
824 void (*port_policer_del)(struct dsa_switch *ds, int port);
825 int (*port_setup_tc)(struct dsa_switch *ds, int port,
831 int (*crosschip_bridge_join)(struct dsa_switch *ds, int tree_index,
834 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int tree_index,
837 int (*crosschip_lag_change)(struct dsa_switch *ds, int sw_index,
839 int (*crosschip_lag_join)(struct dsa_switch *ds, int sw_index,
842 int (*crosschip_lag_leave)(struct dsa_switch *ds, int sw_index,
848 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
850 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
852 void (*port_txtstamp)(struct dsa_switch *ds, int port,
854 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
858 int (*devlink_param_get)(struct dsa_switch *ds, u32 id,
860 int (*devlink_param_set)(struct dsa_switch *ds, u32 id,
862 int (*devlink_info_get)(struct dsa_switch *ds,
865 int (*devlink_sb_pool_get)(struct dsa_switch *ds,
868 int (*devlink_sb_pool_set)(struct dsa_switch *ds, unsigned int sb_index,
872 int (*devlink_sb_port_pool_get)(struct dsa_switch *ds, int port,
875 int (*devlink_sb_port_pool_set)(struct dsa_switch *ds, int port,
879 int (*devlink_sb_tc_pool_bind_get)(struct dsa_switch *ds, int port,
883 int (*devlink_sb_tc_pool_bind_set)(struct dsa_switch *ds, int port,
888 int (*devlink_sb_occ_snapshot)(struct dsa_switch *ds,
890 int (*devlink_sb_occ_max_clear)(struct dsa_switch *ds,
892 int (*devlink_sb_occ_port_pool_get)(struct dsa_switch *ds, int port,
895 int (*devlink_sb_occ_tc_port_bind_get)(struct dsa_switch *ds, int port,
906 int (*port_change_mtu)(struct dsa_switch *ds, int port,
908 int (*port_max_mtu)(struct dsa_switch *ds, int port);
913 int (*port_lag_change)(struct dsa_switch *ds, int port);
914 int (*port_lag_join)(struct dsa_switch *ds, int port,
917 int (*port_lag_leave)(struct dsa_switch *ds, int port,
923 int (*port_hsr_join)(struct dsa_switch *ds, int port,
925 int (*port_hsr_leave)(struct dsa_switch *ds, int port,
931 int (*port_mrp_add)(struct dsa_switch *ds, int port,
933 int (*port_mrp_del)(struct dsa_switch *ds, int port,
935 int (*port_mrp_add_ring_role)(struct dsa_switch *ds, int port,
937 int (*port_mrp_del_ring_role)(struct dsa_switch *ds, int port,
943 int (*tag_8021q_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
945 int (*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
956 int dsa_devlink_params_register(struct dsa_switch *ds,
959 void dsa_devlink_params_unregister(struct dsa_switch *ds,
962 int dsa_devlink_resource_register(struct dsa_switch *ds,
969 void dsa_devlink_resources_unregister(struct dsa_switch *ds);
971 void dsa_devlink_resource_occ_get_register(struct dsa_switch *ds,
975 void dsa_devlink_resource_occ_get_unregister(struct dsa_switch *ds,
978 dsa_devlink_region_create(struct dsa_switch *ds,
982 dsa_devlink_port_region_create(struct dsa_switch *ds,
991 struct dsa_switch *ds;
994 static inline struct dsa_switch *dsa_devlink_to_ds(struct devlink *dl) in dsa_devlink_to_ds()
1002 struct dsa_switch *dsa_devlink_port_to_ds(struct devlink_port *port) in dsa_devlink_port_to_ds()
1093 void dsa_unregister_switch(struct dsa_switch *ds);
1094 int dsa_register_switch(struct dsa_switch *ds);
1095 void dsa_switch_shutdown(struct dsa_switch *ds);
1096 struct dsa_switch *dsa_switch_find(int tree_index, int sw_index);
1098 int dsa_switch_suspend(struct dsa_switch *ds);
1099 int dsa_switch_resume(struct dsa_switch *ds);
1101 static inline int dsa_switch_suspend(struct dsa_switch *ds) in dsa_switch_suspend()
1105 static inline int dsa_switch_resume(struct dsa_switch *ds) in dsa_switch_resume()
1124 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);