#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/acpi.h>
#include <linux/pci.h>
#include <linux/random.h>
#include <linux/slab.h>
#include <linux/ntb.h>
#include "ntb_hw_amd.h"
#define NTB_NAME …
#define NTB_DESC …
#define NTB_VER …
MODULE_DESCRIPTION(…);
MODULE_VERSION(…);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
static const struct file_operations amd_ntb_debugfs_info;
static struct dentry *debugfs_dir;
static int ndev_mw_to_bar(struct amd_ntb_dev *ndev, int idx)
{ … }
static int amd_ntb_mw_count(struct ntb_dev *ntb, int pidx)
{ … }
static int amd_ntb_mw_get_align(struct ntb_dev *ntb, int pidx, int idx,
resource_size_t *addr_align,
resource_size_t *size_align,
resource_size_t *size_max)
{ … }
static int amd_ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, int idx,
dma_addr_t addr, resource_size_t size)
{ … }
static int amd_ntb_get_link_status(struct amd_ntb_dev *ndev)
{ … }
static int amd_link_is_up(struct amd_ntb_dev *ndev)
{ … }
static u64 amd_ntb_link_is_up(struct ntb_dev *ntb,
enum ntb_speed *speed,
enum ntb_width *width)
{ … }
static int amd_ntb_link_enable(struct ntb_dev *ntb,
enum ntb_speed max_speed,
enum ntb_width max_width)
{ … }
static int amd_ntb_link_disable(struct ntb_dev *ntb)
{ … }
static int amd_ntb_peer_mw_count(struct ntb_dev *ntb)
{ … }
static int amd_ntb_peer_mw_get_addr(struct ntb_dev *ntb, int idx,
phys_addr_t *base, resource_size_t *size)
{ … }
static u64 amd_ntb_db_valid_mask(struct ntb_dev *ntb)
{ … }
static int amd_ntb_db_vector_count(struct ntb_dev *ntb)
{ … }
static u64 amd_ntb_db_vector_mask(struct ntb_dev *ntb, int db_vector)
{ … }
static u64 amd_ntb_db_read(struct ntb_dev *ntb)
{ … }
static int amd_ntb_db_clear(struct ntb_dev *ntb, u64 db_bits)
{ … }
static int amd_ntb_db_set_mask(struct ntb_dev *ntb, u64 db_bits)
{ … }
static int amd_ntb_db_clear_mask(struct ntb_dev *ntb, u64 db_bits)
{ … }
static int amd_ntb_peer_db_set(struct ntb_dev *ntb, u64 db_bits)
{ … }
static int amd_ntb_spad_count(struct ntb_dev *ntb)
{ … }
static u32 amd_ntb_spad_read(struct ntb_dev *ntb, int idx)
{ … }
static int amd_ntb_spad_write(struct ntb_dev *ntb,
int idx, u32 val)
{ … }
static u32 amd_ntb_peer_spad_read(struct ntb_dev *ntb, int pidx, int sidx)
{ … }
static int amd_ntb_peer_spad_write(struct ntb_dev *ntb, int pidx,
int sidx, u32 val)
{ … }
static const struct ntb_dev_ops amd_ntb_ops = …;
static void amd_ack_smu(struct amd_ntb_dev *ndev, u32 bit)
{ … }
static void amd_handle_event(struct amd_ntb_dev *ndev, int vec)
{ … }
static void amd_handle_db_event(struct amd_ntb_dev *ndev, int vec)
{ … }
static irqreturn_t ndev_interrupt(struct amd_ntb_dev *ndev, int vec)
{ … }
static irqreturn_t ndev_vec_isr(int irq, void *dev)
{ … }
static irqreturn_t ndev_irq_isr(int irq, void *dev)
{ … }
static int ndev_init_isr(struct amd_ntb_dev *ndev,
int msix_min, int msix_max)
{ … }
static void ndev_deinit_isr(struct amd_ntb_dev *ndev)
{ … }
static ssize_t ndev_debugfs_read(struct file *filp, char __user *ubuf,
size_t count, loff_t *offp)
{ … }
static void ndev_init_debugfs(struct amd_ntb_dev *ndev)
{ … }
static void ndev_deinit_debugfs(struct amd_ntb_dev *ndev)
{ … }
static inline void ndev_init_struct(struct amd_ntb_dev *ndev,
struct pci_dev *pdev)
{ … }
static int amd_poll_link(struct amd_ntb_dev *ndev)
{ … }
static void amd_link_hb(struct work_struct *work)
{ … }
static int amd_init_isr(struct amd_ntb_dev *ndev)
{ … }
static void amd_set_side_info_reg(struct amd_ntb_dev *ndev, bool peer)
{ … }
static void amd_clear_side_info_reg(struct amd_ntb_dev *ndev, bool peer)
{ … }
static void amd_init_side_info(struct amd_ntb_dev *ndev)
{ … }
static void amd_deinit_side_info(struct amd_ntb_dev *ndev)
{ … }
static int amd_init_ntb(struct amd_ntb_dev *ndev)
{ … }
static enum ntb_topo amd_get_topo(struct amd_ntb_dev *ndev)
{ … }
static int amd_init_dev(struct amd_ntb_dev *ndev)
{ … }
static void amd_deinit_dev(struct amd_ntb_dev *ndev)
{ … }
static int amd_ntb_init_pci(struct amd_ntb_dev *ndev,
struct pci_dev *pdev)
{ … }
static void amd_ntb_deinit_pci(struct amd_ntb_dev *ndev)
{ … }
static int amd_ntb_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{ … }
static void amd_ntb_pci_remove(struct pci_dev *pdev)
{ … }
static void amd_ntb_pci_shutdown(struct pci_dev *pdev)
{ … }
static const struct file_operations amd_ntb_debugfs_info = …;
static const struct ntb_dev_data dev_data[] = …;
static const struct pci_device_id amd_ntb_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, amd_ntb_pci_tbl);
static struct pci_driver amd_ntb_pci_driver = …;
static int __init amd_ntb_pci_driver_init(void)
{ … }
module_init(…) …;
static void __exit amd_ntb_pci_driver_exit(void)
{ … }
module_exit(amd_ntb_pci_driver_exit);