xref: /illumos-gate/usr/src/uts/common/io/cxgbe/shared/shared.h (revision 4c75c86ed9514c627ddb82a345adecc7c1e43b91)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source. A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * This file is part of the Chelsio T4 support code.
14  *
15  * Copyright (C) 2011-2013 Chelsio Communications.  All rights reserved.
16  *
17  * This program is distributed in the hope that it will be useful, but WITHOUT
18  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19  * FITNESS FOR A PARTICULAR PURPOSE.  See the LICENSE file included in this
20  * release for licensing terms and conditions.
21  */
22 
23 /*
24  * Copyright 2024 Oxide Computer Company
25  */
26 
27 #ifndef __CXGBE_SHARED_H
28 #define	__CXGBE_SHARED_H
29 
30 #include <sys/ddi.h>
31 #include <sys/sunddi.h>
32 
33 #include "osdep.h"
34 
35 #define	CH_ERR(sc, ...)		cxgb_printf(sc->dip, CE_WARN, ##__VA_ARGS__)
36 #define	CH_WARN(sc, ...)	cxgb_printf(sc->dip, CE_WARN, ##__VA_ARGS__)
37 #define	CH_WARN_RATELIMIT(sc, ...) cxgb_printf(sc->dip, CE_WARN, ##__VA_ARGS__)
38 #define	CH_ALERT(sc, ...)	cxgb_printf(sc->dip, CE_NOTE, ##__VA_ARGS__)
39 #define	CH_INFO(sc, ...)	cxgb_printf(sc->dip, CE_NOTE, ##__VA_ARGS__)
40 
41 #define CH_MSG(sc, level, category, fmt, ...)	do {} while (0)
42 #ifdef DEBUG
43 #define CH_DBG(sc, category, fmt, ...)	\
44 	cxgb_printf(sc->dip, CE_NOTE, ##__VA_ARGS__)
45 #else
46 #define CH_DBG(sc, category, fmt, ...)		do {} while (0)
47 #endif
48 
49 extern int cxgb_printf(dev_info_t *dip, int level, char *f, ...);
50 
51 /* Attach/detach logic used by cxgbe, calling into t4nex */
52 struct port_info;
53 extern int t4_cxgbe_attach(struct port_info *, dev_info_t *);
54 extern int t4_cxgbe_detach(struct port_info *);
55 
56 #endif /* __CXGBE_SHARED_H */
57