14126Szf162725 /* 24126Szf162725 * CDDL HEADER START 34126Szf162725 * 44126Szf162725 * The contents of this file are subject to the terms of the 54126Szf162725 * Common Development and Distribution License (the "License"). 64126Szf162725 * You may not use this file except in compliance with the License. 74126Szf162725 * 84126Szf162725 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 94126Szf162725 * or http://www.opensolaris.org/os/licensing. 104126Szf162725 * See the License for the specific language governing permissions 114126Szf162725 * and limitations under the License. 124126Szf162725 * 134126Szf162725 * When distributing Covered Code, include this CDDL HEADER in each 144126Szf162725 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 154126Szf162725 * If applicable, add the following below this CDDL HEADER, with the 164126Szf162725 * fields enclosed by brackets "[]" replaced with your own identifying 174126Szf162725 * information: Portions Copyright [yyyy] [name of copyright owner] 184126Szf162725 * 194126Szf162725 * CDDL HEADER END 204126Szf162725 */ 214126Szf162725 /* 22*6411Szf162725 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 234126Szf162725 * Use is subject to license terms. 244126Szf162725 */ 254126Szf162725 264126Szf162725 /* 274126Szf162725 * Macro and data structures defined for 802.11i. 284126Szf162725 */ 294126Szf162725 304126Szf162725 #ifndef __WPA_H 314126Szf162725 #define __WPA_H 324126Szf162725 334126Szf162725 #pragma ident "%Z%%M% %I% %E% SMI" 344126Szf162725 354126Szf162725 #include <inet/wifi_ioctl.h> 36*6411Szf162725 #include <sys/net80211_crypto.h> 374126Szf162725 384126Szf162725 #ifdef __cplusplus 394126Szf162725 extern "C" { 404126Szf162725 #endif 414126Szf162725 42*6411Szf162725 #define SERVICE_NAME "network/wpa" 43*6411Szf162725 #define WPA_DOOR "/var/run/wpa_door" 44*6411Szf162725 #define SVC_METHOD "/usr/lib/inet/wpad" 454126Szf162725 464126Szf162725 /* 474126Szf162725 * Parameters. 484126Szf162725 */ 49*6411Szf162725 #define WL_WPA_BASE (WL_PARAMETERS_BASE + 0x500) 50*6411Szf162725 #define WL_SETOPTIE (WL_WPA_BASE + 0x0) 51*6411Szf162725 #define WL_WPA (WL_WPA_BASE + 0x2) 52*6411Szf162725 #define WL_KEY (WL_WPA_BASE + 0x3) 53*6411Szf162725 #define WL_DELKEY (WL_WPA_BASE + 0x4) 54*6411Szf162725 #define WL_SCANRESULTS (WL_WPA_BASE + 0x7) 55*6411Szf162725 #define WL_MLME (WL_WPA_BASE + 0x8) 56*6411Szf162725 #define WL_CAPABILITY (WL_WPA_BASE + 0x9) 574126Szf162725 584126Szf162725 typedef struct wl_wpa_ie { 59*6411Szf162725 uint32_t wpa_ie_len; 60*6411Szf162725 char wpa_ie[1]; /* it's the head of wpa_ie */ 614126Szf162725 } wl_wpa_ie_t; 624126Szf162725 634126Szf162725 typedef struct wl_wpa { 64*6411Szf162725 uint32_t wpa_flag; 654126Szf162725 } wl_wpa_t; 664126Szf162725 674126Szf162725 typedef struct wl_capability { 68*6411Szf162725 uint32_t caps; 694126Szf162725 } wl_capability_t; 704126Szf162725 714126Szf162725 /* 72*6411Szf162725 * WPA/RSN get/set key request. 73*6411Szf162725 * ik_type : wep/tkip/aes 74*6411Szf162725 * ik_keyix : should be between 0 and 3, 0 will be used as default key. 75*6411Szf162725 * ik_keylen: key length in bytes. 76*6411Szf162725 * ik_keydata and ik_keylen include the DATA key and MIC key. 77*6411Szf162725 * ik_keyrsc/ik_keytsc: rx/tx seq number. 784126Szf162725 */ 794126Szf162725 #pragma pack(1) 804126Szf162725 typedef struct wl_key { 81*6411Szf162725 uint8_t ik_type; 824126Szf162725 uint8_t ik_pad; 834126Szf162725 84*6411Szf162725 uint16_t ik_keyix; 85*6411Szf162725 uint8_t ik_keylen; 864126Szf162725 uint8_t ik_flags; 874126Szf162725 884126Szf162725 uint8_t ik_macaddr[IEEE80211_ADDR_LEN]; 89*6411Szf162725 uint64_t ik_keyrsc; 90*6411Szf162725 uint64_t ik_keytsc; 914126Szf162725 924126Szf162725 uint8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE]; 934126Szf162725 } wl_key_t; 944126Szf162725 #pragma pack() 954126Szf162725 96*6411Szf162725 typedef struct wl_del_key { 97*6411Szf162725 uint8_t idk_keyix; 98*6411Szf162725 uint8_t idk_macaddr[IEEE80211_ADDR_LEN]; 99*6411Szf162725 } wl_del_key_t; 100*6411Szf162725 1014126Szf162725 struct wpa_ess { 1024126Szf162725 uint8_t bssid[IEEE80211_ADDR_LEN]; 1034126Szf162725 uint8_t ssid[MAX_ESSID_LENGTH]; 1044126Szf162725 uint32_t ssid_len; 1054126Szf162725 1064126Szf162725 uint8_t wpa_ie[IEEE80211_MAX_WPA_IE]; 1074126Szf162725 uint32_t wpa_ie_len; 1084126Szf162725 int freq; 1094126Szf162725 }; 1104126Szf162725 1114126Szf162725 typedef struct wl_wpa_ess { 1124126Szf162725 uint32_t count; 1134126Szf162725 struct wpa_ess ess[1]; 1144126Szf162725 } wl_wpa_ess_t; 1154126Szf162725 1164126Szf162725 /* 117*6411Szf162725 * structure for WL_MLME state manipulation request. 118*6411Szf162725 * im_op: operations include auth/deauth/assoc/disassoc, 119*6411Szf162725 * im_reason: 802.11 reason code 1204126Szf162725 */ 1214126Szf162725 typedef struct wl_mlme { 122*6411Szf162725 uint8_t im_op; 123*6411Szf162725 uint16_t im_reason; 1244126Szf162725 uint8_t im_macaddr[IEEE80211_ADDR_LEN]; 1254126Szf162725 } wl_mlme_t; 1264126Szf162725 1274126Szf162725 /* 1284126Szf162725 * State machine events 1294126Szf162725 */ 1304126Szf162725 typedef enum { 1314126Szf162725 EVENT_ASSOC, 1324126Szf162725 EVENT_DISASSOC, 1334126Szf162725 EVENT_SCAN_RESULTS 1344126Szf162725 } wpa_event_type; 1354126Szf162725 1364126Szf162725 typedef struct wl_events { 1374126Szf162725 wpa_event_type event; 1384126Szf162725 } wl_events_t; 1394126Szf162725 1404126Szf162725 #ifdef __cplusplus 1414126Szf162725 } 1424126Szf162725 #endif 1434126Szf162725 1444126Szf162725 #endif /* __WPA_H */ 145