linux/drivers/pci/endpoint/pci-ep-cfs.c

// SPDX-License-Identifier: GPL-2.0
/*
 * configfs to configure the PCI endpoint
 *
 * Copyright (C) 2017 Texas Instruments
 * Author: Kishon Vijay Abraham I <[email protected]>
 */

#include <linux/module.h>
#include <linux/idr.h>
#include <linux/slab.h>

#include <linux/pci-epc.h>
#include <linux/pci-epf.h>
#include <linux/pci-ep-cfs.h>

static DEFINE_IDR(functions_idr);
static DEFINE_MUTEX(functions_mutex);
static struct config_group *functions_group;
static struct config_group *controllers_group;

struct pci_epf_group {};

struct pci_epc_group {};

static inline struct pci_epf_group *to_pci_epf_group(struct config_item *item)
{}

static inline struct pci_epc_group *to_pci_epc_group(struct config_item *item)
{}

static int pci_secondary_epc_epf_link(struct config_item *epf_item,
				      struct config_item *epc_item)
{}

static void pci_secondary_epc_epf_unlink(struct config_item *epc_item,
					 struct config_item *epf_item)
{}

static struct configfs_item_operations pci_secondary_epc_item_ops =;

static const struct config_item_type pci_secondary_epc_type =;

static struct config_group
*pci_ep_cfs_add_secondary_group(struct pci_epf_group *epf_group)
{}

static int pci_primary_epc_epf_link(struct config_item *epf_item,
				    struct config_item *epc_item)
{}

static void pci_primary_epc_epf_unlink(struct config_item *epc_item,
				       struct config_item *epf_item)
{}

static struct configfs_item_operations pci_primary_epc_item_ops =;

static const struct config_item_type pci_primary_epc_type =;

static struct config_group
*pci_ep_cfs_add_primary_group(struct pci_epf_group *epf_group)
{}

static ssize_t pci_epc_start_store(struct config_item *item, const char *page,
				   size_t len)
{}

static ssize_t pci_epc_start_show(struct config_item *item, char *page)
{}

CONFIGFS_ATTR();

static struct configfs_attribute *pci_epc_attrs[] =;

static int pci_epc_epf_link(struct config_item *epc_item,
			    struct config_item *epf_item)
{}

static void pci_epc_epf_unlink(struct config_item *epc_item,
			       struct config_item *epf_item)
{}

static struct configfs_item_operations pci_epc_item_ops =;

static const struct config_item_type pci_epc_type =;

struct config_group *pci_ep_cfs_add_epc_group(const char *name)
{}
EXPORT_SYMBOL();

void pci_ep_cfs_remove_epc_group(struct config_group *group)
{}
EXPORT_SYMBOL();

#define PCI_EPF_HEADER_R(_name)

#define PCI_EPF_HEADER_W_u32(_name)

#define PCI_EPF_HEADER_W_u16(_name)

#define PCI_EPF_HEADER_W_u8(_name)

static ssize_t pci_epf_msi_interrupts_store(struct config_item *item,
					    const char *page, size_t len)
{}

static ssize_t pci_epf_msi_interrupts_show(struct config_item *item,
					   char *page)
{}

static ssize_t pci_epf_msix_interrupts_store(struct config_item *item,
					     const char *page, size_t len)
{}

static ssize_t pci_epf_msix_interrupts_show(struct config_item *item,
					    char *page)
{}

PCI_EPF_HEADER_R()
PCI_EPF_HEADER_W_u16()

PCI_EPF_HEADER_R()
PCI_EPF_HEADER_W_u16()

PCI_EPF_HEADER_R()
PCI_EPF_HEADER_W_u8()

PCI_EPF_HEADER_R()
PCI_EPF_HEADER_W_u8()

PCI_EPF_HEADER_R()
PCI_EPF_HEADER_W_u8()

PCI_EPF_HEADER_R()
PCI_EPF_HEADER_W_u8()

PCI_EPF_HEADER_R()
PCI_EPF_HEADER_W_u8()

PCI_EPF_HEADER_R()
PCI_EPF_HEADER_W_u16()

PCI_EPF_HEADER_R()
PCI_EPF_HEADER_W_u16()

PCI_EPF_HEADER_R()
PCI_EPF_HEADER_W_u8()

CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();

static struct configfs_attribute *pci_epf_attrs[] =;

static int pci_epf_vepf_link(struct config_item *epf_pf_item,
			     struct config_item *epf_vf_item)
{}

static void pci_epf_vepf_unlink(struct config_item *epf_pf_item,
				struct config_item *epf_vf_item)
{}

static void pci_epf_release(struct config_item *item)
{}

static struct configfs_item_operations pci_epf_ops =;

static const struct config_item_type pci_epf_type =;

/**
 * pci_epf_type_add_cfs() - Help function drivers to expose function specific
 *                          attributes in configfs
 * @epf: the EPF device that has to be configured using configfs
 * @group: the parent configfs group (corresponding to entries in
 *         pci_epf_device_id)
 *
 * Invoke to expose function specific attributes in configfs.
 *
 * Return: A pointer to a config_group structure or NULL if the function driver
 * does not have anything to expose (attributes configured by user) or if
 * the function driver does not implement the add_cfs() method.
 *
 * Returns an error pointer if this function is called for an unbound EPF device
 * or if the EPF driver add_cfs() method fails.
 */
static struct config_group *pci_epf_type_add_cfs(struct pci_epf *epf,
						 struct config_group *group)
{}

static void pci_ep_cfs_add_type_group(struct pci_epf_group *epf_group)
{}

static void pci_epf_cfs_work(struct work_struct *work)
{}

static struct config_group *pci_epf_make(struct config_group *group,
					 const char *name)
{}

static void pci_epf_drop(struct config_group *group, struct config_item *item)
{}

static struct configfs_group_operations pci_epf_group_ops =;

static const struct config_item_type pci_epf_group_type =;

struct config_group *pci_ep_cfs_add_epf_group(const char *name)
{}
EXPORT_SYMBOL();

void pci_ep_cfs_remove_epf_group(struct config_group *group)
{}
EXPORT_SYMBOL();

static const struct config_item_type pci_functions_type =;

static const struct config_item_type pci_controllers_type =;

static const struct config_item_type pci_ep_type =;

static struct configfs_subsystem pci_ep_cfs_subsys =;

static int __init pci_ep_cfs_init(void)
{}
module_init();

static void __exit pci_ep_cfs_exit(void)
{}
module_exit(pci_ep_cfs_exit);

MODULE_DESCRIPTION();
MODULE_AUTHOR();