diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/rdma/ib_addr.h | 17 | ||||
-rw-r--r-- | include/rdma/ib_verbs.h | 25 |
2 files changed, 37 insertions, 5 deletions
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index 0ff67398928d..81b62307621d 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h | |||
@@ -40,7 +40,7 @@ struct rdma_dev_addr { | |||
40 | unsigned char src_dev_addr[MAX_ADDR_LEN]; | 40 | unsigned char src_dev_addr[MAX_ADDR_LEN]; |
41 | unsigned char dst_dev_addr[MAX_ADDR_LEN]; | 41 | unsigned char dst_dev_addr[MAX_ADDR_LEN]; |
42 | unsigned char broadcast[MAX_ADDR_LEN]; | 42 | unsigned char broadcast[MAX_ADDR_LEN]; |
43 | enum ib_node_type dev_type; | 43 | enum rdma_node_type dev_type; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | /** | 46 | /** |
@@ -72,6 +72,9 @@ int rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr, | |||
72 | 72 | ||
73 | void rdma_addr_cancel(struct rdma_dev_addr *addr); | 73 | void rdma_addr_cancel(struct rdma_dev_addr *addr); |
74 | 74 | ||
75 | int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev, | ||
76 | const unsigned char *dst_dev_addr); | ||
77 | |||
75 | static inline int ip_addr_size(struct sockaddr *addr) | 78 | static inline int ip_addr_size(struct sockaddr *addr) |
76 | { | 79 | { |
77 | return addr->sa_family == AF_INET6 ? | 80 | return addr->sa_family == AF_INET6 ? |
@@ -113,4 +116,16 @@ static inline void ib_addr_set_dgid(struct rdma_dev_addr *dev_addr, | |||
113 | memcpy(dev_addr->dst_dev_addr + 4, gid, sizeof *gid); | 116 | memcpy(dev_addr->dst_dev_addr + 4, gid, sizeof *gid); |
114 | } | 117 | } |
115 | 118 | ||
119 | static inline void iw_addr_get_sgid(struct rdma_dev_addr *dev_addr, | ||
120 | union ib_gid *gid) | ||
121 | { | ||
122 | memcpy(gid, dev_addr->src_dev_addr, sizeof *gid); | ||
123 | } | ||
124 | |||
125 | static inline void iw_addr_get_dgid(struct rdma_dev_addr *dev_addr, | ||
126 | union ib_gid *gid) | ||
127 | { | ||
128 | memcpy(gid, dev_addr->dst_dev_addr, sizeof *gid); | ||
129 | } | ||
130 | |||
116 | #endif /* IB_ADDR_H */ | 131 | #endif /* IB_ADDR_H */ |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 61eed3996117..8eacc3510993 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -56,12 +56,22 @@ union ib_gid { | |||
56 | } global; | 56 | } global; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | enum ib_node_type { | 59 | enum rdma_node_type { |
60 | IB_NODE_CA = 1, | 60 | /* IB values map to NodeInfo:NodeType. */ |
61 | IB_NODE_SWITCH, | 61 | RDMA_NODE_IB_CA = 1, |
62 | IB_NODE_ROUTER | 62 | RDMA_NODE_IB_SWITCH, |
63 | RDMA_NODE_IB_ROUTER, | ||
64 | RDMA_NODE_RNIC | ||
63 | }; | 65 | }; |
64 | 66 | ||
67 | enum rdma_transport_type { | ||
68 | RDMA_TRANSPORT_IB, | ||
69 | RDMA_TRANSPORT_IWARP | ||
70 | }; | ||
71 | |||
72 | enum rdma_transport_type | ||
73 | rdma_node_get_transport(enum rdma_node_type node_type) __attribute_const__; | ||
74 | |||
65 | enum ib_device_cap_flags { | 75 | enum ib_device_cap_flags { |
66 | IB_DEVICE_RESIZE_MAX_WR = 1, | 76 | IB_DEVICE_RESIZE_MAX_WR = 1, |
67 | IB_DEVICE_BAD_PKEY_CNTR = (1<<1), | 77 | IB_DEVICE_BAD_PKEY_CNTR = (1<<1), |
@@ -78,6 +88,9 @@ enum ib_device_cap_flags { | |||
78 | IB_DEVICE_RC_RNR_NAK_GEN = (1<<12), | 88 | IB_DEVICE_RC_RNR_NAK_GEN = (1<<12), |
79 | IB_DEVICE_SRQ_RESIZE = (1<<13), | 89 | IB_DEVICE_SRQ_RESIZE = (1<<13), |
80 | IB_DEVICE_N_NOTIFY_CQ = (1<<14), | 90 | IB_DEVICE_N_NOTIFY_CQ = (1<<14), |
91 | IB_DEVICE_ZERO_STAG = (1<<15), | ||
92 | IB_DEVICE_SEND_W_INV = (1<<16), | ||
93 | IB_DEVICE_MEM_WINDOW = (1<<17) | ||
81 | }; | 94 | }; |
82 | 95 | ||
83 | enum ib_atomic_cap { | 96 | enum ib_atomic_cap { |
@@ -835,6 +848,8 @@ struct ib_cache { | |||
835 | u8 *lmc_cache; | 848 | u8 *lmc_cache; |
836 | }; | 849 | }; |
837 | 850 | ||
851 | struct iw_cm_verbs; | ||
852 | |||
838 | struct ib_device { | 853 | struct ib_device { |
839 | struct device *dma_device; | 854 | struct device *dma_device; |
840 | 855 | ||
@@ -851,6 +866,8 @@ struct ib_device { | |||
851 | 866 | ||
852 | u32 flags; | 867 | u32 flags; |
853 | 868 | ||
869 | struct iw_cm_verbs *iwcm; | ||
870 | |||
854 | int (*query_device)(struct ib_device *device, | 871 | int (*query_device)(struct ib_device *device, |
855 | struct ib_device_attr *device_attr); | 872 | struct ib_device_attr *device_attr); |
856 | int (*query_port)(struct ib_device *device, | 873 | int (*query_port)(struct ib_device *device, |