6 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
8 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * $Id: ng_bt3c.h,v 1.1 2002/11/24 19:47:05 max Exp $
35 * XXX XXX XX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
37 * Based on information obrained from: Jose Orlando Pereira <jop@di.uminho.pt>
38 * and disassembled w2k driver.
40 * XXX XXX XX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
47 /**************************************************************************
48 **************************************************************************
49 ** Netgraph node hook name, type name and type cookie and commands
50 **************************************************************************
51 **************************************************************************/
53 #define NG_BT3C_NODE_TYPE "btccc" /* XXX can't use bt3c in pccard.conf */
54 #define NG_BT3C_HOOK "hook"
56 #define NGM_BT3C_COOKIE 1014752016
59 #define NG_BT3C_ALERT_LEVEL 1
60 #define NG_BT3C_ERR_LEVEL 2
61 #define NG_BT3C_WARN_LEVEL 3
62 #define NG_BT3C_INFO_LEVEL 4
65 #define NG_BT3C_W4_PKT_IND 1 /* wait for packet indicator */
66 #define NG_BT3C_W4_PKT_HDR 2 /* wait for packet header */
67 #define NG_BT3C_W4_PKT_DATA 3 /* wait for packet data */
69 /**************************************************************************
70 **************************************************************************
71 ** BT3C node command/event parameters
72 **************************************************************************
73 **************************************************************************/
75 #define NGM_BT3C_NODE_GET_STATE 1 /* get node state */
76 typedef u_int16_t ng_bt3c_node_state_ep;
78 #define NGM_BT3C_NODE_SET_DEBUG 2 /* set debug level */
79 #define NGM_BT3C_NODE_GET_DEBUG 3 /* get debug level */
80 typedef u_int16_t ng_bt3c_node_debug_ep;
82 #define NGM_BT3C_NODE_GET_QLEN 4 /* get queue length */
83 #define NGM_BT3C_NODE_SET_QLEN 5 /* set queue length */
85 int32_t queue; /* queue index */
86 #define NGM_BT3C_NODE_IN_QUEUE 1 /* incoming queue */
87 #define NGM_BT3C_NODE_OUT_QUEUE 2 /* outgoing queue */
89 int32_t qlen; /* queue length */
90 } ng_bt3c_node_qlen_ep;
92 #define NGM_BT3C_NODE_GET_STAT 6 /* get statistic */
94 u_int32_t pckts_recv; /* # of packets received */
95 u_int32_t bytes_recv; /* # of bytes received */
96 u_int32_t pckts_sent; /* # of packets sent */
97 u_int32_t bytes_sent; /* # of bytes sent */
98 u_int32_t oerrors; /* # of output errors */
99 u_int32_t ierrors; /* # of input errors */
100 } ng_bt3c_node_stat_ep;
102 #define NGM_BT3C_NODE_RESET_STAT 7 /* reset statistic */
104 #define NGM_BT3C_NODE_DOWNLOAD_FIRMWARE 8 /* download firmware */
107 u_int32_t block_address;
108 u_int16_t block_size; /* in words */
109 u_int16_t block_alignment; /* in bytes */
110 } ng_bt3c_firmware_block_ep;
112 #endif /* ndef _NG_BT3C_H_ */