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

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

#ifndef HINIC_HW_EQS_H
#define HINIC_HW_EQS_H

#include <linux/types.h>
#include <linux/workqueue.h>
#include <linux/pci.h>
#include <linux/sizes.h>
#include <linux/bitops.h>
#include <linux/interrupt.h>

#include "hinic_hw_if.h"

#define HINIC_AEQ_CTRL_0_INT_IDX_SHIFT
#define HINIC_AEQ_CTRL_0_DMA_ATTR_SHIFT
#define HINIC_AEQ_CTRL_0_PCI_INTF_IDX_SHIFT
#define HINIC_AEQ_CTRL_0_INT_MODE_SHIFT

#define HINIC_AEQ_CTRL_0_INT_IDX_MASK
#define HINIC_AEQ_CTRL_0_DMA_ATTR_MASK
#define HINIC_AEQ_CTRL_0_PCI_INTF_IDX_MASK
#define HINIC_AEQ_CTRL_0_INT_MODE_MASK

#define HINIC_AEQ_CTRL_0_SET(val, member)

#define HINIC_AEQ_CTRL_0_CLEAR(val, member)

#define HINIC_AEQ_CTRL_1_LEN_SHIFT
#define HINIC_AEQ_CTRL_1_ELEM_SIZE_SHIFT
#define HINIC_AEQ_CTRL_1_PAGE_SIZE_SHIFT

#define HINIC_AEQ_CTRL_1_LEN_MASK
#define HINIC_AEQ_CTRL_1_ELEM_SIZE_MASK
#define HINIC_AEQ_CTRL_1_PAGE_SIZE_MASK

#define HINIC_AEQ_CTRL_1_SET(val, member)

#define HINIC_AEQ_CTRL_1_CLEAR(val, member)

#define HINIC_CEQ_CTRL_0_INTR_IDX_SHIFT
#define HINIC_CEQ_CTRL_0_DMA_ATTR_SHIFT
#define HINIC_CEQ_CTRL_0_KICK_THRESH_SHIFT
#define HINIC_CEQ_CTRL_0_PCI_INTF_IDX_SHIFT
#define HINIC_CEQ_CTRL_0_INTR_MODE_SHIFT

#define HINIC_CEQ_CTRL_0_INTR_IDX_MASK
#define HINIC_CEQ_CTRL_0_DMA_ATTR_MASK
#define HINIC_CEQ_CTRL_0_KICK_THRESH_MASK
#define HINIC_CEQ_CTRL_0_PCI_INTF_IDX_MASK
#define HINIC_CEQ_CTRL_0_INTR_MODE_MASK

#define HINIC_CEQ_CTRL_0_SET(val, member)

#define HINIC_CEQ_CTRL_0_CLEAR(val, member)

#define HINIC_CEQ_CTRL_1_LEN_SHIFT
#define HINIC_CEQ_CTRL_1_PAGE_SIZE_SHIFT

#define HINIC_CEQ_CTRL_1_LEN_MASK
#define HINIC_CEQ_CTRL_1_PAGE_SIZE_MASK

#define HINIC_CEQ_CTRL_1_SET(val, member)

#define HINIC_CEQ_CTRL_1_CLEAR(val, member)

#define HINIC_EQ_ELEM_DESC_TYPE_SHIFT
#define HINIC_EQ_ELEM_DESC_SRC_SHIFT
#define HINIC_EQ_ELEM_DESC_SIZE_SHIFT
#define HINIC_EQ_ELEM_DESC_WRAPPED_SHIFT

#define HINIC_EQ_ELEM_DESC_TYPE_MASK
#define HINIC_EQ_ELEM_DESC_SRC_MASK
#define HINIC_EQ_ELEM_DESC_SIZE_MASK
#define HINIC_EQ_ELEM_DESC_WRAPPED_MASK

#define HINIC_EQ_ELEM_DESC_SET(val, member)

#define HINIC_EQ_ELEM_DESC_GET(val, member)

#define HINIC_EQ_CI_IDX_SHIFT
#define HINIC_EQ_CI_WRAPPED_SHIFT
#define HINIC_EQ_CI_XOR_CHKSUM_SHIFT
#define HINIC_EQ_CI_INT_ARMED_SHIFT

#define HINIC_EQ_CI_IDX_MASK
#define HINIC_EQ_CI_WRAPPED_MASK
#define HINIC_EQ_CI_XOR_CHKSUM_MASK
#define HINIC_EQ_CI_INT_ARMED_MASK

#define HINIC_EQ_CI_SET(val, member)

#define HINIC_EQ_CI_CLEAR(val, member)

#define HINIC_MAX_AEQS
#define HINIC_MAX_CEQS

#define HINIC_AEQE_SIZE
#define HINIC_CEQE_SIZE

#define HINIC_AEQE_DESC_SIZE
#define HINIC_AEQE_DATA_SIZE

#define HINIC_DEFAULT_AEQ_LEN
#define HINIC_DEFAULT_CEQ_LEN

#define HINIC_EQ_PAGE_SIZE

#define HINIC_CEQ_ID_CMDQ

enum hinic_eq_type {};

enum hinic_aeq_type {};

enum hinic_ceq_type {};

enum hinic_eqe_state {};

struct hinic_aeq_elem {};

struct hinic_eq_work {};

struct hinic_eq {};

struct hinic_hw_event_cb {};

struct hinic_aeqs {};

struct hinic_ceq_cb {};

struct hinic_ceqs {};

void hinic_aeq_register_hw_cb(struct hinic_aeqs *aeqs,
			      enum hinic_aeq_type event, void *handle,
			      void (*hwe_handler)(void *handle, void *data,
						  u8 size));

void hinic_aeq_unregister_hw_cb(struct hinic_aeqs *aeqs,
				enum hinic_aeq_type event);

void hinic_ceq_register_cb(struct hinic_ceqs *ceqs,
			   enum hinic_ceq_type event, void *handle,
			   void (*ceq_cb)(void *handle, u32 ceqe_data));

void hinic_ceq_unregister_cb(struct hinic_ceqs *ceqs,
			     enum hinic_ceq_type event);

int hinic_aeqs_init(struct hinic_aeqs *aeqs, struct hinic_hwif *hwif,
		    int num_aeqs, u32 q_len, u32 page_size,
		    struct msix_entry *msix_entries);

void hinic_aeqs_free(struct hinic_aeqs *aeqs);

int hinic_ceqs_init(struct hinic_ceqs *ceqs, struct hinic_hwif *hwif,
		    int num_ceqs, u32 q_len, u32 page_size,
		    struct msix_entry *msix_entries);

void hinic_ceqs_free(struct hinic_ceqs *ceqs);

void hinic_dump_ceq_info(struct hinic_hwdev *hwdev);

void hinic_dump_aeq_info(struct hinic_hwdev *hwdev);

#endif