1 /* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
3 * Copyright(c) 2020 - Cornelis Networks, Inc.
4 * Copyright(c) 2015 - 2017 Intel Corporation.
7 #ifndef _HFI1_USER_EXP_RCV_H
8 #define _HFI1_USER_EXP_RCV_H
19 struct mmu_interval_notifier notifier;
20 struct mutex cover_mutex;
25 struct tid_pageset *psets;
30 struct mmu_interval_notifier notifier;
31 struct hfi1_filedata *fdata;
32 struct mutex invalidate_mutex; /* covers hw removal */
34 struct tid_group *grp;
42 static inline int num_user_pages(unsigned long addr,
45 const unsigned long spage = addr & PAGE_MASK;
46 const unsigned long epage = (addr + len - 1) & PAGE_MASK;
48 return 1 + ((epage - spage) >> PAGE_SHIFT);
51 int hfi1_user_exp_rcv_init(struct hfi1_filedata *fd,
52 struct hfi1_ctxtdata *uctxt);
53 void hfi1_user_exp_rcv_free(struct hfi1_filedata *fd);
54 int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd,
55 struct hfi1_tid_info *tinfo);
56 int hfi1_user_exp_rcv_clear(struct hfi1_filedata *fd,
57 struct hfi1_tid_info *tinfo);
58 int hfi1_user_exp_rcv_invalid(struct hfi1_filedata *fd,
59 struct hfi1_tid_info *tinfo);
61 static inline struct mm_struct *mm_from_tid_node(struct tid_rb_node *node)
63 return node->notifier.mm;
66 #endif /* _HFI1_USER_EXP_RCV_H */