xref: /freebsd/sys/dev/mana/shm_channel.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1*ce110ea1SWei Hu /*-
2*ce110ea1SWei Hu  * SPDX-License-Identifier: BSD-2-Clause
3*ce110ea1SWei Hu  *
4*ce110ea1SWei Hu  * Copyright (c) 2021 Microsoft Corp.
5*ce110ea1SWei Hu  * All rights reserved.
6*ce110ea1SWei Hu  *
7*ce110ea1SWei Hu  * Redistribution and use in source and binary forms, with or without
8*ce110ea1SWei Hu  * modification, are permitted provided that the following conditions
9*ce110ea1SWei Hu  * are met:
10*ce110ea1SWei Hu  *
11*ce110ea1SWei Hu  * 1. Redistributions of source code must retain the above copyright
12*ce110ea1SWei Hu  *    notice, this list of conditions and the following disclaimer.
13*ce110ea1SWei Hu  *
14*ce110ea1SWei Hu  * 2. Redistributions in binary form must reproduce the above copyright
15*ce110ea1SWei Hu  *    notice, this list of conditions and the following disclaimer in the
16*ce110ea1SWei Hu  *    documentation and/or other materials provided with the distribution.
17*ce110ea1SWei Hu  *
18*ce110ea1SWei Hu  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19*ce110ea1SWei Hu  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20*ce110ea1SWei Hu  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21*ce110ea1SWei Hu  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22*ce110ea1SWei Hu  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23*ce110ea1SWei Hu  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24*ce110ea1SWei Hu  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25*ce110ea1SWei Hu  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26*ce110ea1SWei Hu  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27*ce110ea1SWei Hu  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28*ce110ea1SWei Hu  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29*ce110ea1SWei Hu  *
30*ce110ea1SWei Hu  */
31*ce110ea1SWei Hu 
32*ce110ea1SWei Hu #ifndef _SHM_CHANNEL_H
33*ce110ea1SWei Hu #define _SHM_CHANNEL_H
34*ce110ea1SWei Hu 
35*ce110ea1SWei Hu #define __iomem
36*ce110ea1SWei Hu 
37*ce110ea1SWei Hu struct shm_channel {
38*ce110ea1SWei Hu 	device_t		dev;
39*ce110ea1SWei Hu 	void __iomem		*base;
40*ce110ea1SWei Hu };
41*ce110ea1SWei Hu 
42*ce110ea1SWei Hu void mana_smc_init(struct shm_channel *sc, device_t dev, void __iomem *base);
43*ce110ea1SWei Hu 
44*ce110ea1SWei Hu int mana_smc_setup_hwc(struct shm_channel *sc, bool reset_vf,
45*ce110ea1SWei Hu     uint64_t eq_addr, uint64_t cq_addr, uint64_t rq_addr, uint64_t sq_addr,
46*ce110ea1SWei Hu     uint32_t eq_msix_index);
47*ce110ea1SWei Hu 
48*ce110ea1SWei Hu int mana_smc_teardown_hwc(struct shm_channel *sc, bool reset_vf);
49*ce110ea1SWei Hu 
50*ce110ea1SWei Hu #endif /* _SHM_CHANNEL_H */
51