Lines Matching refs:ds
103 int (*connect)(struct dsa_switch *ds);
104 void (*disconnect)(struct dsa_switch *ds);
183 if ((_dp)->ds == (_ds) && (_dp)->hsr_dev == (_hsr))
261 struct dsa_switch *ds; member
517 static inline struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p) in dsa_to_port() argument
519 struct dsa_switch_tree *dst = ds->dst; in dsa_to_port()
523 if (dp->ds == ds && dp->index == p) in dsa_to_port()
555 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p) in dsa_is_unused_port() argument
557 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_UNUSED; in dsa_is_unused_port()
560 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p) in dsa_is_cpu_port() argument
562 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_CPU; in dsa_is_cpu_port()
565 static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p) in dsa_is_dsa_port() argument
567 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_DSA; in dsa_is_dsa_port()
570 static inline bool dsa_is_user_port(struct dsa_switch *ds, int p) in dsa_is_user_port() argument
572 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_USER; in dsa_is_user_port()
589 if ((_dp)->ds == (_ds))
593 if ((_dp)->ds == (_ds))
597 if ((_dp)->ds == (_ds))
619 static inline u32 dsa_user_ports(struct dsa_switch *ds) in dsa_user_ports() argument
624 dsa_switch_for_each_user_port(dp, ds) in dsa_user_ports()
630 static inline u32 dsa_cpu_ports(struct dsa_switch *ds) in dsa_cpu_ports() argument
635 dsa_switch_for_each_cpu_port(cpu_dp, ds) in dsa_cpu_ports()
642 static inline unsigned int dsa_routing_port(struct dsa_switch *ds, int device) in dsa_routing_port() argument
644 struct dsa_switch_tree *dst = ds->dst; in dsa_routing_port()
648 if (dl->dp->ds == ds && dl->link_dp->ds->index == device) in dsa_routing_port()
651 return ds->num_ports; in dsa_routing_port()
655 static inline unsigned int dsa_towards_port(struct dsa_switch *ds, int device, in dsa_towards_port() argument
658 if (device == ds->index) in dsa_towards_port()
661 return dsa_routing_port(ds, device); in dsa_towards_port()
665 static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port) in dsa_upstream_port() argument
667 const struct dsa_port *dp = dsa_to_port(ds, port); in dsa_upstream_port()
673 return dsa_towards_port(ds, cpu_dp->ds->index, cpu_dp->index); in dsa_upstream_port()
677 static inline bool dsa_is_upstream_port(struct dsa_switch *ds, int port) in dsa_is_upstream_port() argument
679 if (dsa_is_unused_port(ds, port)) in dsa_is_upstream_port()
682 return port == dsa_upstream_port(ds, port); in dsa_is_upstream_port()
686 static inline bool dsa_is_downstream_port(struct dsa_switch *ds, int port) in dsa_is_downstream_port() argument
688 return dsa_is_dsa_port(ds, port) && !dsa_is_upstream_port(ds, port); in dsa_is_downstream_port()
692 static inline unsigned int dsa_switch_upstream_port(struct dsa_switch *ds) in dsa_switch_upstream_port() argument
696 dsa_switch_for_each_available_port(dp, ds) { in dsa_switch_upstream_port()
697 return dsa_upstream_port(ds, dp->index); in dsa_switch_upstream_port()
700 return ds->num_ports; in dsa_switch_upstream_port()
722 const struct dsa_switch *ds = dp->ds; in dsa_port_is_vlan_filtering() local
724 if (ds->vlan_filtering_is_global) in dsa_port_is_vlan_filtering()
725 return ds->vlan_filtering; in dsa_port_is_vlan_filtering()
841 return a->ds->dst == b->ds->dst; in dsa_port_tree_same()
854 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
857 int (*change_tag_protocol)(struct dsa_switch *ds,
864 int (*connect_tag_protocol)(struct dsa_switch *ds,
867 int (*port_change_conduit)(struct dsa_switch *ds, int port,
872 int (*setup)(struct dsa_switch *ds);
873 void (*teardown)(struct dsa_switch *ds);
878 int (*port_setup)(struct dsa_switch *ds, int port);
879 void (*port_teardown)(struct dsa_switch *ds, int port);
881 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
886 int (*phy_read)(struct dsa_switch *ds, int port, int regnum);
887 int (*phy_write)(struct dsa_switch *ds, int port,
893 void (*phylink_get_caps)(struct dsa_switch *ds, int port,
895 void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
900 void (*get_strings)(struct dsa_switch *ds, int port,
902 void (*get_ethtool_stats)(struct dsa_switch *ds,
904 int (*get_sset_count)(struct dsa_switch *ds, int port, int sset);
905 void (*get_ethtool_phy_stats)(struct dsa_switch *ds,
907 void (*get_eth_phy_stats)(struct dsa_switch *ds, int port,
909 void (*get_eth_mac_stats)(struct dsa_switch *ds, int port,
911 void (*get_eth_ctrl_stats)(struct dsa_switch *ds, int port,
913 void (*get_rmon_stats)(struct dsa_switch *ds, int port,
916 void (*get_ts_stats)(struct dsa_switch *ds, int port,
918 void (*get_stats64)(struct dsa_switch *ds, int port,
920 void (*get_pause_stats)(struct dsa_switch *ds, int port,
922 void (*self_test)(struct dsa_switch *ds, int port,
928 void (*get_wol)(struct dsa_switch *ds, int port,
930 int (*set_wol)(struct dsa_switch *ds, int port,
936 int (*get_ts_info)(struct dsa_switch *ds, int port,
942 int (*get_mm)(struct dsa_switch *ds, int port,
944 int (*set_mm)(struct dsa_switch *ds, int port,
947 void (*get_mm_stats)(struct dsa_switch *ds, int port,
953 int (*port_get_default_prio)(struct dsa_switch *ds, int port);
954 int (*port_set_default_prio)(struct dsa_switch *ds, int port,
956 int (*port_get_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp);
957 int (*port_add_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp,
959 int (*port_del_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp,
961 int (*port_set_apptrust)(struct dsa_switch *ds, int port,
963 int (*port_get_apptrust)(struct dsa_switch *ds, int port, u8 *sel,
969 int (*suspend)(struct dsa_switch *ds);
970 int (*resume)(struct dsa_switch *ds);
975 int (*port_enable)(struct dsa_switch *ds, int port,
977 void (*port_disable)(struct dsa_switch *ds, int port);
986 int (*port_set_mac_address)(struct dsa_switch *ds, int port,
995 struct dsa_port *(*preferred_default_local_cpu_port)(struct dsa_switch *ds);
1000 bool (*support_eee)(struct dsa_switch *ds, int port);
1001 int (*set_mac_eee)(struct dsa_switch *ds, int port,
1005 int (*get_eeprom_len)(struct dsa_switch *ds);
1006 int (*get_eeprom)(struct dsa_switch *ds,
1008 int (*set_eeprom)(struct dsa_switch *ds,
1014 int (*get_regs_len)(struct dsa_switch *ds, int port);
1015 void (*get_regs)(struct dsa_switch *ds, int port,
1021 int (*port_prechangeupper)(struct dsa_switch *ds, int port,
1027 int (*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
1028 int (*port_bridge_join)(struct dsa_switch *ds, int port,
1032 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
1034 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
1036 int (*port_mst_state_set)(struct dsa_switch *ds, int port,
1038 void (*port_fast_age)(struct dsa_switch *ds, int port);
1039 int (*port_vlan_fast_age)(struct dsa_switch *ds, int port, u16 vid);
1040 int (*port_pre_bridge_flags)(struct dsa_switch *ds, int port,
1043 int (*port_bridge_flags)(struct dsa_switch *ds, int port,
1046 void (*port_set_host_flood)(struct dsa_switch *ds, int port,
1052 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
1055 int (*port_vlan_add)(struct dsa_switch *ds, int port,
1058 int (*port_vlan_del)(struct dsa_switch *ds, int port,
1060 int (*vlan_msti_set)(struct dsa_switch *ds, struct dsa_bridge bridge,
1066 int (*port_fdb_add)(struct dsa_switch *ds, int port,
1069 int (*port_fdb_del)(struct dsa_switch *ds, int port,
1072 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
1074 int (*lag_fdb_add)(struct dsa_switch *ds, struct dsa_lag lag,
1077 int (*lag_fdb_del)(struct dsa_switch *ds, struct dsa_lag lag,
1084 int (*port_mdb_add)(struct dsa_switch *ds, int port,
1087 int (*port_mdb_del)(struct dsa_switch *ds, int port,
1093 int (*get_rxnfc)(struct dsa_switch *ds, int port,
1095 int (*set_rxnfc)(struct dsa_switch *ds, int port,
1101 int (*cls_flower_add)(struct dsa_switch *ds, int port,
1103 int (*cls_flower_del)(struct dsa_switch *ds, int port,
1105 int (*cls_flower_stats)(struct dsa_switch *ds, int port,
1107 int (*port_mirror_add)(struct dsa_switch *ds, int port,
1110 void (*port_mirror_del)(struct dsa_switch *ds, int port,
1112 int (*port_policer_add)(struct dsa_switch *ds, int port,
1114 void (*port_policer_del)(struct dsa_switch *ds, int port);
1115 int (*port_setup_tc)(struct dsa_switch *ds, int port,
1121 int (*crosschip_bridge_join)(struct dsa_switch *ds, int tree_index,
1125 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int tree_index,
1128 int (*crosschip_lag_change)(struct dsa_switch *ds, int sw_index,
1130 int (*crosschip_lag_join)(struct dsa_switch *ds, int sw_index,
1134 int (*crosschip_lag_leave)(struct dsa_switch *ds, int sw_index,
1140 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
1142 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
1145 void (*port_txtstamp)(struct dsa_switch *ds, int port,
1147 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
1151 int (*devlink_param_get)(struct dsa_switch *ds, u32 id,
1153 int (*devlink_param_set)(struct dsa_switch *ds, u32 id,
1155 int (*devlink_info_get)(struct dsa_switch *ds,
1158 int (*devlink_sb_pool_get)(struct dsa_switch *ds,
1161 int (*devlink_sb_pool_set)(struct dsa_switch *ds, unsigned int sb_index,
1165 int (*devlink_sb_port_pool_get)(struct dsa_switch *ds, int port,
1168 int (*devlink_sb_port_pool_set)(struct dsa_switch *ds, int port,
1172 int (*devlink_sb_tc_pool_bind_get)(struct dsa_switch *ds, int port,
1176 int (*devlink_sb_tc_pool_bind_set)(struct dsa_switch *ds, int port,
1181 int (*devlink_sb_occ_snapshot)(struct dsa_switch *ds,
1183 int (*devlink_sb_occ_max_clear)(struct dsa_switch *ds,
1185 int (*devlink_sb_occ_port_pool_get)(struct dsa_switch *ds, int port,
1188 int (*devlink_sb_occ_tc_port_bind_get)(struct dsa_switch *ds, int port,
1199 int (*port_change_mtu)(struct dsa_switch *ds, int port,
1201 int (*port_max_mtu)(struct dsa_switch *ds, int port);
1206 int (*port_lag_change)(struct dsa_switch *ds, int port);
1207 int (*port_lag_join)(struct dsa_switch *ds, int port,
1211 int (*port_lag_leave)(struct dsa_switch *ds, int port,
1217 int (*port_hsr_join)(struct dsa_switch *ds, int port,
1220 int (*port_hsr_leave)(struct dsa_switch *ds, int port,
1226 int (*port_mrp_add)(struct dsa_switch *ds, int port,
1228 int (*port_mrp_del)(struct dsa_switch *ds, int port,
1230 int (*port_mrp_add_ring_role)(struct dsa_switch *ds, int port,
1232 int (*port_mrp_del_ring_role)(struct dsa_switch *ds, int port,
1238 int (*tag_8021q_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
1240 int (*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
1245 void (*conduit_state_change)(struct dsa_switch *ds,
1260 int dsa_devlink_params_register(struct dsa_switch *ds,
1263 void dsa_devlink_params_unregister(struct dsa_switch *ds,
1266 int dsa_devlink_resource_register(struct dsa_switch *ds,
1273 void dsa_devlink_resources_unregister(struct dsa_switch *ds);
1275 void dsa_devlink_resource_occ_get_register(struct dsa_switch *ds,
1279 void dsa_devlink_resource_occ_get_unregister(struct dsa_switch *ds,
1282 dsa_devlink_region_create(struct dsa_switch *ds,
1286 dsa_devlink_port_region_create(struct dsa_switch *ds,
1295 struct dsa_switch *ds; member
1302 return dl_priv->ds; in dsa_devlink_to_ds()
1311 return dl_priv->ds; in dsa_devlink_port_to_ds()
1319 bool dsa_fdb_present_in_other_db(struct dsa_switch *ds, int port,
1322 bool dsa_mdb_present_in_other_db(struct dsa_switch *ds, int port,
1326 int dsa_port_simple_hsr_validate(struct dsa_switch *ds, int port,
1329 int dsa_port_simple_hsr_join(struct dsa_switch *ds, int port,
1332 int dsa_port_simple_hsr_leave(struct dsa_switch *ds, int port,
1370 void dsa_unregister_switch(struct dsa_switch *ds);
1371 int dsa_register_switch(struct dsa_switch *ds);
1372 void dsa_switch_shutdown(struct dsa_switch *ds);
1376 int dsa_switch_suspend(struct dsa_switch *ds);
1377 int dsa_switch_resume(struct dsa_switch *ds);
1379 static inline int dsa_switch_suspend(struct dsa_switch *ds) in dsa_switch_suspend() argument
1383 static inline int dsa_switch_resume(struct dsa_switch *ds) in dsa_switch_resume() argument
1399 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);
1400 bool dsa_supports_eee(struct dsa_switch *ds, int port);