~ubuntu-branches/debian/squeeze/ndiswrapper/squeeze

« back to all changes in this revision

Viewing changes to driver/iw_ndis.h

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode, Kel Modderman, Julian Andres Klode
  • Date: 2008-07-14 21:56:42 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080714215642-e3l2gjhq31gkmdfj
Tags: 1.53-1
[ Kel Modderman ]
* New upstream release. (Closes: #484019)
* Include driver/*.sh in debianized ndiswrapper module tarball.
* The distclean Makefile target no longer exists, use clean instead.
* No longer need to define KSRC in debian/rules/modules, upstream Makefile
  requires only the KBUILD variable.
* Major behaviour change in ndiswrapper-common wrappers for loadndisdriver
  and ndiswrapper utils:
  - check required utils_version attribute of currently installed
    ndiswrapper kernel module, use this version instead of latest version if
    called interactively
  - fallback to detection of latest API version when the information cannot
    be determined from the kernel module (not yet installed)
* Remove dilinger from Uploaders as per his request.
* Remove commented out quilt related code from debian/rules.

[ Julian Andres Klode ]
* debian/control{,.modules.in}:
  - Make me the new maintainer and move Kel to uploaders
  - Add Dm-Upload-Allowed
  - Remove VCS-* fields first, until the new repository has been created
  - Add information to description that pre-compiled modules may be available
  - Update the Standards Version to 3.8.0
* debian/copyright: Follow machine-interpretable copyright
* debian/patches/modules-build.diff: build correctly if only the modules
  target is built or in parallel (LP: #241547) (backported from SVN, r2670)
* Build-Depend on quilt and add README.source

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 *  GNU General Public License for more details.
13
13
 *
14
14
 */
15
 
#ifndef IW_NDIS_H
16
 
#define IW_NDIS_H
 
15
 
 
16
#ifndef _IW_NDIS_H_
 
17
#define _IW_NDIS_H_
17
18
 
18
19
#include "ndis.h"
19
20
 
 
21
#define WL_NOISE        -96     /* typical noise level in dBm */
 
22
#define WL_SIGMAX       -32     /* typical maximum signal level in dBm */
 
23
 
20
24
struct ndis_encr_key {
21
25
        ULONG struct_size;
22
26
        ULONG index;
52
56
        UCHAR data[1];
53
57
};
54
58
 
 
59
enum ndis_reload_defaults { Ndis802_11ReloadWEPKeys };
 
60
 
55
61
struct ndis_assoc_info {
56
62
        ULONG length;
57
63
        USHORT req_ies;
72
78
        ULONG offset_resp_ies;
73
79
};
74
80
 
75
 
struct packed ndis_configuration {
 
81
struct ndis_configuration_fh {
 
82
        ULONG length;
 
83
        ULONG hop_pattern;
 
84
        ULONG hop_set;
 
85
        ULONG dwell_time;
 
86
};
 
87
 
 
88
struct ndis_configuration {
76
89
        ULONG length;
77
90
        ULONG beacon_period;
78
91
        ULONG atim_window;
79
92
        ULONG ds_config;
80
 
        struct ndis_configuration_fh {
81
 
                ULONG length;
82
 
                ULONG hop_pattern;
83
 
                ULONG hop_set;
84
 
                ULONG dwell_time;
85
 
        } fh_config;
 
93
        struct ndis_configuration_fh fh_config;
86
94
};
87
95
 
88
 
struct ndis_ssid_item {
 
96
struct ndis_wlan_bssid {
89
97
        ULONG length;
90
98
        mac_address mac;
91
99
        UCHAR reserved[2];
92
100
        struct ndis_essid ssid;
93
101
        ULONG privacy;
94
 
        LONG rssi;
 
102
        ndis_rssi rssi;
95
103
        UINT net_type;
96
104
        struct ndis_configuration config;
97
105
        UINT mode;
98
106
        ndis_rates rates;
 
107
};
 
108
 
 
109
struct ndis_wlan_bssid_ex {
 
110
        ULONG length;
 
111
        mac_address mac;
 
112
        UCHAR reserved[2];
 
113
        struct ndis_essid ssid;
 
114
        ULONG privacy;
 
115
        ndis_rssi rssi;
 
116
        UINT net_type;
 
117
        struct ndis_configuration config;
 
118
        UINT mode;
 
119
        ndis_rates_ex rates_ex;
99
120
        ULONG ie_length;
100
121
        UCHAR ies[1];
101
122
};
102
123
 
 
124
/* we use bssid_list as bssid_list_ex also */
103
125
struct ndis_bssid_list {
104
126
        ULONG num_items;
105
 
        struct ndis_ssid_item items[1];
 
127
        struct ndis_wlan_bssid bssid[1];
106
128
};
107
129
 
108
130
enum ndis_priv_filter {
109
 
        Ndis802_11PrivFilterAcceptAll,
110
 
        Ndis802_11PrivFilter8021xWEP
 
131
        Ndis802_11PrivFilterAcceptAll, Ndis802_11PrivFilter8021xWEP
111
132
};
112
133
 
113
134
enum network_type {
114
 
        Ndis802_11FH,
115
 
        Ndis802_11DS,
116
 
        Ndis802_11OFDM5,
117
 
        Ndis802_11OFDM24,
 
135
        Ndis802_11FH, Ndis802_11DS, Ndis802_11OFDM5, Ndis802_11OFDM24,
118
136
        /* MSDN site uses Ndis802_11Automode, which is not mentioned
119
137
         * in DDK, so add one and assign it to
120
138
         * Ndis802_11NetworkTypeMax */
121
 
        Ndis802_11Automode,
122
 
        Ndis802_11NetworkTypeMax = Ndis802_11Automode
 
139
        Ndis802_11Automode, Ndis802_11NetworkTypeMax = Ndis802_11Automode
 
140
};
 
141
 
 
142
struct network_type_list {
 
143
        ULONG num;
 
144
        enum network_type types[1];
123
145
};
124
146
 
125
147
enum ndis_power {
126
 
        NDIS_POWER_OFF = 0,
127
 
        NDIS_POWER_MAX,
128
 
        NDIS_POWER_MIN,
129
 
};
130
 
 
131
 
enum ndis_power_profile {
132
 
        NdisPowerProfileBattery,
133
 
        NdisPowerProfileAcOnLine
 
148
        NDIS_POWER_OFF = 0, NDIS_POWER_MAX, NDIS_POWER_MIN,
134
149
};
135
150
 
136
151
struct ndis_auth_req {
139
154
        ULONG flags;
140
155
};
141
156
 
142
 
int add_wep_key(struct ndis_handle *handle, char *key, int key_len, int index);
 
157
struct ndis_bssid_info {
 
158
        mac_address bssid;
 
159
        ndis_pmkid_vavlue pmkid;
 
160
};
 
161
 
 
162
struct ndis_pmkid {
 
163
        ULONG length;
 
164
        ULONG bssid_info_count;
 
165
        struct ndis_bssid_info bssid_info[1];
 
166
};
 
167
 
 
168
int add_wep_key(struct ndis_device *wnd, char *key, int key_len,
 
169
                int index);
 
170
int set_essid(struct ndis_device *wnd, const char *ssid, int ssid_len);
 
171
int set_infra_mode(struct ndis_device *wnd,
 
172
                   enum ndis_infrastructure_mode mode);
 
173
int get_ap_address(struct ndis_device *wnd, mac_address mac);
 
174
int set_ndis_auth_mode(struct ndis_device *wnd, ULONG auth_mode);
 
175
int set_iw_auth_mode(struct ndis_device *wnd, int wpa_version,
 
176
                     int auth_80211_alg);
 
177
int set_auth_mode(struct ndis_device *wnd);
 
178
int set_ndis_encr_mode(struct ndis_device *wnd, int cipher_pairwise,
 
179
                       int cipher_groupwise);
 
180
int get_ndis_encr_mode(struct ndis_device *wnd);
 
181
int set_encr_mode(struct ndis_device *wnd);
 
182
int set_iw_encr_mode(struct ndis_device *wnd, int cipher_pairwise,
 
183
                     int cipher_groupwise);
 
184
int get_ndis_auth_mode(struct ndis_device *wnd);
 
185
int set_priv_filter(struct ndis_device *wnd);
 
186
int set_scan(struct ndis_device *wnd);
 
187
NDIS_STATUS disassociate(struct ndis_device *wnd, int reset_ssid);
 
188
void set_default_iw_params(struct ndis_device *wnd);
143
189
extern const struct iw_handler_def ndis_handler_def;
144
190
 
145
 
int set_essid(struct ndis_handle *handle, const char *ssid, int ssid_len);
146
 
int set_infra_mode(struct ndis_handle *handle,
147
 
                   enum network_infrastructure mode);
148
 
int get_ap_address(struct ndis_handle *handle, mac_address mac);
149
 
int set_auth_mode(struct ndis_handle *handle, int auth_mode);
150
 
int set_encr_mode(struct ndis_handle *handle, int encr_mode);
151
 
int set_privacy_filter(struct ndis_handle *handle, int flags);
152
 
int set_scan(struct ndis_handle *handle);
153
 
 
154
 
/* WPA support */
155
 
 
156
191
#define PRIV_RESET                      SIOCIWFIRSTPRIV+16
157
192
#define PRIV_POWER_PROFILE              SIOCIWFIRSTPRIV+17
158
193
#define PRIV_NETWORK_TYPE               SIOCIWFIRSTPRIV+18
 
194
#define PRIV_DEAUTHENTICATE             SIOCIWFIRSTPRIV+19
 
195
#define PRIV_MEDIA_STREAM_MODE          SIOCIWFIRSTPRIV+20
 
196
#define PRIV_RELOAD_DEFAULTS            SIOCIWFIRSTPRIV+23
 
197
 
 
198
#define RSN_INFO_ELEM           0x30
159
199
 
160
200
/* these have to match what is in wpa_supplicant */
 
201
 
161
202
typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg;
162
203
typedef enum { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP,
163
204
               CIPHER_WEP104 } wpa_cipher;
164
205
typedef enum { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE,
165
206
               KEY_MGMT_802_1X_NO_WPA, KEY_MGMT_WPA_NONE } wpa_key_mgmt;
166
207
 
167
 
#define AUTH_ALG_OPEN_SYSTEM    0x01
168
 
#define AUTH_ALG_SHARED_KEY     0x02
169
 
#define AUTH_ALG_LEAP           0x04
170
 
 
171
 
#define IEEE80211_MODE_INFRA    0
172
 
#define IEEE80211_MODE_IBSS     1
173
 
 
174
 
#define RSN_INFO_ELEM           0x30
175
 
 
176
 
struct wpa_key {
177
 
        wpa_alg alg;
178
 
        u8 *addr;
179
 
        int key_index;
180
 
        int set_tx;
181
 
        u8 *seq;
182
 
        size_t seq_len;
183
 
        u8 *key;
184
 
        size_t key_len;
185
 
};
186
 
 
187
 
struct wpa_assoc_info {
188
 
        const u8 *bssid;
189
 
        const u8 *ssid;
190
 
        size_t ssid_len;
191
 
        int freq;
192
 
        const u8 *wpa_ie;
193
 
        size_t wpa_ie_len;
194
 
        wpa_cipher pairwise_suite;
195
 
        wpa_cipher group_suite;
196
 
        wpa_key_mgmt key_mgmt_suite;
197
 
        int auth_alg;
198
 
        int mode;
199
 
};
200
 
 
201
 
#define WPA_SET_WPA                     SIOCIWFIRSTPRIV+1
202
 
#define WPA_SET_KEY                     SIOCIWFIRSTPRIV+2
203
 
#define WPA_ASSOCIATE                   SIOCIWFIRSTPRIV+3
204
 
#define WPA_DISASSOCIATE                SIOCIWFIRSTPRIV+4
205
 
#define WPA_DROP_UNENCRYPTED            SIOCIWFIRSTPRIV+5
206
 
#define WPA_SET_COUNTERMEASURES         SIOCIWFIRSTPRIV+6
207
 
#define WPA_DEAUTHENTICATE              SIOCIWFIRSTPRIV+7
208
 
#define WPA_SET_AUTH_ALG                SIOCIWFIRSTPRIV+8
209
 
#define WPA_INIT                        SIOCIWFIRSTPRIV+9
210
 
#define WPA_DEINIT                      SIOCIWFIRSTPRIV+10
211
 
 
212
208
#endif // IW_NDIS_H