aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/include/ib_sa.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/include/ib_sa.h')
-rw-r--r--drivers/infiniband/include/ib_sa.h87
1 files changed, 76 insertions, 11 deletions
diff --git a/drivers/infiniband/include/ib_sa.h b/drivers/infiniband/include/ib_sa.h
index 00222285eb9a..6d999f7b5d93 100644
--- a/drivers/infiniband/include/ib_sa.h
+++ b/drivers/infiniband/include/ib_sa.h
@@ -1,5 +1,6 @@
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 * 4 *
4 * This software is available to you under a choice of one of two 5 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU 6 * licenses. You may choose to be licensed under the terms of the GNU
@@ -29,7 +30,7 @@
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE. 31 * SOFTWARE.
31 * 32 *
32 * $Id: ib_sa.h 1389 2004-12-27 22:56:47Z roland $ 33 * $Id: ib_sa.h 2811 2005-07-06 18:11:43Z halr $
33 */ 34 */
34 35
35#ifndef IB_SA_H 36#ifndef IB_SA_H
@@ -41,9 +42,11 @@
41#include <ib_mad.h> 42#include <ib_mad.h>
42 43
43enum { 44enum {
44 IB_SA_CLASS_VERSION = 2, /* IB spec version 1.1/1.2 */ 45 IB_SA_CLASS_VERSION = 2, /* IB spec version 1.1/1.2 */
45 46
46 IB_SA_METHOD_DELETE = 0x15 47 IB_SA_METHOD_GET_TABLE = 0x12,
48 IB_SA_METHOD_GET_TABLE_RESP = 0x92,
49 IB_SA_METHOD_DELETE = 0x15
47}; 50};
48 51
49enum ib_sa_selector { 52enum ib_sa_selector {
@@ -87,10 +90,6 @@ static inline int ib_sa_rate_enum_to_int(enum ib_sa_rate rate)
87 } 90 }
88} 91}
89 92
90typedef u64 __bitwise ib_sa_comp_mask;
91
92#define IB_SA_COMP_MASK(n) ((__force ib_sa_comp_mask) cpu_to_be64(1ull << n))
93
94/* 93/*
95 * Structures for SA records are named "struct ib_sa_xxx_rec." No 94 * Structures for SA records are named "struct ib_sa_xxx_rec." No
96 * attempt is made to pack structures to match the physical layout of 95 * attempt is made to pack structures to match the physical layout of
@@ -195,6 +194,61 @@ struct ib_sa_mcmember_rec {
195 int proxy_join; 194 int proxy_join;
196}; 195};
197 196
197/* Service Record Component Mask Sec 15.2.5.14 Ver 1.1 */
198#define IB_SA_SERVICE_REC_SERVICE_ID IB_SA_COMP_MASK( 0)
199#define IB_SA_SERVICE_REC_SERVICE_GID IB_SA_COMP_MASK( 1)
200#define IB_SA_SERVICE_REC_SERVICE_PKEY IB_SA_COMP_MASK( 2)
201/* reserved: 3 */
202#define IB_SA_SERVICE_REC_SERVICE_LEASE IB_SA_COMP_MASK( 4)
203#define IB_SA_SERVICE_REC_SERVICE_KEY IB_SA_COMP_MASK( 5)
204#define IB_SA_SERVICE_REC_SERVICE_NAME IB_SA_COMP_MASK( 6)
205#define IB_SA_SERVICE_REC_SERVICE_DATA8_0 IB_SA_COMP_MASK( 7)
206#define IB_SA_SERVICE_REC_SERVICE_DATA8_1 IB_SA_COMP_MASK( 8)
207#define IB_SA_SERVICE_REC_SERVICE_DATA8_2 IB_SA_COMP_MASK( 9)
208#define IB_SA_SERVICE_REC_SERVICE_DATA8_3 IB_SA_COMP_MASK(10)
209#define IB_SA_SERVICE_REC_SERVICE_DATA8_4 IB_SA_COMP_MASK(11)
210#define IB_SA_SERVICE_REC_SERVICE_DATA8_5 IB_SA_COMP_MASK(12)
211#define IB_SA_SERVICE_REC_SERVICE_DATA8_6 IB_SA_COMP_MASK(13)
212#define IB_SA_SERVICE_REC_SERVICE_DATA8_7 IB_SA_COMP_MASK(14)
213#define IB_SA_SERVICE_REC_SERVICE_DATA8_8 IB_SA_COMP_MASK(15)
214#define IB_SA_SERVICE_REC_SERVICE_DATA8_9 IB_SA_COMP_MASK(16)
215#define IB_SA_SERVICE_REC_SERVICE_DATA8_10 IB_SA_COMP_MASK(17)
216#define IB_SA_SERVICE_REC_SERVICE_DATA8_11 IB_SA_COMP_MASK(18)
217#define IB_SA_SERVICE_REC_SERVICE_DATA8_12 IB_SA_COMP_MASK(19)
218#define IB_SA_SERVICE_REC_SERVICE_DATA8_13 IB_SA_COMP_MASK(20)
219#define IB_SA_SERVICE_REC_SERVICE_DATA8_14 IB_SA_COMP_MASK(21)
220#define IB_SA_SERVICE_REC_SERVICE_DATA8_15 IB_SA_COMP_MASK(22)
221#define IB_SA_SERVICE_REC_SERVICE_DATA16_0 IB_SA_COMP_MASK(23)
222#define IB_SA_SERVICE_REC_SERVICE_DATA16_1 IB_SA_COMP_MASK(24)
223#define IB_SA_SERVICE_REC_SERVICE_DATA16_2 IB_SA_COMP_MASK(25)
224#define IB_SA_SERVICE_REC_SERVICE_DATA16_3 IB_SA_COMP_MASK(26)
225#define IB_SA_SERVICE_REC_SERVICE_DATA16_4 IB_SA_COMP_MASK(27)
226#define IB_SA_SERVICE_REC_SERVICE_DATA16_5 IB_SA_COMP_MASK(28)
227#define IB_SA_SERVICE_REC_SERVICE_DATA16_6 IB_SA_COMP_MASK(29)
228#define IB_SA_SERVICE_REC_SERVICE_DATA16_7 IB_SA_COMP_MASK(30)
229#define IB_SA_SERVICE_REC_SERVICE_DATA32_0 IB_SA_COMP_MASK(31)
230#define IB_SA_SERVICE_REC_SERVICE_DATA32_1 IB_SA_COMP_MASK(32)
231#define IB_SA_SERVICE_REC_SERVICE_DATA32_2 IB_SA_COMP_MASK(33)
232#define IB_SA_SERVICE_REC_SERVICE_DATA32_3 IB_SA_COMP_MASK(34)
233#define IB_SA_SERVICE_REC_SERVICE_DATA64_0 IB_SA_COMP_MASK(35)
234#define IB_SA_SERVICE_REC_SERVICE_DATA64_1 IB_SA_COMP_MASK(36)
235
236#define IB_DEFAULT_SERVICE_LEASE 0xFFFFFFFF
237
238struct ib_sa_service_rec {
239 u64 id;
240 union ib_gid gid;
241 u16 pkey;
242 /* reserved */
243 u32 lease;
244 u8 key[16];
245 u8 name[64];
246 u8 data8[16];
247 u16 data16[8];
248 u32 data32[4];
249 u64 data64[2];
250};
251
198struct ib_sa_query; 252struct ib_sa_query;
199 253
200void ib_sa_cancel_query(int id, struct ib_sa_query *query); 254void ib_sa_cancel_query(int id, struct ib_sa_query *query);
@@ -202,7 +256,7 @@ void ib_sa_cancel_query(int id, struct ib_sa_query *query);
202int ib_sa_path_rec_get(struct ib_device *device, u8 port_num, 256int ib_sa_path_rec_get(struct ib_device *device, u8 port_num,
203 struct ib_sa_path_rec *rec, 257 struct ib_sa_path_rec *rec,
204 ib_sa_comp_mask comp_mask, 258 ib_sa_comp_mask comp_mask,
205 int timeout_ms, int gfp_mask, 259 int timeout_ms, unsigned int __nocast gfp_mask,
206 void (*callback)(int status, 260 void (*callback)(int status,
207 struct ib_sa_path_rec *resp, 261 struct ib_sa_path_rec *resp,
208 void *context), 262 void *context),
@@ -213,13 +267,24 @@ int ib_sa_mcmember_rec_query(struct ib_device *device, u8 port_num,
213 u8 method, 267 u8 method,
214 struct ib_sa_mcmember_rec *rec, 268 struct ib_sa_mcmember_rec *rec,
215 ib_sa_comp_mask comp_mask, 269 ib_sa_comp_mask comp_mask,
216 int timeout_ms, int gfp_mask, 270 int timeout_ms, unsigned int __nocast gfp_mask,
217 void (*callback)(int status, 271 void (*callback)(int status,
218 struct ib_sa_mcmember_rec *resp, 272 struct ib_sa_mcmember_rec *resp,
219 void *context), 273 void *context),
220 void *context, 274 void *context,
221 struct ib_sa_query **query); 275 struct ib_sa_query **query);
222 276
277int ib_sa_service_rec_query(struct ib_device *device, u8 port_num,
278 u8 method,
279 struct ib_sa_service_rec *rec,
280 ib_sa_comp_mask comp_mask,
281 int timeout_ms, unsigned int __nocast gfp_mask,
282 void (*callback)(int status,
283 struct ib_sa_service_rec *resp,
284 void *context),
285 void *context,
286 struct ib_sa_query **sa_query);
287
223/** 288/**
224 * ib_sa_mcmember_rec_set - Start an MCMember set query 289 * ib_sa_mcmember_rec_set - Start an MCMember set query
225 * @device:device to send query on 290 * @device:device to send query on
@@ -248,7 +313,7 @@ static inline int
248ib_sa_mcmember_rec_set(struct ib_device *device, u8 port_num, 313ib_sa_mcmember_rec_set(struct ib_device *device, u8 port_num,
249 struct ib_sa_mcmember_rec *rec, 314 struct ib_sa_mcmember_rec *rec,
250 ib_sa_comp_mask comp_mask, 315 ib_sa_comp_mask comp_mask,
251 int timeout_ms, int gfp_mask, 316 int timeout_ms, unsigned int __nocast gfp_mask,
252 void (*callback)(int status, 317 void (*callback)(int status,
253 struct ib_sa_mcmember_rec *resp, 318 struct ib_sa_mcmember_rec *resp,
254 void *context), 319 void *context),
@@ -290,7 +355,7 @@ static inline int
290ib_sa_mcmember_rec_delete(struct ib_device *device, u8 port_num, 355ib_sa_mcmember_rec_delete(struct ib_device *device, u8 port_num,
291 struct ib_sa_mcmember_rec *rec, 356 struct ib_sa_mcmember_rec *rec,
292 ib_sa_comp_mask comp_mask, 357 ib_sa_comp_mask comp_mask,
293 int timeout_ms, int gfp_mask, 358 int timeout_ms, unsigned int __nocast gfp_mask,
294 void (*callback)(int status, 359 void (*callback)(int status,
295 struct ib_sa_mcmember_rec *resp, 360 struct ib_sa_mcmember_rec *resp,
296 void *context), 361 void *context),