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