blob: 57bfd7fac6fa13326acbb191e0a0e5076c084dca [file] [log] [blame]
Henk de Groot68c0bdf2009-09-27 11:12:52 +02001/*******************************************************************************
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 * Header describing information required for utility functions used
15 * throughout 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 *
Al Virod36b6912011-12-29 17:09:01 -050026 * Copyright © 2003 Agere Systems Inc.
Henk de Groot68c0bdf2009-09-27 11:12:52 +020027 * 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 *
Al Virod36b6912011-12-29 17:09:01 -050047 * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
Henk de Groot68c0bdf2009-09-27 11:12:52 +020048 * 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
Henk de Groot68c0bdf2009-09-27 11:12:52 +020062#ifndef __WL_UTIL_H__
63#define __WL_UTIL_H__
64
65/*******************************************************************************
66 * function prototypes
67 ******************************************************************************/
Johan Meiring76abcc52012-11-30 18:58:55 +020068int dbm(int value);
Henk de Groot68c0bdf2009-09-27 11:12:52 +020069
Johan Meiring76abcc52012-11-30 18:58:55 +020070int is_valid_key_string(char *s);
Henk de Groot68c0bdf2009-09-27 11:12:52 +020071
Johan Meiring76abcc52012-11-30 18:58:55 +020072void key_string2key(char *ks, KEY_STRCT *key);
Henk de Groot68c0bdf2009-09-27 11:12:52 +020073
Johan Meiring76abcc52012-11-30 18:58:55 +020074void wl_hcf_error(struct net_device *dev, int hcfStatus);
Henk de Groot68c0bdf2009-09-27 11:12:52 +020075
Johan Meiring76abcc52012-11-30 18:58:55 +020076void wl_endian_translate_event(ltv_t *pLtv);
Henk de Groot68c0bdf2009-09-27 11:12:52 +020077
Johan Meiring76abcc52012-11-30 18:58:55 +020078int wl_has_wep(IFBP ifbp);
Henk de Groot68c0bdf2009-09-27 11:12:52 +020079
Johan Meiringe5516fd2012-11-30 18:58:57 +020080hcf_8 wl_parse_ds_ie(PROBE_RESP *probe_rsp);
81hcf_8 *wl_parse_wpa_ie(PROBE_RESP *probe_rsp, hcf_16 *length);
82hcf_8 *wl_print_wpa_ie(hcf_8 *buffer, int length);
Henk de Groot68c0bdf2009-09-27 11:12:52 +020083
84int wl_get_tallies(struct wl_private *, CFG_HERMES_TALLIES_STRCT *);
Johan Meiring76abcc52012-11-30 18:58:55 +020085int wl_is_a_valid_chan(int channel);
86int wl_is_a_valid_freq(long frequency);
87long wl_get_freq_from_chan(int channel);
88int wl_get_chan_from_freq(long frequency);
Henk de Groot68c0bdf2009-09-27 11:12:52 +020089
Johan Meiring76abcc52012-11-30 18:58:55 +020090void wl_process_link_status(struct wl_private *lp);
91void wl_process_probe_response(struct wl_private *lp);
92void wl_process_updated_record(struct wl_private *lp);
93void wl_process_assoc_status(struct wl_private *lp);
94void wl_process_security_status(struct wl_private *lp);
Henk de Groot68c0bdf2009-09-27 11:12:52 +020095
Johan Meiring3bba6192012-11-30 18:58:56 +020096#endif /* __WL_UTIL_H__ */