linux/drivers/dma/ioat/dca.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Intel I/OAT DMA Linux driver
 * Copyright(c) 2007 - 2009 Intel Corporation.
 */

#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/smp.h>
#include <linux/interrupt.h>
#include <linux/dca.h>

/* either a kernel change is needed, or we need something like this in kernel */
#ifndef CONFIG_SMP
#include <asm/smp.h>
#undef cpu_physical_id
#define cpu_physical_id
#endif

#include "dma.h"
#include "registers.h"

/*
 * Bit 7 of a tag map entry is the "valid" bit, if it is set then bits 0:6
 * contain the bit number of the APIC ID to map into the DCA tag.  If the valid
 * bit is not set, then the value must be 0 or 1 and defines the bit in the tag.
 */
#define DCA_TAG_MAP_VALID

#define DCA3_TAG_MAP_BIT_TO_INV
#define DCA3_TAG_MAP_BIT_TO_SEL
#define DCA3_TAG_MAP_LITERAL_VAL

#define DCA_TAG_MAP_MASK

/* expected tag map bytes for I/OAT ver.2 */
#define DCA2_TAG_MAP_BYTE0
#define DCA2_TAG_MAP_BYTE1
#define DCA2_TAG_MAP_BYTE2
#define DCA2_TAG_MAP_BYTE3
#define DCA2_TAG_MAP_BYTE4

/*
 * "Legacy" DCA systems do not implement the DCA register set in the
 * I/OAT device.  Software needs direct support for their tag mappings.
 */

#define APICID_BIT(x)
#define IOAT_TAG_MAP_LEN

/* pack PCI B/D/F into a u16 */
static inline u16 dcaid_from_pcidev(struct pci_dev *pci)
{}

static int dca_enabled_in_bios(struct pci_dev *pdev)
{}

int system_has_dca_enabled(struct pci_dev *pdev)
{}

struct ioat_dca_slot {};

#define IOAT_DCA_MAX_REQ
#define IOAT3_DCA_MAX_REQ

struct ioat_dca_priv {};

static int ioat_dca_dev_managed(struct dca_provider *dca,
				struct device *dev)
{}

static int ioat_dca_add_requester(struct dca_provider *dca, struct device *dev)
{}

static int ioat_dca_remove_requester(struct dca_provider *dca,
				      struct device *dev)
{}

static u8 ioat_dca_get_tag(struct dca_provider *dca,
			    struct device *dev,
			    int cpu)
{}

static const struct dca_ops ioat_dca_ops =;

static int ioat_dca_count_dca_slots(void *iobase, u16 dca_offset)
{}

static inline int dca3_tag_map_invalid(u8 *tag_map)
{}

struct dca_provider *ioat_dca_init(struct pci_dev *pdev, void __iomem *iobase)
{}