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 “AS IS” 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 #ifndef __WAVELAN2_IF_H__
63 #define __WAVELAN2_IF_H__
64 
65 
66 
67 
68 /*******************************************************************************
69  *  constant definitions
70  ******************************************************************************/
71 #define MAX_LTV_BUF_SIZE            (512 - (sizeof(hcf_16) * 2))
72 
73 #define HCF_TALLIES_SIZE            (sizeof(CFG_HERMES_TALLIES_STRCT) + \
74                                      (sizeof(hcf_16) * 2))
75 
76 #define HCF_MAX_MULTICAST           16
77 #define HCF_MAX_NAME_LEN            32
78 #define MAX_LINE_SIZE   			256
79 #define HCF_NUM_IO_PORTS            0x80
80 #define TX_TIMEOUT                  ((800 * HZ) / 1000)
81 
82 
83 //#define HCF_MIN_COMM_QUALITY        0
84 //#define HCF_MAX_COMM_QUALITY        92
85 //#define HCF_MIN_SIGNAL_LEVEL        47
86 //#define HCF_MAX_SIGNAL_LEVEL        138
87 //#define HCF_MIN_NOISE_LEVEL         47
88 //#define HCF_MAX_NOISE_LEVEL         138
89 //#define HCF_0DBM_OFFSET             149
90 
91 // PE1DNN
92 // Better data from the real world. Not scientific but empirical data gathered
93 // from a Thomson Speedtouch 110 which is identified as:
94 // PCMCIA Info: "Agere Systems" "Wireless PC Card Model 0110"
95 //              Manufacture ID: 0156,0003
96 // Lowest measurment for noise floor seen is value 54
97 // Highest signal strength in close proximity to the AP seen is value 118
98 // Very good must be arround 100 (otherwise its never "full scale"
99 // All other constants are derrived from these. This makes the signal gauge
100 // work for me...
101 #define HCF_MIN_SIGNAL_LEVEL        54
102 #define HCF_MAX_SIGNAL_LEVEL        100
103 #define HCF_MIN_NOISE_LEVEL         HCF_MIN_SIGNAL_LEVEL
104 #define HCF_MAX_NOISE_LEVEL         HCF_MAX_SIGNAL_LEVEL
105 #define HCF_0DBM_OFFSET             (HCF_MAX_SIGNAL_LEVEL + 1)
106 #define HCF_MIN_COMM_QUALITY        0
107 #define HCF_MAX_COMM_QUALITY        (HCF_MAX_SIGNAL_LEVEL - HCF_MIN_NOISE_LEVEL + 1)
108 
109 
110 /* For encryption (WEP) */
111 #define MIN_KEY_SIZE                5       // 40 bits RC4 - WEP
112 #define MAX_KEY_SIZE                13      // 104 bits
113 #define MAX_KEYS                    4
114 
115 #define RADIO_CHANNELS              14
116 #define RADIO_SENSITIVITY_LEVELS    3
117 #define RADIO_TX_POWER_MWATT        32
118 #define RADIO_TX_POWER_DBM          15
119 
120 #define MIN_RTS_BYTES               0
121 #define MAX_RTS_BYTES               2347
122 
123 #define MAX_RATES                   8
124 #define MEGABIT                     1024*1024
125 
126 #define HCF_FAILURE                 0xFF
127 #define UIL_FAILURE		            0xFF
128 #define CFG_UIL_CONNECT             0xA123          // Define differently?
129 #define CFG_UIL_CONNECT_ACK_CODE    0x5653435A      // VSCZ
130 #define WVLAN2_UIL_CONNECTED        (0x01L << 0)
131 #define WVLAN2_UIL_BUSY             (0x01L << 1)
132 
133 
134 
135 
136 /*******************************************************************************
137  * driver ioctl interface
138  ******************************************************************************/
139 #define WVLAN2_IOCTL_UIL            SIOCDEVPRIVATE
140 
141 /* The UIL Interface used in conjunction with the WVLAN2_IOCTL_UIL code above
142    is defined in mdd.h. A quick reference of the UIL codes is listed below */
143 /*
144 UIL_FUN_CONNECT
145 UIL_FUN_DISCONNECT
146 UIL_FUN_ACTION
147     UIL_ACT_BLOCK
148     UIL_ACT_UNBLOCK
149     UIL_ACT_SCA
150     UIL_ACT_DIAG
151     UIL_ACT_APPLY
152 UIL_FUN_SEND_DIAG_MSG
153 UIL_FUN_GET_INFO
154 UIL_FUN_PUT_INFO
155 */
156 
157 #define SIOCSIWNETNAME              SIOCDEVPRIVATE+1
158 #define SIOCGIWNETNAME              SIOCDEVPRIVATE+2
159 #define SIOCSIWSTANAME              SIOCDEVPRIVATE+3
160 #define SIOCGIWSTANAME              SIOCDEVPRIVATE+4
161 #define SIOCSIWPORTTYPE             SIOCDEVPRIVATE+5
162 #define SIOCGIWPORTTYPE             SIOCDEVPRIVATE+6
163 
164 /* IOCTL code for the RTS interface */
165 #define WL_IOCTL_RTS                SIOCDEVPRIVATE+7
166 
167 /* IOCTL subcodes for WL_IOCTL_RTS */
168 #define WL_IOCTL_RTS_READ           1
169 #define WL_IOCTL_RTS_WRITE          2
170 #define WL_IOCTL_RTS_BATCH_READ     3
171 #define WL_IOCTL_RTS_BATCH_WRITE    4
172 
173 
174 /*******************************************************************************
175  * STRUCTURE DEFINITIONS
176  ******************************************************************************/
177 typedef struct
178 {
179     __u16   length;
180     __u8    name[HCF_MAX_NAME_LEN];
181 }
182 wvName_t;
183 
184 
185 typedef struct
186 {
187     hcf_16      len;
188     hcf_16      typ;
189     union
190     {
191         hcf_8       u8[MAX_LTV_BUF_SIZE / sizeof(hcf_8)];
192         hcf_16      u16[MAX_LTV_BUF_SIZE / sizeof(hcf_16)];
193         hcf_32      u32[MAX_LTV_BUF_SIZE / sizeof(hcf_32)];
194     } u;
195 }
196 ltv_t;
197 
198 
199 struct uilreq
200 {
201     union
202     {
203         char    ifrn_name[IFNAMSIZ];
204     } ifr_ifrn;
205 
206     IFBP        hcfCtx;
207     __u8        command;
208     __u8        result;
209 
210     /* The data field in this structure is typically an LTV of some type. The
211        len field is the size of the buffer in bytes, as opposed to words (like
212        the L-field in the LTV */
213     __u16       len;
214     void       *data;
215 };
216 
217 
218 struct rtsreq
219 {
220     union
221     {
222         char    ifrn_name[IFNAMSIZ];
223     }
224     ifr_ifrn;
225 
226     __u16   typ;
227     __u16   reg;
228     __u16   len;
229     __u16   *data;
230 };
231 
232 
233 #endif  // __WAVELAN2_IF_H__
234 
235