xref: /illumos-gate/usr/src/uts/common/io/cxgbe/shared/shared.h (revision 5cc82207c6bb1a6b9b4a68cc33698dd1e4a61e28)
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	DRV_VERSION "2.2.1.0"
36 
37 #define	T4_NEXUS_NAME   "t4nex"
38 #define	T4_PORT_NAME    "cxgbe"
39 
40 #define	CH_ERR(sc, ...)		cxgb_printf(sc->dip, CE_WARN, ##__VA_ARGS__)
41 #define	CH_WARN(sc, ...)	cxgb_printf(sc->dip, CE_WARN, ##__VA_ARGS__)
42 #define	CH_WARN_RATELIMIT(sc, ...) cxgb_printf(sc->dip, CE_WARN, ##__VA_ARGS__)
43 #define	CH_ALERT(sc, ...)	cxgb_printf(sc->dip, CE_NOTE, ##__VA_ARGS__)
44 #define	CH_INFO(sc, ...)	cxgb_printf(sc->dip, CE_NOTE, ##__VA_ARGS__)
45 
46 #define	CH_MSG(sc, level, category, fmt, ...)	do {} while (0)
47 #ifdef DEBUG
48 #define	CH_DBG(sc, category, fmt, ...)	\
49 	cxgb_printf(sc->dip, CE_NOTE, ##__VA_ARGS__)
50 #else
51 #define	CH_DBG(sc, category, fmt, ...)		do {} while (0)
52 #endif
53 
54 extern int cxgb_printf(dev_info_t *dip, int level, char *f, ...);
55 
56 /* Attach/detach logic used by cxgbe, calling into t4nex */
57 struct port_info;
58 extern int t4_cxgbe_attach(struct port_info *, dev_info_t *);
59 extern int t4_cxgbe_detach(struct port_info *);
60 
61 #endif /* __CXGBE_SHARED_H */
62