linux/drivers/xen/xen-pciback/conf_space.c

// SPDX-License-Identifier: GPL-2.0
/*
 * PCI Backend - Functions for creating a virtual configuration space for
 *               exported PCI Devices.
 *               It's dangerous to allow PCI Driver Domains to change their
 *               device's resources (memory, i/o ports, interrupts). We need to
 *               restrict changes to certain PCI Configuration registers:
 *               BARs, INTERRUPT_PIN, most registers in the header...
 *
 * Author: Ryan Wilson <[email protected]>
 */

#define dev_fmt(fmt)

#include <linux/kernel.h>
#include <linux/moduleparam.h>
#include <linux/pci.h>
#include "pciback.h"
#include "conf_space.h"
#include "conf_space_quirks.h"

bool xen_pcibk_permissive;
module_param_named(permissive, xen_pcibk_permissive, bool, 0644);

/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word,
 * xen_pcibk_write_config_word, and xen_pcibk_write_config_byte are created. */
#define DEFINE_PCI_CONFIG(op, size, type)

DEFINE_PCI_CONFIG(read, byte, u8 *)
DEFINE_PCI_CONFIG(read, word, u16 *)
DEFINE_PCI_CONFIG(read, dword, u32 *)

DEFINE_PCI_CONFIG()
DEFINE_PCI_CONFIG()
DEFINE_PCI_CONFIG()

static int conf_space_read(struct pci_dev *dev,
			   const struct config_field_entry *entry,
			   int offset, u32 *value)
{}

static int conf_space_write(struct pci_dev *dev,
			    const struct config_field_entry *entry,
			    int offset, u32 value)
{}

static inline u32 get_mask(int size)
{}

static inline int valid_request(int offset, int size)
{}

static inline u32 merge_value(u32 val, u32 new_val, u32 new_val_mask,
			      int offset)
{}

static int xen_pcibios_err_to_errno(int err)
{}

int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size,
			  u32 *ret_val)
{}

int xen_pcibk_config_write(struct pci_dev *dev, int offset, int size, u32 value)
{}

int xen_pcibk_get_interrupt_type(struct pci_dev *dev)
{}

void xen_pcibk_config_free_dyn_fields(struct pci_dev *dev)
{}

void xen_pcibk_config_reset_dev(struct pci_dev *dev)
{}

void xen_pcibk_config_free_dev(struct pci_dev *dev)
{}

int xen_pcibk_config_add_field_offset(struct pci_dev *dev,
				    const struct config_field *field,
				    unsigned int base_offset)
{}

/* This sets up the device's virtual configuration space to keep track of
 * certain registers (like the base address registers (BARs) so that we can
 * keep the client from manipulating them directly.
 */
int xen_pcibk_config_init_dev(struct pci_dev *dev)
{}

int xen_pcibk_config_init(void)
{}