Lines Matching refs:dsa_switch
82 struct dsa_switch;
246 struct dsa_switch *ds;
312 struct dsa_switch { struct
423 static inline struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p) in dsa_to_port() argument
455 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p) in dsa_is_unused_port()
460 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p) in dsa_is_cpu_port()
465 static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p) in dsa_is_dsa_port()
470 static inline bool dsa_is_user_port(struct dsa_switch *ds, int p) in dsa_is_user_port()
475 static inline u32 dsa_user_ports(struct dsa_switch *ds) in dsa_user_ports()
488 static inline unsigned int dsa_routing_port(struct dsa_switch *ds, int device) in dsa_routing_port()
501 static inline unsigned int dsa_towards_port(struct dsa_switch *ds, int device, in dsa_towards_port()
511 static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port) in dsa_upstream_port()
523 static inline bool dsa_is_upstream_port(struct dsa_switch *ds, int port) in dsa_is_upstream_port()
535 static inline bool dsa_switch_is_upstream_of(struct dsa_switch *upstream_ds, in dsa_switch_is_upstream_of()
536 struct dsa_switch *downstream_ds) in dsa_switch_is_upstream_of()
550 const struct dsa_switch *ds = dp->ds; in dsa_port_is_vlan_filtering()
582 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
585 int (*change_tag_protocol)(struct dsa_switch *ds, int port,
589 int (*setup)(struct dsa_switch *ds);
590 void (*teardown)(struct dsa_switch *ds);
595 int (*port_setup)(struct dsa_switch *ds, int port);
596 void (*port_teardown)(struct dsa_switch *ds, int port);
598 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
603 int (*phy_read)(struct dsa_switch *ds, int port, int regnum);
604 int (*phy_write)(struct dsa_switch *ds, int port,
610 void (*adjust_link)(struct dsa_switch *ds, int port,
612 void (*fixed_link_update)(struct dsa_switch *ds, int port,
618 void (*phylink_validate)(struct dsa_switch *ds, int port,
621 int (*phylink_mac_link_state)(struct dsa_switch *ds, int port,
623 void (*phylink_mac_config)(struct dsa_switch *ds, int port,
626 void (*phylink_mac_an_restart)(struct dsa_switch *ds, int port);
627 void (*phylink_mac_link_down)(struct dsa_switch *ds, int port,
630 void (*phylink_mac_link_up)(struct dsa_switch *ds, int port,
636 void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
641 void (*get_strings)(struct dsa_switch *ds, int port,
643 void (*get_ethtool_stats)(struct dsa_switch *ds,
645 int (*get_sset_count)(struct dsa_switch *ds, int port, int sset);
646 void (*get_ethtool_phy_stats)(struct dsa_switch *ds,
648 void (*get_stats64)(struct dsa_switch *ds, int port,
650 void (*self_test)(struct dsa_switch *ds, int port,
656 void (*get_wol)(struct dsa_switch *ds, int port,
658 int (*set_wol)(struct dsa_switch *ds, int port,
664 int (*get_ts_info)(struct dsa_switch *ds, int port,
670 int (*suspend)(struct dsa_switch *ds);
671 int (*resume)(struct dsa_switch *ds);
676 int (*port_enable)(struct dsa_switch *ds, int port,
678 void (*port_disable)(struct dsa_switch *ds, int port);
683 int (*set_mac_eee)(struct dsa_switch *ds, int port,
685 int (*get_mac_eee)(struct dsa_switch *ds, int port,
689 int (*get_eeprom_len)(struct dsa_switch *ds);
690 int (*get_eeprom)(struct dsa_switch *ds,
692 int (*set_eeprom)(struct dsa_switch *ds,
698 int (*get_regs_len)(struct dsa_switch *ds, int port);
699 void (*get_regs)(struct dsa_switch *ds, int port,
705 int (*port_prechangeupper)(struct dsa_switch *ds, int port,
711 int (*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
712 int (*port_bridge_join)(struct dsa_switch *ds, int port,
714 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
717 int (*port_bridge_tx_fwd_offload)(struct dsa_switch *ds, int port,
721 void (*port_bridge_tx_fwd_unoffload)(struct dsa_switch *ds, int port,
724 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
726 void (*port_fast_age)(struct dsa_switch *ds, int port);
727 int (*port_pre_bridge_flags)(struct dsa_switch *ds, int port,
730 int (*port_bridge_flags)(struct dsa_switch *ds, int port,
737 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
740 int (*port_vlan_add)(struct dsa_switch *ds, int port,
743 int (*port_vlan_del)(struct dsa_switch *ds, int port,
748 int (*port_fdb_add)(struct dsa_switch *ds, int port,
750 int (*port_fdb_del)(struct dsa_switch *ds, int port,
752 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
758 int (*port_mdb_add)(struct dsa_switch *ds, int port,
760 int (*port_mdb_del)(struct dsa_switch *ds, int port,
765 int (*get_rxnfc)(struct dsa_switch *ds, int port,
767 int (*set_rxnfc)(struct dsa_switch *ds, int port,
773 int (*cls_flower_add)(struct dsa_switch *ds, int port,
775 int (*cls_flower_del)(struct dsa_switch *ds, int port,
777 int (*cls_flower_stats)(struct dsa_switch *ds, int port,
779 int (*port_mirror_add)(struct dsa_switch *ds, int port,
782 void (*port_mirror_del)(struct dsa_switch *ds, int port,
784 int (*port_policer_add)(struct dsa_switch *ds, int port,
786 void (*port_policer_del)(struct dsa_switch *ds, int port);
787 int (*port_setup_tc)(struct dsa_switch *ds, int port,
793 int (*crosschip_bridge_join)(struct dsa_switch *ds, int tree_index,
796 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int tree_index,
799 int (*crosschip_lag_change)(struct dsa_switch *ds, int sw_index,
801 int (*crosschip_lag_join)(struct dsa_switch *ds, int sw_index,
804 int (*crosschip_lag_leave)(struct dsa_switch *ds, int sw_index,
810 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
812 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
814 void (*port_txtstamp)(struct dsa_switch *ds, int port,
816 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
820 int (*devlink_param_get)(struct dsa_switch *ds, u32 id,
822 int (*devlink_param_set)(struct dsa_switch *ds, u32 id,
824 int (*devlink_info_get)(struct dsa_switch *ds,
827 int (*devlink_sb_pool_get)(struct dsa_switch *ds,
830 int (*devlink_sb_pool_set)(struct dsa_switch *ds, unsigned int sb_index,
834 int (*devlink_sb_port_pool_get)(struct dsa_switch *ds, int port,
837 int (*devlink_sb_port_pool_set)(struct dsa_switch *ds, int port,
841 int (*devlink_sb_tc_pool_bind_get)(struct dsa_switch *ds, int port,
845 int (*devlink_sb_tc_pool_bind_set)(struct dsa_switch *ds, int port,
850 int (*devlink_sb_occ_snapshot)(struct dsa_switch *ds,
852 int (*devlink_sb_occ_max_clear)(struct dsa_switch *ds,
854 int (*devlink_sb_occ_port_pool_get)(struct dsa_switch *ds, int port,
857 int (*devlink_sb_occ_tc_port_bind_get)(struct dsa_switch *ds, int port,
868 int (*port_change_mtu)(struct dsa_switch *ds, int port,
870 int (*port_max_mtu)(struct dsa_switch *ds, int port);
875 int (*port_lag_change)(struct dsa_switch *ds, int port);
876 int (*port_lag_join)(struct dsa_switch *ds, int port,
879 int (*port_lag_leave)(struct dsa_switch *ds, int port,
885 int (*port_hsr_join)(struct dsa_switch *ds, int port,
887 int (*port_hsr_leave)(struct dsa_switch *ds, int port,
893 int (*port_mrp_add)(struct dsa_switch *ds, int port,
895 int (*port_mrp_del)(struct dsa_switch *ds, int port,
897 int (*port_mrp_add_ring_role)(struct dsa_switch *ds, int port,
899 int (*port_mrp_del_ring_role)(struct dsa_switch *ds, int port,
905 int (*tag_8021q_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
907 int (*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
918 int dsa_devlink_params_register(struct dsa_switch *ds,
921 void dsa_devlink_params_unregister(struct dsa_switch *ds,
924 int dsa_devlink_resource_register(struct dsa_switch *ds,
931 void dsa_devlink_resources_unregister(struct dsa_switch *ds);
933 void dsa_devlink_resource_occ_get_register(struct dsa_switch *ds,
937 void dsa_devlink_resource_occ_get_unregister(struct dsa_switch *ds,
940 dsa_devlink_region_create(struct dsa_switch *ds,
944 dsa_devlink_port_region_create(struct dsa_switch *ds,
953 struct dsa_switch *ds;
956 static inline struct dsa_switch *dsa_devlink_to_ds(struct devlink *dl) in dsa_devlink_to_ds()
964 struct dsa_switch *dsa_devlink_port_to_ds(struct devlink_port *port) in dsa_devlink_port_to_ds()
1055 void dsa_unregister_switch(struct dsa_switch *ds);
1056 int dsa_register_switch(struct dsa_switch *ds);
1057 void dsa_switch_shutdown(struct dsa_switch *ds);
1058 struct dsa_switch *dsa_switch_find(int tree_index, int sw_index);
1060 int dsa_switch_suspend(struct dsa_switch *ds);
1061 int dsa_switch_resume(struct dsa_switch *ds);
1063 static inline int dsa_switch_suspend(struct dsa_switch *ds) in dsa_switch_suspend()
1067 static inline int dsa_switch_resume(struct dsa_switch *ds) in dsa_switch_resume()
1086 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);