if_wl_wavelan.h revision 26003
1/*
2 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that the following conditions
4 * are met:
5 * 1. Redistributions of source code must retain all copyright
6 *    notices, this list of conditions and the following disclaimer.
7 * 2. The names of the authors may not be used to endorse or promote products
8 *    derived from this software withough specific prior written permission
9 *
10 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
11 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
12 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
14 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
15 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
16 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
19 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20 *
21 */
22#ifndef	_CHIPS_WAVELAN_H
23#define _CHIPS_WAVELAN_H
24
25/* This file contains definitions that are common for all versions of
26 * the NCR WaveLAN
27 */
28
29#define WAVELAN_ADDR_SIZE	6	/* Size of a MAC address */
30#define WAVELAN_MTU		1500	/* Maximum size of Wavelan packet */
31
32/* Modem Management Controler write commands */
33
34#define MMC_LOOPT_SEL		0x10
35#define MMC_JABBER_ENABLE	0x11
36#define MMC_FREEZE		0x12
37#define MMC_ANTEN_SEL		0x13
38#define MMC_IFS			0x14
39#define MMC_MOD_DELAY		0x15
40#define MMC_JAM_TIME		0x16
41#define MMC_THR_PRE_SET		0x18
42#define MMC_DECAY_PRM		0x19
43#define MMC_DECAY_UPDAT_PRM	0x1a
44#define MMC_QUALITY_THR		0x1b
45#define MMC_NETW_ID_L		0x1c
46#define MMC_NETW_ID_H		0x1d
47#define MMC_MODE_SEL		0x1e
48#define MMC_ENCR_KEY		0x00	/* to 0x07 */
49#define MMC_ENCR_ENABLE		0x08
50#define MMC_DES_IO_INVERT	0x0a
51
52/* MMC read register names */
53
54#define MMC_DCE_STATUS		0x10
55#define MMC_CORRECT_NWID_L	0x14
56#define MMC_CORRECT_NWID_H	0x15
57#define MMC_WRONG_NWID_L	0x16
58#define MMC_WRONG_NWID_H	0x17
59#define MMC_THR_PRE_SET		0x18
60#define MMC_SIGNAL_LVL		0x19
61#define MMC_SILENCE_LVL		0x1a
62#define MMC_SIGN_QUAL		0x1b
63#define MMC_DES_AVAIL		0x09
64
65
66#endif	_CHIPS_WAVELAN_H
67
68/* additional socket ioctl params for wl card
69 * see sys/sockio.h for numbers.  The 2nd params here
70 * must be greater than any values in sockio.h
71 */
72
73#define SIOCGWLCNWID	_IOWR('i', 60, struct ifreq)	/* get wlan current nwid */
74#define SIOCSWLCNWID	_IOWR('i', 61, struct ifreq)	/* set wlan current nwid */
75#define SIOCGWLPSA	_IOWR('i', 62, struct ifreq)	/* get wlan PSA (all) */
76#define SIOCSWLPSA	_IOWR('i', 63, struct ifreq)	/* set wlan PSA (all) */
77
78/* PSA address definitions */
79#define WLPSA_ID		0x0	/* ID byte (0 for ISA, 0x14 for MCA) */
80#define WLPSA_IO1		0x1	/* I/O address 1 */
81#define WLPSA_IO2		0x2	/* I/O address 2 */
82#define WLPSA_IO3		0x3	/* I/O address 3 */
83#define WLPSA_BR1		0x4	/* Bootrom address 1 */
84#define WLPSA_BR2		0x5	/* Bootrom address 2 */
85#define WLPSA_BR3		0x6	/* Bootrom address 3 */
86#define WLPSA_HWCONF		0x7	/* HW config bits */
87#define WLPSA_IRQNO		0x8	/* IRQ value */
88#define WLPSA_UNIMAC		0x10	/* Universal MAC address */
89#define WLPSA_LOCALMAC		0x16	/* Locally configured MAC address */
90#define WLPSA_MACSEL		0x1c	/* MAC selector */
91#define WLPSA_COMPATNO		0x1d	/* compatability number */
92#define WLPSA_THRESH		0x1e	/* RF modem threshold preset */
93#define WLPSA_FEATSEL		0x1f	/* feature select */
94#define WLPSA_SUBBAND		0x20	/* subband selector */
95#define WLPSA_QUALTHRESH	0x21	/* RF modem quality threshold preset */
96#define WLPSA_HWVERSION		0x22	/* hardware version indicator */
97#define WLPSA_NWID		0x23	/* network ID */
98#define WLPSA_NWIDENABLE	0x24	/* network ID enable */
99#define WLPSA_SECURITY		0x25	/* datalink security enable */
100#define WLPSA_DESKEY		0x26	/* datalink security DES key */
101#define WLPSA_DBWIDTH		0x2f	/* databus width select */
102#define WLPSA_CALLCODE		0x30	/* call code (japan only) */
103#define WLPSA_CONFIGURED	0x3c	/* configuration status */
104#define WLPSA_CRCLOW		0x3d	/* CRC-16 (lowbyte) */
105#define WLPSA_CRCHIGH		0x3e	/*        (highbyte) */
106#define WLPSA_CRCOK		0x3f	/* CRC OK flag */
107
108/*
109 * signal strength cache
110 *
111 * driver (wlp only at the moment) keeps cache of last
112 * IP (only) packets to arrive including signal strength info.
113 * daemons may read this with kvm.  See if_wlp.c for globals
114 * that may be accessed through kvm.
115 *
116 * Each entry in the w_sigcache has a unique macsrc and age.
117 * Each entry is identified by its macsrc field.
118 * Age of the packet is identified by its age field.
119 */
120
121#define  MAXCACHEITEMS	10
122#ifndef INT_MAX
123#define        INT_MAX         2147483647
124#endif
125#define  MAX_AGE        (INT_MAX - MAXCACHEITEMS)
126
127/* signal is 7 bits, 0..63, although it doesn't seem to get to 63.
128 * silence is 7 bits, 0..63
129 * quality is 4 bits, 0..15
130 */
131struct w_sigcache {
132        char   macsrc[6]; /* unique MAC address for entry */
133        int    ipsrc;     /* ip address associated with packet */
134        int    signal;    /* signal strength of the packet */
135        int    silence;   /* silence of the packet */
136        int    quality;   /* quality of the packet */
137        int    age;       /* packet has unique age between 1 to MAX_AGE - 1 */
138};
139
140