Commit Graph

67 Commits

Author SHA1 Message Date
Sam Leffler
6a76ae216e Add modes for 1/2 and 1/4-width channels so we have separate roaming
and xmit parameters.  This makes it possible to use tdma on fractional
channels.
o add IEEE80211_MODE_HALF and IEEE80211_MODE_QUARTER; note these are
  band-agnostic (may need revisiting)
o setup all default rates in ic_sup_rates instead of doing it only
  for active modes; we need these to calculate the default tx parameters
  which are not recalculated after a regulatory update (can't just
  recalculate after installing a new channel list because we might
  clobber user settings)
o remove special case code in ieee80211_get_suprates; this is now
  a candidate for an inline or removal
o add various entries for new modes (roaming+tx params, wme, rate
  mapping, scan set setup, country ie construction, tdma, basic rates)

Note these modes are intentionally not visible through if_media.
2009-02-19 05:21:54 +00:00
Sam Leffler
566d825ba7 check ptr against NULL 2009-02-19 04:34:22 +00:00
Sam Leffler
40432d369a instead of special casing lookups for the 11na/g legacy rate set, just
install the rates once when creating the com structure
2009-02-19 04:33:36 +00:00
Sam Leffler
d3f5f855e8 remove ic_stats; it was intended to accumulate stats from vaps as they
were reaped but was never used and is inaccessible
2009-02-13 05:31:18 +00:00
Andrew Thompson
ae55932e23 Add a ieee80211_waitfor_parent() function that will wait for all deferred
parent interface tasks to complete. This had been added to the ioctl path but
it is also need elsewhere like detach so its safe to teardown.

Reported by:	Hans Petter Selasky
Submitted by:	sam
2009-02-12 18:57:18 +00:00
Sam Leffler
c3f10abd7e When crafting a media setting w/ an auto (non-fixed) rate mask out the
turbo option in addition to the mode bits; otherwise if the current
channel is a turbo mode channel we'll form an invalid media setting
and the ifmedia_set operation in vap_attach will panic.

While here use C99-style initialization for an array indexed by mode;
this makes it consistent w/ other usage and avoids breakage if we
should ever change the set of modes.
2009-02-03 22:32:26 +00:00
Sam Leffler
8500d65d94 setup default rate set for static turbo mode 2009-01-29 23:09:12 +00:00
Sam Leffler
9c2c544d8d fill in ieee channel #'s and max tx power for drivers that work exclusively
with frequencies; this mimics how ieee80211_setregdomain works
2009-01-27 22:48:46 +00:00
Sam Leffler
10ad9a77f3 TDMA support for long distance point-to-point links using ath devices:
o add net80211 support for a tdma vap that is built on top of the
  existing adhoc-demo support
o add tdma scheduling of frame transmission to the ath driver; it's
  conceivable other devices might be capable of this too in which case
  they can make use of the 802.11 protocol additions etc.
o add minor bits to user tools that need to know: ifconfig to setup and
  configure, new statistics in athstats, and new debug mask bits

While the architecture can support >2 slots in a TDMA BSS the current
design is intended (and tested) for only 2 slots.

Sponsored by:	Intel
2009-01-08 17:12:47 +00:00
Sam Leffler
31378b1c87 Fix definition of IEEE80211_CHAN_MAX; it was defined as 255 but
really was meant to be 256.  Adjust usage accordingly and replace
bogus usage of this value in checking IEEE channel #'s.

NB: this causes an ABI change; ifconfig must be recompiled
2008-12-15 01:26:33 +00:00
Sam Leffler
ae3f00bbfd honor IEEE80211_CLONE_NOBEACONS for type of vap, not just a sta mode vap 2008-10-25 23:43:08 +00:00
Sam Leffler
f945bd7aa9 o add support for ifconfig wlanX mode foo
o yank useless code for setting fixed rate through media opts: this
  mechanism didn't scale to HT rates and couldn't handle multiple bands;
  fixed tx rates are set with the IEEE80211_IOC_TXPARAMS ioctl
2008-10-25 23:31:20 +00:00
Brooks Davis
d3c4cf45ba Replace a line matching /^ $/ with one matching /^$/.
Obtained from:	//depot/projects/vimage-commit2/...
2008-09-03 20:33:11 +00:00
Weongyo Jeong
b20f0ed118 free ifp allocated at ieee80211_vap_setup.
Reviewed by:	sam, thompsa
2008-09-02 04:49:35 +00:00
Sam Leffler
978359b3f6 Revise lock name handling:
o construct a name for the com lock as done for other locks
o pass the device name to IEEE80211_LOCK_INIT so the mtx name
  is constructed as foo_com_lock
o introduce *_LOCK_OBJ macro's to hide the lock contents and
  minimize redundant code
2008-05-28 23:10:53 +00:00
Sam Leffler
c43feede8b Minor cleanup of vap create work:
o add IEEE80211_C_STA capability to indicate sta mode is supported
  (was previously assumed) and mark drivers as capable
o add ieee80211_opcap array to map an opmode to the equivalent capability bit
o move IEEE80211_C_OPMODE definition to where capabilities are defined so it's
  clear it should be kept in sync (on future additions)
o check device capabilities in clone create before trying to create a vap;
  this makes driver checks unneeded
o make error codes return on failed clone request unique
o temporarily add console printfs on clone request failures to aid in
  debugging; these will move under DIAGNOSTIC or similar before release
2008-05-12 00:15:30 +00:00
Sam Leffler
bb77492f68 use c99-style initialization for ieee80211_phymode_name 2008-05-11 23:33:56 +00:00
Sam Leffler
82fd2577a8 add DFS capability bit and use it to auto-enable DFS support 2008-05-11 23:32:07 +00:00
Sam Leffler
a239061a54 re-enable WME by default; after a full day of testing on iwi I see no
issues and the only way we'll identify them is for people to use it
2008-05-01 03:49:59 +00:00
Sam Leffler
bfa82ae8b0 disable default enabling of WME until we resolve driver regressions 2008-04-30 16:05:57 +00:00
Sam Leffler
0095127918 hookup the parent device's if_input and if_output to stub routines
to catch unintended use (one might argue about if_output but it's
behaviour is ill-defined without vap context)

Noticed by:	Paul B. Mahol
2008-04-25 19:45:42 +00:00
Sam Leffler
b032f27c36 Multi-bss (aka vap) support for 802.11 devices.
Note this includes changes to all drivers and moves some device firmware
loading to use firmware(9) and a separate module (e.g. ral).  Also there
no longer are separate wlan_scan* modules; this functionality is now
bundled into the wlan module.

Supported by:	Hobnob and Marvell
Reviewed by:	many
Obtained from:	Atheros (some bits)
2008-04-20 20:35:46 +00:00
Kip Macy
2de2af32a0 Add padding for anticipated functionality
- vimage
 - TOE
 - multiq
 - host rtentry caching

Rename spare used by 80211 to if_llsoftc

Reviewed by: rwatson, gnn
MFC after: 1 day
2007-12-07 01:46:13 +00:00
Sam Leffler
a557c018f5 add ieee80211_find_channel_byieee to lookup a channel by ieee channel #
Reviewed by:	thompsa
MFC after:	1 week
2007-11-23 05:57:20 +00:00
Sam Leffler
ab562eef00 invalidate ic_prevchan when constructing a new channel list
Approved by:	re (blanket wireless)
2007-09-18 21:54:27 +00:00
Sam Leffler
7edb9e0a7f skip IEEE80211_MODE_AUTO in announcing supported rates in ieee80211_announce;
there won't be any

Approved by:	re (blanket wireless)
2007-09-18 20:51:55 +00:00
Sam Leffler
f0ee92d585 o add IEEE80211_RATE_MCS to use instead of naked constant (for marking MCS)
o correct ieee80211_rate2media handling of MCS
o correct rate HT announcements for 11n devices

Approved by:	re (blanket wireless)
2007-09-18 20:46:36 +00:00
Sam Leffler
95032ab129 remove IFM_IEEE80211_HT40PLUS and IFM_IEEE80211_HT40MINUS; they
never got used so nuke 'em before we branch

Approved by:	re (blanket wireless)
2007-09-18 20:30:40 +00:00
Sam Leffler
68e8e04e93 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.
2007-06-11 03:36:55 +00:00
Sam Leffler
ae8b733312 copyright updates:
o update to include 2007
o switch back to a 2-clause bsd-only license

Reviewed by:	onoe
2007-06-06 04:56:04 +00:00
Sam Leffler
6dbd16f1cc change ic_modecaps to a bit vector and use setbit, et. al. 2007-03-11 22:37:32 +00:00
Sam Leffler
11df4239a6 change ieee80211_mhz2ieee to use the PSB mapping when the frequency
falls in the proper place, not when we're handed a 1/2 or 1/4-rate channel

MFC after:	2 weeks
2007-03-11 06:24:26 +00:00
Sam Leffler
ca4ac7ae14 Add initial support for 900MHz cards like the Ubiquiti SR9:
o add channel flag to enable freq <-> ieee channel # mapping (can
  go away in the future when ieee number is precomputed)
o add mapping between 900mhz freq's and channel #'s that gives a
  unique channel # for each half/quarter/full width channel
o remove assumptions that half/quarter rate channels on happen in 11a
o remove assumptions that all 11g channels are full width
o ensure ic_curchan is reset on mode change so changing the channel
  list (e.g. on countrycode change) doesn't leave curchan set to an
  invalid channel

There is still an issue with switching rate sets; to be fixed separately.

MFC after:	1 month
2007-01-15 01:12:28 +00:00
Matt Jacob
38da14963f Fix compile error. 2007-01-06 05:38:18 +00:00
Sam Leffler
45fa8b0e9a o unbreak rate set defaulting
o mark 11g mode support on finding 11g or pure 11g (OFDM-only)
  channels; was requiring pure 11g which caused some contortions
  in drivers that manually setup their channel lists
2006-12-28 01:31:26 +00:00
Sam Leffler
41b3c790eb First cut at half/quarter-rate 11a channel support (e.g. for use
in the Public Safety Band):
o add channel flags to identify half/quarter-rate operation
o add rate sets (need to check spec on 4Mb/s in 1/4 rate)
o add if_media definitions for new rates
o split net80211 channel setup out into ieee80211_chan_init
o fixup ieee80211_mhz2ieee and ieee80211_ieee2mhz to understand half/quarter
  rate channels: note we temporarily use a nonstandard/hack numbering that
  avoids overlap with 2.4G channels because we don't (yet) have enough
  state to identify and/or map overlapping channel sets
o fixup ieee80211_ifmedia_init so it can be called post attach and will
  recalculate the channel list and associated state; this enables changing
  channel-related state like the regulatory domain after attach (will be
  needed for 802.11d support too)
o add ieee80211_get_suprates to return a reference to the supported rate
  set for a given channel
o add 3, 4.5, and 27 MB/s tx rates to rate <-> media conversion routines
o const-poison channel arg to ieee80211_chan2mode
2006-12-27 18:46:18 +00:00
Sam Leffler
aadecb1ac8 Default the rate sets for 802.11 operating modes so drivers aren't
required to.  Note this only happens when drivers don't set them
up before calling ieee80211_ifattach so this change is backwards
compatible.

MFC after:	1 month
2006-11-26 22:48:03 +00:00
Sam Leffler
246b546762 add support for 802.11 packet injection via bpf
Together with:	Andrea Bittau <a.bittau@cs.ucl.ac.uk>
Reviewed by:	arch@
MFC after:	1 month
2006-07-26 03:15:16 +00:00
Sam Leffler
9cab5ba3f9 back out public safety-specific channel number mapping; we can't do
it until we know it should be applied as otherwise we can map 11a
channels into the 2.4G range and choose the wrong item from the
chanenl array
2006-04-26 16:00:37 +00:00
Sam Leffler
97bcffbd74 o make driver override of net80211 parameter state consistent
with methods: instead of honoring non-zero values expect drivers
  to write their own values on return from ieee80211_ifattach
o add a define for the default h/w bmiss count

MFC after:	2 weeks
2006-02-14 17:48:56 +00:00
Sam Leffler
233e00212e switch beacon miss threshold from a time to the number of beacon
frames; the time value was implicitly based on the beacon interval
but never being updated so wrong when the negotiated beacon interval
was not 100 TU
2006-01-23 20:57:30 +00:00
Sam Leffler
399178c917 correct checking for turbo channels: rev 1.24 fixed static turbo channels
but broke handling of the turboG channel; since we aren't ready to revamp
the channel list just check for turboA channels for now so channel 6 is
considered in auto mode

Noticed by:	gibbs
2005-12-30 00:40:36 +00:00
Sam Leffler
c27e4e31fe make packet bursting configurable (default to on if device is capable) 2005-12-14 19:32:53 +00:00
Sam Leffler
6cfac1074c o correct auto mode logic for avoiding turbo channels
o correct assumption that a static turbo channel is also
  usable in 11a; the opposite is true

MFC after:	1 week
2005-12-12 18:38:20 +00:00
Sam Leffler
6f322b78de Update ieee80211_mhz2ieee to understand public safety bands and spectrum
that can potentially be mapped to negative ieee #'s.

NB: before operation on the latter can be supported we need to cleanup
    various code that assumes ieee channel #'s are >= 0
2005-11-15 05:56:32 +00:00
Sam Leffler
b5c9941514 Clarify/fix handling of the current channel:
o add ic_curchan and use it uniformly for specifying the current
  channel instead of overloading ic->ic_bss->ni_chan (or in some
  drivers ic_ibss_chan)
o add ieee80211_scanparams structure to encapsulate scanning-related
  state captured for rx frames
o move rx beacon+probe response frame handling into separate routines
o change beacon+probe response handling to treat the scan table
  more like a scan cache--look for an existing entry before adding
  a new one; this combined with ic_curchan use corrects handling of
  stations that were previously found at a different channel
o move adhoc neighbor discovery by beacon+probe response frames to
  a new ieee80211_add_neighbor routine

Reviewed by:	avatar
Tested by:	avatar, Michal Mertl
MFC after:	2 weeks
2005-08-10 16:22:30 +00:00
Sam Leffler
d365f9c760 Cleanup beacon/listen interval handling:
o separate configured beacon interval from listen interval; this
  avoids potential use of one value for the other (e.g. setting
  powersavesleep to 0 clobbers the beacon interval used in hostap
  or ibss mode)
o bounds check the beacon interval received in probe response and
  beacon frames and drop frames with bogus settings; not clear
  if we should instead clamp the value as any alteration would
  result in mismatched sta+ap configuration and probably be more
  confusing (don't want to log to the console but perhaps ok with
  rate limiting)
o while here up max beacon interval to reflect WiFi standard

Noticed by:	Martin <nakal@nurfuerspam.de>
MFC after:	1 week
2005-08-08 03:30:57 +00:00
Sam Leffler
2c39b32c94 diff reduction against p4: define IEEE80211_FIXED_RATE_NONE and use
it instead of -1
2005-07-22 16:50:18 +00:00
Sam Leffler
badaf7bbb2 supply a default ic_reset method for drivers; the ioctl code expect this
method to always be setup

Submitted by:	Tai-hwa Liang
2005-01-27 17:39:17 +00:00
Sam Leffler
acc4f7f50c statically allocate the station/neighbor node table; the deferred
allocation scheme introduced a race condition during device state
transitions
2005-01-24 19:32:10 +00:00