1/*	$NetBSD: if_cnwioctl.h,v 1.2.32.1 2005/03/04 16:49:38 skrll 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
58struct cnwstatus {
59	struct ifreq	ifr;
60	u_char		data[0x100];
61};
62
63struct cnwstats {
64	u_quad_t nws_rx;
65	u_quad_t nws_rxerr;
66	u_quad_t nws_rxoverflow;
67	u_quad_t nws_rxoverrun;
68	u_quad_t nws_rxcrcerror;
69	u_quad_t nws_rxframe;
70	u_quad_t nws_rxerrors;
71	u_quad_t nws_rxavail;
72	u_quad_t nws_rxone;
73	u_quad_t nws_tx;
74	u_quad_t nws_txokay;
75	u_quad_t nws_txabort;
76	u_quad_t nws_txlostcd;
77	u_quad_t nws_txerrors;
78	u_quad_t nws_txretries[16];
79};
80
81struct cnwistats {
82	struct ifreq	ifr;
83	struct cnwstats stats;
84};
85
86struct cnwtrail {
87	u_char		what;
88	u_char		status;
89	u_short		length;
90	struct timeval	when;
91	struct timeval	done;
92};
93
94struct cnwitrail {
95	struct ifreq	ifr;
96	int		head;
97	struct cnwtrail trail[128];
98};
99
100#define ifr_domain	ifr_ifru.ifru_flags     /* domain */
101#define ifr_key		ifr_ifru.ifru_flags     /* scramble key */
102
103#define SIOCSCNWDOMAIN	_IOW('i', 254, struct ifreq)	/* set domain */
104#define SIOCGCNWDOMAIN	_IOWR('i', 253, struct ifreq)	/* get domain */
105#define SIOCSCNWKEY	_IOWR('i', 252, struct ifreq)	/* set scramble key */
106#define	SIOCGCNWSTATUS	_IOWR('i', 251, struct cnwstatus)/* get raw status */
107#define	SIOCGCNWSTATS	_IOWR('i', 250, struct cnwistats)/* get stats */
108#define	SIOCGCNWTRAIL	_IOWR('i', 249, struct cnwitrail)/* get trail */
109