#include <linux/auxiliary_bus.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/overflow.h>
#include "../vsec.h"
#include "class.h"
#define TELEM_SIZE_OFFSET …
#define TELEM_GUID_OFFSET …
#define TELEM_BASE_OFFSET …
#define TELEM_ACCESS(v) …
#define TELEM_TYPE(v) …
#define TELEM_SIZE(v) …
#define TELEM_CLIENT_FIXED_BLOCK_GUID …
#define NUM_BYTES_QWORD(v) …
#define SAMPLE_ID_OFFSET(v) …
#define NUM_BYTES_DWORD(v) …
#define SAMPLE_ID_OFFSET32(v) …
static DEFINE_MUTEX(ep_lock);
enum telem_type { … };
struct pmt_telem_priv { … };
static bool pmt_telem_region_overlaps(struct intel_pmt_entry *entry,
struct device *dev)
{ … }
static int pmt_telem_header_decode(struct intel_pmt_entry *entry,
struct device *dev)
{ … }
static int pmt_telem_add_endpoint(struct intel_pmt_entry *entry,
struct pci_dev *pdev)
{ … }
static DEFINE_XARRAY_ALLOC(telem_array);
static struct intel_pmt_namespace pmt_telem_ns = …;
static void pmt_telem_ep_release(struct kref *kref)
{ … }
unsigned long pmt_telem_get_next_endpoint(unsigned long start)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
struct telem_endpoint *pmt_telem_register_endpoint(int devid)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
void pmt_telem_unregister_endpoint(struct telem_endpoint *ep)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int pmt_telem_get_endpoint_info(int devid, struct telem_endpoint_info *info)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int pmt_telem_read(struct telem_endpoint *ep, u32 id, u64 *data, u32 count)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int pmt_telem_read32(struct telem_endpoint *ep, u32 id, u32 *data, u32 count)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
struct telem_endpoint *
pmt_telem_find_and_register_endpoint(struct pci_dev *pcidev, u32 guid, u16 pos)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
static void pmt_telem_remove(struct auxiliary_device *auxdev)
{
struct pmt_telem_priv *priv = auxiliary_get_drvdata(auxdev);
int i;
mutex_lock(&ep_lock);
for (i = 0; i < priv->num_entries; i++) {
struct intel_pmt_entry *entry = &priv->entry[i];
kref_put(&entry->ep->kref, pmt_telem_ep_release);
intel_pmt_dev_destroy(entry, &pmt_telem_ns);
}
mutex_unlock(&ep_lock);
};
static int pmt_telem_probe(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id)
{ … }
static const struct auxiliary_device_id pmt_telem_id_table[] = …;
MODULE_DEVICE_TABLE(auxiliary, pmt_telem_id_table);
static struct auxiliary_driver pmt_telem_aux_driver = …;
static int __init pmt_telem_init(void)
{ … }
module_init(…) …;
static void __exit pmt_telem_exit(void)
{ … }
module_exit(pmt_telem_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);