8919 loader.efi: remove efi_main() from libefi
[unleashed.git] / include / net / wpa.h
blobf57c0ab9dec122a36e2a05465bec3a9f4d28e830
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
27 * Macro and data structures defined for 802.11i.
30 #ifndef __WPA_H
31 #define __WPA_H
33 #pragma ident "%Z%%M% %I% %E% SMI"
35 #include <inet/wifi_ioctl.h>
36 #include <sys/net80211_crypto.h>
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
42 #define SERVICE_NAME "network/wpa"
43 #define WPA_DOOR "/var/run/wpa_door"
44 #define SVC_METHOD "/usr/lib/inet/wpad"
47 * Parameters.
49 #define WL_WPA_BASE (WL_PARAMETERS_BASE + 0x500)
50 #define WL_SETOPTIE (WL_WPA_BASE + 0x0)
51 #define WL_WPA (WL_WPA_BASE + 0x2)
52 #define WL_KEY (WL_WPA_BASE + 0x3)
53 #define WL_DELKEY (WL_WPA_BASE + 0x4)
54 #define WL_SCANRESULTS (WL_WPA_BASE + 0x7)
55 #define WL_MLME (WL_WPA_BASE + 0x8)
56 #define WL_CAPABILITY (WL_WPA_BASE + 0x9)
58 typedef struct wl_wpa_ie {
59 uint32_t wpa_ie_len;
60 char wpa_ie[1]; /* it's the head of wpa_ie */
61 } wl_wpa_ie_t;
63 typedef struct wl_wpa {
64 uint32_t wpa_flag;
65 } wl_wpa_t;
67 typedef struct wl_capability {
68 uint32_t caps;
69 } wl_capability_t;
72 * WPA/RSN get/set key request.
73 * ik_type : wep/tkip/aes
74 * ik_keyix : should be between 0 and 3, 0 will be used as default key.
75 * ik_keylen: key length in bytes.
76 * ik_keydata and ik_keylen include the DATA key and MIC key.
77 * ik_keyrsc/ik_keytsc: rx/tx seq number.
79 #pragma pack(1)
80 typedef struct wl_key {
81 uint8_t ik_type;
82 uint8_t ik_pad;
84 uint16_t ik_keyix;
85 uint8_t ik_keylen;
86 uint8_t ik_flags;
88 uint8_t ik_macaddr[IEEE80211_ADDR_LEN];
89 uint64_t ik_keyrsc;
90 uint64_t ik_keytsc;
92 uint8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
93 } wl_key_t;
94 #pragma pack()
96 typedef struct wl_del_key {
97 uint8_t idk_keyix;
98 uint8_t idk_macaddr[IEEE80211_ADDR_LEN];
99 } wl_del_key_t;
101 struct wpa_ess {
102 uint8_t bssid[IEEE80211_ADDR_LEN];
103 uint8_t ssid[MAX_ESSID_LENGTH];
104 uint32_t ssid_len;
106 uint8_t wpa_ie[IEEE80211_MAX_WPA_IE];
107 uint32_t wpa_ie_len;
108 int freq;
111 typedef struct wl_wpa_ess {
112 uint32_t count;
113 struct wpa_ess ess[1];
114 } wl_wpa_ess_t;
117 * structure for WL_MLME state manipulation request.
118 * im_op: operations include auth/deauth/assoc/disassoc,
119 * im_reason: 802.11 reason code
121 typedef struct wl_mlme {
122 uint8_t im_op;
123 uint16_t im_reason;
124 uint8_t im_macaddr[IEEE80211_ADDR_LEN];
125 } wl_mlme_t;
128 * State machine events
130 typedef enum {
131 EVENT_ASSOC,
132 EVENT_DISASSOC,
133 EVENT_SCAN_RESULTS
134 } wpa_event_type;
136 typedef struct wl_events {
137 wpa_event_type event;
138 } wl_events_t;
140 #ifdef __cplusplus
142 #endif
144 #endif /* __WPA_H */