net80211.h revision 239e91abc172c1397b1e94869c5d0e8ab67bfc22
986N/A/*
986N/A * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
986N/A * Use is subject to license terms.
986N/A */
986N/A
986N/A/*
986N/A * Copyright (c) 2001 Atsushi Onoe
986N/A * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
986N/A * All rights reserved.
986N/A *
986N/A * Redistribution and use in source and binary forms, with or without
986N/A * modification, are permitted provided that the following conditions
986N/A * are met:
986N/A * 1. Redistributions of source code must retain the above copyright
986N/A * notice, this list of conditions and the following disclaimer.
986N/A * 2. Redistributions in binary form must reproduce the above copyright
986N/A * notice, this list of conditions and the following disclaimer in the
986N/A * documentation and/or other materials provided with the distribution.
986N/A * 3. The name of the author may not be used to endorse or promote products
986N/A * derived from this software without specific prior written permission.
986N/A *
1190N/A * Alternatively, this software may be distributed under the terms of the
1185N/A * GNU General Public License ("GPL") version 2 as published by the Free
986N/A * Software Foundation.
986N/A *
986N/A * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
986N/A * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
986N/A * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
986N/A * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
986N/A * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
986N/A * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
986N/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
986N/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
986N/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
986N/A * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
986N/A */
986N/A
1185N/A#pragma ident "%Z%%M% %I% %E% SMI"
1185N/A
986N/A#ifndef _SYS_NET80211_H
986N/A#define _SYS_NET80211_H
1238N/A
1238N/A#include <sys/mac.h>
1238N/A#include <sys/ethernet.h>
1238N/A#include <sys/net80211_proto.h>
1238N/A#include <sys/net80211_crypto.h>
986N/A#include <net/wpa.h>
1185N/A
1185N/A/*
1185N/A * IEEE802.11 kernel support module
1185N/A */
986N/A
986N/A#ifdef __cplusplus
986N/Aextern "C" {
1185N/A#endif
1185N/A
1185N/A/* ic_caps */
1185N/A#define IEEE80211_C_WEP 0x00000001 /* CAPABILITY: WEP available */
1185N/A#define IEEE80211_C_TKIP 0x00000002 /* CAPABILITY: TKIP available */
986N/A#define IEEE80211_C_AES 0x00000004 /* CAPABILITY: AES OCB avail */
986N/A#define IEEE80211_C_AES_CCM 0x00000008 /* CAPABILITY: AES CCM avail */
986N/A#define IEEE80211_C_CKIP 0x00000010 /* CAPABILITY: CKIP available */
1185N/A#define IEEE80211_C_FF 0x00000040 /* CAPABILITY: ATH FF avail */
1185N/A#define IEEE80211_C_TURBOP 0x00000080
1185N/A /* CAPABILITY: ATH Turbo available */
1185N/A#define IEEE80211_C_IBSS 0x00000100 /* CAPABILITY: IBSS available */
1185N/A#define IEEE80211_C_PMGT 0x00000200 /* CAPABILITY: Power mgmt */
1185N/A#define IEEE80211_C_HOSTAP 0x00000400 /* CAPABILITY: HOSTAP avail */
1185N/A#define IEEE80211_C_AHDEMO 0x00000800 /* CAPABILITY: Old Adhoc Demo */
986N/A#define IEEE80211_C_SWRETRY 0x00001000 /* CAPABILITY: sw tx retry */
1185N/A#define IEEE80211_C_TXPMGT 0x00002000 /* CAPABILITY: tx power mgmt */
1190N/A#define IEEE80211_C_SHSLOT 0x00004000 /* CAPABILITY: short slottime */
1185N/A#define IEEE80211_C_SHPREAMBLE 0x00008000 /* CAPABILITY: short preamble */
1185N/A#define IEEE80211_C_MONITOR 0x00010000 /* CAPABILITY: monitor mode */
1185N/A#define IEEE80211_C_TKIPMIC 0x00020000 /* CAPABILITY: TKIP MIC avail */
986N/A#define IEEE80211_C_WPA1 0x00800000 /* CAPABILITY: WPA1 avail */
986N/A#define IEEE80211_C_WPA2 0x01000000 /* CAPABILITY: WPA2 avail */
986N/A#define IEEE80211_C_WPA 0x01800000
1185N/A /* CAPABILITY: WPA1+WPA2 avail */
1185N/A#define IEEE80211_C_BURST 0x02000000 /* CAPABILITY: frame bursting */
1185N/A#define IEEE80211_C_WME 0x04000000 /* CAPABILITY: WME avail */
1185N/A#define IEEE80211_C_WDS 0x08000000 /* CAPABILITY: 4-addr support */
1185N/A/* 0x10000000 reserved */
1185N/A#define IEEE80211_C_BGSCAN 0x20000000 /* CAPABILITY: bg scanning */
1185N/A#define IEEE80211_C_TXFRAG 0x40000000 /* CAPABILITY: tx fragments */
986N/A/* XXX protection/barker? */
1185N/A
1190N/A#define IEEE80211_C_CRYPTO 0x0000001f /* CAPABILITY: crypto alg's */
1185N/A
1185N/A/* ic_flags */
1185N/A/* NB: bits 0x4c available */
986N/A#define IEEE80211_F_FF 0x00000001 /* CONF: ATH FF enabled */
986N/A#define IEEE80211_F_TURBOP 0x00000002 /* CONF: ATH Turbo enabled */
986N/A#define IEEE80211_F_BURST 0x00000004 /* CONF: bursting enabled */
1185N/A/* NB: this is intentionally setup to be IEEE80211_CAPINFO_PRIVACY */
1185N/A#define IEEE80211_F_PRIVACY 0x00000010 /* CONF: privacy enabled */
1185N/A#define IEEE80211_F_PUREG 0x00000020 /* CONF: 11g w/o 11b sta's */
1185N/A#define IEEE80211_F_SCANONLY 0x00000040 /* CONF: scan only */
1185N/A#define IEEE80211_F_SCAN 0x00000080 /* STATUS: scanning */
1185N/A#define IEEE80211_F_ASCAN 0x00000100 /* STATUS: active scan */
1185N/A#define IEEE80211_F_SIBSS 0x00000200 /* STATUS: start IBSS */
986N/A/* NB: this is intentionally setup to be IEEE80211_CAPINFO_SHORT_SLOTTIME */
1190N/A#define IEEE80211_F_SHSLOT 0x00000400
1185N/A /* STATUS: use short slot time */
1185N/A#define IEEE80211_F_PMGTON 0x00000800 /* CONF: Power mgmt enable */
1185N/A#define IEEE80211_F_DESBSSID 0x00001000 /* CONF: des_bssid is set */
986N/A#define IEEE80211_F_WME 0x00002000 /* CONF: enable WME use */
986N/A#define IEEE80211_F_BGSCAN 0x00004000
986N/A /* CONF: bg scan enabled (???) */
1185N/A#define IEEE80211_F_SWRETRY 0x00008000 /* CONF: sw tx retry enabled */
1185N/A#define IEEE80211_F_TXPOW_FIXED 0x00010000 /* TX Power: fixed rate */
1185N/A#define IEEE80211_F_IBSSON 0x00020000 /* CONF: IBSS creation enable */
1185N/A#define IEEE80211_F_SHPREAMBLE 0x00040000 /* STATUS: use short preamble */
1185N/A#define IEEE80211_F_DATAPAD 0x00080000 /* CONF: do alignment pad */
1185N/A#define IEEE80211_F_USEPROT 0x00100000 /* STATUS: protection enabled */
1185N/A#define IEEE80211_F_USEBARKER 0x00200000
986N/A /* STATUS: use barker preamble */
1185N/A#define IEEE80211_F_TIMUPDATE 0x00400000 /* STATUS: update beacon tim */
1185N/A#define IEEE80211_F_WPA1 0x00800000 /* CONF: WPA enabled */
1185N/A#define IEEE80211_F_WPA2 0x01000000 /* CONF: WPA2 enabled */
1185N/A#define IEEE80211_F_WPA 0x01800000 /* CONF: WPA/WPA2 enabled */
1185N/A#define IEEE80211_F_DROPUNENC 0x02000000 /* CONF: drop unencrypted */
986N/A#define IEEE80211_F_COUNTERM 0x04000000 /* CONF: TKIP countermeasures */
986N/A#define IEEE80211_F_HIDESSID 0x08000000 /* CONF: hide SSID in beacon */
986N/A#define IEEE80211_F_NOBRIDGE 0x10000000 /* CONF: dis. internal bridge */
1185N/A#define IEEE80211_F_WMEUPDATE 0x20000000 /* STATUS: update beacon wme */
1185N/A
1185N/A/* ic_flags_ext */
1185N/A#define IEEE80211_FEXT_WDS 0x00000001 /* CONF: 4 addr allowed */
1185N/A/* 0x00000006 reserved */
1185N/A#define IEEE80211_FEXT_BGSCAN 0x00000008
1185N/A /* STATUS: enable full bgscan completion */
986N/A#define IEEE80211_FEXT_ERPUPDATE 0x00000200 /* STATUS: update ERP element */
986N/A#define IEEE80211_FEXT_SWBMISS 0x00000400 /* CONF: do bmiss in s/w */
1190N/A
986N/A/*
1185N/A * Channel attributes (ich_flags)
986N/A * bits 0-3 are for private use by drivers
986N/A */
986N/A#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */
986N/A#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */
1190N/A#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */
1185N/A#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */
1185N/A#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */
1185N/A#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
1185N/A#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
1185N/A#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
1185N/A
1185N/A#define IEEE80211_CHAN_MAX 255
986N/A#define IEEE80211_CHAN_BYTES 32 /* howmany(IEEE80211_CHAN_MAX, NBBY) */
986N/A#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */
1185N/A#define IEEE80211_CHAN_ANYC \
986N/A ((struct ieee80211_channel *)IEEE80211_CHAN_ANY)
1190N/A
1185N/A#define IEEE80211_IS_CHAN_2GHZ(_c) \
1185N/A (((_c)->ich_flags & IEEE80211_CHAN_2GHZ) != 0)
986N/A#define IEEE80211_IS_CHAN_5GHZ(_c) \
986N/A (((_c)->ich_flags & IEEE80211_CHAN_5GHZ) != 0)
986N/A
986N/A#define IEEE80211_NODE_HASHSIZE 32
986N/A
986N/A#define IEEE80211_FIXED_RATE_NONE 0
986N/A#define IEEE80211_MCAST_RATE_DEFAULT (2*1) /* default mcast rate (1M) */
986N/A
986N/A/* WME stream classes */
986N/A#define WME_AC_BE 0 /* best effort */
986N/A#define WME_AC_BK 1 /* background */
1185N/A#define WME_AC_VI 2 /* video */
986N/A#define WME_AC_VO 3 /* voice */
986N/A
986N/A#define MAX_EVENT 16
986N/A#define MAX_IEEE80211STR 256
986N/A
986N/A/*
986N/A * Authentication mode.
986N/A */
986N/Aenum ieee80211_authmode {
986N/A IEEE80211_AUTH_NONE = 0,
986N/A IEEE80211_AUTH_OPEN = 1, /* open */
986N/A IEEE80211_AUTH_SHARED = 2, /* shared-key */
986N/A IEEE80211_AUTH_8021X = 3, /* 802.1x */
986N/A IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */
986N/A /* NB: these are used only for ioctls */
986N/A IEEE80211_AUTH_WPA = 5 /* WPA/RSN w/ 802.1x/PSK */
986N/A};
986N/A
986N/Aenum ieee80211_state {
986N/A IEEE80211_S_INIT = 0, /* default state */
986N/A IEEE80211_S_SCAN = 1, /* scanning */
986N/A IEEE80211_S_AUTH = 2, /* try to authenticate */
1185N/A IEEE80211_S_ASSOC = 3, /* try to assoc */
1185N/A IEEE80211_S_RUN = 4 /* associated */
1185N/A};
986N/A#define IEEE80211_S_MAX (IEEE80211_S_RUN+1)
986N/A
986N/A/*
986N/A * 802.11 rate set.
986N/A */
986N/A#define IEEE80211_RATE_MAXSIZE 15 /* max rates we'll handle */
986N/A#define IEEE80211_RATE_SIZE 8 /* 802.11 standard */
986N/A#define IEEE80211_XRATE_SIZE (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE)
986N/A /* size of extended supported rates */
986N/Astruct ieee80211_rateset {
986N/A uint8_t ir_nrates;
986N/A uint8_t ir_rates[IEEE80211_RATE_MAXSIZE];
986N/A};
986N/A
986N/A/*
1190N/A * Channels are specified by frequency and attributes.
986N/A */
1185N/Astruct ieee80211_channel {
986N/A uint16_t ich_freq; /* setting in Mhz */
986N/A uint16_t ich_flags; /* see below */
986N/A};
986N/A
986N/Astruct ieee80211_device_stats {
986N/A uint32_t is_tx_frags;
986N/A uint32_t is_tx_bytes;
986N/A uint32_t is_tx_mcast;
986N/A uint32_t is_tx_failed;
986N/A uint32_t is_tx_retries;
986N/A uint32_t is_rts_success;
1185N/A uint32_t is_rts_failure;
1185N/A uint32_t is_ack_failure;
1185N/A uint32_t is_rx_frags;
1185N/A uint32_t is_rx_bytes;
986N/A uint32_t is_rx_mcast;
986N/A uint32_t is_rx_dups;
1190N/A uint32_t is_fcs_errors;
986N/A uint32_t is_wep_errors;
1185N/A uint32_t is_tx_nobuf;
986N/A uint32_t is_tx_unknownmgt;
986N/A};
986N/A
1185N/Astruct ieee80211_crypto_state;
986N/Atypedef struct ieee80211_node_table ieee80211_node_table_t;
986N/Atypedef struct ieee80211_node ieee80211_node_t;
1185N/Atypedef struct ieee80211com ieee80211com_t;
986N/A
986N/Astruct ieee80211_node_table {
1185N/A struct ieee80211com *nt_ic; /* back reference */
986N/A
986N/A const char *nt_name; /* for debugging */
986N/A /* For node inactivity processing */
986N/A int nt_inact_timer; /* inactivity timer */
1190N/A int nt_inact_init; /* initial node inact setting */
986N/A void (*nt_timeout)(struct ieee80211_node_table *);
986N/A uint32_t nt_scangen; /* gen# for timeout scan */
986N/A kmutex_t nt_scanlock; /* on nt_scangen */
1185N/A kmutex_t nt_nodelock; /* on node table */
986N/A
986N/A int nt_keyixmax; /* keyixmap size */
1185N/A struct ieee80211_node **nt_keyixmap; /* key ix -> node map */
1185N/A
986N/A list_t nt_node; /* information of all nodes */
986N/A list_t nt_hash[IEEE80211_NODE_HASHSIZE];
986N/A};
986N/A
986N/A/*
1190N/A * Node specific information. Note that drivers are expected
986N/A * to derive from this structure to add device-specific per-node
986N/A * state. This is done by overriding the ic_node_* methods in
986N/A * the ieee80211com structure.
986N/A */
986N/Astruct ieee80211_node {
986N/A struct ieee80211com *in_ic;
986N/A struct ieee80211_node_table *in_table;
986N/A
986N/A uint8_t in_authmode; /* authentication algorithm */
986N/A uint16_t in_flags; /* special purpose state */
986N/A uint16_t in_associd; /* assoc response */
986N/A uint16_t in_txpower; /* current transmit power */
986N/A uint16_t in_vlan; /* vlan tag */
/*
* Tx/Rx sequence number.
* index 0 is used when QoS is not enabled. index 1-16 is used
* when QoS is enabled. 1-16 corresponds to TID 0-15.
*/
uint16_t in_txseqs[17]; /* tx seq per-tid */
uint16_t in_rxseqs[17]; /* rx seq previous per-tid */
clock_t in_rxfragstamp; /* time stamp of last rx frag */
mblk_t *in_rxfrag; /* rx frag reassembly */
uint32_t in_scangen; /* gen# for timeout scan */
uint32_t in_refcnt;
/* hardware */
uint32_t in_rstamp; /* recv timestamp */
uint8_t in_rssi; /* recv ssi */
/* header */
uint8_t in_macaddr[IEEE80211_ADDR_LEN];
uint8_t in_bssid[IEEE80211_ADDR_LEN];
/* beacon, probe response */
union {
uint8_t data[8];
uint64_t tsf;
} in_tstamp; /* from last rcv'd beacon */
uint16_t in_intval; /* beacon interval */
uint16_t in_capinfo; /* capabilities */
uint8_t in_esslen;
uint8_t in_essid[IEEE80211_NWID_LEN];
struct ieee80211_rateset in_rates; /* negotiated rate set */
struct ieee80211_channel *in_chan; /* XXX multiple uses */
enum ieee80211_phytype in_phytype;
uint16_t in_fhdwell; /* FH only */
uint8_t in_fhindex; /* FH only */
uint8_t in_erp; /* ERP from beacon/probe resp */
uint16_t in_tim_off; /* byte offset to TIM ie */
uint8_t in_dtim_period; /* DTIM period */
uint8_t in_dtim_count; /* DTIM count for last bcn */
uint32_t *in_challenge; /* shared-key challenge */
struct ieee80211_key in_ucastkey; /* unicast key */
uint8_t *in_wpa_ie; /* captured WPA/RSN ie */
/* others */
int32_t in_fails; /* failure count to associate */
int16_t in_inact; /* inactivity mark count */
int16_t in_inact_reload; /* inactivity reload value */
int32_t in_txrate; /* index to ni_rates[] */
list_node_t in_node; /* element of nt->nt_node */
list_node_t in_hash; /* element of nt->nt_hash */
};
struct ieee80211com {
mac_handle_t ic_mach;
/* Initialized by driver */
uint8_t ic_macaddr[IEEE80211_ADDR_LEN];
uint32_t ic_caps; /* capabilities */
enum ieee80211_phytype ic_phytype; /* XXX wrong for multi-mode */
enum ieee80211_opmode ic_opmode; /* current operation mode */
enum ieee80211_state ic_state; /* current 802.11 state */
struct ieee80211_channel ic_sup_channels[IEEE80211_CHAN_MAX+1];
struct ieee80211_rateset ic_sup_rates[IEEE80211_MODE_MAX];
enum ieee80211_phymode ic_curmode; /* OPT current mode */
struct ieee80211_channel *ic_curchan; /* OPT current channel */
struct ieee80211_channel *ic_ibss_chan; /* OPT bss channel */
uint8_t ic_maxrssi; /* maximum hardware RSSI */
/* INITIALIZED by IEEE80211, used/overridden by driver */
uint16_t ic_modecaps; /* set of mode capabilities */
uint8_t ic_chan_active[IEEE80211_CHAN_BYTES];
enum ieee80211_protmode ic_protmode; /* 802.11g protection mode */
uint16_t ic_bintval; /* beacon interval */
uint16_t ic_lintval; /* listen interval */
uint16_t ic_txpowlimit; /* global tx power limit */
uint8_t ic_bmissthreshold;
uint16_t ic_rtsthreshold;
uint16_t ic_fragthreshold;
int32_t ic_mcast_rate; /* rate for mcast frames */
uint8_t ic_fixed_rate; /* value of fixed rate */
int32_t ic_des_esslen; /* length of desired essid */
uint8_t ic_des_essid[IEEE80211_NWID_LEN];
uint8_t ic_des_bssid[IEEE80211_ADDR_LEN];
struct ieee80211_channel *ic_des_chan; /* desired channel */
void *ic_opt_ie; /* user-specified IE's */
uint16_t ic_opt_ie_len; /* length of ic_opt_ie */
uint8_t ic_nickname[IEEE80211_NWID_LEN];
uint16_t ic_tim_len; /* ic_tim_bitmap size (bytes) */
uint8_t *ic_tim_bitmap; /* powersave stations w/ data */
timeout_id_t ic_watchdog_timer; /* watchdog timer */
/* Cipher state/configuration. */
struct ieee80211_crypto_state ic_crypto;
const struct ieee80211_cipher *ic_ciphers[IEEE80211_CIPHER_MAX];
kmutex_t ic_doorlock;
char ic_wpadoor[MAX_IEEE80211STR];
wpa_event_type ic_eventq[MAX_EVENT];
uint32_t ic_evq_head, ic_evq_tail;
/* Runtime states */
uint32_t ic_flags; /* state/conf flags */
uint32_t ic_flags_ext; /* extended state flags */
struct ieee80211_node *ic_bss; /* information for this node */
struct ieee80211_device_stats ic_stats;
struct ieee80211_node_table ic_scan; /* STA: scan candidates */
struct ieee80211_node_table ic_sta; /* AP:stations/IBSS:neighbors */
/* callback functions */
/*
* Functions initialized by driver before calling ieee80211_attach()
* Those must be initialized are marked with M(andatory)
*
* ic_xmit - [M] transmit a management or null data frame
* return 0 on success, non-zero on error
* ic_watchdog - [O] periodic run function, enabled by
* ieee80211_start_watchdog()
* ic_set_tim - [O] set/clear traffic indication map
* ic_set_shortslot - [O] enable/disable short slot timing
* ic_node_newassoc - [O] driver specific operation on a newly
* associated or re-assoced node
*/
int (*ic_xmit)(ieee80211com_t *, mblk_t *, uint8_t);
void (*ic_watchdog)(void *);
void (*ic_set_tim)(ieee80211com_t *,
ieee80211_node_t *, int);
void (*ic_set_shortslot)(ieee80211com_t *, int);
void (*ic_node_newassoc)(ieee80211_node_t *, int);
/*
* Functions initialized by ieee80211_attach(), driver could
* override these functions after calling ieee80211_attach()
*
* ic_reset - reset
* ic_recv_mgmt - handle received management frames
* ic_send_mgmt - construct and transmit management frames
* ic_newstate - handle state transition
* ic_node_alloc - allocate a new BSS info node
* ic_node_cleanup - cleanup or free memory spaces of a node
* ic_node_free - free a node
* ic_node_getrssi - get node's rssi
*/
int (*ic_reset)(ieee80211com_t *);
void (*ic_recv_mgmt)(ieee80211com_t *,
mblk_t *, ieee80211_node_t *,
int, int, uint32_t);
int (*ic_send_mgmt)(ieee80211com_t *,
ieee80211_node_t *, int, int);
int (*ic_newstate)(ieee80211com_t *,
enum ieee80211_state, int);
struct ieee80211_node *(*ic_node_alloc)(ieee80211com_t *);
void (*ic_node_cleanup)(ieee80211_node_t *);
void (*ic_node_free)(ieee80211_node_t *);
uint8_t (*ic_node_getrssi)(const ieee80211_node_t *);
kmutex_t ic_genlock;
void *ic_private; /* ieee80211 private data */
};
#define ic_nw_keys ic_crypto.cs_nw_keys
#define ic_def_txkey ic_crypto.cs_def_txkey
extern const char *ieee80211_state_name[IEEE80211_S_MAX];
#define IEEE80211_RATE(_ix) \
(in->in_rates.ir_rates[(_ix)] & IEEE80211_RATE_VAL)
#define ieee80211_new_state(_ic, _nstate, _arg) \
(((_ic)->ic_newstate)((_ic), (_nstate), (_arg)))
#define ieee80211_macaddr_sprintf(_addr) \
ether_sprintf((struct ether_addr *)(_addr))
/*
* Node reference counting definitions.
*
* ieee80211_node_initref initialize the reference count to 1
* ieee80211_node_incref add a reference
* ieee80211_node_decref remove a reference
* ieee80211_node_decref_nv remove a reference and return new value
* ieee80211_node_refcnt reference count for printing (only)
*/
#include <sys/atomic.h>
#define ieee80211_node_initref(_in) \
((_in)->in_refcnt = 1)
#define ieee80211_node_incref(_in) \
atomic_inc_uint(&(_in)->in_refcnt)
#define ieee80211_node_decref(_in) \
atomic_dec_uint(&(_in)->in_refcnt)
#define ieee80211_node_decref_nv(_in) \
atomic_dec_uint_nv(&(_in)->in_refcnt)
#define ieee80211_node_refcnt(_in) \
(_in)->in_refcnt
typedef void ieee80211_iter_func(void *, ieee80211_node_t *);
/* Initialization */
void ieee80211_attach(ieee80211com_t *);
void ieee80211_detach(ieee80211com_t *);
void ieee80211_media_init(ieee80211com_t *);
int ieee80211_ioctl(ieee80211com_t *, queue_t *, mblk_t *);
/* Protocol Processing */
int ieee80211_input(ieee80211com_t *, mblk_t *, ieee80211_node_t *,
int32_t, uint32_t);
mblk_t *ieee80211_encap(ieee80211com_t *, mblk_t *, ieee80211_node_t *);
mblk_t *ieee80211_beacon_alloc(ieee80211com_t *, ieee80211_node_t *,
struct ieee80211_beacon_offsets *);
int ieee80211_beacon_update(ieee80211com_t *, ieee80211_node_t *,
struct ieee80211_beacon_offsets *, mblk_t *, int);
void ieee80211_beacon_miss(ieee80211com_t *);
void ieee80211_begin_scan(ieee80211com_t *, boolean_t);
void ieee80211_next_scan(ieee80211com_t *);
void ieee80211_end_scan(ieee80211com_t *);
void ieee80211_cancel_scan(ieee80211com_t *);
void ieee80211_sta_join(ieee80211com_t *, ieee80211_node_t *);
void ieee80211_sta_leave(ieee80211com_t *, ieee80211_node_t *);
boolean_t ieee80211_ibss_merge(ieee80211_node_t *);
/* Node Operation */
ieee80211_node_t *ieee80211_ref_node(ieee80211_node_t *);
void ieee80211_unref_node(ieee80211_node_t **);
void ieee80211_node_authorize(ieee80211_node_t *);
void ieee80211_node_unauthorize(ieee80211_node_t *);
ieee80211_node_t *ieee80211_alloc_node(ieee80211com_t *,
ieee80211_node_table_t *, const uint8_t *);
void ieee80211_free_node(ieee80211_node_t *);
void ieee80211_node_table_reset(ieee80211_node_table_t *);
void ieee80211_iterate_nodes(ieee80211_node_table_t *, ieee80211_iter_func *,
void *);
ieee80211_node_t *ieee80211_find_node(ieee80211_node_table_t *,
const uint8_t *);
ieee80211_node_t *ieee80211_find_node_with_ssid(ieee80211_node_table_t *,
const uint8_t *, uint32_t, const uint8_t *);
ieee80211_node_t *ieee80211_find_txnode(ieee80211com_t *,
const uint8_t daddr[IEEE80211_ADDR_LEN]);
ieee80211_node_t *ieee80211_find_rxnode(ieee80211com_t *,
const struct ieee80211_frame *);
/* Crypto */
extern struct ieee80211_key *ieee80211_crypto_encap(ieee80211com_t *, mblk_t *);
extern struct ieee80211_key *ieee80211_crypto_decap(ieee80211com_t *, mblk_t *,
int);
extern int ieee80211_crypto_newkey(ieee80211com_t *, int, int,
struct ieee80211_key *);
extern int ieee80211_crypto_delkey(ieee80211com_t *, struct ieee80211_key *);
extern int ieee80211_crypto_setkey(ieee80211com_t *, struct ieee80211_key *,
const uint8_t macaddr[IEEE80211_ADDR_LEN]);
/* Helper Functions */
int ieee80211_stat(ieee80211com_t *ic, uint_t stat, uint64_t *val);
uint32_t ieee80211_chan2ieee(ieee80211com_t *, struct ieee80211_channel *);
enum ieee80211_phymode ieee80211_chan2mode(ieee80211com_t *,
struct ieee80211_channel *);
uint32_t ieee80211_ieee2mhz(uint32_t, uint32_t);
void ieee80211_reset_chan(ieee80211com_t *);
void ieee80211_dump_pkt(const uint8_t *, int32_t, int32_t, int32_t);
void ieee80211_watchdog(void *);
void ieee80211_start_watchdog(ieee80211com_t *, uint32_t);
void ieee80211_stop_watchdog(ieee80211com_t *);
void *ieee80211_malloc(size_t);
void ieee80211_free(void *);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_NET80211_H */