Lines Matching refs:ds

93 	int (*connect)(struct dsa_switch *ds);
94 void (*disconnect)(struct dsa_switch *ds);
187 if ((_dp)->ds == (_ds) && (_dp)->hsr_dev == (_hsr))
265 struct dsa_switch *ds; member
496 static inline struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p) in dsa_to_port() argument
498 struct dsa_switch_tree *dst = ds->dst; in dsa_to_port()
502 if (dp->ds == ds && dp->index == p) in dsa_to_port()
534 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p) in dsa_is_unused_port() argument
536 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_UNUSED; in dsa_is_unused_port()
539 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p) in dsa_is_cpu_port() argument
541 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_CPU; in dsa_is_cpu_port()
544 static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p) in dsa_is_dsa_port() argument
546 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_DSA; in dsa_is_dsa_port()
549 static inline bool dsa_is_user_port(struct dsa_switch *ds, int p) in dsa_is_user_port() argument
551 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_USER; in dsa_is_user_port()
560 if ((_dp)->ds == (_ds))
564 if ((_dp)->ds == (_ds))
568 if ((_dp)->ds == (_ds))
586 static inline u32 dsa_user_ports(struct dsa_switch *ds) in dsa_user_ports() argument
591 dsa_switch_for_each_user_port(dp, ds) in dsa_user_ports()
597 static inline u32 dsa_cpu_ports(struct dsa_switch *ds) in dsa_cpu_ports() argument
602 dsa_switch_for_each_cpu_port(cpu_dp, ds) in dsa_cpu_ports()
609 static inline unsigned int dsa_routing_port(struct dsa_switch *ds, int device) in dsa_routing_port() argument
611 struct dsa_switch_tree *dst = ds->dst; in dsa_routing_port()
615 if (dl->dp->ds == ds && dl->link_dp->ds->index == device) in dsa_routing_port()
618 return ds->num_ports; in dsa_routing_port()
622 static inline unsigned int dsa_towards_port(struct dsa_switch *ds, int device, in dsa_towards_port() argument
625 if (device == ds->index) in dsa_towards_port()
628 return dsa_routing_port(ds, device); in dsa_towards_port()
632 static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port) in dsa_upstream_port() argument
634 const struct dsa_port *dp = dsa_to_port(ds, port); in dsa_upstream_port()
640 return dsa_towards_port(ds, cpu_dp->ds->index, cpu_dp->index); in dsa_upstream_port()
644 static inline bool dsa_is_upstream_port(struct dsa_switch *ds, int port) in dsa_is_upstream_port() argument
646 if (dsa_is_unused_port(ds, port)) in dsa_is_upstream_port()
649 return port == dsa_upstream_port(ds, port); in dsa_is_upstream_port()
653 static inline bool dsa_is_downstream_port(struct dsa_switch *ds, int port) in dsa_is_downstream_port() argument
655 return dsa_is_dsa_port(ds, port) && !dsa_is_upstream_port(ds, port); in dsa_is_downstream_port()
659 static inline unsigned int dsa_switch_upstream_port(struct dsa_switch *ds) in dsa_switch_upstream_port() argument
663 dsa_switch_for_each_available_port(dp, ds) { in dsa_switch_upstream_port()
664 return dsa_upstream_port(ds, dp->index); in dsa_switch_upstream_port()
667 return ds->num_ports; in dsa_switch_upstream_port()
689 const struct dsa_switch *ds = dp->ds; in dsa_port_is_vlan_filtering() local
691 if (ds->vlan_filtering_is_global) in dsa_port_is_vlan_filtering()
692 return ds->vlan_filtering; in dsa_port_is_vlan_filtering()
807 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
810 int (*change_tag_protocol)(struct dsa_switch *ds,
817 int (*connect_tag_protocol)(struct dsa_switch *ds,
821 int (*setup)(struct dsa_switch *ds);
822 void (*teardown)(struct dsa_switch *ds);
827 int (*port_setup)(struct dsa_switch *ds, int port);
828 void (*port_teardown)(struct dsa_switch *ds, int port);
830 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
835 int (*phy_read)(struct dsa_switch *ds, int port, int regnum);
836 int (*phy_write)(struct dsa_switch *ds, int port,
842 void (*adjust_link)(struct dsa_switch *ds, int port,
844 void (*fixed_link_update)(struct dsa_switch *ds, int port,
850 void (*phylink_get_caps)(struct dsa_switch *ds, int port,
852 void (*phylink_validate)(struct dsa_switch *ds, int port,
855 struct phylink_pcs *(*phylink_mac_select_pcs)(struct dsa_switch *ds,
858 int (*phylink_mac_link_state)(struct dsa_switch *ds, int port,
860 void (*phylink_mac_config)(struct dsa_switch *ds, int port,
863 void (*phylink_mac_an_restart)(struct dsa_switch *ds, int port);
864 void (*phylink_mac_link_down)(struct dsa_switch *ds, int port,
867 void (*phylink_mac_link_up)(struct dsa_switch *ds, int port,
873 void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
878 void (*get_strings)(struct dsa_switch *ds, int port,
880 void (*get_ethtool_stats)(struct dsa_switch *ds,
882 int (*get_sset_count)(struct dsa_switch *ds, int port, int sset);
883 void (*get_ethtool_phy_stats)(struct dsa_switch *ds,
885 void (*get_eth_phy_stats)(struct dsa_switch *ds, int port,
887 void (*get_eth_mac_stats)(struct dsa_switch *ds, int port,
889 void (*get_eth_ctrl_stats)(struct dsa_switch *ds, int port,
891 void (*get_stats64)(struct dsa_switch *ds, int port,
893 void (*self_test)(struct dsa_switch *ds, int port,
899 void (*get_wol)(struct dsa_switch *ds, int port,
901 int (*set_wol)(struct dsa_switch *ds, int port,
907 int (*get_ts_info)(struct dsa_switch *ds, int port,
913 int (*port_get_default_prio)(struct dsa_switch *ds, int port);
914 int (*port_set_default_prio)(struct dsa_switch *ds, int port,
916 int (*port_get_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp);
917 int (*port_add_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp,
919 int (*port_del_dscp_prio)(struct dsa_switch *ds, int port, u8 dscp,
925 int (*suspend)(struct dsa_switch *ds);
926 int (*resume)(struct dsa_switch *ds);
931 int (*port_enable)(struct dsa_switch *ds, int port,
933 void (*port_disable)(struct dsa_switch *ds, int port);
938 int (*set_mac_eee)(struct dsa_switch *ds, int port,
940 int (*get_mac_eee)(struct dsa_switch *ds, int port,
944 int (*get_eeprom_len)(struct dsa_switch *ds);
945 int (*get_eeprom)(struct dsa_switch *ds,
947 int (*set_eeprom)(struct dsa_switch *ds,
953 int (*get_regs_len)(struct dsa_switch *ds, int port);
954 void (*get_regs)(struct dsa_switch *ds, int port,
960 int (*port_prechangeupper)(struct dsa_switch *ds, int port,
966 int (*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
967 int (*port_bridge_join)(struct dsa_switch *ds, int port,
971 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
973 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
975 int (*port_mst_state_set)(struct dsa_switch *ds, int port,
977 void (*port_fast_age)(struct dsa_switch *ds, int port);
978 int (*port_vlan_fast_age)(struct dsa_switch *ds, int port, u16 vid);
979 int (*port_pre_bridge_flags)(struct dsa_switch *ds, int port,
982 int (*port_bridge_flags)(struct dsa_switch *ds, int port,
985 void (*port_set_host_flood)(struct dsa_switch *ds, int port,
991 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
994 int (*port_vlan_add)(struct dsa_switch *ds, int port,
997 int (*port_vlan_del)(struct dsa_switch *ds, int port,
999 int (*vlan_msti_set)(struct dsa_switch *ds, struct dsa_bridge bridge,
1005 int (*port_fdb_add)(struct dsa_switch *ds, int port,
1008 int (*port_fdb_del)(struct dsa_switch *ds, int port,
1011 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
1013 int (*lag_fdb_add)(struct dsa_switch *ds, struct dsa_lag lag,
1016 int (*lag_fdb_del)(struct dsa_switch *ds, struct dsa_lag lag,
1023 int (*port_mdb_add)(struct dsa_switch *ds, int port,
1026 int (*port_mdb_del)(struct dsa_switch *ds, int port,
1032 int (*get_rxnfc)(struct dsa_switch *ds, int port,
1034 int (*set_rxnfc)(struct dsa_switch *ds, int port,
1040 int (*cls_flower_add)(struct dsa_switch *ds, int port,
1042 int (*cls_flower_del)(struct dsa_switch *ds, int port,
1044 int (*cls_flower_stats)(struct dsa_switch *ds, int port,
1046 int (*port_mirror_add)(struct dsa_switch *ds, int port,
1049 void (*port_mirror_del)(struct dsa_switch *ds, int port,
1051 int (*port_policer_add)(struct dsa_switch *ds, int port,
1053 void (*port_policer_del)(struct dsa_switch *ds, int port);
1054 int (*port_setup_tc)(struct dsa_switch *ds, int port,
1060 int (*crosschip_bridge_join)(struct dsa_switch *ds, int tree_index,
1064 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int tree_index,
1067 int (*crosschip_lag_change)(struct dsa_switch *ds, int sw_index,
1069 int (*crosschip_lag_join)(struct dsa_switch *ds, int sw_index,
1072 int (*crosschip_lag_leave)(struct dsa_switch *ds, int sw_index,
1078 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
1080 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
1082 void (*port_txtstamp)(struct dsa_switch *ds, int port,
1084 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
1088 int (*devlink_param_get)(struct dsa_switch *ds, u32 id,
1090 int (*devlink_param_set)(struct dsa_switch *ds, u32 id,
1092 int (*devlink_info_get)(struct dsa_switch *ds,
1095 int (*devlink_sb_pool_get)(struct dsa_switch *ds,
1098 int (*devlink_sb_pool_set)(struct dsa_switch *ds, unsigned int sb_index,
1102 int (*devlink_sb_port_pool_get)(struct dsa_switch *ds, int port,
1105 int (*devlink_sb_port_pool_set)(struct dsa_switch *ds, int port,
1109 int (*devlink_sb_tc_pool_bind_get)(struct dsa_switch *ds, int port,
1113 int (*devlink_sb_tc_pool_bind_set)(struct dsa_switch *ds, int port,
1118 int (*devlink_sb_occ_snapshot)(struct dsa_switch *ds,
1120 int (*devlink_sb_occ_max_clear)(struct dsa_switch *ds,
1122 int (*devlink_sb_occ_port_pool_get)(struct dsa_switch *ds, int port,
1125 int (*devlink_sb_occ_tc_port_bind_get)(struct dsa_switch *ds, int port,
1136 int (*port_change_mtu)(struct dsa_switch *ds, int port,
1138 int (*port_max_mtu)(struct dsa_switch *ds, int port);
1143 int (*port_lag_change)(struct dsa_switch *ds, int port);
1144 int (*port_lag_join)(struct dsa_switch *ds, int port,
1147 int (*port_lag_leave)(struct dsa_switch *ds, int port,
1153 int (*port_hsr_join)(struct dsa_switch *ds, int port,
1155 int (*port_hsr_leave)(struct dsa_switch *ds, int port,
1161 int (*port_mrp_add)(struct dsa_switch *ds, int port,
1163 int (*port_mrp_del)(struct dsa_switch *ds, int port,
1165 int (*port_mrp_add_ring_role)(struct dsa_switch *ds, int port,
1167 int (*port_mrp_del_ring_role)(struct dsa_switch *ds, int port,
1173 int (*tag_8021q_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
1175 int (*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
1180 void (*master_state_change)(struct dsa_switch *ds,
1193 int dsa_devlink_params_register(struct dsa_switch *ds,
1196 void dsa_devlink_params_unregister(struct dsa_switch *ds,
1199 int dsa_devlink_resource_register(struct dsa_switch *ds,
1206 void dsa_devlink_resources_unregister(struct dsa_switch *ds);
1208 void dsa_devlink_resource_occ_get_register(struct dsa_switch *ds,
1212 void dsa_devlink_resource_occ_get_unregister(struct dsa_switch *ds,
1215 dsa_devlink_region_create(struct dsa_switch *ds,
1219 dsa_devlink_port_region_create(struct dsa_switch *ds,
1228 struct dsa_switch *ds; member
1235 return dl_priv->ds; in dsa_devlink_to_ds()
1244 return dl_priv->ds; in dsa_devlink_port_to_ds()
1259 bool dsa_fdb_present_in_other_db(struct dsa_switch *ds, int port,
1262 bool dsa_mdb_present_in_other_db(struct dsa_switch *ds, int port,
1337 void dsa_unregister_switch(struct dsa_switch *ds);
1338 int dsa_register_switch(struct dsa_switch *ds);
1339 void dsa_switch_shutdown(struct dsa_switch *ds);
1343 int dsa_switch_suspend(struct dsa_switch *ds);
1344 int dsa_switch_resume(struct dsa_switch *ds);
1346 static inline int dsa_switch_suspend(struct dsa_switch *ds) in dsa_switch_suspend() argument
1350 static inline int dsa_switch_resume(struct dsa_switch *ds) in dsa_switch_resume() argument
1366 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);