1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32#ifndef QEDE_ROCE_H
33#define QEDE_ROCE_H
34
35#include <linux/pci.h>
36#include <linux/netdevice.h>
37#include <linux/types.h>
38#include <linux/workqueue.h>
39
40struct qedr_dev;
41struct qed_dev;
42struct qede_dev;
43
44enum qede_rdma_event {
45 QEDE_UP,
46 QEDE_DOWN,
47 QEDE_CHANGE_ADDR,
48 QEDE_CLOSE
49};
50
51struct qede_rdma_event_work {
52 struct list_head list;
53 struct work_struct work;
54 void *ptr;
55 enum qede_rdma_event event;
56};
57
58struct qedr_driver {
59 unsigned char name[32];
60
61 struct qedr_dev* (*add)(struct qed_dev *, struct pci_dev *,
62 struct net_device *);
63
64 void (*remove)(struct qedr_dev *);
65 void (*notify)(struct qedr_dev *, enum qede_rdma_event);
66};
67
68
69
70
71int qede_rdma_register_driver(struct qedr_driver *drv);
72void qede_rdma_unregister_driver(struct qedr_driver *drv);
73
74bool qede_rdma_supported(struct qede_dev *dev);
75
76#if IS_ENABLED(CONFIG_QED_RDMA)
77int qede_rdma_dev_add(struct qede_dev *dev, bool recovery);
78void qede_rdma_dev_event_open(struct qede_dev *dev);
79void qede_rdma_dev_event_close(struct qede_dev *dev);
80void qede_rdma_dev_remove(struct qede_dev *dev, bool recovery);
81void qede_rdma_event_changeaddr(struct qede_dev *edr);
82
83#else
84static inline int qede_rdma_dev_add(struct qede_dev *dev,
85 bool recovery)
86{
87 return 0;
88}
89
90static inline void qede_rdma_dev_event_open(struct qede_dev *dev) {}
91static inline void qede_rdma_dev_event_close(struct qede_dev *dev) {}
92static inline void qede_rdma_dev_remove(struct qede_dev *dev,
93 bool recovery) {}
94static inline void qede_rdma_event_changeaddr(struct qede_dev *edr) {}
95#endif
96#endif
97