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