aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/Kbuild2
-rw-r--r--include/rdma/ib_addr.h17
-rw-r--r--include/rdma/ib_sa.h45
-rw-r--r--include/rdma/ib_user_verbs.h2
-rw-r--r--include/rdma/ib_verbs.h31
-rw-r--r--include/rdma/iw_cm.h258
-rw-r--r--include/rdma/rdma_cm.h12
7 files changed, 350 insertions, 17 deletions
diff --git a/include/rdma/Kbuild b/include/rdma/Kbuild
index eb710ba9b1a0..e7c043216558 100644
--- a/include/rdma/Kbuild
+++ b/include/rdma/Kbuild
@@ -1 +1 @@
header-y := ib_user_mad.h header-y += ib_user_mad.h
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
73void rdma_addr_cancel(struct rdma_dev_addr *addr); 73void rdma_addr_cancel(struct rdma_dev_addr *addr);
74 74
75int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
76 const unsigned char *dst_dev_addr);
77
75static inline int ip_addr_size(struct sockaddr *addr) 78static 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
119static 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
125static 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_sa.h b/include/rdma/ib_sa.h
index c99e4420fd7e..97715b0c20b6 100644
--- a/include/rdma/ib_sa.h
+++ b/include/rdma/ib_sa.h
@@ -1,6 +1,7 @@
1/* 1/*
2 * Copyright (c) 2004 Topspin Communications. All rights reserved. 2 * Copyright (c) 2004 Topspin Communications. All rights reserved.
3 * Copyright (c) 2005 Voltaire, Inc. All rights reserved. 3 * Copyright (c) 2005 Voltaire, Inc. All rights reserved.
4 * Copyright (c) 2006 Intel Corporation. All rights reserved.
4 * 5 *
5 * This software is available to you under a choice of one of two 6 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU 7 * licenses. You may choose to be licensed under the terms of the GNU
@@ -36,8 +37,11 @@
36#ifndef IB_SA_H 37#ifndef IB_SA_H
37#define IB_SA_H 38#define IB_SA_H
38 39
40#include <linux/completion.h>
39#include <linux/compiler.h> 41#include <linux/compiler.h>
40 42
43#include <asm/atomic.h>
44
41#include <rdma/ib_verbs.h> 45#include <rdma/ib_verbs.h>
42#include <rdma/ib_mad.h> 46#include <rdma/ib_mad.h>
43 47
@@ -79,8 +83,8 @@ enum {
79}; 83};
80 84
81enum ib_sa_selector { 85enum ib_sa_selector {
82 IB_SA_GTE = 0, 86 IB_SA_GT = 0,
83 IB_SA_LTE = 1, 87 IB_SA_LT = 1,
84 IB_SA_EQ = 2, 88 IB_SA_EQ = 2,
85 /* 89 /*
86 * The meaning of "best" depends on the attribute: for 90 * The meaning of "best" depends on the attribute: for
@@ -250,11 +254,28 @@ struct ib_sa_service_rec {
250 u64 data64[2]; 254 u64 data64[2];
251}; 255};
252 256
257struct ib_sa_client {
258 atomic_t users;
259 struct completion comp;
260};
261
262/**
263 * ib_sa_register_client - Register an SA client.
264 */
265void ib_sa_register_client(struct ib_sa_client *client);
266
267/**
268 * ib_sa_unregister_client - Deregister an SA client.
269 * @client: Client object to deregister.
270 */
271void ib_sa_unregister_client(struct ib_sa_client *client);
272
253struct ib_sa_query; 273struct ib_sa_query;
254 274
255void ib_sa_cancel_query(int id, struct ib_sa_query *query); 275void ib_sa_cancel_query(int id, struct ib_sa_query *query);
256 276
257int ib_sa_path_rec_get(struct ib_device *device, u8 port_num, 277int ib_sa_path_rec_get(struct ib_sa_client *client,
278 struct ib_device *device, u8 port_num,
258 struct ib_sa_path_rec *rec, 279 struct ib_sa_path_rec *rec,
259 ib_sa_comp_mask comp_mask, 280 ib_sa_comp_mask comp_mask,
260 int timeout_ms, gfp_t gfp_mask, 281 int timeout_ms, gfp_t gfp_mask,
@@ -264,7 +285,8 @@ int ib_sa_path_rec_get(struct ib_device *device, u8 port_num,
264 void *context, 285 void *context,
265 struct ib_sa_query **query); 286 struct ib_sa_query **query);
266 287
267int ib_sa_mcmember_rec_query(struct ib_device *device, u8 port_num, 288int ib_sa_mcmember_rec_query(struct ib_sa_client *client,
289 struct ib_device *device, u8 port_num,
268 u8 method, 290 u8 method,
269 struct ib_sa_mcmember_rec *rec, 291 struct ib_sa_mcmember_rec *rec,
270 ib_sa_comp_mask comp_mask, 292 ib_sa_comp_mask comp_mask,
@@ -275,7 +297,8 @@ int ib_sa_mcmember_rec_query(struct ib_device *device, u8 port_num,
275 void *context, 297 void *context,
276 struct ib_sa_query **query); 298 struct ib_sa_query **query);
277 299
278int ib_sa_service_rec_query(struct ib_device *device, u8 port_num, 300int ib_sa_service_rec_query(struct ib_sa_client *client,
301 struct ib_device *device, u8 port_num,
279 u8 method, 302 u8 method,
280 struct ib_sa_service_rec *rec, 303 struct ib_sa_service_rec *rec,
281 ib_sa_comp_mask comp_mask, 304 ib_sa_comp_mask comp_mask,
@@ -288,6 +311,7 @@ int ib_sa_service_rec_query(struct ib_device *device, u8 port_num,
288 311
289/** 312/**
290 * ib_sa_mcmember_rec_set - Start an MCMember set query 313 * ib_sa_mcmember_rec_set - Start an MCMember set query
314 * @client:SA client
291 * @device:device to send query on 315 * @device:device to send query on
292 * @port_num: port number to send query on 316 * @port_num: port number to send query on
293 * @rec:MCMember Record to send in query 317 * @rec:MCMember Record to send in query
@@ -311,7 +335,8 @@ int ib_sa_service_rec_query(struct ib_device *device, u8 port_num,
311 * cancel the query. 335 * cancel the query.
312 */ 336 */
313static inline int 337static inline int
314ib_sa_mcmember_rec_set(struct ib_device *device, u8 port_num, 338ib_sa_mcmember_rec_set(struct ib_sa_client *client,
339 struct ib_device *device, u8 port_num,
315 struct ib_sa_mcmember_rec *rec, 340 struct ib_sa_mcmember_rec *rec,
316 ib_sa_comp_mask comp_mask, 341 ib_sa_comp_mask comp_mask,
317 int timeout_ms, gfp_t gfp_mask, 342 int timeout_ms, gfp_t gfp_mask,
@@ -321,7 +346,7 @@ ib_sa_mcmember_rec_set(struct ib_device *device, u8 port_num,
321 void *context, 346 void *context,
322 struct ib_sa_query **query) 347 struct ib_sa_query **query)
323{ 348{
324 return ib_sa_mcmember_rec_query(device, port_num, 349 return ib_sa_mcmember_rec_query(client, device, port_num,
325 IB_MGMT_METHOD_SET, 350 IB_MGMT_METHOD_SET,
326 rec, comp_mask, 351 rec, comp_mask,
327 timeout_ms, gfp_mask, callback, 352 timeout_ms, gfp_mask, callback,
@@ -330,6 +355,7 @@ ib_sa_mcmember_rec_set(struct ib_device *device, u8 port_num,
330 355
331/** 356/**
332 * ib_sa_mcmember_rec_delete - Start an MCMember delete query 357 * ib_sa_mcmember_rec_delete - Start an MCMember delete query
358 * @client:SA client
333 * @device:device to send query on 359 * @device:device to send query on
334 * @port_num: port number to send query on 360 * @port_num: port number to send query on
335 * @rec:MCMember Record to send in query 361 * @rec:MCMember Record to send in query
@@ -353,7 +379,8 @@ ib_sa_mcmember_rec_set(struct ib_device *device, u8 port_num,
353 * cancel the query. 379 * cancel the query.
354 */ 380 */
355