linux/drivers/net/ethernet/intel/idpf/idpf_controlq.h

/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright (C) 2023 Intel Corporation */

#ifndef _IDPF_CONTROLQ_H_
#define _IDPF_CONTROLQ_H_

#include <linux/slab.h>

#include "idpf_controlq_api.h"

/* Maximum buffer length for all control queue types */
#define IDPF_CTLQ_MAX_BUF_LEN

#define IDPF_CTLQ_DESC(R, i)

#define IDPF_CTLQ_DESC_UNUSED(R)

/* Control Queue default settings */
#define IDPF_CTRL_SQ_CMD_TIMEOUT

struct idpf_ctlq_desc {};

/* Flags sub-structure
 * |0  |1  |2  |3  |4  |5  |6  |7  |8  |9  |10 |11 |12 |13 |14 |15 |
 * |DD |CMP|ERR|  * RSV *  |FTYPE  | *RSV* |RD |VFC|BUF|  HOST_ID  |
 */
/* command flags and offsets */
#define IDPF_CTLQ_FLAG_DD_S
#define IDPF_CTLQ_FLAG_CMP_S
#define IDPF_CTLQ_FLAG_ERR_S
#define IDPF_CTLQ_FLAG_FTYPE_S
#define IDPF_CTLQ_FLAG_RD_S
#define IDPF_CTLQ_FLAG_VFC_S
#define IDPF_CTLQ_FLAG_BUF_S
#define IDPF_CTLQ_FLAG_HOST_ID_S

#define IDPF_CTLQ_FLAG_DD
#define IDPF_CTLQ_FLAG_CMP
#define IDPF_CTLQ_FLAG_ERR
#define IDPF_CTLQ_FLAG_FTYPE_VM
#define IDPF_CTLQ_FLAG_FTYPE_PF
#define IDPF_CTLQ_FLAG_RD
#define IDPF_CTLQ_FLAG_VFC
#define IDPF_CTLQ_FLAG_BUF

/* Host ID is a special field that has 3b and not a 1b flag */
#define IDPF_CTLQ_FLAG_HOST_ID_M

struct idpf_mbxq_desc {};

/* Define the driver hardware struct to replace other control structs as needed
 * Align to ctlq_hw_info
 */
struct idpf_hw {};

int idpf_ctlq_alloc_ring_res(struct idpf_hw *hw,
			     struct idpf_ctlq_info *cq);

void idpf_ctlq_dealloc_ring_res(struct idpf_hw *hw, struct idpf_ctlq_info *cq);

/* prototype for functions used for dynamic memory allocation */
void *idpf_alloc_dma_mem(struct idpf_hw *hw, struct idpf_dma_mem *mem,
			 u64 size);
void idpf_free_dma_mem(struct idpf_hw *hw, struct idpf_dma_mem *mem);
#endif /* _IDPF_CONTROLQ_H_ */