Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (c) 2004 Topspin Communications.  All rights reserved.
0003  * Copyright (c) 2005 Voltaire, Inc.  All rights reserved.
0004  * Copyright (c) 2006 Intel Corporation.  All rights reserved.
0005  *
0006  * This software is available to you under a choice of one of two
0007  * licenses.  You may choose to be licensed under the terms of the GNU
0008  * General Public License (GPL) Version 2, available from the file
0009  * COPYING in the main directory of this source tree, or the
0010  * OpenIB.org BSD license below:
0011  *
0012  *     Redistribution and use in source and binary forms, with or
0013  *     without modification, are permitted provided that the following
0014  *     conditions are met:
0015  *
0016  *      - Redistributions of source code must retain the above
0017  *        copyright notice, this list of conditions and the following
0018  *        disclaimer.
0019  *
0020  *      - Redistributions in binary form must reproduce the above
0021  *        copyright notice, this list of conditions and the following
0022  *        disclaimer in the documentation and/or other materials
0023  *        provided with the distribution.
0024  *
0025  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0026  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0027  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0028  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
0029  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
0030  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0031  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0032  * SOFTWARE.
0033  */
0034 
0035 #ifndef SA_H
0036 #define SA_H
0037 
0038 #include <rdma/ib_sa.h>
0039 
0040 static inline void ib_sa_client_get(struct ib_sa_client *client)
0041 {
0042     atomic_inc(&client->users);
0043 }
0044 
0045 static inline void ib_sa_client_put(struct ib_sa_client *client)
0046 {
0047     if (atomic_dec_and_test(&client->users))
0048         complete(&client->comp);
0049 }
0050 
0051 int ib_sa_mcmember_rec_query(struct ib_sa_client *client,
0052                  struct ib_device *device, u32 port_num, u8 method,
0053                  struct ib_sa_mcmember_rec *rec,
0054                  ib_sa_comp_mask comp_mask,
0055                  unsigned long timeout_ms, gfp_t gfp_mask,
0056                  void (*callback)(int status,
0057                           struct ib_sa_mcmember_rec *resp,
0058                           void *context),
0059                  void *context, struct ib_sa_query **sa_query);
0060 
0061 int mcast_init(void);
0062 void mcast_cleanup(void);
0063 
0064 #endif /* SA_H */