provider.c (0ea8a56de21be24cb79abb03dee79aabcd60a316) provider.c (d18bb3e15201918b8d07e85a6e010ca5ed28dad5)
1/*
2 * Copyright (c) 2009-2010 Chelsio, Inc. All rights reserved.
3 *
4 * 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 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 176 unchanged lines hidden (view full) ---

185 ret = remap_pfn_range(vma, vma->vm_start,
186 addr >> PAGE_SHIFT,
187 len, vma->vm_page_prot);
188 }
189
190 return ret;
191}
192
1/*
2 * Copyright (c) 2009-2010 Chelsio, Inc. All rights reserved.
3 *
4 * 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 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 176 unchanged lines hidden (view full) ---

185 ret = remap_pfn_range(vma, vma->vm_start,
186 addr >> PAGE_SHIFT,
187 len, vma->vm_page_prot);
188 }
189
190 return ret;
191}
192
193static void c4iw_deallocate_pd(struct ib_pd *pd, struct ib_udata *udata)
193static int c4iw_deallocate_pd(struct ib_pd *pd, struct ib_udata *udata)
194{
195 struct c4iw_dev *rhp;
196 struct c4iw_pd *php;
197
198 php = to_c4iw_pd(pd);
199 rhp = php->rhp;
200 pr_debug("ibpd %p pdid 0x%x\n", pd, php->pdid);
201 c4iw_put_resource(&rhp->rdev.resource.pdid_table, php->pdid);
202 mutex_lock(&rhp->rdev.stats.lock);
203 rhp->rdev.stats.pd.cur--;
204 mutex_unlock(&rhp->rdev.stats.lock);
194{
195 struct c4iw_dev *rhp;
196 struct c4iw_pd *php;
197
198 php = to_c4iw_pd(pd);
199 rhp = php->rhp;
200 pr_debug("ibpd %p pdid 0x%x\n", pd, php->pdid);
201 c4iw_put_resource(&rhp->rdev.resource.pdid_table, php->pdid);
202 mutex_lock(&rhp->rdev.stats.lock);
203 rhp->rdev.stats.pd.cur--;
204 mutex_unlock(&rhp->rdev.stats.lock);
205 return 0;
205}
206
207static int c4iw_allocate_pd(struct ib_pd *pd, struct ib_udata *udata)
208{
209 struct c4iw_pd *php = to_c4iw_pd(pd);
210 struct ib_device *ibdev = pd->device;
211 u32 pdid;
212 struct c4iw_dev *rhp;

--- 279 unchanged lines hidden (view full) ---

492 .post_send = c4iw_post_send,
493 .post_srq_recv = c4iw_post_srq_recv,
494 .query_device = c4iw_query_device,
495 .query_gid = c4iw_query_gid,
496 .query_port = c4iw_query_port,
497 .query_qp = c4iw_ib_query_qp,
498 .reg_user_mr = c4iw_reg_user_mr,
499 .req_notify_cq = c4iw_arm_cq,
206}
207
208static int c4iw_allocate_pd(struct ib_pd *pd, struct ib_udata *udata)
209{
210 struct c4iw_pd *php = to_c4iw_pd(pd);
211 struct ib_device *ibdev = pd->device;
212 u32 pdid;
213 struct c4iw_dev *rhp;

--- 279 unchanged lines hidden (view full) ---

493 .post_send = c4iw_post_send,
494 .post_srq_recv = c4iw_post_srq_recv,
495 .query_device = c4iw_query_device,
496 .query_gid = c4iw_query_gid,
497 .query_port = c4iw_query_port,
498 .query_qp = c4iw_ib_query_qp,
499 .reg_user_mr = c4iw_reg_user_mr,
500 .req_notify_cq = c4iw_arm_cq,
500 INIT_RDMA_OBJ_SIZE(ib_pd, c4iw_pd, ibpd),
501
501 INIT_RDMA_OBJ_SIZE(ib_cq, c4iw_cq, ibcq),
502 INIT_RDMA_OBJ_SIZE(ib_cq, c4iw_cq, ibcq),
503 INIT_RDMA_OBJ_SIZE(ib_mw, c4iw_mw, ibmw),
504 INIT_RDMA_OBJ_SIZE(ib_pd, c4iw_pd, ibpd),
502 INIT_RDMA_OBJ_SIZE(ib_srq, c4iw_srq, ibsrq),
503 INIT_RDMA_OBJ_SIZE(ib_ucontext, c4iw_ucontext, ibucontext),
504};
505
506static int set_netdevs(struct ib_device *ib_dev, struct c4iw_rdev *rdev)
507{
508 int ret;
509 int i;

--- 78 unchanged lines hidden ---
505 INIT_RDMA_OBJ_SIZE(ib_srq, c4iw_srq, ibsrq),
506 INIT_RDMA_OBJ_SIZE(ib_ucontext, c4iw_ucontext, ibucontext),
507};
508
509static int set_netdevs(struct ib_device *ib_dev, struct c4iw_rdev *rdev)
510{
511 int ret;
512 int i;

--- 78 unchanged lines hidden ---