Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4284
b: refs/heads/master
c: 53b8b3f
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier authored and Linus Torvalds committed Jul 8, 2005
1 parent 62bda9b commit f49ad34
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e0b537c7d94efe3fea0fee8e2533c3231a8af75
refs/heads/master: 53b8b3ffd5e0b10f3c683096a663d0cc22179c43
18 changes: 18 additions & 0 deletions trunk/drivers/infiniband/hw/mthca/mthca_provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
*/

#include <ib_smi.h>
#include <linux/mm.h>

#include "mthca_dev.h"
#include "mthca_cmd.h"
Expand Down Expand Up @@ -340,6 +341,22 @@ static int mthca_dealloc_ucontext(struct ib_ucontext *context)
return 0;
}

static int mthca_mmap_uar(struct ib_ucontext *context,
struct vm_area_struct *vma)
{
if (vma->vm_end - vma->vm_start != PAGE_SIZE)
return -EINVAL;

vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);

if (remap_pfn_range(vma, vma->vm_start,
to_mucontext(context)->uar.pfn,
PAGE_SIZE, vma->vm_page_prot))
return -EAGAIN;

return 0;
}

static struct ib_pd *mthca_alloc_pd(struct ib_device *ibdev,
struct ib_ucontext *context,
struct ib_udata *udata)
Expand Down Expand Up @@ -766,6 +783,7 @@ int mthca_register_device(struct mthca_dev *dev)
dev->ib_dev.query_gid = mthca_query_gid;
dev->ib_dev.alloc_ucontext = mthca_alloc_ucontext;
dev->ib_dev.dealloc_ucontext = mthca_dealloc_ucontext;
dev->ib_dev.mmap = mthca_mmap_uar;
dev->ib_dev.alloc_pd = mthca_alloc_pd;
dev->ib_dev.dealloc_pd = mthca_dealloc_pd;
dev->ib_dev.create_ah = mthca_ah_create;
Expand Down

0 comments on commit f49ad34

Please sign in to comment.