linux/drivers/ntb/hw/amd/ntb_hw_amd.c

/*
 * This file is provided under a dual BSD/GPLv2 license.  When using or
 *   redistributing this file, you may do so under either license.
 *
 *   GPL LICENSE SUMMARY
 *
 *   Copyright (C) 2016 Advanced Micro Devices, Inc. All Rights Reserved.
 *   Copyright (C) 2016 T-Platforms. All Rights Reserved.
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of version 2 of the GNU General Public License as
 *   published by the Free Software Foundation.
 *
 *   BSD LICENSE
 *
 *   Copyright (C) 2016 Advanced Micro Devices, Inc. All Rights Reserved.
 *   Copyright (C) 2016 T-Platforms. All Rights Reserved.
 *
 *   Redistribution and use in source and binary forms, with or without
 *   modification, are permitted provided that the following conditions
 *   are met:
 *
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copy
 *       notice, this list of conditions and the following disclaimer in
 *       the documentation and/or other materials provided with the
 *       distribution.
 *     * Neither the name of AMD Corporation nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * AMD PCIe NTB Linux driver
 *
 * Contact Information:
 * Xiangliang Yu <[email protected]>
 */

#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);