Lines Matching +full:ocelot +full:- +full:hsio

1 /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
23 * - In one of PGID[0-63]: for the destination masks. There are 2 paths by
25 * - The {DMAC, VID} is present in the MAC table. In that case, the
28 * - The {DMAC, VID} is not present in the MAC table (it is unknown). The
34 * ocelot->num_phys_ports - 1, or a multicast set: the PGIDs from
35 * ocelot->num_phys_ports to 63. By convention, a unicast PGID corresponds to
40 * - In one of PGID[64-79]: for the aggregation mask. The switch classifier
41 * dissects each frame and generates a 4-bit Link Aggregation Code which is
48 * - In one of PGID[80-90]: for the source mask. The third time, the PGID table
60 * PGID_MC: the flooding destinations for non-IP multicast traffic.
73 #define for_each_unicast_dest_pgid(ocelot, pgid) \ argument
75 (pgid) < (ocelot)->num_phys_ports; \
78 #define for_each_nonreserved_multicast_dest_pgid(ocelot, pgid) \ argument
79 for ((pgid) = (ocelot)->num_phys_ports + 1; \
83 #define for_each_aggr_pgid(ocelot, pgid) \ argument
104 #define REG_MASK GENMASK(TARGET_OFFSET - 1, 0)
119 HSIO, enumerator
648 struct ocelot;
652 struct net_device *(*port_to_netdev)(struct ocelot *ocelot, int port);
654 int (*reset)(struct ocelot *ocelot);
658 void (*psfp_init)(struct ocelot *ocelot);
659 int (*psfp_filter_add)(struct ocelot *ocelot, int port,
661 int (*psfp_filter_del)(struct ocelot *ocelot, struct flow_cls_offload *f);
662 int (*psfp_stats_get)(struct ocelot *ocelot, struct flow_cls_offload *f,
664 void (*cut_through_fwd)(struct ocelot *ocelot);
665 void (*tas_clock_adjust)(struct ocelot *ocelot);
666 void (*tas_guard_bands_update)(struct ocelot *ocelot, int port);
667 void (*update_stats)(struct ocelot *ocelot);
691 /* all VLANs are egress-untagged */
693 /* all VLANs except the native VLAN and VID 0 are egress-tagged */
695 /* all VLANs except VID 0 are egress-tagged */
697 /* all VLANs are egress-tagged */
765 struct ocelot *ocelot; member
805 struct ocelot { struct
871 * configuration of the Time-Aware Shaper, MAC Merge layer and
872 * cut-through forwarding, on which it depends
883 /* Protects the 2-step TX timestamp ID logic */
899 #define ocelot_bulk_read(ocelot, reg, buf, count) \ argument
900 __ocelot_bulk_read_ix(ocelot, reg, 0, buf, count)
902 #define ocelot_read_ix(ocelot, reg, gi, ri) \ argument
903 __ocelot_read_ix(ocelot, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
904 #define ocelot_read_gix(ocelot, reg, gi) \ argument
905 __ocelot_read_ix(ocelot, reg, reg##_GSZ * (gi))
906 #define ocelot_read_rix(ocelot, reg, ri) \ argument
907 __ocelot_read_ix(ocelot, reg, reg##_RSZ * (ri))
908 #define ocelot_read(ocelot, reg) \ argument
909 __ocelot_read_ix(ocelot, reg, 0)
911 #define ocelot_write_ix(ocelot, val, reg, gi, ri) \ argument
912 __ocelot_write_ix(ocelot, val, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
913 #define ocelot_write_gix(ocelot, val, reg, gi) \ argument
914 __ocelot_write_ix(ocelot, val, reg, reg##_GSZ * (gi))
915 #define ocelot_write_rix(ocelot, val, reg, ri) \ argument
916 __ocelot_write_ix(ocelot, val, reg, reg##_RSZ * (ri))
917 #define ocelot_write(ocelot, val, reg) __ocelot_write_ix(ocelot, val, reg, 0) argument
919 #define ocelot_rmw_ix(ocelot, val, m, reg, gi, ri) \ argument
920 __ocelot_rmw_ix(ocelot, val, m, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
921 #define ocelot_rmw_gix(ocelot, val, m, reg, gi) \ argument
922 __ocelot_rmw_ix(ocelot, val, m, reg, reg##_GSZ * (gi))
923 #define ocelot_rmw_rix(ocelot, val, m, reg, ri) \ argument
924 __ocelot_rmw_ix(ocelot, val, m, reg, reg##_RSZ * (ri))
925 #define ocelot_rmw(ocelot, val, m, reg) __ocelot_rmw_ix(ocelot, val, m, reg, 0) argument
927 #define ocelot_field_write(ocelot, reg, val) \ argument
928 regmap_field_write((ocelot)->regfields[(reg)], (val))
929 #define ocelot_field_read(ocelot, reg, val) \ argument
930 regmap_field_read((ocelot)->regfields[(reg)], (val))
931 #define ocelot_fields_write(ocelot, id, reg, val) \ argument
932 regmap_fields_write((ocelot)->regfields[(reg)], (id), (val))
933 #define ocelot_fields_read(ocelot, id, reg, val) \ argument
934 regmap_fields_read((ocelot)->regfields[(reg)], (id), (val))
936 #define ocelot_target_read_ix(ocelot, target, reg, gi, ri) \ argument
937 __ocelot_target_read_ix(ocelot, target, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
938 #define ocelot_target_read_gix(ocelot, target, reg, gi) \ argument
939 __ocelot_target_read_ix(ocelot, target, reg, reg##_GSZ * (gi))
940 #define ocelot_target_read_rix(ocelot, target, reg, ri) \ argument
941 __ocelot_target_read_ix(ocelot, target, reg, reg##_RSZ * (ri))
942 #define ocelot_target_read(ocelot, target, reg) \ argument
943 __ocelot_target_read_ix(ocelot, target, reg, 0)
945 #define ocelot_target_write_ix(ocelot, target, val, reg, gi, ri) \ argument
946 __ocelot_target_write_ix(ocelot, target, val, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
947 #define ocelot_target_write_gix(ocelot, target, val, reg, gi) \ argument
948 __ocelot_target_write_ix(ocelot, target, val, reg, reg##_GSZ * (gi))
949 #define ocelot_target_write_rix(ocelot, target, val, reg, ri) \ argument
950 __ocelot_target_write_ix(ocelot, target, val, reg, reg##_RSZ * (ri))
951 #define ocelot_target_write(ocelot, target, val, reg) \ argument
952 __ocelot_target_write_ix(ocelot, target, val, reg, 0)
959 int __ocelot_bulk_read_ix(struct ocelot *ocelot, enum ocelot_reg reg,
961 u32 __ocelot_read_ix(struct ocelot *ocelot, enum ocelot_reg reg, u32 offset);
962 void __ocelot_write_ix(struct ocelot *ocelot, u32 val, enum ocelot_reg reg,
964 void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask,
966 u32 __ocelot_target_read_ix(struct ocelot *ocelot, enum ocelot_target target,
968 void __ocelot_target_write_ix(struct ocelot *ocelot, enum ocelot_target target,
972 void ocelot_lock_inj_grp(struct ocelot *ocelot, int grp);
973 void ocelot_unlock_inj_grp(struct ocelot *ocelot, int grp);
974 void ocelot_lock_xtr_grp(struct ocelot *ocelot, int grp);
975 void ocelot_unlock_xtr_grp(struct ocelot *ocelot, int grp);
976 void ocelot_lock_xtr_grp_bh(struct ocelot *ocelot, int grp);
977 void ocelot_unlock_xtr_grp_bh(struct ocelot *ocelot, int grp);
978 bool ocelot_can_inject(struct ocelot *ocelot, int grp);
979 void ocelot_port_inject_frame(struct ocelot *ocelot, int port, int grp,
981 void ocelot_ifh_set_basic(void *ifh, struct ocelot *ocelot, int port,
983 int ocelot_xtr_poll_frame(struct ocelot *ocelot, int grp, struct sk_buff **skb);
984 void ocelot_drain_cpu_queue(struct ocelot *ocelot, int grp);
985 void ocelot_ptp_rx_timestamp(struct ocelot *ocelot, struct sk_buff *skb,
989 int ocelot_regfields_init(struct ocelot *ocelot,
991 struct regmap *ocelot_regmap_init(struct ocelot *ocelot, struct resource *res);
992 int ocelot_reset(struct ocelot *ocelot);
993 int ocelot_init(struct ocelot *ocelot);
994 void ocelot_deinit(struct ocelot *ocelot);
995 void ocelot_init_port(struct ocelot *ocelot, int port);
996 void ocelot_deinit_port(struct ocelot *ocelot, int port);
998 void ocelot_port_setup_dsa_8021q_cpu(struct ocelot *ocelot, int cpu);
999 void ocelot_port_teardown_dsa_8021q_cpu(struct ocelot *ocelot, int cpu);
1000 void ocelot_port_assign_dsa_8021q_cpu(struct ocelot *ocelot, int port, int cpu);
1001 void ocelot_port_unassign_dsa_8021q_cpu(struct ocelot *ocelot, int port);
1002 u32 ocelot_port_assigned_dsa_8021q_cpu_mask(struct ocelot *ocelot, int port);
1010 void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data);
1011 void ocelot_get_ethtool_stats(struct ocelot *ocelot, int port, u64 *data);
1012 int ocelot_get_sset_count(struct ocelot *ocelot, int port, int sset);
1013 void ocelot_port_get_stats64(struct ocelot *ocelot, int port,
1015 void ocelot_port_get_pause_stats(struct ocelot *ocelot, int port,
1017 void ocelot_port_get_mm_stats(struct ocelot *ocelot, int port,
1019 void ocelot_port_get_rmon_stats(struct ocelot *ocelot, int port,
1022 void ocelot_port_get_eth_ctrl_stats(struct ocelot *ocelot, int port,
1024 void ocelot_port_get_eth_mac_stats(struct ocelot *ocelot, int port,
1026 void ocelot_port_get_eth_phy_stats(struct ocelot *ocelot, int port,
1028 int ocelot_get_ts_info(struct ocelot *ocelot, int port,
1030 void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs);
1031 int ocelot_port_vlan_filtering(struct ocelot *ocelot, int port, bool enabled,
1033 void ocelot_bridge_stp_state_set(struct ocelot *ocelot, int port, u8 state);
1034 u32 ocelot_get_bridge_fwd_mask(struct ocelot *ocelot, int src_port);
1035 int ocelot_port_pre_bridge_flags(struct ocelot *ocelot, int port,
1037 void ocelot_port_bridge_flags(struct ocelot *ocelot, int port,
1039 int ocelot_port_get_default_prio(struct ocelot *ocelot, int port);
1040 int ocelot_port_set_default_prio(struct ocelot *ocelot, int port, u8 prio);
1041 int ocelot_port_get_dscp_prio(struct ocelot *ocelot, int port, u8 dscp);
1042 int ocelot_port_add_dscp_prio(struct ocelot *ocelot, int port, u8 dscp, u8 prio);
1043 int ocelot_port_del_dscp_prio(struct ocelot *ocelot, int port, u8 dscp, u8 prio);
1044 int ocelot_port_bridge_join(struct ocelot *ocelot, int port,
1047 void ocelot_port_bridge_leave(struct ocelot *ocelot, int port,
1049 int ocelot_mact_flush(struct ocelot *ocelot, int port);
1050 int ocelot_fdb_dump(struct ocelot *ocelot, int port,
1052 int ocelot_fdb_add(struct ocelot *ocelot, int port, const unsigned char *addr,
1054 int ocelot_fdb_del(struct ocelot *ocelot, int port, const unsigned char *addr,
1056 int ocelot_lag_fdb_add(struct ocelot *ocelot, struct net_device *bond,
1059 int ocelot_lag_fdb_del(struct ocelot *ocelot, struct net_device *bond,
1062 int ocelot_vlan_prepare(struct ocelot *ocelot, int port, u16 vid, bool pvid,
1064 int ocelot_vlan_add(struct ocelot *ocelot, int port, u16 vid, bool pvid,
1066 int ocelot_vlan_del(struct ocelot *ocelot, int port, u16 vid);
1067 int ocelot_hwstamp_get(struct ocelot *ocelot, int port, struct ifreq *ifr);
1068 int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr);
1069 int ocelot_port_txtstamp_request(struct ocelot *ocelot, int port,
1072 void ocelot_get_txtstamp(struct ocelot *ocelot);
1073 void ocelot_port_set_maxlen(struct ocelot *ocelot, int port, size_t sdu);
1074 int ocelot_get_max_mtu(struct ocelot *ocelot, int port);
1075 int ocelot_port_policer_add(struct ocelot *ocelot, int port,
1077 int ocelot_port_policer_del(struct ocelot *ocelot, int port);
1078 int ocelot_port_mirror_add(struct ocelot *ocelot, int from, int to,
1080 void ocelot_port_mirror_del(struct ocelot *ocelot, int from, bool ingress);
1081 int ocelot_cls_flower_replace(struct ocelot *ocelot, int port,
1083 int ocelot_cls_flower_destroy(struct ocelot *ocelot, int port,
1085 int ocelot_cls_flower_stats(struct ocelot *ocelot, int port,
1087 int ocelot_port_mdb_add(struct ocelot *ocelot, int port,
1090 int ocelot_port_mdb_del(struct ocelot *ocelot, int port,
1093 int ocelot_port_lag_join(struct ocelot *ocelot, int port,
1097 void ocelot_port_lag_leave(struct ocelot *ocelot, int port,
1099 void ocelot_port_lag_change(struct ocelot *ocelot, int port, bool lag_tx_active);
1100 int ocelot_bond_get_id(struct ocelot *ocelot, struct net_device *bond);
1102 int ocelot_devlink_sb_register(struct ocelot *ocelot);
1103 void ocelot_devlink_sb_unregister(struct ocelot *ocelot);
1104 int ocelot_sb_pool_get(struct ocelot *ocelot, unsigned int sb_index,
1107 int ocelot_sb_pool_set(struct ocelot *ocelot, unsigned int sb_index,
1111 int ocelot_sb_port_pool_get(struct ocelot *ocelot, int port,
1114 int ocelot_sb_port_pool_set(struct ocelot *ocelot, int port,
1117 int ocelot_sb_tc_pool_bind_get(struct ocelot *ocelot, int port,
1121 int ocelot_sb_tc_pool_bind_set(struct ocelot *ocelot, int port,
1126 int ocelot_sb_occ_snapshot(struct ocelot *ocelot, unsigned int sb_index);
1127 int ocelot_sb_occ_max_clear(struct ocelot *ocelot, unsigned int sb_index);
1128 int ocelot_sb_occ_port_pool_get(struct ocelot *ocelot, int port,
1131 int ocelot_sb_occ_tc_port_bind_get(struct ocelot *ocelot, int port,
1136 int ocelot_port_configure_serdes(struct ocelot *ocelot, int port,
1139 void ocelot_phylink_mac_config(struct ocelot *ocelot, int port,
1142 void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port,
1146 void ocelot_phylink_mac_link_up(struct ocelot *ocelot, int port,
1154 int ocelot_mact_lookup(struct ocelot *ocelot, int *dst_idx,
1157 int ocelot_mact_learn_streamdata(struct ocelot *ocelot, int dst_idx,
1163 int ocelot_migrate_mdbs(struct ocelot *ocelot, unsigned long from_mask,
1166 int ocelot_vcap_policer_add(struct ocelot *ocelot, u32 pol_ix,
1168 int ocelot_vcap_policer_del(struct ocelot *ocelot, u32 pol_ix);
1170 void ocelot_mm_irq(struct ocelot *ocelot);
1171 int ocelot_port_set_mm(struct ocelot *ocelot, int port,
1174 int ocelot_port_get_mm(struct ocelot *ocelot, int port,
1176 int ocelot_port_mqprio(struct ocelot *ocelot, int port,
1180 int ocelot_mrp_add(struct ocelot *ocelot, int port,
1182 int ocelot_mrp_del(struct ocelot *ocelot, int port,
1184 int ocelot_mrp_add_ring_role(struct ocelot *ocelot, int port,
1186 int ocelot_mrp_del_ring_role(struct ocelot *ocelot, int port,
1189 static inline int ocelot_mrp_add(struct ocelot *ocelot, int port, in ocelot_mrp_add() argument
1192 return -EOPNOTSUPP; in ocelot_mrp_add()
1195 static inline int ocelot_mrp_del(struct ocelot *ocelot, int port, in ocelot_mrp_del() argument
1198 return -EOPNOTSUPP; in ocelot_mrp_del()
1202 ocelot_mrp_add_ring_role(struct ocelot *ocelot, int port, in ocelot_mrp_add_ring_role() argument
1205 return -EOPNOTSUPP; in ocelot_mrp_add_ring_role()
1209 ocelot_mrp_del_ring_role(struct ocelot *ocelot, int port, in ocelot_mrp_del_ring_role() argument
1212 return -EOPNOTSUPP; in ocelot_mrp_del_ring_role()
1216 void ocelot_pll5_init(struct ocelot *ocelot);