Lines Matching refs:ds

99 	int (*connect)(struct dsa_switch *ds);
100 void (*disconnect)(struct dsa_switch *ds);
179 if ((_dp)->ds == (_ds) && (_dp)->hsr_dev == (_hsr))
257 struct dsa_switch *ds;
512 static inline struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p)
514 struct dsa_switch_tree *dst = ds->dst;
518 if (dp->ds == ds && dp->index == p)
550 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p)
552 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_UNUSED;
555 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p)
557 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_CPU;
560 static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p)
562 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_DSA;
565 static inline bool dsa_is_user_port(struct dsa_switch *ds, int p)
567 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_USER;
584 if ((_dp)->ds == (_ds))
588 if ((_dp)->ds == (_ds))
592 if ((_dp)->ds == (_ds))
614 static inline u32 dsa_user_ports(struct dsa_switch *ds)
619 dsa_switch_for_each_user_port(dp, ds)
625 static inline u32 dsa_cpu_ports(struct dsa_switch *ds)
630 dsa_switch_for_each_cpu_port(cpu_dp, ds)
637 static inline unsigned int dsa_routing_port(struct dsa_switch *ds, int device)
639 struct dsa_switch_tree *dst = ds->dst;
643 if (dl->dp->ds == ds && dl->link_dp->ds->index == device)
646 return ds->num_ports;
650 static inline unsigned int dsa_towards_port(struct dsa_switch *ds, int device,
653 if (device == ds->index)
656 return dsa_routing_port(ds, device);
660 static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port)
662 const struct dsa_port *dp = dsa_to_port(ds, port);
668 return dsa_towards_port(ds, cpu_dp->ds->index, cpu_dp->index);
672 static inline bool dsa_is_upstream_port(struct dsa_switch *ds, int port)
674 if (dsa_is_unused_port(ds, port))
677 return port == dsa_upstream_port(ds, port);
681 static inline bool dsa_is_downstream_port(struct dsa_switch *ds, int port)
683 return dsa_is_dsa_port(ds, port) && !dsa_is_upstream_port(ds, port);
687 static inline unsigned int dsa_switch_upstream_port(struct dsa_switch *ds)
691 dsa_switch_for_each_available_port(dp, ds) {
692 return dsa_upstream_port(ds, dp->index);
695 return ds->num_ports;
717 const struct dsa_switch *ds = dp->ds;
719 if (ds->vlan_filtering_is_global)
720 return ds->vlan_filtering;
836 return a->ds->dst == b->ds->dst;
849 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
852 int (*change_tag_protocol)(struct dsa_switch *ds,
859 int (*connect_tag_protocol)(struct dsa_switch *ds,
862 int (*port_change_conduit)(struct dsa_switch *ds, int port,
867 int (*setup)(struct dsa_switch *ds);
868 void (*teardown)(struct dsa_switch *ds);
873 int (*port_setup)(struct dsa_switch *ds, int port);
874 void (*port_teardown)(struct dsa_switch *ds, int port);
876 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
881 int (*phy_read)(struct dsa_switch *ds, int port, int regnum);
882 int (*phy_write)(struct dsa_switch *ds, int port,
888 void (*phylink_get_caps)(struct dsa_switch *ds, int port,
890 void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
895 void (*get_strings)(struct dsa_switch *ds, int port,
897 void (*get_ethtool_stats)(struct dsa_switch *ds,
899 int (*get_sset_count)(struct dsa_switch *ds, int port, int sset);
900 void (*get_ethtool_phy_stats)(struct dsa_switch *ds,
902 void (*get_eth_phy_stats)(struct dsa_switch *ds, int port,
904 void (*get_eth_mac_stats)(struct dsa_switch *ds, int port,
906 void (*get_eth_ctrl_stats)(struct dsa_switch *ds, int port,
908 void (*get_rmon_stats)(struct dsa_switch *ds, int port,
911 void (*get_ts_stats)(struct dsa_switch *ds, int port,
913 void (*get_stats64)(struct dsa_switch *ds, int port,
915 void (*get_pause_stats)(struct dsa_switch *ds, int port,
917 void (*self_test)(struct dsa_switch *ds, int port,
923 void (*get_wol)(struct dsa_switch *ds, int port,
925 int (*set_wol)(struct dsa_switch *ds, int port,
931 int (*get_ts_info)(struct dsa_switch *ds, int port,
937 int (*get_mm)(struct dsa_switch *ds, int port,
939 int (*set_mm)(struct dsa_switch *ds, int port,
942 void (*get_mm_stats)(struct dsa_switch *ds, int port,
948 int (*port_get_default_prio)(struct dsa_switch *ds, int port);
949 int (*port_set_default_prio)(struct dsa_switch *ds, int port,
951 int (*port_get_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp);
952 int (*port_add_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp,
954 int (*port_del_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp,
956 int (*port_set_apptrust)(struct dsa_switch *ds, int port,
958 int (*port_get_apptrust)(struct dsa_switch *ds, int port, u8 *sel,
964 int (*suspend)(struct dsa_switch *ds);
965 int (*resume)(struct dsa_switch *ds);
970 int (*port_enable)(struct dsa_switch *ds, int port,
972 void (*port_disable)(struct dsa_switch *ds, int port);
981 int (*port_set_mac_address)(struct dsa_switch *ds, int port,
990 struct dsa_port *(*preferred_default_local_cpu_port)(struct dsa_switch *ds);
995 bool (*support_eee)(struct dsa_switch *ds, int port);
996 int (*set_mac_eee)(struct dsa_switch *ds, int port,
1000 int (*get_eeprom_len)(struct dsa_switch *ds);
1001 int (*get_eeprom)(struct dsa_switch *ds,
1003 int (*set_eeprom)(struct dsa_switch *ds,
1009 int (*get_regs_len)(struct dsa_switch *ds, int port);
1010 void (*get_regs)(struct dsa_switch *ds, int port,
1016 int (*port_prechangeupper)(struct dsa_switch *ds, int port,
1022 int (*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
1023 int (*port_bridge_join)(struct dsa_switch *ds, int port,
1027 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
1029 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
1031 int (*port_mst_state_set)(struct dsa_switch *ds, int port,
1033 void (*port_fast_age)(struct dsa_switch *ds, int port);
1034 int (*port_vlan_fast_age)(struct dsa_switch *ds, int port, u16 vid);
1035 int (*port_pre_bridge_flags)(struct dsa_switch *ds, int port,
1038 int (*port_bridge_flags)(struct dsa_switch *ds, int port,
1041 void (*port_set_host_flood)(struct dsa_switch *ds, int port,
1047 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
1050 int (*port_vlan_add)(struct dsa_switch *ds, int port,
1053 int (*port_vlan_del)(struct dsa_switch *ds, int port,
1055 int (*vlan_msti_set)(struct dsa_switch *ds, struct dsa_bridge bridge,
1061 int (*port_fdb_add)(struct dsa_switch *ds, int port,
1064 int (*port_fdb_del)(struct dsa_switch *ds, int port,
1067 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
1069 int (*lag_fdb_add)(struct dsa_switch *ds, struct dsa_lag lag,
1072 int (*lag_fdb_del)(struct dsa_switch *ds, struct dsa_lag lag,
1079 int (*port_mdb_add)(struct dsa_switch *ds, int port,
1082 int (*port_mdb_del)(struct dsa_switch *ds, int port,
1088 int (*get_rxnfc)(struct dsa_switch *ds, int port,
1090 int (*set_rxnfc)(struct dsa_switch *ds, int port,
1096 int (*cls_flower_add)(struct dsa_switch *ds, int port,
1098 int (*cls_flower_del)(struct dsa_switch *ds, int port,
1100 int (*cls_flower_stats)(struct dsa_switch *ds, int port,
1102 int (*port_mirror_add)(struct dsa_switch *ds, int port,
1105 void (*port_mirror_del)(struct dsa_switch *ds, int port,
1107 int (*port_policer_add)(struct dsa_switch *ds, int port,
1109 void (*port_policer_del)(struct dsa_switch *ds, int port);
1110 int (*port_setup_tc)(struct dsa_switch *ds, int port,
1116 int (*crosschip_bridge_join)(struct dsa_switch *ds, int tree_index,
1120 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int tree_index,
1123 int (*crosschip_lag_change)(struct dsa_switch *ds, int sw_index,
1125 int (*crosschip_lag_join)(struct dsa_switch *ds, int sw_index,
1129 int (*crosschip_lag_leave)(struct dsa_switch *ds, int sw_index,
1135 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
1137 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
1140 void (*port_txtstamp)(struct dsa_switch *ds, int port,
1142 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
1146 int (*devlink_param_get)(struct dsa_switch *ds, u32 id,
1148 int (*devlink_param_set)(struct dsa_switch *ds, u32 id,
1150 int (*devlink_info_get)(struct dsa_switch *ds,
1153 int (*devlink_sb_pool_get)(struct dsa_switch *ds,
1156 int (*devlink_sb_pool_set)(struct dsa_switch *ds, unsigned int sb_index,
1160 int (*devlink_sb_port_pool_get)(struct dsa_switch *ds, int port,
1163 int (*devlink_sb_port_pool_set)(struct dsa_switch *ds, int port,
1167 int (*devlink_sb_tc_pool_bind_get)(struct dsa_switch *ds, int port,
1171 int (*devlink_sb_tc_pool_bind_set)(struct dsa_switch *ds, int port,
1176 int (*devlink_sb_occ_snapshot)(struct dsa_switch *ds,
1178 int (*devlink_sb_occ_max_clear)(struct dsa_switch *ds,
1180 int (*devlink_sb_occ_port_pool_get)(struct dsa_switch *ds, int port,
1183 int (*devlink_sb_occ_tc_port_bind_get)(struct dsa_switch *ds, int port,
1194 int (*port_change_mtu)(struct dsa_switch *ds, int port,
1196 int (*port_max_mtu)(struct dsa_switch *ds, int port);
1201 int (*port_lag_change)(struct dsa_switch *ds, int port);
1202 int (*port_lag_join)(struct dsa_switch *ds, int port,
1206 int (*port_lag_leave)(struct dsa_switch *ds, int port,
1212 int (*port_hsr_join)(struct dsa_switch *ds, int port,
1215 int (*port_hsr_leave)(struct dsa_switch *ds, int port,
1221 int (*port_mrp_add)(struct dsa_switch *ds, int port,
1223 int (*port_mrp_del)(struct dsa_switch *ds, int port,
1225 int (*port_mrp_add_ring_role)(struct dsa_switch *ds, int port,
1227 int (*port_mrp_del_ring_role)(struct dsa_switch *ds, int port,
1233 int (*tag_8021q_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
1235 int (*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
1240 void (*conduit_state_change)(struct dsa_switch *ds,
1254 int dsa_devlink_params_register(struct dsa_switch *ds,
1257 void dsa_devlink_params_unregister(struct dsa_switch *ds,
1260 int dsa_devlink_resource_register(struct dsa_switch *ds,
1267 void dsa_devlink_resources_unregister(struct dsa_switch *ds);
1269 void dsa_devlink_resource_occ_get_register(struct dsa_switch *ds,
1273 void dsa_devlink_resource_occ_get_unregister(struct dsa_switch *ds,
1276 dsa_devlink_region_create(struct dsa_switch *ds,
1280 dsa_devlink_port_region_create(struct dsa_switch *ds,
1289 struct dsa_switch *ds;
1296 return dl_priv->ds;
1305 return dl_priv->ds;
1318 bool dsa_fdb_present_in_other_db(struct dsa_switch *ds, int port,
1321 bool dsa_mdb_present_in_other_db(struct dsa_switch *ds, int port,
1360 void dsa_unregister_switch(struct dsa_switch *ds);
1361 int dsa_register_switch(struct dsa_switch *ds);
1362 void dsa_switch_shutdown(struct dsa_switch *ds);
1366 int dsa_switch_suspend(struct dsa_switch *ds);
1367 int dsa_switch_resume(struct dsa_switch *ds);
1369 static inline int dsa_switch_suspend(struct dsa_switch *ds)
1373 static inline int dsa_switch_resume(struct dsa_switch *ds)
1389 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);
1390 bool dsa_supports_eee(struct dsa_switch *ds, int port);