xref: /titanic_41/usr/src/cmd/avs/dsstat/sndr_stats.h (revision 2a62b4a97f3b5b0ef5f3288ebbfc8509fb793b60)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SNDR_STATS_H
27 #define	_SNDR_STATS_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 #define	GOT_SET_KSTAT	0x01
34 #define	GOT_BMP_KSTAT	0x02
35 #define	GOT_SEC_KSTAT	0x04
36 
37 #define	GOT_COMPLETE_SNDR (GOT_SET_KSTAT|GOT_BMP_KSTAT|GOT_SEC_KSTAT)
38 
39 #define	SNDR_COMPLETE(x) (((x) & (GOT_COMPLETE_SNDR)) != (GOT_COMPLETE_SNDR))
40 
41 /* SNDR strings */
42 #define	RDC_KSTAT_RDCNAME	"sndr"
43 #define	RDC_KSTAT_BMPNAME	"sndrbmp"
44 
45 #define	RDC_DISABLED		"<<set disabled>>"
46 #define	RDC_SECONDARY		"net"
47 #define	RDC_BITMAP		"bmp"
48 
49 typedef struct sndrstat_s
50 {
51 	kstat_t *pre_set;
52 	kstat_t *pre_bmp;
53 	kstat_t *pre_sec;
54 	kstat_t *cur_set;
55 	kstat_t *cur_bmp;
56 	kstat_t *cur_sec;
57 	int collected;
58 	struct sndrstat_s *next;
59 } sndrstat_t;
60 
61 /* Prototypes */
62 int sndr_discover(kstat_ctl_t *);
63 int sndr_update(kstat_ctl_t *);
64 int sndr_report();
65 
66 #ifdef	__cplusplus
67 }
68 #endif
69 
70 #endif /* _SNDR_STATS_H */
71