Lines Matching refs:dsa_switch
91 struct dsa_switch;
98 int (*connect)(struct dsa_switch *ds);
99 void (*disconnect)(struct dsa_switch *ds);
266 struct dsa_switch *ds;
378 struct dsa_switch { struct
498 static inline struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p) in dsa_to_port() argument
536 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p) in dsa_is_unused_port()
541 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p) in dsa_is_cpu_port()
546 static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p) in dsa_is_dsa_port()
551 static inline bool dsa_is_user_port(struct dsa_switch *ds, int p) in dsa_is_user_port()
596 static inline u32 dsa_user_ports(struct dsa_switch *ds) in dsa_user_ports()
607 static inline u32 dsa_cpu_ports(struct dsa_switch *ds) in dsa_cpu_ports()
619 static inline unsigned int dsa_routing_port(struct dsa_switch *ds, int device) in dsa_routing_port()
632 static inline unsigned int dsa_towards_port(struct dsa_switch *ds, int device, in dsa_towards_port()
642 static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port) in dsa_upstream_port()
654 static inline bool dsa_is_upstream_port(struct dsa_switch *ds, int port) in dsa_is_upstream_port()
663 static inline bool dsa_is_downstream_port(struct dsa_switch *ds, int port) in dsa_is_downstream_port()
669 static inline unsigned int dsa_switch_upstream_port(struct dsa_switch *ds) in dsa_switch_upstream_port()
684 static inline bool dsa_switch_is_upstream_of(struct dsa_switch *upstream_ds, in dsa_switch_is_upstream_of()
685 struct dsa_switch *downstream_ds) in dsa_switch_is_upstream_of()
699 const struct dsa_switch *ds = dp->ds; in dsa_port_is_vlan_filtering()
831 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
834 int (*change_tag_protocol)(struct dsa_switch *ds,
841 int (*connect_tag_protocol)(struct dsa_switch *ds,
844 int (*port_change_master)(struct dsa_switch *ds, int port,
849 int (*setup)(struct dsa_switch *ds);
850 void (*teardown)(struct dsa_switch *ds);
855 int (*port_setup)(struct dsa_switch *ds, int port);
856 void (*port_teardown)(struct dsa_switch *ds, int port);
858 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
863 int (*phy_read)(struct dsa_switch *ds, int port, int regnum);
864 int (*phy_write)(struct dsa_switch *ds, int port,
870 void (*adjust_link)(struct dsa_switch *ds, int port,
872 void (*fixed_link_update)(struct dsa_switch *ds, int port,
878 void (*phylink_get_caps)(struct dsa_switch *ds, int port,
880 struct phylink_pcs *(*phylink_mac_select_pcs)(struct dsa_switch *ds,
883 int (*phylink_mac_link_state)(struct dsa_switch *ds, int port,
885 void (*phylink_mac_config)(struct dsa_switch *ds, int port,
888 void (*phylink_mac_an_restart)(struct dsa_switch *ds, int port);
889 void (*phylink_mac_link_down)(struct dsa_switch *ds, int port,
892 void (*phylink_mac_link_up)(struct dsa_switch *ds, int port,
898 void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
903 void (*get_strings)(struct dsa_switch *ds, int port,
905 void (*get_ethtool_stats)(struct dsa_switch *ds,
907 int (*get_sset_count)(struct dsa_switch *ds, int port, int sset);
908 void (*get_ethtool_phy_stats)(struct dsa_switch *ds,
910 void (*get_eth_phy_stats)(struct dsa_switch *ds, int port,
912 void (*get_eth_mac_stats)(struct dsa_switch *ds, int port,
914 void (*get_eth_ctrl_stats)(struct dsa_switch *ds, int port,
916 void (*get_rmon_stats)(struct dsa_switch *ds, int port,
919 void (*get_stats64)(struct dsa_switch *ds, int port,
921 void (*get_pause_stats)(struct dsa_switch *ds, int port,
923 void (*self_test)(struct dsa_switch *ds, int port,
929 void (*get_wol)(struct dsa_switch *ds, int port,
931 int (*set_wol)(struct dsa_switch *ds, int port,
937 int (*get_ts_info)(struct dsa_switch *ds, int port,
943 int (*get_mm)(struct dsa_switch *ds, int port,
945 int (*set_mm)(struct dsa_switch *ds, int port,
948 void (*get_mm_stats)(struct dsa_switch *ds, int port,
954 int (*port_get_default_prio)(struct dsa_switch *ds, int port);
955 int (*port_set_default_prio)(struct dsa_switch *ds, int port,
957 int (*port_get_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp);
958 int (*port_add_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp,
960 int (*port_del_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp,
966 int (*suspend)(struct dsa_switch *ds);
967 int (*resume)(struct dsa_switch *ds);
972 int (*port_enable)(struct dsa_switch *ds, int port,
974 void (*port_disable)(struct dsa_switch *ds, int port);
979 int (*set_mac_eee)(struct dsa_switch *ds, int port,
981 int (*get_mac_eee)(struct dsa_switch *ds, int port,
985 int (*get_eeprom_len)(struct dsa_switch *ds);
986 int (*get_eeprom)(struct dsa_switch *ds,
988 int (*set_eeprom)(struct dsa_switch *ds,
994 int (*get_regs_len)(struct dsa_switch *ds, int port);
995 void (*get_regs)(struct dsa_switch *ds, int port,
1001 int (*port_prechangeupper)(struct dsa_switch *ds, int port,
1007 int (*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
1008 int (*port_bridge_join)(struct dsa_switch *ds, int port,
1012 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
1014 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
1016 int (*port_mst_state_set)(struct dsa_switch *ds, int port,
1018 void (*port_fast_age)(struct dsa_switch *ds, int port);
1019 int (*port_vlan_fast_age)(struct dsa_switch *ds, int port, u16 vid);
1020 int (*port_pre_bridge_flags)(struct dsa_switch *ds, int port,
1023 int (*port_bridge_flags)(struct dsa_switch *ds, int port,
1026 void (*port_set_host_flood)(struct dsa_switch *ds, int port,
1032 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
1035 int (*port_vlan_add)(struct dsa_switch *ds, int port,
1038 int (*port_vlan_del)(struct dsa_switch *ds, int port,
1040 int (*vlan_msti_set)(struct dsa_switch *ds, struct dsa_bridge bridge,
1046 int (*port_fdb_add)(struct dsa_switch *ds, int port,
1049 int (*port_fdb_del)(struct dsa_switch *ds, int port,
1052 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
1054 int (*lag_fdb_add)(struct dsa_switch *ds, struct dsa_lag lag,
1057 int (*lag_fdb_del)(struct dsa_switch *ds, struct dsa_lag lag,
1064 int (*port_mdb_add)(struct dsa_switch *ds, int port,
1067 int (*port_mdb_del)(struct dsa_switch *ds, int port,
1073 int (*get_rxnfc)(struct dsa_switch *ds, int port,
1075 int (*set_rxnfc)(struct dsa_switch *ds, int port,
1081 int (*cls_flower_add)(struct dsa_switch *ds, int port,
1083 int (*cls_flower_del)(struct dsa_switch *ds, int port,
1085 int (*cls_flower_stats)(struct dsa_switch *ds, int port,
1087 int (*port_mirror_add)(struct dsa_switch *ds, int port,
1090 void (*port_mirror_del)(struct dsa_switch *ds, int port,
1092 int (*port_policer_add)(struct dsa_switch *ds, int port,
1094 void (*port_policer_del)(struct dsa_switch *ds, int port);
1095 int (*port_setup_tc)(struct dsa_switch *ds, int port,
1101 int (*crosschip_bridge_join)(struct dsa_switch *ds, int tree_index,
1105 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int tree_index,
1108 int (*crosschip_lag_change)(struct dsa_switch *ds, int sw_index,
1110 int (*crosschip_lag_join)(struct dsa_switch *ds, int sw_index,
1114 int (*crosschip_lag_leave)(struct dsa_switch *ds, int sw_index,
1120 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
1122 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
1124 void (*port_txtstamp)(struct dsa_switch *ds, int port,
1126 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
1130 int (*devlink_param_get)(struct dsa_switch *ds, u32 id,
1132 int (*devlink_param_set)(struct dsa_switch *ds, u32 id,
1134 int (*devlink_info_get)(struct dsa_switch *ds,
1137 int (*devlink_sb_pool_get)(struct dsa_switch *ds,
1140 int (*devlink_sb_pool_set)(struct dsa_switch *ds, unsigned int sb_index,
1144 int (*devlink_sb_port_pool_get)(struct dsa_switch *ds, int port,
1147 int (*devlink_sb_port_pool_set)(struct dsa_switch *ds, int port,
1151 int (*devlink_sb_tc_pool_bind_get)(struct dsa_switch *ds, int port,
1155 int (*devlink_sb_tc_pool_bind_set)(struct dsa_switch *ds, int port,
1160 int (*devlink_sb_occ_snapshot)(struct dsa_switch *ds,
1162 int (*devlink_sb_occ_max_clear)(struct dsa_switch *ds,
1164 int (*devlink_sb_occ_port_pool_get)(struct dsa_switch *ds, int port,
1167 int (*devlink_sb_occ_tc_port_bind_get)(struct dsa_switch *ds, int port,
1178 int (*port_change_mtu)(struct dsa_switch *ds, int port,
1180 int (*port_max_mtu)(struct dsa_switch *ds, int port);
1185 int (*port_lag_change)(struct dsa_switch *ds, int port);
1186 int (*port_lag_join)(struct dsa_switch *ds, int port,
1190 int (*port_lag_leave)(struct dsa_switch *ds, int port,
1196 int (*port_hsr_join)(struct dsa_switch *ds, int port,
1198 int (*port_hsr_leave)(struct dsa_switch *ds, int port,
1204 int (*port_mrp_add)(struct dsa_switch *ds, int port,
1206 int (*port_mrp_del)(struct dsa_switch *ds, int port,
1208 int (*port_mrp_add_ring_role)(struct dsa_switch *ds, int port,
1210 int (*port_mrp_del_ring_role)(struct dsa_switch *ds, int port,
1216 int (*tag_8021q_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
1218 int (*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
1223 void (*master_state_change)(struct dsa_switch *ds,
1236 int dsa_devlink_params_register(struct dsa_switch *ds,
1239 void dsa_devlink_params_unregister(struct dsa_switch *ds,
1242 int dsa_devlink_resource_register(struct dsa_switch *ds,
1249 void dsa_devlink_resources_unregister(struct dsa_switch *ds);
1251 void dsa_devlink_resource_occ_get_register(struct dsa_switch *ds,
1255 void dsa_devlink_resource_occ_get_unregister(struct dsa_switch *ds,
1258 dsa_devlink_region_create(struct dsa_switch *ds,
1262 dsa_devlink_port_region_create(struct dsa_switch *ds,
1271 struct dsa_switch *ds;
1274 static inline struct dsa_switch *dsa_devlink_to_ds(struct devlink *dl) in dsa_devlink_to_ds()
1282 struct dsa_switch *dsa_devlink_port_to_ds(struct devlink_port *port) in dsa_devlink_port_to_ds()
1300 bool dsa_fdb_present_in_other_db(struct dsa_switch *ds, int port,
1303 bool dsa_mdb_present_in_other_db(struct dsa_switch *ds, int port,
1378 void dsa_unregister_switch(struct dsa_switch *ds);
1379 int dsa_register_switch(struct dsa_switch *ds);
1380 void dsa_switch_shutdown(struct dsa_switch *ds);
1381 struct dsa_switch *dsa_switch_find(int tree_index, int sw_index);
1384 int dsa_switch_suspend(struct dsa_switch *ds);
1385 int dsa_switch_resume(struct dsa_switch *ds);
1387 static inline int dsa_switch_suspend(struct dsa_switch *ds) in dsa_switch_suspend()
1391 static inline int dsa_switch_resume(struct dsa_switch *ds) in dsa_switch_resume()
1407 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);