1107120Sjulian/*
2107120Sjulian * ng_h4.h
3139823Simp */
4139823Simp
5139823Simp/*-
6107120Sjulian * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
7107120Sjulian * All rights reserved.
8107120Sjulian *
9107120Sjulian * Redistribution and use in source and binary forms, with or without
10107120Sjulian * modification, are permitted provided that the following conditions
11107120Sjulian * are met:
12107120Sjulian * 1. Redistributions of source code must retain the above copyright
13107120Sjulian *    notice, this list of conditions and the following disclaimer.
14107120Sjulian * 2. Redistributions in binary form must reproduce the above copyright
15107120Sjulian *    notice, this list of conditions and the following disclaimer in the
16107120Sjulian *    documentation and/or other materials provided with the distribution.
17107120Sjulian *
18107120Sjulian * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19107120Sjulian * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20107120Sjulian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21107120Sjulian * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22107120Sjulian * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23107120Sjulian * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24107120Sjulian * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25107120Sjulian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26107120Sjulian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27107120Sjulian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28107120Sjulian * SUCH DAMAGE.
29107120Sjulian *
30114878Sjulian * $Id: ng_h4.h,v 1.1 2002/11/24 19:47:05 max Exp $
31107120Sjulian * $FreeBSD$
32107120Sjulian *
33107120Sjulian * Based on:
34107120Sjulian * ---------
35107120Sjulian *
36107120Sjulian * FreeBSD: src/sys/netgraph/ng_tty.h
37107120Sjulian * Author: Archie Cobbs <archie@freebsd.org>
38107120Sjulian */
39107120Sjulian
40107120Sjulian/*
41107120Sjulian * This file contains everything that application needs to know about
42107120Sjulian * Bluetooth HCI UART transport layer as per chapter H4 of the Bluetooth
43107120Sjulian * Specification Book v1.1.
44107120Sjulian *
45107120Sjulian * This file can be included by both kernel and userland applications.
46107120Sjulian */
47107120Sjulian
48107120Sjulian#ifndef _NETGRAPH_H4_H_
49122634Semax#define _NETGRAPH_H4_H_
50107120Sjulian
51107120Sjulian/**************************************************************************
52107120Sjulian **************************************************************************
53107120Sjulian **     Netgraph node hook name, type name and type cookie and commands
54107120Sjulian **************************************************************************
55107120Sjulian **************************************************************************/
56107120Sjulian
57107120Sjulian/* Hook name */
58107120Sjulian#define NG_H4_HOOK		"hook"
59107120Sjulian
60107120Sjulian/* Node type name and magic cookie */
61107120Sjulian#define NG_H4_NODE_TYPE		"h4"
62107120Sjulian#define NGM_H4_COOKIE		1013899512
63107120Sjulian
64107120Sjulian/* Node states */
65107120Sjulian#define NG_H4_W4_PKT_IND	1	/* Waiting for packet indicator */
66107120Sjulian#define NG_H4_W4_PKT_HDR	2	/* Waiting for packet header */
67107120Sjulian#define NG_H4_W4_PKT_DATA	3	/* Waiting for packet data */
68107120Sjulian
69107120Sjulian/* Debug levels */
70107120Sjulian#define NG_H4_ALERT_LEVEL	1
71107120Sjulian#define NG_H4_ERR_LEVEL		2
72107120Sjulian#define NG_H4_WARN_LEVEL	3
73107120Sjulian#define NG_H4_INFO_LEVEL	4
74107120Sjulian
75107120Sjulian/**************************************************************************
76107120Sjulian **************************************************************************
77107120Sjulian **                    H4 node command/event parameters
78107120Sjulian **************************************************************************
79107120Sjulian **************************************************************************/
80107120Sjulian
81107120Sjulian/* Reset node */
82107120Sjulian#define NGM_H4_NODE_RESET	1
83107120Sjulian
84107120Sjulian/* Get node state (see states above) */
85107120Sjulian#define NGM_H4_NODE_GET_STATE	2
86107120Sjuliantypedef u_int16_t	ng_h4_node_state_ep;
87107120Sjulian
88107120Sjulian/* Get/Set node debug level (see levels above) */
89107120Sjulian#define NGM_H4_NODE_GET_DEBUG	3
90107120Sjulian#define NGM_H4_NODE_SET_DEBUG	4
91107120Sjuliantypedef u_int16_t	ng_h4_node_debug_ep;
92107120Sjulian
93107120Sjulian/* Get/Set max queue length for the node */
94107120Sjulian#define NGM_H4_NODE_GET_QLEN	5
95107120Sjulian#define NGM_H4_NODE_SET_QLEN	6
96107120Sjuliantypedef int32_t		ng_h4_node_qlen_ep;
97107120Sjulian
98107120Sjulian/* Get node statistic */
99107120Sjulian#define NGM_H4_NODE_GET_STAT	7
100107120Sjuliantypedef struct {
101107120Sjulian	u_int32_t	pckts_recv; /* # of packets received */
102107120Sjulian	u_int32_t	bytes_recv; /* # of bytes received */
103107120Sjulian	u_int32_t	pckts_sent; /* # of packets sent */
104107120Sjulian	u_int32_t	bytes_sent; /* # of bytes sent */
105107120Sjulian	u_int32_t	oerrors;    /* # of output errors */
106107120Sjulian	u_int32_t	ierrors;    /* # of input errors */
107107120Sjulian} ng_h4_node_stat_ep;
108107120Sjulian
109107120Sjulian/* Reset node statistic */
110107120Sjulian#define NGM_H4_NODE_RESET_STAT	8
111107120Sjulian
112107120Sjulian#endif /* _NETGRAPH_H4_H_ */
113107120Sjulian
114