main.c (298486) | main.c (299179) |
---|---|
1/* 2 * Copyright (c) 2006, 2007 Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved. 4 * 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 --- 785 unchanged lines hidden (view full) --- 794static int mlx4_ib_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) 795{ 796 struct mlx4_ib_dev *dev = to_mdev(context->device); 797 798 /* Last 8 bits hold the command others are data per that command */ 799 unsigned long command = vma->vm_pgoff & MLX4_IB_MMAP_CMD_MASK; 800 801 if (command < MLX4_IB_MMAP_GET_CONTIGUOUS_PAGES) { | 1/* 2 * Copyright (c) 2006, 2007 Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved. 4 * 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 --- 785 unchanged lines hidden (view full) --- 794static int mlx4_ib_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) 795{ 796 struct mlx4_ib_dev *dev = to_mdev(context->device); 797 798 /* Last 8 bits hold the command others are data per that command */ 799 unsigned long command = vma->vm_pgoff & MLX4_IB_MMAP_CMD_MASK; 800 801 if (command < MLX4_IB_MMAP_GET_CONTIGUOUS_PAGES) { |
802 /* compatability handling for commands 0 & 1*/ | 802 /* compatibility handling for commands 0 & 1*/ |
803 if (vma->vm_end - vma->vm_start != PAGE_SIZE) 804 return -EINVAL; 805 } 806 if (command == MLX4_IB_MMAP_UAR_PAGE) { 807 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 808 809 if (io_remap_pfn_range(vma, vma->vm_start, 810 to_mucontext(context)->uar.pfn, --- 2084 unchanged lines hidden --- | 803 if (vma->vm_end - vma->vm_start != PAGE_SIZE) 804 return -EINVAL; 805 } 806 if (command == MLX4_IB_MMAP_UAR_PAGE) { 807 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 808 809 if (io_remap_pfn_range(vma, vma->vm_start, 810 to_mucontext(context)->uar.pfn, --- 2084 unchanged lines hidden --- |