2 * Copyright (c) 2005 Ammasso, Inc. All rights reserved.
3 * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
5 * 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 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37 #include <linux/inetdevice.h>
39 #include <rdma/ib_verbs.h>
40 #include <rdma/ib_pack.h>
43 #include <rdma/iw_cm.h>
45 #define C2_MPT_FLAG_ATOMIC (1 << 14)
46 #define C2_MPT_FLAG_REMOTE_WRITE (1 << 13)
47 #define C2_MPT_FLAG_REMOTE_READ (1 << 12)
48 #define C2_MPT_FLAG_LOCAL_WRITE (1 << 11)
49 #define C2_MPT_FLAG_LOCAL_READ (1 << 10)
53 DECLARE_PCI_UNMAP_ADDR(mapping
)
57 /* The user context keeps track of objects allocated for a
58 * particular user-mode client. */
60 struct ib_ucontext ibucontext
;
65 /* All objects associated with a PD are kept in the
66 * associated user context if present.
97 wait_queue_head_t wait
;
109 struct iw_cm_id
*cm_id
;
112 wait_queue_head_t wait
;
118 u32 rdma_write_sgl_depth
;
125 struct c2_cr_query_attrs
{
132 static inline struct c2_pd
*to_c2pd(struct ib_pd
*ibpd
)
134 return container_of(ibpd
, struct c2_pd
, ibpd
);
137 static inline struct c2_ucontext
*to_c2ucontext(struct ib_ucontext
*ibucontext
)
139 return container_of(ibucontext
, struct c2_ucontext
, ibucontext
);
142 static inline struct c2_mr
*to_c2mr(struct ib_mr
*ibmr
)
144 return container_of(ibmr
, struct c2_mr
, ibmr
);
148 static inline struct c2_ah
*to_c2ah(struct ib_ah
*ibah
)
150 return container_of(ibah
, struct c2_ah
, ibah
);
153 static inline struct c2_cq
*to_c2cq(struct ib_cq
*ibcq
)
155 return container_of(ibcq
, struct c2_cq
, ibcq
);
158 static inline struct c2_qp
*to_c2qp(struct ib_qp
*ibqp
)
160 return container_of(ibqp
, struct c2_qp
, ibqp
);
163 static inline int is_rnic_addr(struct net_device
*netdev
, u32 addr
)
165 struct in_device
*ind
;
168 ind
= in_dev_get(netdev
);
173 if (ifa
->ifa_address
== addr
) {
182 #endif /* C2_PROVIDER_H */