1 /*	$NetBSD: if_cnwioctl.h,v 1.5 2015/09/06 06:01:00 dholland Exp $	*/
2 
3 /*
4  * Copyright (c) 1996, 1997 Berkeley Software Design, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that this notice is retained,
9  * the conditions in the following notices are met, and terms applying
10  * to contributors in the following notices also apply to Berkeley
11  * Software Design, Inc.
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. All advertising materials mentioning features or use of this software
19  *    must display the following acknowledgement:
20  *      This product includes software developed by
21  *	Berkeley Software Design, Inc.
22  * 4. Neither the name of the Berkeley Software Design, Inc. nor the names
23  *    of its contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND
27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE DISCLAIMED.  IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE
30  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36  * SUCH DAMAGE.
37  *
38  *	PAO2 Id: if_cnwioctl.h,v 1.1.8.1 1998/12/05 22:47:11 itojun Exp
39  *
40  * Paul Borman, December 1996
41  *
42  * This driver is derived from a generic frame work which is
43  * Copyright(c) 1994,1995,1996
44  * Yoichi Shinoda, Yoshitaka Tokugawa, WIDE Project, Wildboar Project
45  * and Foretune.  All rights reserved.
46  *
47  * A linux driver was used as the "hardware reference manual" (i.e.,
48  * to determine registers and a general outline of how the card works)
49  * That driver is publically available and copyright
50  *
51  * John Markus Bj,Ax(Brndalen
52  * Department of Computer Science
53  * University of Troms,Ax(B
54  * Norway
55  * johnm@staff.cs.uit.no, http://www.cs.uit.no/~johnm/
56  */
57 
58 #include <sys/ioccom.h>
59 
60 struct cnwstatus {
61 	struct ifreq	ifr;
62 	u_char		data[0x100];
63 };
64 
65 struct cnwstats {
66 	u_quad_t nws_rx;
67 	u_quad_t nws_rxerr;
68 	u_quad_t nws_rxoverflow;
69 	u_quad_t nws_rxoverrun;
70 	u_quad_t nws_rxcrcerror;
71 	u_quad_t nws_rxframe;
72 	u_quad_t nws_rxerrors;
73 	u_quad_t nws_rxavail;
74 	u_quad_t nws_rxone;
75 	u_quad_t nws_tx;
76 	u_quad_t nws_txokay;
77 	u_quad_t nws_txabort;
78 	u_quad_t nws_txlostcd;
79 	u_quad_t nws_txerrors;
80 	u_quad_t nws_txretries[16];
81 };
82 
83 struct cnwistats {
84 	struct ifreq	ifr;
85 	struct cnwstats stats;
86 };
87 
88 struct cnwtrail {
89 	u_char		what;
90 	u_char		status;
91 	u_short		length;
92 	struct timeval	when;
93 	struct timeval	done;
94 };
95 
96 struct cnwitrail {
97 	struct ifreq	ifr;
98 	int		head;
99 	struct cnwtrail trail[128];
100 };
101 
102 #define ifr_domain	ifr_ifru.ifru_flags     /* domain */
103 #define ifr_key		ifr_ifru.ifru_flags     /* scramble key */
104 
105 #define SIOCSCNWDOMAIN	_IOW('i', 254, struct ifreq)	/* set domain */
106 #define SIOCGCNWDOMAIN	_IOWR('i', 253, struct ifreq)	/* get domain */
107 #define SIOCSCNWKEY	_IOWR('i', 252, struct ifreq)	/* set scramble key */
108 #define	SIOCGCNWSTATUS	_IOWR('i', 251, struct cnwstatus)/* get raw status */
109 #define	SIOCGCNWSTATS	_IOWR('i', 250, struct cnwistats)/* get stats */
110 #define	SIOCGCNWTRAIL	_IOWR('i', 249, struct cnwitrail)/* get trail */
111