diff options
author | sam <sam@FreeBSD.org> | 2007-06-11 03:36:55 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2007-06-11 03:36:55 +0000 |
commit | 6a8b18f11591df29764d02a686661d87559bf7f6 (patch) | |
tree | e13543d4810ca316d27ca22651054eea880c1d34 /sys/net80211/ieee80211_freebsd.h | |
parent | a9a2aaf8ad63975b1a3595ae20df675a7c6336c6 (diff) | |
download | FreeBSD-src-6a8b18f11591df29764d02a686661d87559bf7f6.zip FreeBSD-src-6a8b18f11591df29764d02a686661d87559bf7f6.tar.gz |
Update 802.11 wireless support:
o major overhaul of the way channels are handled: channels are now
fully enumerated and uniquely identify the operating characteristics;
these changes are visible to user applications which require changes
o make scanning support independent of the state machine to enable
background scanning and roaming
o move scanning support into loadable modules based on the operating
mode to enable different policies and reduce the memory footprint
on systems w/ constrained resources
o add background scanning in station mode (no support for adhoc/ibss
mode yet)
o significantly speedup sta mode scanning with a variety of techniques
o add roaming support when background scanning is supported; for now
we use a simple algorithm to trigger a roam: we threshold the rssi
and tx rate, if either drops too low we try to roam to a new ap
o add tx fragmentation support
o add first cut at 802.11n support: this code works with forthcoming
drivers but is incomplete; it's included now to establish a baseline
for other drivers to be developed and for user applications
o adjust max_linkhdr et. al. to reflect 802.11 requirements; this eliminates
prepending mbufs for traffic generated locally
o add support for Atheros protocol extensions; mainly the fast frames
encapsulation (note this can be used with any card that can tx+rx
large frames correctly)
o add sta support for ap's that beacon both WPA1+2 support
o change all data types from bsd-style to posix-style
o propagate noise floor data from drivers to net80211 and on to user apps
o correct various issues in the sta mode state machine related to handling
authentication and association failures
o enable the addition of sta mode power save support for drivers that need
net80211 support (not in this commit)
o remove old WI compatibility ioctls (wicontrol is officially dead)
o change the data structures returned for get sta info and get scan
results so future additions will not break user apps
o fixed tx rate is now maintained internally as an ieee rate and not an
index into the rate set; this needs to be extended to deal with
multi-mode operation
o add extended channel specifications to radiotap to enable 11n sniffing
Drivers:
o ath: add support for bg scanning, tx fragmentation, fast frames,
dynamic turbo (lightly tested), 11n (sniffing only and needs
new hal)
o awi: compile tested only
o ndis: lightly tested
o ipw: lightly tested
o iwi: add support for bg scanning (well tested but may have some
rough edges)
o ral, ural, rum: add suppoort for bg scanning, calibrate rssi data
o wi: lightly tested
This work is based on contributions by Atheros, kmacy, sephe, thompsa,
mlaier, kevlo, and others. Much of the scanning work was supported by
Atheros. The 11n work was supported by Marvell.
Diffstat (limited to 'sys/net80211/ieee80211_freebsd.h')
-rw-r--r-- | sys/net80211/ieee80211_freebsd.h | 68 |
1 files changed, 66 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h index dc4cd95..4b9fc70 100644 --- a/sys/net80211/ieee80211_freebsd.h +++ b/sys/net80211/ieee80211_freebsd.h @@ -29,6 +29,18 @@ #ifdef _KERNEL /* + * Common state locking definitions. + */ +typedef struct mtx ieee80211_com_lock_t; +#define IEEE80211_LOCK_INIT(_ic, _name) \ + mtx_init(&(_ic)->ic_comlock, _name, "802.11 com lock", MTX_DEF) +#define IEEE80211_LOCK_DESTROY(_ic) mtx_destroy(&(_ic)->ic_comlock) +#define IEEE80211_LOCK(_ic) mtx_lock(&(_ic)->ic_comlock) +#define IEEE80211_UNLOCK(_ic) mtx_unlock(&(_ic)->ic_comlock) +#define IEEE80211_LOCK_ASSERT(_ic) \ + mtx_assert(&(_ic)->ic_comlock, MA_OWNED) + +/* * Beacon locking definitions. */ typedef struct mtx ieee80211_beacon_lock_t; @@ -60,7 +72,7 @@ typedef struct mtx ieee80211_node_lock_t; */ typedef struct mtx ieee80211_scan_lock_t; #define IEEE80211_SCAN_LOCK_INIT(_nt, _name) \ - mtx_init(&(_nt)->nt_scanlock, _name, "802.11 scangen", MTX_DEF) + mtx_init(&(_nt)->nt_scanlock, _name, "802.11 node scangen", MTX_DEF) #define IEEE80211_SCAN_LOCK_DESTROY(_nt) mtx_destroy(&(_nt)->nt_scanlock) #define IEEE80211_SCAN_LOCK(_nt) mtx_lock(&(_nt)->nt_scanlock) #define IEEE80211_SCAN_UNLOCK(_nt) mtx_unlock(&(_nt)->nt_scanlock) @@ -165,10 +177,21 @@ int ieee80211_node_dectestref(struct ieee80211_node *ni); struct ifqueue; void ieee80211_drain_ifq(struct ifqueue *); -struct mbuf *ieee80211_getmgtframe(u_int8_t **frm, u_int pktlen); +#define msecs_to_ticks(ms) ((ms)*1000/hz) +#define time_after(a,b) ((long)(b) - (long)(a) < 0) +#define time_before(a,b) time_after(b,a) +#define time_after_eq(a,b) ((long)(a) - (long)(b) >= 0) +#define time_before_eq(a,b) time_after_eq(b,a) + +struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen); +/* tx path usage */ #define M_LINK0 M_PROTO1 /* WEP requested */ #define M_PWR_SAV M_PROTO4 /* bypass PS handling */ #define M_MORE_DATA M_PROTO5 /* more data frames to follow */ +#define M_FF 0x20000 /* fast frame */ +#define M_TXCB 0x40000 /* do tx complete callback */ +/* rx path usage */ +#define M_AMPDU M_PROTO1 /* A-MPDU processing done */ /* * Encode WME access control bits in the PROTO flags. * This is safe since it's passed directly in to the @@ -193,6 +216,17 @@ struct mbuf *ieee80211_getmgtframe(u_int8_t **frm, u_int pktlen); #define M_AGE_GET(m) (m->m_pkthdr.csum_data) #define M_AGE_SUB(m,adj) (m->m_pkthdr.csum_data -= adj) +#define MTAG_ABI_NET80211 1132948340 /* net80211 ABI */ + +struct ieee80211_cb { + void (*func)(struct ieee80211_node *, void *, int status); + void *arg; +}; +#define NET80211_TAG_CALLBACK 0 /* xmit complete callback */ +int ieee80211_add_callback(struct mbuf *m, + void (*func)(struct ieee80211_node *, void *, int), void *arg); +void ieee80211_process_callback(struct ieee80211_node *, struct mbuf *, int); + void get_random_bytes(void *, size_t); struct ieee80211com; @@ -201,6 +235,36 @@ void ieee80211_sysctl_attach(struct ieee80211com *); void ieee80211_sysctl_detach(struct ieee80211com *); void ieee80211_load_module(const char *); + +#define IEEE80211_CRYPTO_MODULE(name, version) \ +static int \ +name##_modevent(module_t mod, int type, void *unused) \ +{ \ + switch (type) { \ + case MOD_LOAD: \ + ieee80211_crypto_register(&name); \ + return 0; \ + case MOD_UNLOAD: \ + case MOD_QUIESCE: \ + if (nrefs) { \ + printf("wlan_##name: still in use (%u dynamic refs)\n",\ + nrefs); \ + return EBUSY; \ + } \ + if (type == MOD_UNLOAD) \ + ieee80211_crypto_unregister(&name); \ + return 0; \ + } \ + return EINVAL; \ +} \ +static moduledata_t name##_mod = { \ + "wlan_" #name, \ + name##_modevent, \ + 0 \ +}; \ +DECLARE_MODULE(wlan_##name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);\ +MODULE_VERSION(wlan_##name, version); \ +MODULE_DEPEND(wlan_##name, wlan, 1, 1, 1) #endif /* _KERNEL */ /* XXX this stuff belongs elsewhere */ |