linux/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Huawei HiNIC PCI Express Linux driver
 * Copyright(c) 2017 Huawei Technologies Co., Ltd
 */

#ifndef HINIC_HW_API_CMD_H
#define HINIC_HW_API_CMD_H

#include <linux/types.h>
#include <linux/semaphore.h>

#include "hinic_hw_if.h"

#define HINIC_API_CMD_PI_IDX_SHIFT

#define HINIC_API_CMD_PI_IDX_MASK

#define HINIC_API_CMD_PI_SET(val, member)

#define HINIC_API_CMD_PI_CLEAR(val, member)

#define HINIC_API_CMD_CHAIN_REQ_RESTART_SHIFT

#define HINIC_API_CMD_CHAIN_REQ_RESTART_MASK

#define HINIC_API_CMD_CHAIN_REQ_SET(val, member)

#define HINIC_API_CMD_CHAIN_REQ_GET(val, member)

#define HINIC_API_CMD_CHAIN_REQ_CLEAR(val, member)

#define HINIC_API_CMD_CHAIN_CTRL_RESTART_WB_STAT_SHIFT
#define HINIC_API_CMD_CHAIN_CTRL_XOR_ERR_SHIFT
#define HINIC_API_CMD_CHAIN_CTRL_AEQE_EN_SHIFT
#define HINIC_API_CMD_CHAIN_CTRL_AEQ_ID_SHIFT
#define HINIC_API_CMD_CHAIN_CTRL_XOR_CHK_EN_SHIFT
#define HINIC_API_CMD_CHAIN_CTRL_CELL_SIZE_SHIFT

#define HINIC_API_CMD_CHAIN_CTRL_RESTART_WB_STAT_MASK
#define HINIC_API_CMD_CHAIN_CTRL_XOR_ERR_MASK
#define HINIC_API_CMD_CHAIN_CTRL_AEQE_EN_MASK
#define HINIC_API_CMD_CHAIN_CTRL_AEQ_ID_MASK
#define HINIC_API_CMD_CHAIN_CTRL_XOR_CHK_EN_MASK
#define HINIC_API_CMD_CHAIN_CTRL_CELL_SIZE_MASK

#define HINIC_API_CMD_CHAIN_CTRL_SET(val, member)

#define HINIC_API_CMD_CHAIN_CTRL_CLEAR(val, member)

#define HINIC_API_CMD_CELL_CTRL_DATA_SZ_SHIFT
#define HINIC_API_CMD_CELL_CTRL_RD_DMA_ATTR_SHIFT
#define HINIC_API_CMD_CELL_CTRL_WR_DMA_ATTR_SHIFT
#define HINIC_API_CMD_CELL_CTRL_XOR_CHKSUM_SHIFT

#define HINIC_API_CMD_CELL_CTRL_DATA_SZ_MASK
#define HINIC_API_CMD_CELL_CTRL_RD_DMA_ATTR_MASK
#define HINIC_API_CMD_CELL_CTRL_WR_DMA_ATTR_MASK
#define HINIC_API_CMD_CELL_CTRL_XOR_CHKSUM_MASK

#define HINIC_API_CMD_CELL_CTRL_SET(val, member)

#define HINIC_API_CMD_DESC_API_TYPE_SHIFT
#define HINIC_API_CMD_DESC_RD_WR_SHIFT
#define HINIC_API_CMD_DESC_MGMT_BYPASS_SHIFT
#define HINIC_API_CMD_DESC_DEST_SHIFT
#define HINIC_API_CMD_DESC_SIZE_SHIFT
#define HINIC_API_CMD_DESC_XOR_CHKSUM_SHIFT

#define HINIC_API_CMD_DESC_API_TYPE_MASK
#define HINIC_API_CMD_DESC_RD_WR_MASK
#define HINIC_API_CMD_DESC_MGMT_BYPASS_MASK
#define HINIC_API_CMD_DESC_DEST_MASK
#define HINIC_API_CMD_DESC_SIZE_MASK
#define HINIC_API_CMD_DESC_XOR_CHKSUM_MASK

#define HINIC_API_CMD_DESC_SET(val, member)

#define HINIC_API_CMD_STATUS_HEADER_CHAIN_ID_SHIFT

#define HINIC_API_CMD_STATUS_HEADER_CHAIN_ID_MASK

#define HINIC_API_CMD_STATUS_HEADER_GET(val, member)

#define HINIC_API_CMD_STATUS_CONS_IDX_SHIFT
#define HINIC_API_CMD_STATUS_FSM_SHIFT
#define HINIC_API_CMD_STATUS_CHKSUM_ERR_SHIFT
#define HINIC_API_CMD_STATUS_CPLD_ERR_SHIFT

#define HINIC_API_CMD_STATUS_CONS_IDX_MASK
#define HINIC_API_CMD_STATUS_FSM_MASK
#define HINIC_API_CMD_STATUS_CHKSUM_ERR_MASK
#define HINIC_API_CMD_STATUS_CPLD_ERR_MASK

#define HINIC_API_CMD_STATUS_GET(val, member)

enum hinic_api_cmd_chain_type {};

struct hinic_api_cmd_chain_attr {};

struct hinic_api_cmd_status {};

/* HW struct */
struct hinic_api_cmd_cell {};

struct hinic_api_cmd_cell_ctxt {};

struct hinic_api_cmd_chain {};

int hinic_api_cmd_write(struct hinic_api_cmd_chain *chain,
			enum hinic_node_id dest, u8 *cmd, u16 size);

int hinic_api_cmd_init(struct hinic_api_cmd_chain **chain,
		       struct hinic_hwif *hwif);

void hinic_api_cmd_free(struct hinic_api_cmd_chain **chain);

#endif