Main Page | Data Structures | Directories | File List | Data Fields | Globals

_ieee80211.h

Go to the documentation of this file.
00001 /*-
00002  * Copyright (c) 2001 Atsushi Onoe
00003  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright
00012  *    notice, this list of conditions and the following disclaimer in the
00013  *    documentation and/or other materials provided with the distribution.
00014  * 3. The name of the author may not be used to endorse or promote products
00015  *    derived from this software without specific prior written permission.
00016  *
00017  * Alternatively, this software may be distributed under the terms of the
00018  * GNU General Public License ("GPL") version 2 as published by the Free
00019  * Software Foundation.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00022  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00023  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00024  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00025  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00026  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00027  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00028  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00029  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00030  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  *
00032  * $FreeBSD: src/sys/net80211/_ieee80211.h,v 1.2 2004/12/31 22:42:38 sam Exp $
00033  */
00034 #ifndef _NET80211__IEEE80211_H_
00035 #define _NET80211__IEEE80211_H_
00036 
00037 enum ieee80211_phytype {
00038         IEEE80211_T_DS,                 /* direct sequence spread spectrum */
00039         IEEE80211_T_FH,                 /* frequency hopping */
00040         IEEE80211_T_OFDM,               /* frequency division multiplexing */
00041         IEEE80211_T_TURBO,              /* high rate OFDM, aka turbo mode */
00042         IEEE80211_T_XR
00043 };
00044 #define IEEE80211_T_CCK IEEE80211_T_DS  /* more common nomenclature */
00045 
00046 /* XXX not really a mode; there are really multiple PHY's */
00047 enum ieee80211_phymode {
00048         IEEE80211_MODE_AUTO     = 0,    /* autoselect */
00049         IEEE80211_MODE_11A      = 1,    /* 5GHz, OFDM */
00050         IEEE80211_MODE_11B      = 2,    /* 2GHz, CCK */
00051         IEEE80211_MODE_11G      = 3,    /* 2GHz, OFDM */
00052         IEEE80211_MODE_FH       = 4,    /* 2GHz, GFSK */
00053         IEEE80211_MODE_TURBO_A  = 5,    /* 5GHz, OFDM, 2x clock */
00054         IEEE80211_MODE_TURBO_G  = 6     /* 2GHz, OFDM, 2x clock */
00055 };
00056 #define IEEE80211_MODE_MAX      (IEEE80211_MODE_TURBO_G+1)
00057 
00058 enum ieee80211_opmode {
00059         IEEE80211_M_STA         = 1,    /* infrastructure station */
00060         IEEE80211_M_IBSS        = 0,    /* IBSS (adhoc) station */
00061         IEEE80211_M_AHDEMO      = 3,    /* Old lucent compatible adhoc demo */
00062         IEEE80211_M_HOSTAP      = 6,    /* Software Access Point */
00063         IEEE80211_M_MONITOR     = 8     /* Monitor mode */
00064 };
00065 
00066 /*
00067  * 802.11g protection mode.
00068  */
00069 enum ieee80211_protmode {
00070         IEEE80211_PROT_NONE     = 0,    /* no protection */
00071         IEEE80211_PROT_CTSONLY  = 1,    /* CTS to self */
00072         IEEE80211_PROT_RTSCTS   = 2     /* RTS-CTS */
00073 };
00074 
00075 /*
00076  * Authentication mode.
00077  */
00078 enum ieee80211_authmode {
00079         IEEE80211_AUTH_NONE     = 0,
00080         IEEE80211_AUTH_OPEN     = 1,            /* open */
00081         IEEE80211_AUTH_SHARED   = 2,            /* shared-key */
00082         IEEE80211_AUTH_8021X    = 3,            /* 802.1x */
00083         IEEE80211_AUTH_AUTO     = 4,            /* auto-select/accept */
00084         /* NB: these are used only for ioctls */
00085         IEEE80211_AUTH_WPA      = 5             /* WPA/RSN w/ 802.1x/PSK */
00086 };
00087 
00088 /*
00089  * Roaming mode is effectively who controls the operation
00090  * of the 802.11 state machine when operating as a station.
00091  * State transitions are controlled either by the driver
00092  * (typically when management frames are processed by the
00093  * hardware/firmware), the host (auto/normal operation of
00094  * the 802.11 layer), or explicitly through ioctl requests
00095  * when applications like wpa_supplicant want control.
00096  */
00097 enum ieee80211_roamingmode {
00098         IEEE80211_ROAMING_DEVICE= 0,    /* driver/hardware control */
00099         IEEE80211_ROAMING_AUTO  = 1,    /* 802.11 layer control */
00100         IEEE80211_ROAMING_MANUAL= 2     /* application control */
00101 };
00102 
00103 /*
00104  * Channels are specified by frequency and attributes.
00105  */
00106 struct ieee80211_channel {
00107         u_int16_t       ic_freq;        /* setting in Mhz */
00108         u_int16_t       ic_flags;       /* see below */
00109 };
00110 
00111 #define IEEE80211_CHAN_MAX      255
00112 #define IEEE80211_CHAN_BYTES    32      /* howmany(IEEE80211_CHAN_MAX, NBBY) */
00113 #define IEEE80211_CHAN_ANY      0xffff  /* token for ``any channel'' */
00114 #define IEEE80211_CHAN_ANYC \
00115         ((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
00116 
00117 /* bits 0-3 are for private use by drivers */
00118 /* channel attributes */
00119 #define IEEE80211_CHAN_TURBO    0x0010  /* Turbo channel */
00120 #define IEEE80211_CHAN_CCK      0x0020  /* CCK channel */
00121 #define IEEE80211_CHAN_OFDM     0x0040  /* OFDM channel */
00122 #define IEEE80211_CHAN_2GHZ     0x0080  /* 2 GHz spectrum channel. */
00123 #define IEEE80211_CHAN_5GHZ     0x0100  /* 5 GHz spectrum channel */
00124 #define IEEE80211_CHAN_PASSIVE  0x0200  /* Only passive scan allowed */
00125 #define IEEE80211_CHAN_DYN      0x0400  /* Dynamic CCK-OFDM channel */
00126 #define IEEE80211_CHAN_GFSK     0x0800  /* GFSK channel (FHSS PHY) */
00127 #define IEEE80211_CHAN_XR      0x1000  /* XXX */
00128 
00129 /*
00130  * Useful combinations of channel characteristics.
00131  */
00132 #define IEEE80211_CHAN_FHSS \
00133         (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK)
00134 #define IEEE80211_CHAN_A \
00135         (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM)
00136 #define IEEE80211_CHAN_B \
00137         (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK)
00138 #define IEEE80211_CHAN_PUREG \
00139         (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM)
00140 #define IEEE80211_CHAN_G \
00141         (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
00142 #define IEEE80211_CHAN_T \
00143         (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
00144 #define IEEE80211_CHAN_108G \
00145         (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
00146 
00147 #define IEEE80211_IS_CHAN_FHSS(_c) \
00148         (((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS)
00149 #define IEEE80211_IS_CHAN_A(_c) \
00150         (((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A)
00151 #define IEEE80211_IS_CHAN_B(_c) \
00152         (((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B)
00153 #define IEEE80211_IS_CHAN_PUREG(_c) \
00154         (((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG)
00155 #define IEEE80211_IS_CHAN_G(_c) \
00156         (((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G)
00157 #define IEEE80211_IS_CHAN_T(_c) \
00158         (((_c)->ic_flags & IEEE80211_CHAN_T) == IEEE80211_CHAN_T)
00159 #define IEEE80211_IS_CHAN_108G(_c) \
00160         (((_c)->ic_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G)
00161 
00162 #define IEEE80211_IS_CHAN_2GHZ(_c) \
00163         (((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0)
00164 #define IEEE80211_IS_CHAN_5GHZ(_c) \
00165         (((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0)
00166 #define IEEE80211_IS_CHAN_OFDM(_c) \
00167         (((_c)->ic_flags & IEEE80211_CHAN_OFDM) != 0)
00168 #define IEEE80211_IS_CHAN_CCK(_c) \
00169         (((_c)->ic_flags & IEEE80211_CHAN_CCK) != 0)
00170 #define IEEE80211_IS_CHAN_GFSK(_c) \
00171         (((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0)
00172 
00173 /* ni_chan encoding for FH phy */
00174 #define IEEE80211_FH_CHANMOD    80
00175 #define IEEE80211_FH_CHAN(set,pat)      (((set)-1)*IEEE80211_FH_CHANMOD+(pat))
00176 #define IEEE80211_FH_CHANSET(chan)      ((chan)/IEEE80211_FH_CHANMOD+1)
00177 #define IEEE80211_FH_CHANPAT(chan)      ((chan)%IEEE80211_FH_CHANMOD)
00178 
00179 /*
00180  * 802.11 rate set.
00181  */
00182 #define IEEE80211_RATE_SIZE     8               /* 802.11 standard */
00183 #define IEEE80211_RATE_MAXSIZE  15              /* max rates we'll handle */
00184 
00185 struct ieee80211_rateset {
00186         u_int8_t                rs_nrates;
00187         u_int8_t                rs_rates[IEEE80211_RATE_MAXSIZE];
00188 };
00189 
00190 /* XXX */
00191 #define IEEE80211_MAX_LEN 2304
00192 
00193 #endif /* _NET80211__IEEE80211_H_ */

Generated on Mon Nov 21 15:58:10 2005 for openwifi by  doxygen 1.4.1