xref: /linux/include/net/mana/shm_channel.h (revision fcee7d82f27d6a8b1ddc5bbefda59b4e441e9bc0)
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright (c) 2021, Microsoft Corporation. */
3 
4 #ifndef _SHM_CHANNEL_H
5 #define _SHM_CHANNEL_H
6 
7 #define SMC_APERTURE_BITS 256
8 #define SMC_BASIC_UNIT (sizeof(u32))
9 #define SMC_APERTURE_DWORDS (SMC_APERTURE_BITS / (SMC_BASIC_UNIT * 8))
10 #define SMC_LAST_DWORD (SMC_APERTURE_DWORDS - 1)
11 #define SMC_APERTURE_SIZE  (SMC_APERTURE_BITS / 8)
12 
13 struct shm_channel {
14 	struct device *dev;
15 	void __iomem *base;
16 };
17 
18 void mana_smc_init(struct shm_channel *sc, struct device *dev,
19 		   void __iomem *base);
20 
21 int mana_smc_setup_hwc(struct shm_channel *sc, bool reset_vf, u64 eq_addr,
22 		       u64 cq_addr, u64 rq_addr, u64 sq_addr,
23 		       u32 eq_msix_index);
24 
25 int mana_smc_teardown_hwc(struct shm_channel *sc, bool reset_vf);
26 
27 #endif /* _SHM_CHANNEL_H */
28