#include <linux/bitfield.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/pci.h>
#include <linux/pci_ids.h>
#include <linux/dma-mapping.h>
#include <linux/kthread.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#include <linux/ccp.h>
#include "ccp-dev.h"
#include "psp-dev.h"
#include "hsti.h"
#define AA …
#define BB …
#define CC …
#define DD …
#define MSIX_VECTORS …
struct sp_pci { … };
static struct sp_device *sp_dev_master;
#define version_attribute_show(name, _offset) …
version_attribute_show(bootloader_version, psp->vdata->bootloader_info_reg)
static DEVICE_ATTR_RO(bootloader_version);
version_attribute_show(tee_version, psp->vdata->tee->info_reg)
static DEVICE_ATTR_RO(tee_version);
static struct attribute *psp_firmware_attrs[] = …;
static umode_t psp_firmware_is_visible(struct kobject *kobj, struct attribute *attr, int idx)
{ … }
static struct attribute_group psp_firmware_attr_group = …;
static const struct attribute_group *psp_groups[] = …;
static int sp_get_msix_irqs(struct sp_device *sp)
{ … }
static int sp_get_msi_irq(struct sp_device *sp)
{ … }
static int sp_get_irqs(struct sp_device *sp)
{ … }
static void sp_free_irqs(struct sp_device *sp)
{ … }
static bool sp_pci_is_master(struct sp_device *sp)
{ … }
static void psp_set_master(struct sp_device *sp)
{ … }
static struct sp_device *psp_get_master(void)
{ … }
static void psp_clear_master(struct sp_device *sp)
{ … }
static int sp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{ … }
static void sp_pci_shutdown(struct pci_dev *pdev)
{ … }
static void sp_pci_remove(struct pci_dev *pdev)
{ … }
static int __maybe_unused sp_pci_suspend(struct device *dev)
{ … }
static int __maybe_unused sp_pci_resume(struct device *dev)
{ … }
#ifdef CONFIG_CRYPTO_DEV_SP_PSP
static const struct sev_vdata sevv1 = …;
static const struct sev_vdata sevv2 = …;
static const struct tee_vdata teev1 = …;
static const struct tee_vdata teev2 = …;
static const struct platform_access_vdata pa_v1 = …;
static const struct platform_access_vdata pa_v2 = …;
static const struct psp_vdata pspv1 = …;
static const struct psp_vdata pspv2 = …;
static const struct psp_vdata pspv3 = …;
static const struct psp_vdata pspv4 = …;
static const struct psp_vdata pspv5 = …;
static const struct psp_vdata pspv6 = …;
#endif
static const struct sp_dev_vdata dev_vdata[] = …;
static const struct pci_device_id sp_pci_table[] = …;
MODULE_DEVICE_TABLE(pci, sp_pci_table);
static SIMPLE_DEV_PM_OPS(sp_pci_pm_ops, sp_pci_suspend, sp_pci_resume);
static struct pci_driver sp_pci_driver = …;
int sp_pci_init(void)
{ … }
void sp_pci_exit(void)
{ … }