linux/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.h

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright(c) 1999 - 2018 Intel Corporation. */

#ifndef _DCB_CONFIG_H_
#define _DCB_CONFIG_H_

#include <linux/dcbnl.h>
#include "ixgbe_type.h"

/* DCB data structures */

#define IXGBE_MAX_PACKET_BUFFERS
#define MAX_USER_PRIORITY
#define MAX_BW_GROUP
#define BW_PERCENT

#define DCB_TX_CONFIG
#define DCB_RX_CONFIG

/* DCB error Codes */
#define DCB_SUCCESS
#define DCB_ERR_CONFIG
#define DCB_ERR_PARAM

/* Transmit and receive Errors */
/* Error in bandwidth group allocation */
#define DCB_ERR_BW_GROUP
/* Error in traffic class bandwidth allocation */
#define DCB_ERR_TC_BW
/* Traffic class has both link strict and group strict enabled */
#define DCB_ERR_LS_GS
/* Link strict traffic class has non zero bandwidth */
#define DCB_ERR_LS_BW_NONZERO
/* Link strict bandwidth group has non zero bandwidth */
#define DCB_ERR_LS_BWG_NONZERO
/*  Traffic class has zero bandwidth */
#define DCB_ERR_TC_BW_ZERO

#define DCB_NOT_IMPLEMENTED

struct dcb_pfc_tc_debug {};

enum strict_prio_type {};

/* DCB capability definitions */
#define IXGBE_DCB_PG_SUPPORT
#define IXGBE_DCB_PFC_SUPPORT
#define IXGBE_DCB_BCN_SUPPORT
#define IXGBE_DCB_UP2TC_SUPPORT
#define IXGBE_DCB_GSP_SUPPORT

#define IXGBE_DCB_8_TC_SUPPORT

struct dcb_support {};

/* Traffic class bandwidth allocation per direction */
struct tc_bw_alloc {};

enum dcb_pfc_type {};

/* Traffic class configuration */
struct tc_configuration {};

struct dcb_num_tcs {};

struct ixgbe_dcb_config {};

/* DCB driver APIs */
void ixgbe_dcb_unpack_pfc(struct ixgbe_dcb_config *cfg, u8 *pfc_en);
void ixgbe_dcb_unpack_refill(struct ixgbe_dcb_config *, int, u16 *);
void ixgbe_dcb_unpack_max(struct ixgbe_dcb_config *, u16 *);
void ixgbe_dcb_unpack_bwgid(struct ixgbe_dcb_config *, int, u8 *);
void ixgbe_dcb_unpack_prio(struct ixgbe_dcb_config *, int, u8 *);
void ixgbe_dcb_unpack_map(struct ixgbe_dcb_config *, int, u8 *);
u8 ixgbe_dcb_get_tc_from_up(struct ixgbe_dcb_config *, int, u8);

/* DCB credits calculation */
int ixgbe_dcb_calculate_tc_credits(struct ixgbe_hw *,
				   struct ixgbe_dcb_config *, int, u8);

/* DCB hw initialization */
int ixgbe_dcb_hw_ets(struct ixgbe_hw *hw, struct ieee_ets *ets, int max);
int ixgbe_dcb_hw_ets_config(struct ixgbe_hw *hw, u16 *refill, u16 *max,
			    u8 *bwg_id, u8 *prio_type, u8 *tc_prio);
int ixgbe_dcb_hw_pfc_config(struct ixgbe_hw *hw, u8 pfc_en, u8 *tc_prio);
int ixgbe_dcb_hw_config(struct ixgbe_hw *, struct ixgbe_dcb_config *);

void ixgbe_dcb_read_rtrup2tc(struct ixgbe_hw *hw, u8 *map);

/* DCB definitions for credit calculation */
#define DCB_CREDIT_QUANTUM
#define MAX_CREDIT_REFILL
#define DCB_MAX_TSO_SIZE
#define MINIMUM_CREDIT_FOR_TSO
#define MAX_CREDIT

#endif /* _DCB_CONFIG_H */