NTB: switchtec_ntb: Introduce initial NTB driver

Seeing the Switchtec NTB hardware shares the same endpoint as the
management endpoint we utilize the class_interface API to register
an NTB driver for every Switchtec device in the system that has the
NTB class code.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Stephen Bates <sbates@raithlin.com>
Reviewed-by: Kurt Schwemmer <kurt.schwemmer@microsemi.com>
Acked-by: Allen Hubbe <Allen.Hubbe@dell.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
This commit is contained in:
Logan Gunthorpe
2017-08-03 12:19:46 -06:00
committed by Jon Mason
parent fa5ab66e36
commit 33dea5aae0
8 changed files with 101 additions and 0 deletions

View File

@@ -320,6 +320,8 @@ struct pff_csr_regs {
u32 reserved4[174];
} __packed;
struct switchtec_ntb;
struct switchtec_dev {
struct pci_dev *pdev;
struct device dev;
@@ -357,6 +359,8 @@ struct switchtec_dev {
struct work_struct link_event_work;
void (*link_notifier)(struct switchtec_dev *stdev);
u8 link_event_count[SWITCHTEC_MAX_PFF_CSR];
struct switchtec_ntb *sndev;
};
static inline struct switchtec_dev *to_stdev(struct device *dev)