~ubuntu-branches/debian/sid/acx100/sid

« back to all changes in this revision

Viewing changes to include/acx100_helper2.h

  • Committer: Bazaar Package Importer
  • Author(s): Miguel Gea Milvaques
  • Date: 2005-04-13 23:36:11 UTC
  • Revision ID: james.westby@ubuntu.com-20050413233611-5ec8mnua3b9k3t4u
Tags: upstream-0.2.0pre8+52
ImportĀ upstreamĀ versionĀ 0.2.0pre8+52

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* include/acx100_helper2.h
 
2
 *
 
3
 * --------------------------------------------------------------------
 
4
 *
 
5
 * Copyright (C) 2003  ACX100 Open Source Project
 
6
 *
 
7
 *   The contents of this file are subject to the Mozilla Public
 
8
 *   License Version 1.1 (the "License"); you may not use this file
 
9
 *   except in compliance with the License. You may obtain a copy of
 
10
 *   the License at http://www.mozilla.org/MPL/
 
11
 *
 
12
 *   Software distributed under the License is distributed on an "AS
 
13
 *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
14
 *   implied. See the License for the specific language governing
 
15
 *   rights and limitations under the License.
 
16
 *
 
17
 *   Alternatively, the contents of this file may be used under the
 
18
 *   terms of the GNU Public License version 2 (the "GPL"), in which
 
19
 *   case the provisions of the GPL are applicable instead of the
 
20
 *   above.  If you wish to allow the use of your version of this file
 
21
 *   only under the terms of the GPL and not to allow others to use
 
22
 *   your version of this file under the MPL, indicate your decision
 
23
 *   by deleting the provisions above and replace them with the notice
 
24
 *   and other provisions required by the GPL.  If you do not delete
 
25
 *   the provisions above, a recipient may use your version of this
 
26
 *   file under either the MPL or the GPL.
 
27
 *
 
28
 * --------------------------------------------------------------------
 
29
 *
 
30
 * Inquiries regarding the ACX100 Open Source Project can be
 
31
 * made directly to:
 
32
 *
 
33
 * acx100-users@lists.sf.net
 
34
 * http://acx100.sf.net
 
35
 *
 
36
 * --------------------------------------------------------------------
 
37
 */
 
38
#ifndef __ACX_ACX100_HELPER2_H
 
39
#define __ACX_ACX100_HELPER2_H
 
40
 
 
41
#define MAX_NUMBER_OF_SITE 31
 
42
 
 
43
typedef struct ssid {
 
44
        u8 element_ID ACX_PACKED;
 
45
        u8 length ACX_PACKED;
 
46
        u8 inf[32] ACX_PACKED;
 
47
} ssid_t;
 
48
 
 
49
typedef struct rates {
 
50
        u8 element_ID ACX_PACKED;
 
51
        u8 length ACX_PACKED;
 
52
        u8 sup_rates[8] ACX_PACKED;
 
53
} rates_t;
 
54
 
 
55
typedef struct fhps {
 
56
        u8 element_ID ACX_PACKED;
 
57
        u8 length ACX_PACKED;
 
58
        u16 dwell_time ACX_PACKED;
 
59
        u8 hop_set ACX_PACKED;
 
60
        u8 hop_pattern ACX_PACKED;
 
61
        u8 hop_index ACX_PACKED;
 
62
} fhps_t;
 
63
 
 
64
typedef struct dsps {
 
65
        u8 element_ID ACX_PACKED;
 
66
        u8 length ACX_PACKED;
 
67
        u8 curr_channel ACX_PACKED;
 
68
} dsps_t;
 
69
 
 
70
typedef struct cfps {
 
71
        u8 element_ID ACX_PACKED;
 
72
        u8 length ACX_PACKED;
 
73
        u8 cfp_count ACX_PACKED;
 
74
        u8 cfp_period ACX_PACKED;
 
75
        u16 cfp_max_dur ACX_PACKED;
 
76
        u16 cfp_dur_rem ACX_PACKED;
 
77
} cfps_t;
 
78
 
 
79
typedef struct challenge_text {
 
80
        u8 element_ID ACX_PACKED;
 
81
        u8 length ACX_PACKED;
 
82
        u8 text[253] ACX_PACKED;
 
83
} challenge_text_t;
 
84
 
 
85
 
 
86
/* Warning. Several types used in below structs are
 
87
** in fact variable length. Use structs with such fields with caution */
 
88
typedef struct auth_frame_body {
 
89
        u16 auth_alg ACX_PACKED;
 
90
        u16 auth_seq ACX_PACKED;
 
91
        u16 status ACX_PACKED;
 
92
        challenge_text_t challenge ACX_PACKED;
 
93
} auth_frame_body_t;
 
94
 
 
95
typedef struct assocresp_frame_body {
 
96
        u16 cap_info ACX_PACKED;
 
97
        u16 status ACX_PACKED;
 
98
        u16 aid ACX_PACKED;
 
99
        rates_t rates ACX_PACKED;
 
100
} assocresp_frame_body_t;
 
101
 
 
102
typedef struct reassocreq_frame_body {
 
103
        u16 cap_info ACX_PACKED;
 
104
        u16 listen_int ACX_PACKED;
 
105
        u8 current_ap[6] ACX_PACKED;
 
106
        ssid_t ssid ACX_PACKED;
 
107
        rates_t rates ACX_PACKED;
 
108
} reassocreq_frame_body_t;
 
109
 
 
110
typedef struct reassocresp_frame_body {
 
111
        u16 cap_info ACX_PACKED;
 
112
        u16 status ACX_PACKED;
 
113
        u16 aid ACX_PACKED;
 
114
        rates_t rates ACX_PACKED;
 
115
} reassocresp_frame_body_t;
 
116
 
 
117
typedef struct deauthen_frame_body {
 
118
        u16 reason ACX_PACKED;
 
119
} deauthen_frame_body_t;
 
120
 
 
121
typedef struct disassoc_frame_body {
 
122
        u16 reason ACX_PACKED;
 
123
} disassoc_frame_body_t;
 
124
 
 
125
typedef struct probereq_frame_body {
 
126
        ssid_t ssid ACX_PACKED;
 
127
        rates_t rates ACX_PACKED;
 
128
} probereq_frame_body_t;
 
129
 
 
130
typedef struct proberesp_frame_body {
 
131
        u8 timestamp[8] ACX_PACKED;
 
132
        u16 beacon_int ACX_PACKED;
 
133
        u16 cap_info ACX_PACKED;
 
134
        ssid_t ssid ACX_PACKED;
 
135
        rates_t rates ACX_PACKED;
 
136
        fhps_t fhps ACX_PACKED;
 
137
        dsps_t dsps ACX_PACKED;
 
138
        cfps_t cfps ACX_PACKED;
 
139
} proberesp_frame_body_t;
 
140
 
 
141
void acx_sta_list_init(wlandevice_t *priv);
 
142
void acx_set_status(wlandevice_t *priv, u16 status);
 
143
int acx_rx_ieee802_11_frame(wlandevice_t *priv, rxhostdesc_t *desc);
 
144
u32 acx_transmit_disassoc(client_t *arg_0, wlandevice_t *priv);
 
145
void acx_timer(unsigned long a);
 
146
void acx_complete_dot11_scan(wlandevice_t *priv);
 
147
 
 
148
#define COUNT_STATE_STR 6
 
149
 
 
150
static inline const char *acx_get_status_name(u16 status)
 
151
{
 
152
        extern const char * const g_wlan_state_str[COUNT_STATE_STR];
 
153
        return g_wlan_state_str[
 
154
                (status < COUNT_STATE_STR) ?
 
155
                        status : COUNT_STATE_STR-1
 
156
                ];
 
157
}
 
158
 
 
159
#endif /* __ACX_ACX100_HELPER2_H */