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