linux/drivers/net/ethernet/microchip/sparx5/sparx5_port.h

/* SPDX-License-Identifier: GPL-2.0+ */
/* Microchip Sparx5 Switch driver
 *
 * Copyright (c) 2021 Microchip Technology Inc. and its subsidiaries.
 */

#ifndef __SPARX5_PORT_H__
#define __SPARX5_PORT_H__

#include "sparx5_main.h"

/* Port PCP rewrite mode */
#define SPARX5_PORT_REW_TAG_CTRL_CLASSIFIED
#define SPARX5_PORT_REW_TAG_CTRL_DEFAULT
#define SPARX5_PORT_REW_TAG_CTRL_MAPPED

/* Port DSCP rewrite mode */
#define SPARX5_PORT_REW_DSCP_NONE
#define SPARX5_PORT_REW_DSCP_IF_ZERO
#define SPARX5_PORT_REW_DSCP_SELECTED
#define SPARX5_PORT_REW_DSCP_ALL

static inline bool sparx5_port_is_2g5(int portno)
{}

static inline bool sparx5_port_is_5g(int portno)
{}

static inline bool sparx5_port_is_10g(int portno)
{}

static inline bool sparx5_port_is_25g(int portno)
{}

static inline u32 sparx5_to_high_dev(int port)
{}

static inline u32 sparx5_to_pcs_dev(int port)
{}

static inline int sparx5_port_dev_index(int port)
{}

int sparx5_port_init(struct sparx5 *sparx5,
		     struct sparx5_port *spx5_port,
		     struct sparx5_port_config *conf);

int sparx5_port_config(struct sparx5 *sparx5,
		       struct sparx5_port *spx5_port,
		       struct sparx5_port_config *conf);

int sparx5_port_pcs_set(struct sparx5 *sparx5,
			struct sparx5_port *port,
			struct sparx5_port_config *conf);

int sparx5_serdes_set(struct sparx5 *sparx5,
		      struct sparx5_port *spx5_port,
		      struct sparx5_port_config *conf);

struct sparx5_port_status {};

int sparx5_get_port_status(struct sparx5 *sparx5,
			   struct sparx5_port *port,
			   struct sparx5_port_status *status);

void sparx5_port_enable(struct sparx5_port *port, bool enable);
int sparx5_port_fwd_urg(struct sparx5 *sparx5, u32 speed);

#define SPARX5_PORT_QOS_PCP_COUNT
#define SPARX5_PORT_QOS_DEI_COUNT
#define SPARX5_PORT_QOS_PCP_DEI_COUNT
struct sparx5_port_qos_pcp_map {};

struct sparx5_port_qos_pcp_rewr_map {};

#define SPARX5_PORT_QOS_DP_NUM
struct sparx5_port_qos_dscp_rewr_map {};

#define SPARX5_PORT_QOS_DSCP_COUNT
struct sparx5_port_qos_dscp_map {};

struct sparx5_port_qos_pcp {};

struct sparx5_port_qos_pcp_rewr {};

struct sparx5_port_qos_dscp {};

struct sparx5_port_qos_dscp_rewr {};

struct sparx5_port_qos {};

int sparx5_port_qos_set(struct sparx5_port *port, struct sparx5_port_qos *qos);

int sparx5_port_qos_pcp_set(const struct sparx5_port *port,
			    struct sparx5_port_qos_pcp *qos);

int sparx5_port_qos_pcp_rewr_set(const struct sparx5_port *port,
				 struct sparx5_port_qos_pcp_rewr *qos);

int sparx5_port_qos_dscp_set(const struct sparx5_port *port,
			     struct sparx5_port_qos_dscp *qos);

void sparx5_port_qos_dscp_rewr_mode_set(const struct sparx5_port *port,
					int mode);

int sparx5_port_qos_dscp_rewr_set(const struct sparx5_port *port,
				  struct sparx5_port_qos_dscp_rewr *qos);

int sparx5_port_qos_default_set(const struct sparx5_port *port,
				const struct sparx5_port_qos *qos);

#endif	/* __SPARX5_PORT_H__ */