linux/drivers/net/ethernet/freescale/dpaa2/dpni-cmd.h

/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
/* Copyright 2013-2016 Freescale Semiconductor Inc.
 * Copyright 2016 NXP
 * Copyright 2020 NXP
 */
#ifndef _FSL_DPNI_CMD_H
#define _FSL_DPNI_CMD_H

#include "dpni.h"

/* DPNI Version */
#define DPNI_VER_MAJOR
#define DPNI_VER_MINOR
#define DPNI_CMD_BASE_VERSION
#define DPNI_CMD_2ND_VERSION
#define DPNI_CMD_3RD_VERSION
#define DPNI_CMD_ID_OFFSET

#define DPNI_CMD(id)
#define DPNI_CMD_V2(id)
#define DPNI_CMD_V3(id)

#define DPNI_CMDID_OPEN
#define DPNI_CMDID_CLOSE
#define DPNI_CMDID_CREATE
#define DPNI_CMDID_DESTROY
#define DPNI_CMDID_GET_API_VERSION

#define DPNI_CMDID_ENABLE
#define DPNI_CMDID_DISABLE
#define DPNI_CMDID_GET_ATTR
#define DPNI_CMDID_RESET
#define DPNI_CMDID_IS_ENABLED

#define DPNI_CMDID_SET_IRQ
#define DPNI_CMDID_GET_IRQ
#define DPNI_CMDID_SET_IRQ_ENABLE
#define DPNI_CMDID_GET_IRQ_ENABLE
#define DPNI_CMDID_SET_IRQ_MASK
#define DPNI_CMDID_GET_IRQ_MASK
#define DPNI_CMDID_GET_IRQ_STATUS
#define DPNI_CMDID_CLEAR_IRQ_STATUS

#define DPNI_CMDID_SET_POOLS
#define DPNI_CMDID_SET_ERRORS_BEHAVIOR

#define DPNI_CMDID_GET_QDID
#define DPNI_CMDID_GET_TX_DATA_OFFSET
#define DPNI_CMDID_GET_LINK_STATE
#define DPNI_CMDID_SET_MAX_FRAME_LENGTH
#define DPNI_CMDID_GET_MAX_FRAME_LENGTH
#define DPNI_CMDID_SET_LINK_CFG
#define DPNI_CMDID_SET_TX_SHAPING

#define DPNI_CMDID_SET_MCAST_PROMISC
#define DPNI_CMDID_GET_MCAST_PROMISC
#define DPNI_CMDID_SET_UNICAST_PROMISC
#define DPNI_CMDID_GET_UNICAST_PROMISC
#define DPNI_CMDID_SET_PRIM_MAC
#define DPNI_CMDID_GET_PRIM_MAC
#define DPNI_CMDID_ADD_MAC_ADDR
#define DPNI_CMDID_REMOVE_MAC_ADDR
#define DPNI_CMDID_CLR_MAC_FILTERS

#define DPNI_CMDID_SET_RX_TC_DIST

#define DPNI_CMDID_ENABLE_VLAN_FILTER
#define DPNI_CMDID_ADD_VLAN_ID
#define DPNI_CMDID_REMOVE_VLAN_ID

#define DPNI_CMDID_SET_QOS_TBL
#define DPNI_CMDID_ADD_QOS_ENT
#define DPNI_CMDID_REMOVE_QOS_ENT
#define DPNI_CMDID_CLR_QOS_TBL
#define DPNI_CMDID_ADD_FS_ENT
#define DPNI_CMDID_REMOVE_FS_ENT
#define DPNI_CMDID_CLR_FS_ENT

#define DPNI_CMDID_GET_STATISTICS
#define DPNI_CMDID_GET_QUEUE
#define DPNI_CMDID_SET_QUEUE
#define DPNI_CMDID_GET_TAILDROP
#define DPNI_CMDID_SET_TAILDROP

#define DPNI_CMDID_GET_PORT_MAC_ADDR

#define DPNI_CMDID_GET_BUFFER_LAYOUT
#define DPNI_CMDID_SET_BUFFER_LAYOUT

#define DPNI_CMDID_SET_TX_CONFIRMATION_MODE
#define DPNI_CMDID_SET_CONGESTION_NOTIFICATION
#define DPNI_CMDID_GET_CONGESTION_NOTIFICATION
#define DPNI_CMDID_SET_EARLY_DROP
#define DPNI_CMDID_GET_EARLY_DROP
#define DPNI_CMDID_GET_OFFLOAD
#define DPNI_CMDID_SET_OFFLOAD

#define DPNI_CMDID_SET_RX_FS_DIST
#define DPNI_CMDID_SET_RX_HASH_DIST
#define DPNI_CMDID_GET_LINK_CFG

#define DPNI_CMDID_SET_SINGLE_STEP_CFG
#define DPNI_CMDID_GET_SINGLE_STEP_CFG

/* Macros for accessing command fields smaller than 1byte */
#define DPNI_MASK(field)

#define dpni_set_field(var, field, val)
#define dpni_get_field(var, field)

struct dpni_cmd_open {};

#define DPNI_BACKUP_POOL(val, order)

struct dpni_cmd_pool {};

struct dpni_cmd_set_pools {};

/* The enable indication is always the least significant bit */
#define DPNI_ENABLE_SHIFT
#define DPNI_ENABLE_SIZE

struct dpni_rsp_is_enabled {};

struct dpni_rsp_get_irq {};

struct dpni_cmd_set_irq_enable {};

struct dpni_cmd_get_irq_enable {};

struct dpni_rsp_get_irq_enable {};

struct dpni_cmd_set_irq_mask {};

struct dpni_cmd_get_irq_mask {};

struct dpni_rsp_get_irq_mask {};

struct dpni_cmd_get_irq_status {};

struct dpni_rsp_get_irq_status {};

struct dpni_cmd_clear_irq_status {};

struct dpni_rsp_get_attr {};

#define DPNI_ERROR_ACTION_SHIFT
#define DPNI_ERROR_ACTION_SIZE
#define DPNI_FRAME_ANN_SHIFT
#define DPNI_FRAME_ANN_SIZE

struct dpni_cmd_set_errors_behavior {};

/* There are 3 separate commands for configuring Rx, Tx and Tx confirmation
 * buffer layouts, but they all share the same parameters.
 * If one of the functions changes, below structure needs to be split.
 */

#define DPNI_PASS_TS_SHIFT
#define DPNI_PASS_TS_SIZE
#define DPNI_PASS_PR_SHIFT
#define DPNI_PASS_PR_SIZE
#define DPNI_PASS_FS_SHIFT
#define DPNI_PASS_FS_SIZE

struct dpni_cmd_get_buffer_layout {};

struct dpni_rsp_get_buffer_layout {};

struct dpni_cmd_set_buffer_layout {};

struct dpni_cmd_set_offload {};

struct dpni_cmd_get_offload {};

struct dpni_rsp_get_offload {};

struct dpni_cmd_get_qdid {};

struct dpni_rsp_get_qdid {};

struct dpni_rsp_get_tx_data_offset {};

struct dpni_cmd_get_statistics {};

struct dpni_rsp_get_statistics {};

struct dpni_cmd_link_cfg {};

#define DPNI_LINK_STATE_SHIFT
#define DPNI_LINK_STATE_SIZE

struct dpni_rsp_get_link_state {};

struct dpni_cmd_set_max_frame_length {};

struct dpni_rsp_get_max_frame_length {};

struct dpni_cmd_set_multicast_promisc {};

struct dpni_rsp_get_multicast_promisc {};

struct dpni_cmd_set_unicast_promisc {};

struct dpni_rsp_get_unicast_promisc {};

struct dpni_cmd_set_primary_mac_addr {};

struct dpni_rsp_get_primary_mac_addr {};

struct dpni_rsp_get_port_mac_addr {};

struct dpni_cmd_add_mac_addr {};

struct dpni_cmd_remove_mac_addr {};

#define DPNI_UNICAST_FILTERS_SHIFT
#define DPNI_UNICAST_FILTERS_SIZE
#define DPNI_MULTICAST_FILTERS_SHIFT
#define DPNI_MULTICAST_FILTERS_SIZE

struct dpni_cmd_clear_mac_filters {};

#define DPNI_DIST_MODE_SHIFT
#define DPNI_DIST_MODE_SIZE
#define DPNI_MISS_ACTION_SHIFT
#define DPNI_MISS_ACTION_SIZE

struct dpni_cmd_set_rx_tc_dist {};

/* dpni_set_rx_tc_dist extension (structure of the DMA-able memory at
 * key_cfg_iova)
 */
struct dpni_mask_cfg {};

#define DPNI_EFH_TYPE_SHIFT
#define DPNI_EFH_TYPE_SIZE
#define DPNI_EXTRACT_TYPE_SHIFT
#define DPNI_EXTRACT_TYPE_SIZE

struct dpni_dist_extract {};

struct dpni_ext_set_rx_tc_dist {};

struct dpni_cmd_get_queue {};

#define DPNI_DEST_TYPE_SHIFT
#define DPNI_DEST_TYPE_SIZE
#define DPNI_STASH_CTRL_SHIFT
#define DPNI_STASH_CTRL_SIZE
#define DPNI_HOLD_ACTIVE_SHIFT
#define DPNI_HOLD_ACTIVE_SIZE

struct dpni_rsp_get_queue {};

struct dpni_cmd_set_queue {};

struct dpni_cmd_set_taildrop {};

struct dpni_cmd_get_taildrop {};

struct dpni_rsp_get_taildrop {};

struct dpni_rsp_get_api_version {};

#define DPNI_RX_FS_DIST_ENABLE_SHIFT
#define DPNI_RX_FS_DIST_ENABLE_SIZE
struct dpni_cmd_set_rx_fs_dist {};

#define DPNI_RX_HASH_DIST_ENABLE_SHIFT
#define DPNI_RX_HASH_DIST_ENABLE_SIZE
struct dpni_cmd_set_rx_hash_dist {};

struct dpni_cmd_add_fs_entry {};

struct dpni_cmd_remove_fs_entry {};

#define DPNI_DISCARD_ON_MISS_SHIFT
#define DPNI_DISCARD_ON_MISS_SIZE

struct dpni_cmd_set_qos_table {};

struct dpni_cmd_add_qos_entry {};

struct dpni_cmd_remove_qos_entry {};

#define DPNI_DEST_TYPE_SHIFT
#define DPNI_DEST_TYPE_SIZE
#define DPNI_CONG_UNITS_SHIFT
#define DPNI_CONG_UNITS_SIZE

struct dpni_cmd_set_congestion_notification {};

#define DPNI_COUPLED_SHIFT
#define DPNI_COUPLED_SIZE

struct dpni_cmd_set_tx_shaping {};

#define DPNI_PTP_ENABLE_SHIFT
#define DPNI_PTP_ENABLE_SIZE
#define DPNI_PTP_CH_UPDATE_SHIFT
#define DPNI_PTP_CH_UPDATE_SIZE

struct dpni_cmd_single_step_cfg {};

struct dpni_rsp_single_step_cfg {};

struct dpni_cmd_enable_vlan_filter {};

struct dpni_cmd_vlan_id {};

#endif /* _FSL_DPNI_CMD_H */