linux/drivers/net/ethernet/microsoft/mana/shm_channel.c

// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/* Copyright (c) 2021, Microsoft Corporation. */

#include <linux/delay.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/mm.h>

#include <net/mana/gdma.h>
#include <net/mana/shm_channel.h>

#define PAGE_FRAME_L48_WIDTH_BYTES
#define PAGE_FRAME_L48_WIDTH_BITS
#define PAGE_FRAME_L48_MASK
#define PAGE_FRAME_H4_WIDTH_BITS
#define VECTOR_MASK
#define SHMEM_VF_RESET_STATE

#define SMC_MSG_TYPE_ESTABLISH_HWC
#define SMC_MSG_TYPE_ESTABLISH_HWC_VERSION

#define SMC_MSG_TYPE_DESTROY_HWC
#define SMC_MSG_TYPE_DESTROY_HWC_VERSION

#define SMC_MSG_DIRECTION_REQUEST
#define SMC_MSG_DIRECTION_RESPONSE

/* Structures labeled with "HW DATA" are exchanged with the hardware. All of
 * them are naturally aligned and hence don't need __packed.
 */

/* Shared memory channel protocol header
 *
 * msg_type: set on request and response; response matches request.
 * msg_version: newer PF writes back older response (matching request)
 *  older PF acts on latest version known and sets that version in result
 *  (less than request).
 * direction: 0 for request, VF->PF; 1 for response, PF->VF.
 * status: 0 on request,
 *   operation result on response (success = 0, failure = 1 or greater).
 * reset_vf: If set on either establish or destroy request, indicates perform
 *  FLR before/after the operation.
 * owner_is_pf: 1 indicates PF owned, 0 indicates VF owned.
 */
smc_proto_hdr; /* HW DATA */

#define SMC_APERTURE_BITS
#define SMC_BASIC_UNIT
#define SMC_APERTURE_DWORDS
#define SMC_LAST_DWORD

static int mana_smc_poll_register(void __iomem *base, bool reset)
{}

static int mana_smc_read_response(struct shm_channel *sc, u32 msg_type,
				  u32 msg_version, bool reset_vf)
{}

void mana_smc_init(struct shm_channel *sc, struct device *dev,
		   void __iomem *base)
{}

int mana_smc_setup_hwc(struct shm_channel *sc, bool reset_vf, u64 eq_addr,
		       u64 cq_addr, u64 rq_addr, u64 sq_addr,
		       u32 eq_msix_index)
{}

int mana_smc_teardown_hwc(struct shm_channel *sc, bool reset_vf)
{}