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

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

#ifndef HINIC_CMDQ_H
#define HINIC_CMDQ_H

#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/completion.h>
#include <linux/pci.h>

#include "hinic_hw_if.h"
#include "hinic_hw_wq.h"

#define HINIC_CMDQ_CTXT_CURR_WQE_PAGE_PFN_SHIFT
#define HINIC_CMDQ_CTXT_EQ_ID_SHIFT
#define HINIC_CMDQ_CTXT_CEQ_ARM_SHIFT
#define HINIC_CMDQ_CTXT_CEQ_EN_SHIFT
#define HINIC_CMDQ_CTXT_WRAPPED_SHIFT

#define HINIC_CMDQ_CTXT_CURR_WQE_PAGE_PFN_MASK
#define HINIC_CMDQ_CTXT_EQ_ID_MASK
#define HINIC_CMDQ_CTXT_CEQ_ARM_MASK
#define HINIC_CMDQ_CTXT_CEQ_EN_MASK
#define HINIC_CMDQ_CTXT_WRAPPED_MASK

#define HINIC_CMDQ_CTXT_PAGE_INFO_SET(val, member)

#define HINIC_CMDQ_CTXT_PAGE_INFO_GET(val, member)

#define HINIC_CMDQ_CTXT_PAGE_INFO_CLEAR(val, member)

#define HINIC_CMDQ_CTXT_WQ_BLOCK_PFN_SHIFT
#define HINIC_CMDQ_CTXT_CI_SHIFT

#define HINIC_CMDQ_CTXT_WQ_BLOCK_PFN_MASK
#define HINIC_CMDQ_CTXT_CI_MASK

#define HINIC_CMDQ_CTXT_BLOCK_INFO_SET(val, member)

#define HINIC_CMDQ_CTXT_BLOCK_INFO_GET(val, member)

#define HINIC_CMDQ_CTXT_BLOCK_INFO_CLEAR(val, member)

#define HINIC_SAVED_DATA_ARM_SHIFT

#define HINIC_SAVED_DATA_ARM_MASK

#define HINIC_SAVED_DATA_SET(val, member)

#define HINIC_SAVED_DATA_GET(val, member)

#define HINIC_SAVED_DATA_CLEAR(val, member)

#define HINIC_CMDQ_DB_INFO_HI_PROD_IDX_SHIFT
#define HINIC_CMDQ_DB_INFO_PATH_SHIFT
#define HINIC_CMDQ_DB_INFO_CMDQ_TYPE_SHIFT
#define HINIC_CMDQ_DB_INFO_DB_TYPE_SHIFT

#define HINIC_CMDQ_DB_INFO_HI_PROD_IDX_MASK
#define HINIC_CMDQ_DB_INFO_PATH_MASK
#define HINIC_CMDQ_DB_INFO_CMDQ_TYPE_MASK
#define HINIC_CMDQ_DB_INFO_DB_TYPE_MASK

#define HINIC_CMDQ_DB_INFO_SET(val, member)

#define HINIC_CMDQ_BUF_SIZE

#define HINIC_CMDQ_BUF_HW_RSVD
#define HINIC_CMDQ_MAX_DATA_SIZE

enum hinic_cmdq_type {};

enum hinic_set_arm_qtype {};

enum hinic_cmd_ack_type {};

struct hinic_cmdq_buf {};

struct hinic_cmdq_arm_bit {};

struct hinic_cmdq_ctxt_info {};

struct hinic_cmdq_ctxt {};

struct hinic_cmdq {};

struct hinic_cmdqs {};

int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs,
			 struct hinic_cmdq_buf *cmdq_buf);

void hinic_free_cmdq_buf(struct hinic_cmdqs *cmdqs,
			 struct hinic_cmdq_buf *cmdq_buf);

int hinic_cmdq_direct_resp(struct hinic_cmdqs *cmdqs,
			   enum hinic_mod_type mod, u8 cmd,
			   struct hinic_cmdq_buf *buf_in, u64 *out_param);

int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif,
		     void __iomem **db_area);

void hinic_free_cmdqs(struct hinic_cmdqs *cmdqs);

#endif