linux/drivers/infiniband/hw/hfi1/user_sdma.h

/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
 * Copyright(c) 2023 - Cornelis Networks, Inc.
 * Copyright(c) 2015 - 2018 Intel Corporation.
 */
#ifndef _HFI1_USER_SDMA_H
#define _HFI1_USER_SDMA_H

#include <linux/device.h>
#include <linux/wait.h>

#include "common.h"
#include "iowait.h"
#include "user_exp_rcv.h"
#include "mmu_rb.h"
#include "pinning.h"
#include "sdma.h"

/* The maximum number of Data io vectors per message/request */
#define MAX_VECTORS_PER_REQ
/*
 * Maximum number of packet to send from each message/request
 * before moving to the next one.
 */
#define MAX_PKTS_PER_QUEUE

#define num_pages(x)

#define req_opcode(x)
#define req_version(x)
#define req_iovcnt(x)

/* Number of BTH.PSN bits used for sequence number in expected rcvs */
#define BTH_SEQ_MASK

#define AHG_KDETH_INTR_SHIFT
#define AHG_KDETH_SH_SHIFT
#define AHG_KDETH_ARRAY_SIZE

#define PBC2LRH(x)
#define LRH2PBC(x)

/**
 * Build an SDMA AHG header update descriptor and save it to an array.
 * @arr        - Array to save the descriptor to.
 * @idx        - Index of the array at which the descriptor will be saved.
 * @array_size - Size of the array arr.
 * @dw         - Update index into the header in DWs.
 * @bit        - Start bit.
 * @width      - Field width.
 * @value      - 16 bits of immediate data to write into the field.
 * Returns -ERANGE if idx is invalid. If successful, returns the next index
 * (idx + 1) of the array to be used for the next descriptor.
 */
static inline int ahg_header_set(u32 *arr, int idx, size_t array_size,
				 u8 dw, u8 bit, u8 width, u16 value)
{}

/* Tx request flag bits */
#define TXREQ_FLAGS_REQ_ACK
#define TXREQ_FLAGS_REQ_DISABLE_SH

enum pkt_q_sdma_state {};

#define SDMA_IOWAIT_TIMEOUT

#define SDMA_DBG(req, fmt, ...)

struct hfi1_user_sdma_pkt_q {};

struct hfi1_user_sdma_comp_q {};

struct user_sdma_iovec {};

/* evict operation argument */
struct evict_data {};

struct user_sdma_request {} ____cacheline_aligned_in_smp;

/*
 * A single txreq could span up to 3 physical pages when the MTU
 * is sufficiently large (> 4K). Each of the IOV pointers also
 * needs it's own set of flags so the vector has been handled
 * independently of each other.
 */
struct user_sdma_txreq {};

int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt,
				struct hfi1_filedata *fd);
int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd,
			       struct hfi1_ctxtdata *uctxt);
int hfi1_user_sdma_process_request(struct hfi1_filedata *fd,
				   struct iovec *iovec, unsigned long dim,
				   unsigned long *count);
#endif /* _HFI1_USER_SDMA_H */