8f0cb10a5be6a836737a1ab9ca19db174d6691f1
[linux-2.6-block.git] / drivers / staging / wlags49_h2 / wl_if.h
1 /*******************************************************************************
2  * Agere Systems Inc.
3  * Wireless device driver for Linux (wlags49).
4  *
5  * Copyright (c) 1998-2003 Agere Systems Inc.
6  * All rights reserved.
7  *   http://www.agere.com
8  *
9  * Initially developed by TriplePoint, Inc.
10  *   http://www.triplepoint.com
11  *
12  *------------------------------------------------------------------------------
13  *
14  *   Driver common header for info needed by driver source and user-space
15  *   processes communicating with the driver.
16  *
17  *------------------------------------------------------------------------------
18  *
19  * SOFTWARE LICENSE
20  *
21  * This software is provided subject to the following terms and conditions,
22  * which you should read carefully before using the software.  Using this
23  * software indicates your acceptance of these terms and conditions.  If you do
24  * not agree with these terms and conditions, do not use the software.
25  *
26  * Copyright © 2003 Agere Systems Inc.
27  * All rights reserved.
28  *
29  * Redistribution and use in source or binary forms, with or without
30  * modifications, are permitted provided that the following conditions are met:
31  *
32  * . Redistributions of source code must retain the above copyright notice, this
33  *    list of conditions and the following Disclaimer as comments in the code as
34  *    well as in the documentation and/or other materials provided with the
35  *    distribution.
36  *
37  * . Redistributions in binary form must reproduce the above copyright notice,
38  *    this list of conditions and the following Disclaimer in the documentation
39  *    and/or other materials provided with the distribution.
40  *
41  * . Neither the name of Agere Systems Inc. nor the names of the contributors
42  *    may be used to endorse or promote products derived from this software
43  *    without specific prior written permission.
44  *
45  * Disclaimer
46  *
47  * THIS SOFTWARE IS PROVIDED \93AS IS\94 AND ANY EXPRESS OR IMPLIED WARRANTIES,
48  * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
49  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  ANY
50  * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
51  * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
52  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
53  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
54  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
55  * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
56  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
57  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
58  * DAMAGE.
59  *
60  ******************************************************************************/
61
62
63
64
65 /*******************************************************************************
66  * VERSION CONTROL INFORMATION
67  *******************************************************************************
68  *
69  * $Author: nico $
70  * $Date: 2004/07/19 08:16:15 $
71  * $Revision: 1.2 $
72  * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_if.h,v $
73  *
74  ******************************************************************************/
75
76
77
78
79 #ifndef __WAVELAN2_IF_H__
80 #define __WAVELAN2_IF_H__
81
82
83
84
85 /*******************************************************************************
86  *  constant definitions
87  ******************************************************************************/
88 #define MAX_LTV_BUF_SIZE            (512 - (sizeof(hcf_16) * 2))
89
90 #define HCF_TALLIES_SIZE            (sizeof(CFG_HERMES_TALLIES_STRCT) + \
91                                      (sizeof(hcf_16) * 2))
92
93 #define HCF_MAX_MULTICAST           16
94 #define HCF_MAX_NAME_LEN            32
95 #define MAX_LINE_SIZE                           256
96 #define HCF_NUM_IO_PORTS            0x80
97 #define TX_TIMEOUT                  ((800 * HZ) / 1000)
98
99
100 #define HCF_MIN_COMM_QUALITY        0
101 #define HCF_MAX_COMM_QUALITY        92
102 #define HCF_MIN_SIGNAL_LEVEL        47
103 #define HCF_MAX_SIGNAL_LEVEL        138
104 #define HCF_MIN_NOISE_LEVEL         47
105 #define HCF_MAX_NOISE_LEVEL         138
106 #define HCF_0DBM_OFFSET             149
107
108 /* For encryption (WEP) */
109 #define MIN_KEY_SIZE                5       // 40 bits RC4 - WEP
110 #define MAX_KEY_SIZE                13      // 104 bits
111 #define MAX_KEYS                    4
112
113 #define RADIO_CHANNELS              14
114 #define RADIO_SENSITIVITY_LEVELS    3
115 #define RADIO_TX_POWER_MWATT        32
116 #define RADIO_TX_POWER_DBM          15
117
118 #define MIN_RTS_BYTES               0
119 #define MAX_RTS_BYTES               2347
120
121 #define MAX_RATES                   8
122 #define MEGABIT                     1024*1024
123
124 #define HCF_FAILURE                 0xFF
125 #define UIL_FAILURE                         0xFF
126 #define CFG_UIL_CONNECT             0xA123          // Define differently?
127 #define CFG_UIL_CONNECT_ACK_CODE    0x5653435A      // VSCZ
128 #define WVLAN2_UIL_CONNECTED        (0x01L << 0)
129 #define WVLAN2_UIL_BUSY             (0x01L << 1)
130
131
132
133
134 /*******************************************************************************
135  * driver ioctl interface
136  ******************************************************************************/
137 #define WVLAN2_IOCTL_UIL            SIOCDEVPRIVATE
138
139 /* The UIL Interface used in conjunction with the WVLAN2_IOCTL_UIL code above
140    is defined in mdd.h. A quick reference of the UIL codes is listed below */
141 /*
142 UIL_FUN_CONNECT
143 UIL_FUN_DISCONNECT
144 UIL_FUN_ACTION
145     UIL_ACT_BLOCK
146     UIL_ACT_UNBLOCK
147     UIL_ACT_SCA
148     UIL_ACT_DIAG
149     UIL_ACT_APPLY
150 UIL_FUN_SEND_DIAG_MSG
151 UIL_FUN_GET_INFO
152 UIL_FUN_PUT_INFO
153 */
154
155 #define SIOCSIWNETNAME              SIOCDEVPRIVATE+1
156 #define SIOCGIWNETNAME              SIOCDEVPRIVATE+2
157 #define SIOCSIWSTANAME              SIOCDEVPRIVATE+3
158 #define SIOCGIWSTANAME              SIOCDEVPRIVATE+4
159 #define SIOCSIWPORTTYPE             SIOCDEVPRIVATE+5
160 #define SIOCGIWPORTTYPE             SIOCDEVPRIVATE+6
161
162 /* IOCTL code for the RTS interface */
163 #define WL_IOCTL_RTS                SIOCDEVPRIVATE+7
164
165 /* IOCTL subcodes for WL_IOCTL_RTS */
166 #define WL_IOCTL_RTS_READ           1
167 #define WL_IOCTL_RTS_WRITE          2
168 #define WL_IOCTL_RTS_BATCH_READ     3
169 #define WL_IOCTL_RTS_BATCH_WRITE    4
170
171
172 /*******************************************************************************
173  * STRUCTURE DEFINITIONS
174  ******************************************************************************/
175 typedef struct
176 {
177     __u16   length;
178     __u8    name[HCF_MAX_NAME_LEN];
179 }
180 wvName_t;
181
182
183 typedef struct
184 {
185     hcf_16      len;
186     hcf_16      typ;
187     union
188     {
189         hcf_8       u8[MAX_LTV_BUF_SIZE / sizeof(hcf_8)];
190         hcf_16      u16[MAX_LTV_BUF_SIZE / sizeof(hcf_16)];
191         hcf_32      u32[MAX_LTV_BUF_SIZE / sizeof(hcf_32)];
192     } u;
193 }
194 ltv_t;
195
196
197 struct uilreq
198 {
199     union
200     {
201         char    ifrn_name[IFNAMSIZ];
202     } ifr_ifrn;
203
204     IFBP        hcfCtx;
205     __u8        command;
206     __u8        result;
207
208     /* The data field in this structure is typically an LTV of some type. The
209        len field is the size of the buffer in bytes, as opposed to words (like
210        the L-field in the LTV */
211     __u16       len;
212     void       *data;
213 };
214
215
216 struct rtsreq
217 {
218     union
219     {
220         char    ifrn_name[IFNAMSIZ];
221     }
222     ifr_ifrn;
223
224     __u16   typ;
225     __u16   reg;
226     __u16   len;
227     __u16   *data;
228 };
229
230
231 #endif  // __WAVELAN2_IF_H__
232