linux/include/linux/qed/qed_chain.h

/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
/* QLogic qed NIC Driver
 * Copyright (c) 2015-2017  QLogic Corporation
 * Copyright (c) 2019-2020 Marvell International Ltd.
 */

#ifndef _QED_CHAIN_H
#define _QED_CHAIN_H

#include <linux/types.h>
#include <asm/byteorder.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/qed/common_hsi.h>

enum qed_chain_mode {};

enum qed_chain_use_mode {};

enum qed_chain_cnt_type {};

struct qed_chain_next {};

struct qed_chain_pbl_u16 {};

struct qed_chain_pbl_u32 {};

struct qed_chain_u16 {};

struct qed_chain_u32 {};

struct addr_tbl_entry {};

struct qed_chain {};

struct qed_chain_init_params {};

#define QED_CHAIN_PAGE_SIZE

#define ELEMS_PER_PAGE(elem_size, page_size)

#define UNUSABLE_ELEMS_PER_PAGE(elem_size, mode)

#define USABLE_ELEMS_PER_PAGE(elem_size, page_size, mode)

#define QED_CHAIN_PAGE_CNT(elem_cnt, elem_size, page_size, mode)

#define is_chain_u16(p)
#define is_chain_u32(p)

/* Accessors */

static inline u16 qed_chain_get_prod_idx(const struct qed_chain *chain)
{}

static inline u16 qed_chain_get_cons_idx(const struct qed_chain *chain)
{}

static inline u32 qed_chain_get_prod_idx_u32(const struct qed_chain *chain)
{}

static inline u32 qed_chain_get_cons_idx_u32(const struct qed_chain *chain)
{}

static inline u16 qed_chain_get_elem_used(const struct qed_chain *chain)
{}

static inline u16 qed_chain_get_elem_left(const struct qed_chain *chain)
{}

static inline u32 qed_chain_get_elem_used_u32(const struct qed_chain *chain)
{}

static inline u32 qed_chain_get_elem_left_u32(const struct qed_chain *chain)
{}

static inline u16 qed_chain_get_usable_per_page(const struct qed_chain *chain)
{}

static inline u8 qed_chain_get_unusable_per_page(const struct qed_chain *chain)
{}

static inline u32 qed_chain_get_page_cnt(const struct qed_chain *chain)
{}

static inline dma_addr_t qed_chain_get_pbl_phys(const struct qed_chain *chain)
{}

/**
 * qed_chain_advance_page(): Advance the next element across pages for a
 *                           linked chain.
 *
 * @p_chain: P_chain.
 * @p_next_elem: P_next_elem.
 * @idx_to_inc: Idx_to_inc.
 * @page_to_inc: page_to_inc.
 *
 * Return: Void.
 */
static inline void
qed_chain_advance_page(struct qed_chain *p_chain,
		       void **p_next_elem, void *idx_to_inc, void *page_to_inc)
{}

#define is_unusable_idx(p, idx)

#define is_unusable_idx_u32(p, idx)
#define is_unusable_next_idx(p, idx)

#define is_unusable_next_idx_u32(p, idx)

#define test_and_skip(p, idx)

/**
 * qed_chain_return_produced(): A chain in which the driver "Produces"
 *                              elements should use this API
 *                              to indicate previous produced elements
 *                              are now consumed.
 *
 * @p_chain: Chain.
 *
 * Return: Void.
 */
static inline void qed_chain_return_produced(struct qed_chain *p_chain)
{}

/**
 * qed_chain_produce(): A chain in which the driver "Produces"
 *                      elements should use this to get a pointer to
 *                      the next element which can be "Produced". It's driver
 *                      responsibility to validate that the chain has room for
 *                      new element.
 *
 * @p_chain: Chain.
 *
 * Return: void*, a pointer to next element.
 */
static inline void *qed_chain_produce(struct qed_chain *p_chain)
{}

/**
 * qed_chain_get_capacity(): Get the maximum number of BDs in chain
 *
 * @p_chain: Chain.
 *
 * Return: number of unusable BDs.
 */
static inline u32 qed_chain_get_capacity(struct qed_chain *p_chain)
{}

/**
 * qed_chain_recycle_consumed(): Returns an element which was
 *                               previously consumed;
 *                               Increments producers so they could
 *                               be written to FW.
 *
 * @p_chain: Chain.
 *
 * Return: Void.
 */
static inline void qed_chain_recycle_consumed(struct qed_chain *p_chain)
{}

/**
 * qed_chain_consume(): A Chain in which the driver utilizes data written
 *                      by a different source (i.e., FW) should use this to
 *                      access passed buffers.
 *
 * @p_chain: Chain.
 *
 * Return: void*, a pointer to the next buffer written.
 */
static inline void *qed_chain_consume(struct qed_chain *p_chain)
{}

/**
 * qed_chain_reset(): Resets the chain to its start state.
 *
 * @p_chain: pointer to a previously allocated chain.
 *
 * Return Void.
 */
static inline void qed_chain_reset(struct qed_chain *p_chain)
{}

/**
 * qed_chain_get_last_elem(): Returns a pointer to the last element of the
 *                            chain.
 *
 * @p_chain: Chain.
 *
 * Return: void*.
 */
static inline void *qed_chain_get_last_elem(struct qed_chain *p_chain)
{}

/**
 * qed_chain_set_prod(): sets the prod to the given value.
 *
 * @p_chain: Chain.
 * @prod_idx: Prod Idx.
 * @p_prod_elem: Prod elem.
 *
 * Return Void.
 */
static inline void qed_chain_set_prod(struct qed_chain *p_chain,
				      u32 prod_idx, void *p_prod_elem)
{}

/**
 * qed_chain_pbl_zero_mem(): set chain memory to 0.
 *
 * @p_chain: Chain.
 *
 * Return: Void.
 */
static inline void qed_chain_pbl_zero_mem(struct qed_chain *p_chain)
{}

#endif