ocelot.h (6c30384eb1dec96b678ff9c01c15134b1a0e81f4) ocelot.h (f59fd9cab7305266f4148776c3b66329551a2a3a)
1/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
2/* Copyright (c) 2017 Microsemi Corporation
3 */
4
5#ifndef _SOC_MSCC_OCELOT_H
6#define _SOC_MSCC_OCELOT_H
7
8#include <linux/ptp_clock_kernel.h>

--- 565 unchanged lines hidden (view full) ---

574 int pol_lpr;
575};
576
577struct ocelot_vlan {
578 bool valid;
579 u16 vid;
580};
581
1/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
2/* Copyright (c) 2017 Microsemi Corporation
3 */
4
5#ifndef _SOC_MSCC_OCELOT_H
6#define _SOC_MSCC_OCELOT_H
7
8#include <linux/ptp_clock_kernel.h>

--- 565 unchanged lines hidden (view full) ---

574 int pol_lpr;
575};
576
577struct ocelot_vlan {
578 bool valid;
579 u16 vid;
580};
581
582enum ocelot_sb {
583 OCELOT_SB_BUF,
584 OCELOT_SB_REF,
585 OCELOT_SB_NUM,
586};
587
588enum ocelot_sb_pool {
589 OCELOT_SB_POOL_ING,
590 OCELOT_SB_POOL_EGR,
591 OCELOT_SB_POOL_NUM,
592};
593
582struct ocelot_port {
583 struct ocelot *ocelot;
584
585 struct regmap *target;
586
587 bool vlan_aware;
588 /* VLAN that untagged frames are classified to, on ingress */
589 struct ocelot_vlan pvid_vlan;

--- 17 unchanged lines hidden (view full) ---

607
608 const struct ocelot_ops *ops;
609 struct regmap *targets[TARGET_MAX];
610 struct regmap_field *regfields[REGFIELD_MAX];
611 const u32 *const *map;
612 const struct ocelot_stat_layout *stats_layout;
613 unsigned int num_stats;
614
594struct ocelot_port {
595 struct ocelot *ocelot;
596
597 struct regmap *target;
598
599 bool vlan_aware;
600 /* VLAN that untagged frames are classified to, on ingress */
601 struct ocelot_vlan pvid_vlan;

--- 17 unchanged lines hidden (view full) ---

619
620 const struct ocelot_ops *ops;
621 struct regmap *targets[TARGET_MAX];
622 struct regmap_field *regfields[REGFIELD_MAX];
623 const u32 *const *map;
624 const struct ocelot_stat_layout *stats_layout;
625 unsigned int num_stats;
626
627 u32 pool_size[OCELOT_SB_NUM][OCELOT_SB_POOL_NUM];
615 int packet_buffer_size;
616 int num_frame_refs;
617 int num_mact_rows;
618
619 struct net_device *hw_bridge_dev;
620 u16 bridge_mask;
621 u16 bridge_fwd_mask;
622

--- 155 unchanged lines hidden (view full) ---

778 struct flow_cls_offload *f, bool ingress);
779int ocelot_cls_flower_stats(struct ocelot *ocelot, int port,
780 struct flow_cls_offload *f, bool ingress);
781int ocelot_port_mdb_add(struct ocelot *ocelot, int port,
782 const struct switchdev_obj_port_mdb *mdb);
783int ocelot_port_mdb_del(struct ocelot *ocelot, int port,
784 const struct switchdev_obj_port_mdb *mdb);
785
628 int packet_buffer_size;
629 int num_frame_refs;
630 int num_mact_rows;
631
632 struct net_device *hw_bridge_dev;
633 u16 bridge_mask;
634 u16 bridge_fwd_mask;
635

--- 155 unchanged lines hidden (view full) ---

791 struct flow_cls_offload *f, bool ingress);
792int ocelot_cls_flower_stats(struct ocelot *ocelot, int port,
793 struct flow_cls_offload *f, bool ingress);
794int ocelot_port_mdb_add(struct ocelot *ocelot, int port,
795 const struct switchdev_obj_port_mdb *mdb);
796int ocelot_port_mdb_del(struct ocelot *ocelot, int port,
797 const struct switchdev_obj_port_mdb *mdb);
798
799int ocelot_devlink_sb_register(struct ocelot *ocelot);
800void ocelot_devlink_sb_unregister(struct ocelot *ocelot);
801int ocelot_sb_pool_get(struct ocelot *ocelot, unsigned int sb_index,
802 u16 pool_index,
803 struct devlink_sb_pool_info *pool_info);
804int ocelot_sb_pool_set(struct ocelot *ocelot, unsigned int sb_index,
805 u16 pool_index, u32 size,
806 enum devlink_sb_threshold_type threshold_type,
807 struct netlink_ext_ack *extack);
808int ocelot_sb_port_pool_get(struct ocelot *ocelot, int port,
809 unsigned int sb_index, u16 pool_index,
810 u32 *p_threshold);
811int ocelot_sb_port_pool_set(struct ocelot *ocelot, int port,
812 unsigned int sb_index, u16 pool_index,
813 u32 threshold, struct netlink_ext_ack *extack);
814int ocelot_sb_tc_pool_bind_get(struct ocelot *ocelot, int port,
815 unsigned int sb_index, u16 tc_index,
816 enum devlink_sb_pool_type pool_type,
817 u16 *p_pool_index, u32 *p_threshold);
818int ocelot_sb_tc_pool_bind_set(struct ocelot *ocelot, int port,
819 unsigned int sb_index, u16 tc_index,
820 enum devlink_sb_pool_type pool_type,
821 u16 pool_index, u32 threshold,
822 struct netlink_ext_ack *extack);
823int ocelot_sb_occ_snapshot(struct ocelot *ocelot, unsigned int sb_index);
824int ocelot_sb_occ_max_clear(struct ocelot *ocelot, unsigned int sb_index);
825int ocelot_sb_occ_port_pool_get(struct ocelot *ocelot, int port,
826 unsigned int sb_index, u16 pool_index,
827 u32 *p_cur, u32 *p_max);
828int ocelot_sb_occ_tc_port_bind_get(struct ocelot *ocelot, int port,
829 unsigned int sb_index, u16 tc_index,
830 enum devlink_sb_pool_type pool_type,
831 u32 *p_cur, u32 *p_max);
832
786#endif
833#endif