vt.c (c1b332bc16a6e9d42b4ab0b5282e3937f776bf71) vt.c (8afd32eb58b6885fc3e268c69b1b1b627aa2afaf)
1/*
2 * Copyright(c) 2015 Intel Corporation.
3 *
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
6 *
7 * GPL LICENSE SUMMARY
8 *

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

71
72 /*
73 * Drivers have the option to override anything in the ibdev that they
74 * want to specifically handle. VT needs to check for things it supports
75 * and if the driver wants to handle that functionality let it. We may
76 * come up with a better mechanism that simplifies the code at some
77 * point.
78 */
1/*
2 * Copyright(c) 2015 Intel Corporation.
3 *
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
6 *
7 * GPL LICENSE SUMMARY
8 *

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

71
72 /*
73 * Drivers have the option to override anything in the ibdev that they
74 * want to specifically handle. VT needs to check for things it supports
75 * and if the driver wants to handle that functionality let it. We may
76 * come up with a better mechanism that simplifies the code at some
77 * point.
78 */
79
80 /* DMA Operations */
79 rdi->ibdev.dma_ops =
80 rdi->ibdev.dma_ops ? : &rvt_default_dma_mapping_ops;
81
81 rdi->ibdev.dma_ops =
82 rdi->ibdev.dma_ops ? : &rvt_default_dma_mapping_ops;
83
84 /* Protection Domain */
85 rdi->ibdev.alloc_pd =
86 rdi->ibdev.alloc_pd ? : rvt_alloc_pd;
87 rdi->ibdev.dealloc_pd =
88 rdi->ibdev.dealloc_pd ? : rvt_dealloc_pd;
89
90 spin_lock_init(&rdi->n_pds_lock);
91 rdi->n_pds_allocated = 0;
92
93 /* We are now good to announce we exist */
82 return ib_register_device(&rdi->ibdev, rdi->port_callback);
83}
84EXPORT_SYMBOL(rvt_register_device);
85
86void rvt_unregister_device(struct rvt_dev_info *rdi)
87{
88 if (!rdi)
89 return;
90
91 ib_unregister_device(&rdi->ibdev);
92}
93EXPORT_SYMBOL(rvt_unregister_device);
94 return ib_register_device(&rdi->ibdev, rdi->port_callback);
95}
96EXPORT_SYMBOL(rvt_register_device);
97
98void rvt_unregister_device(struct rvt_dev_info *rdi)
99{
100 if (!rdi)
101 return;
102
103 ib_unregister_device(&rdi->ibdev);
104}
105EXPORT_SYMBOL(rvt_unregister_device);