xref: /dflybsd-src/sys/netgraph7/bluetooth/drivers/h4/ng_h4_prse.h (revision b06ebda0110aaa466b4f7ba6cacac7a26b29f434)
1*b06ebda0SMatthew Dillon /*
2*b06ebda0SMatthew Dillon  * ng_h4_prse.h
3*b06ebda0SMatthew Dillon  */
4*b06ebda0SMatthew Dillon 
5*b06ebda0SMatthew Dillon /*-
6*b06ebda0SMatthew Dillon  * Copyright (c) 2001 Maksim Yevmenkin <m_evmenkin@yahoo.com>
7*b06ebda0SMatthew Dillon  * All rights reserved.
8*b06ebda0SMatthew Dillon  *
9*b06ebda0SMatthew Dillon  * Redistribution and use in source and binary forms, with or without
10*b06ebda0SMatthew Dillon  * modification, are permitted provided that the following conditions
11*b06ebda0SMatthew Dillon  * are met:
12*b06ebda0SMatthew Dillon  * 1. Redistributions of source code must retain the above copyright
13*b06ebda0SMatthew Dillon  *    notice, this list of conditions and the following disclaimer.
14*b06ebda0SMatthew Dillon  * 2. Redistributions in binary form must reproduce the above copyright
15*b06ebda0SMatthew Dillon  *    notice, this list of conditions and the following disclaimer in the
16*b06ebda0SMatthew Dillon  *    documentation and/or other materials provided with the distribution.
17*b06ebda0SMatthew Dillon  *
18*b06ebda0SMatthew Dillon  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19*b06ebda0SMatthew Dillon  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*b06ebda0SMatthew Dillon  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*b06ebda0SMatthew Dillon  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22*b06ebda0SMatthew Dillon  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*b06ebda0SMatthew Dillon  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*b06ebda0SMatthew Dillon  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*b06ebda0SMatthew Dillon  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*b06ebda0SMatthew Dillon  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*b06ebda0SMatthew Dillon  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*b06ebda0SMatthew Dillon  * SUCH DAMAGE.
29*b06ebda0SMatthew Dillon  *
30*b06ebda0SMatthew Dillon  * $Id: ng_h4_prse.h,v 1.4 2005/10/31 17:57:43 max Exp $
31*b06ebda0SMatthew Dillon  * $FreeBSD: src/sys/netgraph/bluetooth/drivers/h4/ng_h4_prse.h,v 1.5 2007/08/13 17:19:28 emax Exp $
32*b06ebda0SMatthew Dillon  */
33*b06ebda0SMatthew Dillon 
34*b06ebda0SMatthew Dillon /***************************************************************************
35*b06ebda0SMatthew Dillon  ***************************************************************************
36*b06ebda0SMatthew Dillon  **                  ng_parse definitions for the H4 node
37*b06ebda0SMatthew Dillon  ***************************************************************************
38*b06ebda0SMatthew Dillon  ***************************************************************************/
39*b06ebda0SMatthew Dillon 
40*b06ebda0SMatthew Dillon #ifndef _NETGRAPH_H4_PRSE_H_
41*b06ebda0SMatthew Dillon #define _NETGRAPH_H4_PRSE_H_
42*b06ebda0SMatthew Dillon 
43*b06ebda0SMatthew Dillon /*
44*b06ebda0SMatthew Dillon  * H4 node command list
45*b06ebda0SMatthew Dillon  */
46*b06ebda0SMatthew Dillon 
47*b06ebda0SMatthew Dillon /* Stat info */
48*b06ebda0SMatthew Dillon static const struct ng_parse_struct_field	ng_h4_stat_type_fields[] =
49*b06ebda0SMatthew Dillon {
50*b06ebda0SMatthew Dillon 	{ "pckts_recv",	&ng_parse_uint32_type, },
51*b06ebda0SMatthew Dillon 	{ "bytes_recv",	&ng_parse_uint32_type, },
52*b06ebda0SMatthew Dillon 	{ "pckts_sent",	&ng_parse_uint32_type, },
53*b06ebda0SMatthew Dillon 	{ "bytes_sent",	&ng_parse_uint32_type, },
54*b06ebda0SMatthew Dillon 	{ "oerrors",	&ng_parse_uint32_type, },
55*b06ebda0SMatthew Dillon 	{ "ierrors",	&ng_parse_uint32_type, },
56*b06ebda0SMatthew Dillon 	{ NULL, }
57*b06ebda0SMatthew Dillon };
58*b06ebda0SMatthew Dillon static const struct ng_parse_type		ng_h4_stat_type = {
59*b06ebda0SMatthew Dillon 	&ng_parse_struct_type,
60*b06ebda0SMatthew Dillon 	&ng_h4_stat_type_fields
61*b06ebda0SMatthew Dillon };
62*b06ebda0SMatthew Dillon 
63*b06ebda0SMatthew Dillon static const struct ng_cmdlist	ng_h4_cmdlist[] = {
64*b06ebda0SMatthew Dillon 	{
65*b06ebda0SMatthew Dillon 		NGM_H4_COOKIE,
66*b06ebda0SMatthew Dillon 		NGM_H4_NODE_RESET,
67*b06ebda0SMatthew Dillon 		"reset",
68*b06ebda0SMatthew Dillon 		NULL,
69*b06ebda0SMatthew Dillon 		NULL
70*b06ebda0SMatthew Dillon 	},
71*b06ebda0SMatthew Dillon 	{
72*b06ebda0SMatthew Dillon 		NGM_H4_COOKIE,
73*b06ebda0SMatthew Dillon 		NGM_H4_NODE_GET_STATE,
74*b06ebda0SMatthew Dillon 		"get_state",
75*b06ebda0SMatthew Dillon 		NULL,
76*b06ebda0SMatthew Dillon 		&ng_parse_uint16_type
77*b06ebda0SMatthew Dillon 	},
78*b06ebda0SMatthew Dillon 	{
79*b06ebda0SMatthew Dillon 		NGM_H4_COOKIE,
80*b06ebda0SMatthew Dillon 		NGM_H4_NODE_GET_DEBUG,
81*b06ebda0SMatthew Dillon 		"get_debug",
82*b06ebda0SMatthew Dillon 		NULL,
83*b06ebda0SMatthew Dillon 		&ng_parse_uint16_type
84*b06ebda0SMatthew Dillon 	},
85*b06ebda0SMatthew Dillon 	{
86*b06ebda0SMatthew Dillon 		NGM_H4_COOKIE,
87*b06ebda0SMatthew Dillon 		NGM_H4_NODE_SET_DEBUG,
88*b06ebda0SMatthew Dillon 		"set_debug",
89*b06ebda0SMatthew Dillon 		&ng_parse_uint16_type,
90*b06ebda0SMatthew Dillon 		NULL
91*b06ebda0SMatthew Dillon 	},
92*b06ebda0SMatthew Dillon 	{
93*b06ebda0SMatthew Dillon 		NGM_H4_COOKIE,
94*b06ebda0SMatthew Dillon 		NGM_H4_NODE_GET_QLEN,
95*b06ebda0SMatthew Dillon 		"get_qlen",
96*b06ebda0SMatthew Dillon 		NULL,
97*b06ebda0SMatthew Dillon 		&ng_parse_int32_type
98*b06ebda0SMatthew Dillon 	},
99*b06ebda0SMatthew Dillon 	{
100*b06ebda0SMatthew Dillon 		NGM_H4_COOKIE,
101*b06ebda0SMatthew Dillon 		NGM_H4_NODE_SET_QLEN,
102*b06ebda0SMatthew Dillon 		"set_qlen",
103*b06ebda0SMatthew Dillon 		&ng_parse_int32_type,
104*b06ebda0SMatthew Dillon 		NULL
105*b06ebda0SMatthew Dillon 	},
106*b06ebda0SMatthew Dillon 	{
107*b06ebda0SMatthew Dillon 		NGM_H4_COOKIE,
108*b06ebda0SMatthew Dillon 		NGM_H4_NODE_GET_STAT,
109*b06ebda0SMatthew Dillon 		"get_stat",
110*b06ebda0SMatthew Dillon 		NULL,
111*b06ebda0SMatthew Dillon 		&ng_h4_stat_type
112*b06ebda0SMatthew Dillon 	},
113*b06ebda0SMatthew Dillon 	{
114*b06ebda0SMatthew Dillon 		NGM_H4_COOKIE,
115*b06ebda0SMatthew Dillon 		NGM_H4_NODE_RESET_STAT,
116*b06ebda0SMatthew Dillon 		"reset_stat",
117*b06ebda0SMatthew Dillon 		NULL,
118*b06ebda0SMatthew Dillon 		NULL
119*b06ebda0SMatthew Dillon 	},
120*b06ebda0SMatthew Dillon 	{ 0, }
121*b06ebda0SMatthew Dillon };
122*b06ebda0SMatthew Dillon 
123*b06ebda0SMatthew Dillon #endif /* ndef _NETGRAPH_H4_PRSE_H_ */
124*b06ebda0SMatthew Dillon 
125