include/soc/mscc/ocelot.h

Source file repositories/reference/linux-study-clean/include/soc/mscc/ocelot.h

File Facts

System
Linux kernel
Corpus path
include/soc/mscc/ocelot.h
Extension
.h
Size
37635 bytes
Lines
1231
Domain
Repository Root And Misc
Bucket
include
Inferred role
Repository Root And Misc: implementation source
Status
source implementation candidate

Why This File Exists

Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ocelot_ops {
	struct net_device *(*port_to_netdev)(struct ocelot *ocelot, int port);
	int (*netdev_to_port)(struct ocelot *ocelot, struct net_device *dev);
	int (*reset)(struct ocelot *ocelot);
	u16 (*wm_enc)(u16 value);
	u16 (*wm_dec)(u16 value);
	void (*wm_stat)(u32 val, u32 *inuse, u32 *maxuse);
	void (*psfp_init)(struct ocelot *ocelot);
	int (*psfp_filter_add)(struct ocelot *ocelot, int port,
			       struct flow_cls_offload *f);
	int (*psfp_filter_del)(struct ocelot *ocelot, struct flow_cls_offload *f);
	int (*psfp_stats_get)(struct ocelot *ocelot, struct flow_cls_offload *f,
			      struct flow_stats *stats);
	void (*cut_through_fwd)(struct ocelot *ocelot);
	void (*tas_clock_adjust)(struct ocelot *ocelot);
	void (*tas_guard_bands_update)(struct ocelot *ocelot, int port);
	void (*update_stats)(struct ocelot *ocelot);
};

struct ocelot_vcap_policer {
	struct list_head pol_list;
	u16 base;
	u16 max;
	u16 base2;
	u16 max2;
};

struct ocelot_vcap_block {
	struct list_head rules;
	int count;
};

struct ocelot_bridge_vlan {
	u16 vid;
	unsigned long portmask;
	unsigned long untagged;
	struct list_head list;
};

enum ocelot_port_tag_config {
	/* all VLANs are egress-untagged */
	OCELOT_PORT_TAG_DISABLED = 0,
	/* all VLANs except the native VLAN and VID 0 are egress-tagged */
	OCELOT_PORT_TAG_NATIVE = 1,
	/* all VLANs except VID 0 are egress-tagged */
	OCELOT_PORT_TAG_TRUNK_NO_VID0 = 2,
	/* all VLANs are egress-tagged */
	OCELOT_PORT_TAG_TRUNK = 3,
};

struct ocelot_psfp_list {
	struct list_head stream_list;
	struct list_head sfi_list;
	struct list_head sgi_list;
	/* Serialize access to the lists */
	struct mutex lock;
};

enum ocelot_sb {
	OCELOT_SB_BUF,
	OCELOT_SB_REF,
	OCELOT_SB_NUM,
};

enum ocelot_sb_pool {
	OCELOT_SB_POOL_ING,
	OCELOT_SB_POOL_EGR,
	OCELOT_SB_POOL_NUM,
};

/* MAC table entry types.
 * ENTRYTYPE_NORMAL is subject to aging.
 * ENTRYTYPE_LOCKED is not subject to aging.
 * ENTRYTYPE_MACv4 is not subject to aging. For IPv4 multicast.
 * ENTRYTYPE_MACv6 is not subject to aging. For IPv6 multicast.
 */
enum macaccess_entry_type {
	ENTRYTYPE_NORMAL = 0,
	ENTRYTYPE_LOCKED,
	ENTRYTYPE_MACv4,
	ENTRYTYPE_MACv6,
};

enum ocelot_proto {
	OCELOT_PROTO_PTP_L2 = BIT(0),
	OCELOT_PROTO_PTP_L4 = BIT(1),
};

#define OCELOT_QUIRK_PCS_PERFORMS_RATE_ADAPTATION	BIT(0)
#define OCELOT_QUIRK_QSGMII_PORTS_MUST_BE_UP		BIT(1)

Annotation

Implementation Notes