#include <linux/module.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/gfp.h>
#include "mthca_dev.h"
#include "mthca_config_reg.h"
#include "mthca_cmd.h"
#include "mthca_profile.h"
#include "mthca_memfree.h"
#include "mthca_wqe.h"
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#ifdef CONFIG_INFINIBAND_MTHCA_DEBUG
int mthca_debug_level = …;
module_param_named(debug_level, mthca_debug_level, int, 0644);
MODULE_PARM_DESC(…) …;
#endif
#ifdef CONFIG_PCI_MSI
static int msi_x = …;
module_param(msi_x, int, 0444);
MODULE_PARM_DESC(…) …;
#else
#define msi_x …
#endif
static int tune_pci = …;
module_param(tune_pci, int, 0444);
MODULE_PARM_DESC(…) …;
DEFINE_MUTEX(…) …;
#define MTHCA_DEFAULT_NUM_QP …
#define MTHCA_DEFAULT_RDB_PER_QP …
#define MTHCA_DEFAULT_NUM_CQ …
#define MTHCA_DEFAULT_NUM_MCG …
#define MTHCA_DEFAULT_NUM_MPT …
#define MTHCA_DEFAULT_NUM_MTT …
#define MTHCA_DEFAULT_NUM_UDAV …
#define MTHCA_DEFAULT_NUM_RESERVED_MTTS …
#define MTHCA_DEFAULT_NUM_UARC_SIZE …
static struct mthca_profile hca_profile = …;
module_param_named(num_qp, hca_profile.num_qp, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(rdb_per_qp, hca_profile.rdb_per_qp, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(num_cq, hca_profile.num_cq, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(num_mcg, hca_profile.num_mcg, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(num_mpt, hca_profile.num_mpt, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(num_mtt, hca_profile.num_mtt, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(num_udav, hca_profile.num_udav, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(fmr_reserved_mtts, hca_profile.fmr_reserved_mtts, int, 0444);
MODULE_PARM_DESC(…) …;
static int log_mtts_per_seg = …;
module_param_named(log_mtts_per_seg, log_mtts_per_seg, int, 0444);
MODULE_PARM_DESC(…) …;
static char mthca_version[] = …;
static int mthca_tune_pci(struct mthca_dev *mdev)
{ … }
static int mthca_dev_lim(struct mthca_dev *mdev, struct mthca_dev_lim *dev_lim)
{ … }
static int mthca_init_tavor(struct mthca_dev *mdev)
{ … }
static int mthca_load_fw(struct mthca_dev *mdev)
{ … }
static int mthca_init_icm(struct mthca_dev *mdev,
struct mthca_dev_lim *dev_lim,
struct mthca_init_hca_param *init_hca,
u64 icm_size)
{ … }
static void mthca_free_icms(struct mthca_dev *mdev)
{ … }
static int mthca_init_arbel(struct mthca_dev *mdev)
{ … }
static void mthca_close_hca(struct mthca_dev *mdev)
{ … }
static int mthca_init_hca(struct mthca_dev *mdev)
{ … }
static int mthca_setup_hca(struct mthca_dev *dev)
{ … }
static int mthca_enable_msi_x(struct mthca_dev *mdev)
{ … }
enum { … };
#define MTHCA_FW_VER(major, minor, subminor) …
static struct { … } mthca_hca_table[] = …;
static int __mthca_init_one(struct pci_dev *pdev, int hca_type)
{ … }
static void __mthca_remove_one(struct pci_dev *pdev)
{ … }
int __mthca_restart_one(struct pci_dev *pdev)
{ … }
static int mthca_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
{ … }
static void mthca_remove_one(struct pci_dev *pdev)
{ … }
static const struct pci_device_id mthca_pci_table[] = …;
MODULE_DEVICE_TABLE(pci, mthca_pci_table);
static struct pci_driver mthca_driver = …;
static void __init __mthca_check_profile_val(const char *name, int *pval,
int pval_default)
{ … }
#define mthca_check_profile_val(name, default) …
static void __init mthca_validate_profile(void)
{ … }
static int __init mthca_init(void)
{ … }
static void __exit mthca_cleanup(void)
{ … }
module_init(…) …;
module_exit(mthca_cleanup);