Lines Matching refs:ds

98 	int (*connect)(struct dsa_switch *ds);
99 void (*disconnect)(struct dsa_switch *ds);
178 if ((_dp)->ds == (_ds) && (_dp)->hsr_dev == (_hsr))
256 struct dsa_switch *ds;
491 static inline struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p)
493 struct dsa_switch_tree *dst = ds->dst;
497 if (dp->ds == ds && dp->index == p)
529 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p)
531 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_UNUSED;
534 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p)
536 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_CPU;
539 static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p)
541 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_DSA;
544 static inline bool dsa_is_user_port(struct dsa_switch *ds, int p)
546 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_USER;
563 if ((_dp)->ds == (_ds))
567 if ((_dp)->ds == (_ds))
571 if ((_dp)->ds == (_ds))
589 static inline u32 dsa_user_ports(struct dsa_switch *ds)
594 dsa_switch_for_each_user_port(dp, ds)
600 static inline u32 dsa_cpu_ports(struct dsa_switch *ds)
605 dsa_switch_for_each_cpu_port(cpu_dp, ds)
612 static inline unsigned int dsa_routing_port(struct dsa_switch *ds, int device)
614 struct dsa_switch_tree *dst = ds->dst;
618 if (dl->dp->ds == ds && dl->link_dp->ds->index == device)
621 return ds->num_ports;
625 static inline unsigned int dsa_towards_port(struct dsa_switch *ds, int device,
628 if (device == ds->index)
631 return dsa_routing_port(ds, device);
635 static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port)
637 const struct dsa_port *dp = dsa_to_port(ds, port);
643 return dsa_towards_port(ds, cpu_dp->ds->index, cpu_dp->index);
647 static inline bool dsa_is_upstream_port(struct dsa_switch *ds, int port)
649 if (dsa_is_unused_port(ds, port))
652 return port == dsa_upstream_port(ds, port);
656 static inline bool dsa_is_downstream_port(struct dsa_switch *ds, int port)
658 return dsa_is_dsa_port(ds, port) && !dsa_is_upstream_port(ds, port);
662 static inline unsigned int dsa_switch_upstream_port(struct dsa_switch *ds)
666 dsa_switch_for_each_available_port(dp, ds) {
667 return dsa_upstream_port(ds, dp->index);
670 return ds->num_ports;
692 const struct dsa_switch *ds = dp->ds;
694 if (ds->vlan_filtering_is_global)
695 return ds->vlan_filtering;
811 return a->ds->dst == b->ds->dst;
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_conduit)(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);
979 int (*port_set_mac_address)(struct dsa_switch *ds, int port,
988 struct dsa_port *(*preferred_default_local_cpu_port)(struct dsa_switch *ds);
993 int (*set_mac_eee)(struct dsa_switch *ds, int port,
995 int (*get_mac_eee)(struct dsa_switch *ds, int port,
999 int (*get_eeprom_len)(struct dsa_switch *ds);
1000 int (*get_eeprom)(struct dsa_switch *ds,
1002 int (*set_eeprom)(struct dsa_switch *ds,
1008 int (*get_regs_len)(struct dsa_switch *ds, int port);
1009 void (*get_regs)(struct dsa_switch *ds, int port,
1015 int (*port_prechangeupper)(struct dsa_switch *ds, int port,
1021 int (*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
1022 int (*port_bridge_join)(struct dsa_switch *ds, int port,
1026 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
1028 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
1030 int (*port_mst_state_set)(struct dsa_switch *ds, int port,
1032 void (*port_fast_age)(struct dsa_switch *ds, int port);
1033 int (*port_vlan_fast_age)(struct dsa_switch *ds, int port, u16 vid);
1034 int (*port_pre_bridge_flags)(struct dsa_switch *ds, int port,
1037 int (*port_bridge_flags)(struct dsa_switch *ds, int port,
1040 void (*port_set_host_flood)(struct dsa_switch *ds, int port,
1046 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
1049 int (*port_vlan_add)(struct dsa_switch *ds, int port,
1052 int (*port_vlan_del)(struct dsa_switch *ds, int port,
1054 int (*vlan_msti_set)(struct dsa_switch *ds, struct dsa_bridge bridge,
1060 int (*port_fdb_add)(struct dsa_switch *ds, int port,
1063 int (*port_fdb_del)(struct dsa_switch *ds, int port,
1066 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
1068 int (*lag_fdb_add)(struct dsa_switch *ds, struct dsa_lag lag,
1071 int (*lag_fdb_del)(struct dsa_switch *ds, struct dsa_lag lag,
1078 int (*port_mdb_add)(struct dsa_switch *ds, int port,
1081 int (*port_mdb_del)(struct dsa_switch *ds, int port,
1087 int (*get_rxnfc)(struct dsa_switch *ds, int port,
1089 int (*set_rxnfc)(struct dsa_switch *ds, int port,
1095 int (*cls_flower_add)(struct dsa_switch *ds, int port,
1097 int (*cls_flower_del)(struct dsa_switch *ds, int port,
1099 int (*cls_flower_stats)(struct dsa_switch *ds, int port,
1101 int (*port_mirror_add)(struct dsa_switch *ds, int port,
1104 void (*port_mirror_del)(struct dsa_switch *ds, int port,
1106 int (*port_policer_add)(struct dsa_switch *ds, int port,
1108 void (*port_policer_del)(struct dsa_switch *ds, int port);
1109 int (*port_setup_tc)(struct dsa_switch *ds, int port,
1115 int (*crosschip_bridge_join)(struct dsa_switch *ds, int tree_index,
1119 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int tree_index,
1122 int (*crosschip_lag_change)(struct dsa_switch *ds, int sw_index,
1124 int (*crosschip_lag_join)(struct dsa_switch *ds, int sw_index,
1128 int (*crosschip_lag_leave)(struct dsa_switch *ds, int sw_index,
1134 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
1136 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
1138 void (*port_txtstamp)(struct dsa_switch *ds, int port,
1140 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
1144 int (*devlink_param_get)(struct dsa_switch *ds, u32 id,
1146 int (*devlink_param_set)(struct dsa_switch *ds, u32 id,
1148 int (*devlink_info_get)(struct dsa_switch *ds,
1151 int (*devlink_sb_pool_get)(struct dsa_switch *ds,
1154 int (*devlink_sb_pool_set)(struct dsa_switch *ds, unsigned int sb_index,
1158 int (*devlink_sb_port_pool_get)(struct dsa_switch *ds, int port,
1161 int (*devlink_sb_port_pool_set)(struct dsa_switch *ds, int port,
1165 int (*devlink_sb_tc_pool_bind_get)(struct dsa_switch *ds, int port,
1169 int (*devlink_sb_tc_pool_bind_set)(struct dsa_switch *ds, int port,
1174 int (*devlink_sb_occ_snapshot)(struct dsa_switch *ds,
1176 int (*devlink_sb_occ_max_clear)(struct dsa_switch *ds,
1178 int (*devlink_sb_occ_port_pool_get)(struct dsa_switch *ds, int port,
1181 int (*devlink_sb_occ_tc_port_bind_get)(struct dsa_switch *ds, int port,
1192 int (*port_change_mtu)(struct dsa_switch *ds, int port,
1194 int (*port_max_mtu)(struct dsa_switch *ds, int port);
1199 int (*port_lag_change)(struct dsa_switch *ds, int port);
1200 int (*port_lag_join)(struct dsa_switch *ds, int port,
1204 int (*port_lag_leave)(struct dsa_switch *ds, int port,
1210 int (*port_hsr_join)(struct dsa_switch *ds, int port,
1213 int (*port_hsr_leave)(struct dsa_switch *ds, int port,
1219 int (*port_mrp_add)(struct dsa_switch *ds, int port,
1221 int (*port_mrp_del)(struct dsa_switch *ds, int port,
1223 int (*port_mrp_add_ring_role)(struct dsa_switch *ds, int port,
1225 int (*port_mrp_del_ring_role)(struct dsa_switch *ds, int port,
1231 int (*tag_8021q_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
1233 int (*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
1238 void (*conduit_state_change)(struct dsa_switch *ds,
1251 int dsa_devlink_params_register(struct dsa_switch *ds,
1254 void dsa_devlink_params_unregister(struct dsa_switch *ds,
1257 int dsa_devlink_resource_register(struct dsa_switch *ds,
1264 void dsa_devlink_resources_unregister(struct dsa_switch *ds);
1266 void dsa_devlink_resource_occ_get_register(struct dsa_switch *ds,
1270 void dsa_devlink_resource_occ_get_unregister(struct dsa_switch *ds,
1273 dsa_devlink_region_create(struct dsa_switch *ds,
1277 dsa_devlink_port_region_create(struct dsa_switch *ds,
1286 struct dsa_switch *ds;
1293 return dl_priv->ds;
1302 return dl_priv->ds;
1315 bool dsa_fdb_present_in_other_db(struct dsa_switch *ds, int port,
1318 bool dsa_mdb_present_in_other_db(struct dsa_switch *ds, int port,
1357 void dsa_unregister_switch(struct dsa_switch *ds);
1358 int dsa_register_switch(struct dsa_switch *ds);
1359 void dsa_switch_shutdown(struct dsa_switch *ds);
1363 int dsa_switch_suspend(struct dsa_switch *ds);
1364 int dsa_switch_resume(struct dsa_switch *ds);
1366 static inline int dsa_switch_suspend(struct dsa_switch *ds)
1370 static inline int dsa_switch_resume(struct dsa_switch *ds)
1386 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);