Lines Matching refs:dsa_switch
91 struct dsa_switch;
98 int (*connect)(struct dsa_switch *ds);
99 void (*disconnect)(struct dsa_switch *ds);
256 struct dsa_switch *ds;
371 struct dsa_switch { struct
491 static inline struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p) in dsa_to_port() argument
529 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p) in dsa_is_unused_port()
534 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p) in dsa_is_cpu_port()
539 static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p) in dsa_is_dsa_port()
544 static inline bool dsa_is_user_port(struct dsa_switch *ds, int p) in dsa_is_user_port()
589 static inline u32 dsa_user_ports(struct dsa_switch *ds) in dsa_user_ports()
600 static inline u32 dsa_cpu_ports(struct dsa_switch *ds) in dsa_cpu_ports()
612 static inline unsigned int dsa_routing_port(struct dsa_switch *ds, int device) in dsa_routing_port()
625 static inline unsigned int dsa_towards_port(struct dsa_switch *ds, int device, in dsa_towards_port()
635 static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port) in dsa_upstream_port()
647 static inline bool dsa_is_upstream_port(struct dsa_switch *ds, int port) in dsa_is_upstream_port()
656 static inline bool dsa_is_downstream_port(struct dsa_switch *ds, int port) in dsa_is_downstream_port()
662 static inline unsigned int dsa_switch_upstream_port(struct dsa_switch *ds) in dsa_switch_upstream_port()
677 static inline bool dsa_switch_is_upstream_of(struct dsa_switch *upstream_ds, in dsa_switch_is_upstream_of()
678 struct dsa_switch *downstream_ds) in dsa_switch_is_upstream_of()
692 const struct dsa_switch *ds = dp->ds; in dsa_port_is_vlan_filtering()
824 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
827 int (*change_tag_protocol)(struct dsa_switch *ds,
834 int (*connect_tag_protocol)(struct dsa_switch *ds,
837 int (*port_change_master)(struct dsa_switch *ds, int port,
842 int (*setup)(struct dsa_switch *ds);
843 void (*teardown)(struct dsa_switch *ds);
848 int (*port_setup)(struct dsa_switch *ds, int port);
849 void (*port_teardown)(struct dsa_switch *ds, int port);
851 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
856 int (*phy_read)(struct dsa_switch *ds, int port, int regnum);
857 int (*phy_write)(struct dsa_switch *ds, int port,
863 void (*adjust_link)(struct dsa_switch *ds, int port,
865 void (*fixed_link_update)(struct dsa_switch *ds, int port,
871 void (*phylink_get_caps)(struct dsa_switch *ds, int port,
873 struct phylink_pcs *(*phylink_mac_select_pcs)(struct dsa_switch *ds,
876 int (*phylink_mac_prepare)(struct dsa_switch *ds, int port,
879 void (*phylink_mac_config)(struct dsa_switch *ds, int port,
882 int (*phylink_mac_finish)(struct dsa_switch *ds, int port,
885 void (*phylink_mac_link_down)(struct dsa_switch *ds, int port,
888 void (*phylink_mac_link_up)(struct dsa_switch *ds, int port,
894 void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
899 void (*get_strings)(struct dsa_switch *ds, int port,
901 void (*get_ethtool_stats)(struct dsa_switch *ds,
903 int (*get_sset_count)(struct dsa_switch *ds, int port, int sset);
904 void (*get_ethtool_phy_stats)(struct dsa_switch *ds,
906 void (*get_eth_phy_stats)(struct dsa_switch *ds, int port,
908 void (*get_eth_mac_stats)(struct dsa_switch *ds, int port,
910 void (*get_eth_ctrl_stats)(struct dsa_switch *ds, int port,
912 void (*get_rmon_stats)(struct dsa_switch *ds, int port,
915 void (*get_stats64)(struct dsa_switch *ds, int port,
917 void (*get_pause_stats)(struct dsa_switch *ds, int port,
919 void (*self_test)(struct dsa_switch *ds, int port,
925 void (*get_wol)(struct dsa_switch *ds, int port,
927 int (*set_wol)(struct dsa_switch *ds, int port,
933 int (*get_ts_info)(struct dsa_switch *ds, int port,
939 int (*get_mm)(struct dsa_switch *ds, int port,
941 int (*set_mm)(struct dsa_switch *ds, int port,
944 void (*get_mm_stats)(struct dsa_switch *ds, int port,
950 int (*port_get_default_prio)(struct dsa_switch *ds, int port);
951 int (*port_set_default_prio)(struct dsa_switch *ds, int port,
953 int (*port_get_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp);
954 int (*port_add_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp,
956 int (*port_del_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp,
962 int (*suspend)(struct dsa_switch *ds);
963 int (*resume)(struct dsa_switch *ds);
968 int (*port_enable)(struct dsa_switch *ds, int port,
970 void (*port_disable)(struct dsa_switch *ds, int port);
978 struct dsa_port *(*preferred_default_local_cpu_port)(struct dsa_switch *ds);
983 int (*set_mac_eee)(struct dsa_switch *ds, int port,
985 int (*get_mac_eee)(struct dsa_switch *ds, int port,
989 int (*get_eeprom_len)(struct dsa_switch *ds);
990 int (*get_eeprom)(struct dsa_switch *ds,
992 int (*set_eeprom)(struct dsa_switch *ds,
998 int (*get_regs_len)(struct dsa_switch *ds, int port);
999 void (*get_regs)(struct dsa_switch *ds, int port,
1005 int (*port_prechangeupper)(struct dsa_switch *ds, int port,
1011 int (*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
1012 int (*port_bridge_join)(struct dsa_switch *ds, int port,
1016 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
1018 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
1020 int (*port_mst_state_set)(struct dsa_switch *ds, int port,
1022 void (*port_fast_age)(struct dsa_switch *ds, int port);
1023 int (*port_vlan_fast_age)(struct dsa_switch *ds, int port, u16 vid);
1024 int (*port_pre_bridge_flags)(struct dsa_switch *ds, int port,
1027 int (*port_bridge_flags)(struct dsa_switch *ds, int port,
1030 void (*port_set_host_flood)(struct dsa_switch *ds, int port,
1036 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
1039 int (*port_vlan_add)(struct dsa_switch *ds, int port,
1042 int (*port_vlan_del)(struct dsa_switch *ds, int port,
1044 int (*vlan_msti_set)(struct dsa_switch *ds, struct dsa_bridge bridge,
1050 int (*port_fdb_add)(struct dsa_switch *ds, int port,
1053 int (*port_fdb_del)(struct dsa_switch *ds, int port,
1056 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
1058 int (*lag_fdb_add)(struct dsa_switch *ds, struct dsa_lag lag,
1061 int (*lag_fdb_del)(struct dsa_switch *ds, struct dsa_lag lag,
1068 int (*port_mdb_add)(struct dsa_switch *ds, int port,
1071 int (*port_mdb_del)(struct dsa_switch *ds, int port,
1077 int (*get_rxnfc)(struct dsa_switch *ds, int port,
1079 int (*set_rxnfc)(struct dsa_switch *ds, int port,
1085 int (*cls_flower_add)(struct dsa_switch *ds, int port,
1087 int (*cls_flower_del)(struct dsa_switch *ds, int port,
1089 int (*cls_flower_stats)(struct dsa_switch *ds, int port,
1091 int (*port_mirror_add)(struct dsa_switch *ds, int port,
1094 void (*port_mirror_del)(struct dsa_switch *ds, int port,
1096 int (*port_policer_add)(struct dsa_switch *ds, int port,
1098 void (*port_policer_del)(struct dsa_switch *ds, int port);
1099 int (*port_setup_tc)(struct dsa_switch *ds, int port,
1105 int (*crosschip_bridge_join)(struct dsa_switch *ds, int tree_index,
1109 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int tree_index,
1112 int (*crosschip_lag_change)(struct dsa_switch *ds, int sw_index,
1114 int (*crosschip_lag_join)(struct dsa_switch *ds, int sw_index,
1118 int (*crosschip_lag_leave)(struct dsa_switch *ds, int sw_index,
1124 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
1126 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
1128 void (*port_txtstamp)(struct dsa_switch *ds, int port,
1130 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
1134 int (*devlink_param_get)(struct dsa_switch *ds, u32 id,
1136 int (*devlink_param_set)(struct dsa_switch *ds, u32 id,
1138 int (*devlink_info_get)(struct dsa_switch *ds,
1141 int (*devlink_sb_pool_get)(struct dsa_switch *ds,
1144 int (*devlink_sb_pool_set)(struct dsa_switch *ds, unsigned int sb_index,
1148 int (*devlink_sb_port_pool_get)(struct dsa_switch *ds, int port,
1151 int (*devlink_sb_port_pool_set)(struct dsa_switch *ds, int port,
1155 int (*devlink_sb_tc_pool_bind_get)(struct dsa_switch *ds, int port,
1159 int (*devlink_sb_tc_pool_bind_set)(struct dsa_switch *ds, int port,
1164 int (*devlink_sb_occ_snapshot)(struct dsa_switch *ds,
1166 int (*devlink_sb_occ_max_clear)(struct dsa_switch *ds,
1168 int (*devlink_sb_occ_port_pool_get)(struct dsa_switch *ds, int port,
1171 int (*devlink_sb_occ_tc_port_bind_get)(struct dsa_switch *ds, int port,
1182 int (*port_change_mtu)(struct dsa_switch *ds, int port,
1184 int (*port_max_mtu)(struct dsa_switch *ds, int port);
1189 int (*port_lag_change)(struct dsa_switch *ds, int port);
1190 int (*port_lag_join)(struct dsa_switch *ds, int port,
1194 int (*port_lag_leave)(struct dsa_switch *ds, int port,
1200 int (*port_hsr_join)(struct dsa_switch *ds, int port,
1202 int (*port_hsr_leave)(struct dsa_switch *ds, int port,
1208 int (*port_mrp_add)(struct dsa_switch *ds, int port,
1210 int (*port_mrp_del)(struct dsa_switch *ds, int port,
1212 int (*port_mrp_add_ring_role)(struct dsa_switch *ds, int port,
1214 int (*port_mrp_del_ring_role)(struct dsa_switch *ds, int port,
1220 int (*tag_8021q_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
1222 int (*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
1227 void (*master_state_change)(struct dsa_switch *ds,
1240 int dsa_devlink_params_register(struct dsa_switch *ds,
1243 void dsa_devlink_params_unregister(struct dsa_switch *ds,
1246 int dsa_devlink_resource_register(struct dsa_switch *ds,
1253 void dsa_devlink_resources_unregister(struct dsa_switch *ds);
1255 void dsa_devlink_resource_occ_get_register(struct dsa_switch *ds,
1259 void dsa_devlink_resource_occ_get_unregister(struct dsa_switch *ds,
1262 dsa_devlink_region_create(struct dsa_switch *ds,
1266 dsa_devlink_port_region_create(struct dsa_switch *ds,
1275 struct dsa_switch *ds;
1278 static inline struct dsa_switch *dsa_devlink_to_ds(struct devlink *dl) in dsa_devlink_to_ds()
1286 struct dsa_switch *dsa_devlink_port_to_ds(struct devlink_port *port) in dsa_devlink_port_to_ds()
1304 bool dsa_fdb_present_in_other_db(struct dsa_switch *ds, int port,
1307 bool dsa_mdb_present_in_other_db(struct dsa_switch *ds, int port,
1346 void dsa_unregister_switch(struct dsa_switch *ds);
1347 int dsa_register_switch(struct dsa_switch *ds);
1348 void dsa_switch_shutdown(struct dsa_switch *ds);
1349 struct dsa_switch *dsa_switch_find(int tree_index, int sw_index);
1352 int dsa_switch_suspend(struct dsa_switch *ds);
1353 int dsa_switch_resume(struct dsa_switch *ds);
1355 static inline int dsa_switch_suspend(struct dsa_switch *ds) in dsa_switch_suspend()
1359 static inline int dsa_switch_resume(struct dsa_switch *ds) in dsa_switch_resume()
1375 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);