📄 ieee80211_var.h
字号:
/*- * Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * Alternatively, this software may be distributed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $Id: ieee80211_var.h 3080 2007-12-25 03:15:19Z br1 $ */#ifndef _NET80211_IEEE80211_VAR_H_#define _NET80211_IEEE80211_VAR_H_/* * Definitions for IEEE 802.11 drivers. */#define IEEE80211_DEBUG#undef IEEE80211_DEBUG_REFCNT /* node refcnt stuff */#include <net80211/ieee80211_linux.h>#include <sys/queue.h>#include <net80211/_ieee80211.h>#include <net80211/ieee80211.h>#include <net80211/ieee80211_crypto.h>#include <net80211/ieee80211_ioctl.h> /* for ieee80211_stats */#include <net80211/ieee80211_node.h>#include <net80211/ieee80211_power.h>#include <net80211/ieee80211_proto.h>#include <net80211/ieee80211_scan.h>#define IEEE80211_TXPOWER_MAX 100 /* .5 dBm units */#define IEEE80211_TXPOWER_MIN 0 /* kill radio */#define IEEE80211_DTIM_MAX 15 /* max DTIM period */#define IEEE80211_DTIM_MIN 1 /* min DTIM period */#define IEEE80211_DTIM_DEFAULT 1 /* default DTIM period */#define IEEE80211_BINTVAL_MAX 1000 /* max beacon interval (TU's) */#define IEEE80211_BINTVAL_MIN 25 /* min beacon interval (TU's) */#define IEEE80211_BINTVAL_DEFAULT 100 /* default beacon interval (TU's) */#define IEEE80211_BINTVAL_VALID(_bi) \ ((IEEE80211_BINTVAL_MIN <= (_bi)) && \ ((_bi) <= IEEE80211_BINTVAL_MAX))#define IEEE80211_BINTVAL_SANITISE(_bi) \ (IEEE80211_BINTVAL_VALID(_bi) ? \ (_bi) : IEEE80211_BINTVAL_DEFAULT)#define IEEE80211_BGSCAN_INTVAL_MIN 15 /* min bg scan intvl (secs) */#define IEEE80211_BGSCAN_INTVAL_DEFAULT (5*60) /* default bg scan intvl */#define IEEE80211_BGSCAN_IDLE_MIN 100 /* min idle time (ms) */#define IEEE80211_BGSCAN_IDLE_DEFAULT 250 /* default idle time (ms) */#define IEEE80211_COVERAGE_CLASS_MAX 31 /* max coverage class */#define IEEE80211_REGCLASSIDS_MAX 10 /* max regclass id list */#define IEEE80211_PS_SLEEP 0x1 /* STA is in power saving mode */#define IEEE80211_PS_MAX_QUEUE 50 /* maximum saved packets */#define IEEE80211_XR_BEACON_FACTOR 3 /* factor between xr Beacon interval and normal beacon interval */#define IEEE80211_XR_DEFAULT_RATE_INDEX 0 #define IEEE80211_XR_FRAG_THRESHOLD 540 #define IEEE80211_FIXED_RATE_NONE -1#define IEEE80211_SWBMISS_THRESHOLD 10 /* software beacon miss threshold, in TU's */#define IEEE80211_MS_TO_TU(x) (((x) * 1000) / 1024)#define IEEE80211_TU_TO_MS(x) (((x) * 1024) / 1000)#define IEEE80211_TU_TO_JIFFIES(x) ((IEEE80211_TU_TO_MS(x) * HZ) / 1000)#define IEEE80211_JIFFIES_TO_TU(x) IEEE80211_MS_TO_TU((x) * 1000 / HZ)#define IEEE80211_APPIE_MAX 1024#define IEEE80211_PWRCONSTRAINT_VAL(ic) \ (((ic)->ic_bsschan->ic_maxregpower > (ic)->ic_curchanmaxpwr) ? \ (ic)->ic_bsschan->ic_maxregpower - (ic)->ic_curchanmaxpwr : 0)/* * 802.11 control state is split into a common portion that maps * 1-1 to a physical device and one or more "Virtual AP's" (VAP) * that are bound to an ieee80211com instance and share a single * underlying device. Each VAP has a corresponding OS device * entity through which traffic flows and that applications use * for issuing ioctls, etc. *//* * Data common to one or more virtual AP's. State shared by * the underlying device and the net80211 layer is exposed here; * e.g. device-specific callbacks. */struct ieee80211vap;struct ieee80211com { struct net_device *ic_dev; /* associated device */ ieee80211com_lock_t ic_comlock; /* state update lock */ ieee80211com_lock_t ic_vapslock; /* vap state machine lock */ TAILQ_HEAD(, ieee80211vap) ic_vaps; /* list of vap instances */ enum ieee80211_phytype ic_phytype; /* XXX wrong for multi-mode */ enum ieee80211_opmode ic_opmode; /* operation mode */ struct ifmedia ic_media; /* interface media config */ u_int8_t ic_myaddr[IEEE80211_ADDR_LEN]; struct timer_list ic_inact; /* mgmt/inactivity timer */ u_int32_t ic_flags; /* state flags */ u_int32_t ic_flags_ext; /* extension of state flags */ u_int32_t ic_caps; /* capabilities */ u_int8_t ic_ath_cap; /* Atheros adv. capabilities */ u_int8_t ic_promisc; /* vap's needing promisc mode */ u_int8_t ic_allmulti; /* vap's needing all multicast*/ u_int8_t ic_nopened; /* vap's been opened */ struct ieee80211_rateset ic_sup_rates[IEEE80211_MODE_MAX]; struct ieee80211_rateset ic_sup_xr_rates; struct ieee80211_rateset ic_sup_half_rates; struct ieee80211_rateset ic_sup_quarter_rates; u_int16_t ic_modecaps; /* set of mode capabilities */ u_int16_t ic_curmode; /* current mode */ u_int16_t ic_lintval; /* beacon interval */ u_int16_t ic_holdover; /* PM hold over duration */ u_int16_t ic_bmisstimeout; /* beacon miss threshold (ms) */ unsigned long ic_bmiss_guard; /* when to cease ignoring bmiss (jiffies) */ u_int16_t ic_txpowlimit; /* global tx power limit (in 0.5 dBm) */ u_int16_t ic_newtxpowlimit; /* tx power limit to change to (in 0.5 dBm) */ u_int16_t ic_uapsdmaxtriggers; /* max triggers that could arrive */ u_int8_t ic_coverageclass; /* coverage class */ /* * Channel state: * * ic_channels is the set of available channels for the device; * it is setup by the driver * ic_nchans is the number of valid entries in ic_channels * ic_chan_avail is a bit vector of these channels used to check * whether a channel is available w/o searching the channel table. * ic_chan_active is a (potentially) constrained subset of * ic_chan_avail that reflects any mode setting or user-specified * limit on the set of channels to use/scan * ic_curchan is the current channel the device is set to; it may * be different from ic_bsschan when we are off-channel scanning * or otherwise doing background work * ic_bsschan is the channel selected for operation; it may * be undefined (IEEE80211_CHAN_ANYC) * ic_prevchan is a cached ``previous channel'' used to optimize * lookups when switching back+forth between two channels * (e.g. for dynamic turbo) */ int ic_nchans; /* # entries in ic_channels */ struct ieee80211_channel ic_channels[IEEE80211_CHAN_MAX+1]; u_int8_t ic_chan_avail[IEEE80211_CHAN_BYTES]; u_int8_t ic_chan_active[IEEE80211_CHAN_BYTES]; struct ieee80211_channel *ic_curchan; /* current channel */ struct ieee80211_channel *ic_bsschan; /* bss channel */ struct ieee80211_channel *ic_prevchan; /* previous channel */ int16_t ic_channoise; /* current channel noise in dBm */ /* regulatory class ids */ u_int ic_nregclass; /* # entries in ic_regclassids */ u_int8_t ic_regclassids[IEEE80211_REGCLASSIDS_MAX]; /* scan-related state */ struct ieee80211_scan_state *ic_scan; /* scan state */ enum ieee80211_roamingmode ic_roaming; /* roaming mode */ unsigned long ic_lastdata; /* time of last data frame */ unsigned long ic_lastscan; /* time last scan completed */ /* NB: this is the union of all vap stations/neighbors */ struct ieee80211_node_table ic_sta; /* stations/neighbors */ /* XXX multi-bss: split out common/vap parts? */ struct ieee80211_wme_state ic_wme; /* WME/WMM state */ /* XXX multi-bss: can per-vap be done/make sense? */ enum ieee80211_protmode ic_protmode; /* 802.11g protection mode */ u_int16_t ic_nonerpsta; /* # non-ERP stations */ u_int16_t ic_longslotsta; /* # long slot time stations */ u_int16_t ic_sta_assoc; /* stations associated */ u_int16_t ic_dt_sta_assoc; /* dturbo capable stations */ u_int16_t ic_xr_sta_assoc; /* XR stations associated */ /* * Spectrum Management. */ u_int16_t ic_country_code; int ic_country_outdoor; struct ieee80211_ie_country ic_country_ie; /* country info element */ /* * current channel max power, used to compute Power Constraint IE. * * NB: local power constraint depends on the channel, but assuming it must * be detected dynamically, we cannot maintain a table (i.e., will not * know value until change to channel and detect). */ u_int8_t ic_curchanmaxpwr; u_int8_t ic_chanchange_tbtt; u_int8_t ic_chanchange_chan; /* virtual ap create/delete */ struct ieee80211vap *(*ic_vap_create)(struct ieee80211com *, const char *, int, int, int, struct net_device *); void (*ic_vap_delete)(struct ieee80211vap *); /* send/recv 802.11 management frame */ int (*ic_send_mgmt)(struct ieee80211_node *, int, int); void (*ic_recv_mgmt)(struct ieee80211_node *, struct sk_buff *, int, int, u_int32_t); /* send management frame to driver, like hardstart */ int (*ic_mgtstart)(struct ieee80211com *, struct sk_buff *); /* reset device state after 802.11 parameter/state change */ int (*ic_init)(struct net_device *);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -