summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_proto.c
Commit message (Collapse)AuthorAgeFilesLines
* if_start() is being used here as a way of kick-starting the new queueadrian2012-12-221-0/+5
| | | | | | processing. For if_transmit() style hardware drivers (which none publicly exist yet, for wireless) they will need to still implement if_start() but only to re-start the TX queue.
* Update the aggressive mode logic to also enable aggressive modeadrian2012-12-101-8/+50
| | | | | | | | | | | | parameters in IBSSes. IBSS was just being plainly ignored here even though aggressive mode was 'on'. This still doesn't fix the "why are the WME parameters reset upon interface down/up" issue. PR: kern/165969
* Create a new task to handle 802.11n channel width changes.adrian2012-03-251-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a channel width change updates the 802.11n HT info data in net80211 but it doesn't trigger any device changes. So the device driver may decide that HT40 frames can be transmitted but the last device channel set only had HT20 set. Now, a task is scheduled so a hardware reset or change isn't done during any active ongoing RX. It also means that it's serialised with the other task operations (eg channel change.) This isn't the final incantation of this work, see below. For now, any unmodified drivers will simply receive a channel change log entry. A subsequent patch to ath(4) will introduce some basic channel change handling (by resetting the NIC.) Other NICs may need to update their rate control information. TODO: * There's still a small window at the present moment where the channel width has been updated but the task hasn't been fired. The final version of this should likely pass in a channel width field to the driver and let the driver atomically do whatever it needs to before changing the channel. PR: kern/166286
* Although it's documented that the vap newstate call can drop theadrian2012-02-241-0/+6
| | | | | | | | comlock, I'd like to find and analyse these cases to see if they really are valid. So, throw in a lock here and wait for the (hopefully!) inevitable complaints.
* Fix a panic in the wifi stack when a software beacon miss occurs in the ↵adrian2011-10-021-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | wrong state. The ieee80211_swbmiss() callout is not called with the ic lock held, so it's quite possible the scheduler will run the callout during a state change. This patch: * changes the swbmiss callout to be locked by the ic lock * enforces the ic lock being held across the beacon vap functions by grabbing it inside beacon_miss() and beacon_swmiss(). This ensures that the ic lock is held (and thus the VAP state stays constant) during beacon miss and software miss processing. Since the callout is removed whilst the ic lock is held, it also ensures that the ic lock can't be called during a state change or exhibit any race conditions seen above. Both Edgar and Joel report that this patch fixes the crash and doesn't introduce new issues. Reported by: Edgar Martinez <emartinez@kbcnetworks.com> Reported by: Joel Dahl <joel@vnode.se> Reported by: emaste
* Fix brokenness introduced by my last commit.adrian2011-07-201-0/+2
| | | | Approved by: re (implicit)
* This sets the BSS channel for each VAP for the given interface.adrian2011-07-191-0/+15
| | | | | | | | | It's only relevant in STA mode. The CSA forces a channel switch for the interface, but doesn't update the VAP channel. Approved by: re (bz)
* Fix a WME corner case found by the FreeBSD 802.11n testing crew.adrian2011-03-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The symptom: sometimes 11n (and non-11n) throughput is great. Sometimes it isn't. Much teeth gnashing occured, and much kernel bisecting happened, until someone figured out it was the order of which things were rebooted, not the kernel versions. (Which was great news to me, it meant that I hadn't broken if_ath.) What we found was that sometimes the WME parameters for the best-effort queue had a burst window ("txop") in which the station would be allowed to TX as many packets as it could fit inside that particular burst window. This improved throughput. After initially thinking it was a bug - the WME parameters for the best-effort queue -should- have a txop of 0, Bernard and I discovered "aggressive mode" in net80211 - where the WME BE queue parameters are changed if there's not a lot of high priority traffic going on. The WME parameters announced in the association response and beacon frames just "change" based on what the current traffic levels are. So in fact yes, the STA was acutally supposed to be doing this higher throughput stuff as it's just meant to be configuring things based on the WME parameters - but it wasn't. What was eventually happening was this: * at startup, the wme qosinfo count field would be 0; * it'd be parsed in ieee80211_parse_wmeparams(); * and it would be bumped (to say 10); * .. and the WME queue parameters would be correctly parsed and set. But then, when you restarted the assocation (eg hostap goes away and comes back with the same qosinfo count field of 10, or if you destroy the sta VIF and re-create it), the WME qosinfo count field - which is associated not to the VIF, but to the main interface - wouldn't be cleared, so the queue default parameters would be used (which include no burst setting for the BE queue) and would remain that way until the hostap qosinfo count field changed, or the STA was actually rebooted. This fix simply cleares the wme capability field (which has the count field) to 0, forcing it to be reset by the next received beacon. Thanks go to Milu for finding it and helping me track down what was going on, and Bernard Schmidt for working through the net80211 and WME specific magic.
* Add a new mgmt subtype "ACTION NO ACK" defined in 802.11n-2009, while herebschmidt2011-02-211-1/+1
| | | | | | | | | clean up parts of the *_recv_mgmt() functions. - make sure appropriate counters are bumped and debug messages are printed - order the unhandled subtypes by value and add a few missing ones - fix some whitespace nits - remove duplicate code in adhoc_recv_mgmt() - remove a useless comment, probably left in while c&p
* Default to the lowest negotiated rate for mgmt/multicast traffic in 11n modeadrian2011-02-211-0/+18
| | | | | | | | | | The current code transmits management and multicast frames at MCS 0. What it should do is check whether the negotiated basic set is zero (and the MCS set is not) before making this decision. For now, simply default to the lowest negotiated rate, rather than MCS 0. This fixes the behaviour with at least the DLINK DIR-825, which ACKs but silently ignores block-ack (BA) response frames.
* fixes a broken software beacon miss handler. There is a race to checkweongyo2010-03-141-2/+0
| | | | | | | vap->iv_bmiss_count == 0 in ieee80211_swbmiss because iv_swbmiss_task is enqueued by taskqueue. Reviewed by: rpaulo
* Implementation of the upcoming Wireless Mesh standard, 802.11s, on therpaulo2009-07-111-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | net80211 wireless stack. This work is based on the March 2009 D3.0 draft standard. This standard is expected to become final next year. This includes two main net80211 modules, ieee80211_mesh.c which deals with peer link management, link metric calculation, routing table control and mesh configuration and ieee80211_hwmp.c which deals with the actually routing process on the mesh network. HWMP is the mandatory routing protocol on by the mesh standard, but others, such as RA-OLSR, can be implemented. Authentication and encryption are not implemented. There are several scripts under tools/tools/net80211/scripts that can be used to test different mesh network topologies and they also teach you how to setup a mesh vap (for the impatient: ifconfig wlan0 create wlandev ... wlanmode mesh). A new build option is available: IEEE80211_SUPPORT_MESH and it's enabled by default on GENERIC kernels for i386, amd64, sparc64 and pc98. Drivers that support mesh networks right now are: ath, ral and mwl. More information at: http://wiki.freebsd.org/WifiMesh Please note that this work is experimental. Also, please note that bridging a mesh vap with another network interface is not yet supported. Many thanks to the FreeBSD Foundation for sponsoring this project and to Sam Leffler for his support. Also, I would like to thank Gateworks Corporation for sending me a Cambria board which was used during the development of this project. Reviewed by: sam Approved by: re (kensmith) Obtained from: projects/mesh11s
* o station mode channel switch supportsam2009-06-041-9/+28
| | | | | | | | | | o IEEE80211_IOC_CHANSWITCH fixups: - restrict to hostap vaps - return EOPNOTSUPP instead of EINVAL when applied to !hostap vap or to a vap w/o 11h enabled - interpret count of 0 to mean cancel the current CSA Reviewed by: rpaulo, avatar
* remove another vestige of the null if_softc on detach hacksam2009-06-021-16/+6
|
* Overhaul monitor mode handling:sam2009-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | o replace DLT_IEEE802_11 support in net80211 with DLT_IEEE802_11_RADIO and remove explicit bpf support from wireless drivers; drivers now use ieee80211_radiotap_attach to setup shared data structures that hold the radiotap header for each packet tx/rx o remove rx timestamp from the rx path; it was used only by the tdma support for debugging and was mostly useless due to it being 32-bits and mostly unavailable o track DLT_IEEE80211_RADIO bpf attachments and maintain per-vap and per-com state when there are active taps o track the number of monitor mode vaps o use bpf tap and monitor mode vap state to decide when to collect radiotap state and dispatch frames; drivers no longer explicitly directly check bpf state or use bpf calls to tap frames o handle radiotap state updates on channel change in net80211; drivers should not do this (unless they bypass net80211 which is almost always a mistake) o update various drivers to be more consistent/correct in handling radiotap o update ral to include TSF in radiotap'd frames o add promisc mode callback to wi Reviewed by: cbzimmer, rpaulo, thompsa
* Cancel the scan when going to INIT state. Should do this for other states herethompsa2009-05-101-0/+2
| | | | too as once the protocol newstate handler runs the scan has always ended.
* Relax the condition for printing the lost state transition message. The newthompsa2009-05-031-10/+12
| | | | | state will be set before the EXT_STATEWAIT flag is cleared and its ok to transition again at that point.
* Create a taskqueue for each wireless interface which provides a serialisedthompsa2009-05-021-44/+171
| | | | | | | | | | | | | | | | | | | | | | | sleepable context for net80211 driver callbacks. This removes the need for USB and firmware based drivers to roll their own code to defer the chip programming for state changes, scan requests, channel changes and mcast/promisc updates. When a driver callback completes the hardware state is now guaranteed to have been updated and is in sync with net80211 layer. This nukes around 1300 lines of code from the wireless device drivers making them more readable and less race prone. The net80211 layer has been updated as follows - all state/channel changes are serialised on the taskqueue. - ieee80211_new_state() always queues and can now be called from any context - scanning runs from a single taskq function and executes to completion. driver callbacks are synchronous so the channel, phy mode and rx filters are guaranteed to be set in hardware before probe request frames are transmitted. Help and contributions from Sam Leffler. Reviewed by: sam
* split Atheros SuperG support out into it's own file that's included onlysam2009-03-241-33/+0
| | | | with a new IEEE80211_SUPPORT_SUPERG option
* o reset aggressive mode flag; it was being left set after marking ansam2009-02-201-1/+2
| | | | | interface down o only allow the first vap to initialize shared wme parameters
* misc cleanup of wme parameter settingsam2009-02-201-63/+46
|
* Add modes for 1/2 and 1/4-width channels so we have separate roamingsam2009-02-191-0/+20
| | | | | | | | | | | | | | | | | | 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.
* use c99 initializerssam2009-02-191-101/+101
|
* o consolidate loops to eliminate assumptions about ordering of modessam2009-02-191-13/+10
| | | | o replace 0x80 by IEEE80211_RATE_MCS
* Add a ieee80211_waitfor_parent() function that will wait for all deferredthompsa2009-02-121-0/+15
| | | | | | | | 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
* convert MALLOC/FREE to malloc/freesam2008-12-181-1/+1
|
* Revert the removal of the MALLOC and FREE macros from the net80211 code.des2008-10-231-1/+1
| | | | Requested by: sam
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-231-1/+1
| | | | MFC after: 3 months
* Add ieee80211_suspend_all and ieee80211_resume_all forsam2008-05-281-0/+40
| | | | brute force suspend/resume handling of vaps.
* ignore sw beacon miss while scanning, just reset the beacon count and timersam2008-05-221-1/+18
| | | | Reviewed by: thompsa
* Multi-bss (aka vap) support for 802.11 devices.sam2008-04-201-475/+776
| | | | | | | | | | | 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)
* update default wme parameters to latest WiFi test planssam2007-11-231-24/+24
| | | | | Reviewed by: Allan Lim MFC after: 3 days
* sync 11n support with vap code base; many changes based on interopsam2007-11-021-1/+3
| | | | | | testing with all major vendors MFC after: 1 week
* don't try to re-associate after a parameter change, too many ap'ssam2007-11-021-11/+1
| | | | | | | don't do this right; instead go to the scan cache so we pass through auth state (if the cache is warm we can do this w/o an actual scan) MFC after: 1 week
* mgmt subtype 13 is actionsam2007-09-181-1/+1
| | | | | Approved by: re (blanket wireless) MFC after: 2 weeks
* Update beacon handling to sync w/ vap code base:sam2007-09-171-1/+7
| | | | | | | | | | | | | | | | | | | o add driver callback to handle notification of beacon changes; this is required for devices that manage beacon frames themselves (devices must override the default handler which does nothing) o move beacon update-related flags from ieee80211com to the beacon offsets storage (or handle however a driver wants) o expand beacon offsets structure with members needed for 11h/dfs and appie's o change calling convention for ieee80211_beacon_alloc and ieee80211_beacon_update o add overlapping bss support for 11g; requires driver to pass beacon frames from overlapping bss up to net80211 which is not presently done by any driver o move HT beacon contents update to a routine in the HT code area Reviewed by: avatar, thompsa, sephe Approved by: re (blanket wireless)
* o add 802.11 state machine states for DFS and client-side power savesam2007-09-051-1/+16
| | | | | | | o fixup drivers to ignore new states Reviewed by: avatar (?) Approved by: re (blanket wireless)
* Correct state machine handling of AUTH -> AUTH transitions that passsam2007-06-161-0/+1
| | | | | | | | through wpa_supplcant. If a sta is deauth'd (e.g. due to inactivity) with roaming mode set to manual then a subsequent MLME assoc request will be incorrectly handled and the station will never reauthenticate. To fix this interpret a reason code of zero as sufficient to send an auth request frame.
* Update 802.11 wireless support:sam2007-06-111-151/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* copyright updates:sam2007-06-061-7/+1
| | | | | | | o update to include 2007 o switch back to a 2-clause bsd-only license Reviewed by: onoe
* change ieee80211_fix_rate to take a rate set instead of usingsam2007-03-111-3/+2
| | | | | | ni_rates; this lets us re-use the code to check 11n HT rates MFC after: 2 weeks
* add ieee80211_opmode_name array for mapping the opmode to a stringsam2007-03-071-0/+10
| | | | | | for printing diagnostic msgs MFC after: 2 weeks
* Fix potential node refcnt leak. If mbufs are q'd on ic_mgtq whensam2007-01-081-7/+9
| | | | | | | | | | the state machine clocks to INIT, node references are not reclaimed. Add a new routine ieee80211_drain_ifq that does this and use it instead of IF_DRAIN. Submitted by: Sepherosa Ziehau Obtained from: DragonFly MFC after: 1 month
* Correct several issues with rate set negotiation:sam2007-01-081-33/+32
| | | | | | | | | | | | | | | | | | | | o add IEEE80211_F_JOIN flag to ieee80211_fix_rate to indicate a station is joining a BSS; this is used to control whether or not we over-write the basic rate bit in the calculated rate set o fix ieee80211_fix_rate to honor IEEE80211_F_DODEL when IEEE80211_F_DONEGO is not specified (e.g. when joining an ibss network) o on sta join always delete unusable rates from the negotiated rate set, this was being done only ibss networks but is also needed for 11g bss with mixed stations o on sta join delete unusable rates from the bss node's rate set, not the scan table entry's rate set o when calculating a rate set for new neighbors in an ibss caculate a negotiated rate set so drivers are not presented with rates they should not use Submitted by: Sepherosa Ziehau (w/ modifications) Obtained from: DragonFly MFC after: 1 month
* First cut at half/quarter-rate 11a channel support (e.g. for usesam2006-12-271-2/+3
| | | | | | | | | | | | | | | | | | | | 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
* add support for 802.11 packet injection via bpfsam2006-07-261-0/+1
| | | | | | Together with: Andrea Bittau <a.bittau@cs.ucl.ac.uk> Reviewed by: arch@ MFC after: 1 month
* fix switching between agressive and non-agressive wmm modessam2006-03-101-2/+2
| | | | | Obtained from: atheros MFC after: 3 days
* when scanning channels marked passive defer probe request untilsam2006-03-061-12/+4
| | | | | | | 802.11 traffic is seen; fixes problems with ap's hiding their ssid Obtained from: atheros MFC after: 1 week
* s/w beacon miss facility; need to add knobs to fiddle with the settingssam2006-01-231-0/+37
| | | | MFC after: 2 weeks
* enable "aggressive mode" only when operating in ap or station mode; insam2006-01-021-1/+1
| | | | | | | | particular this fixes use of wme in adhoc demo mode, it wasn't possible to set the txop limit because the aggressive mode logic would override Reviewed by: apatti MFC after: 2 weeks
OpenPOWER on IntegriCloud