summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211.c
Commit message (Collapse)AuthorAgeFilesLines
* Use the iflladdr_event event to keep the mac address on the vap in sync withthompsa2010-01-191-0/+3
| | | | | | | the parent wirless interface. If the user passed in a mac address or it was autogenerated then flag this to avoid trashing it on update. This will fix wlan+lagg in a post vap world.
* Take a step towards removing if_watchdog/if_timer. Don't explicitly setjhb2009-11-061-1/+0
| | | | | if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already.
* Drain link state event changes posted during vap destroy. This is asam2009-08-121-1/+3
| | | | | | | | | | band-aid for the general problem that if_link_state_change can be called between if_detach and if_free leaving a task queued that has been free'd. Spotted by: thompsa Reviewed by: rwatson Approved by: re (rwatson)
* Filter setting IFF_PROMISC on tdma vaps; we don't want the underyling devicesam2009-07-311-1/+2
| | | | | | to be in promiscuous mode as we have a h/w bssid. Approved by: re (kib)
* correct handling of IFF_PROMISC; this should not be pushed to the parentsam2009-07-241-1/+2
| | | | | | | device except for monitor and ahdemo mode vaps Reviewed by: rpaulo Approved by: re (kensmith)
* monitor mode vaps are meant to be read-only so they can operate on anysam2009-07-241-5/+18
| | | | | | | | frequency w/o regulatory issues, do this by hooking if_transmit and if_output with routines that discard all transmits Reviewed by: thompsa, cbzimmer (intent) Approved by: re (kensmith)
* Implementation of the upcoming Wireless Mesh standard, 802.11s, on therpaulo2009-07-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add ieee80211_ageq; a facility for staging packets that requiresam2009-07-051-0/+37
| | | | | | | | | | | | | | | | | | | long-term work before they can be serviced. Packets are tagged and assigned an age (in seconds) at the point they are added to the queue. If a packet is not retrieved before it's age expires it is reclaimed. Tagging can take two forms: a reference to an ieee80211_node (as happens in the tx path) or an opaque token in cases where there is no reference or the node structure is not stable (i.e. it's going to be destroyed). o add ic_stageq to replace the per-node wds staging queue used for dynamic wds o add ieee80211_mac_hash for building ageq tokens; this computes a 32-bit hash from an 802.11 mac address (copied from the bridge) o while here fix a stray ';' noticed in IEEE80211_PSQ_INIT Reviewed by: rpaulo Approved by: re (kensmith)
* Modify most routines returning 'struct ifaddr *' to return referencesrwatson2009-06-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rather than pointers, requiring callers to properly dispose of those references. The following routines now return references: ifaddr_byindex ifa_ifwithaddr ifa_ifwithbroadaddr ifa_ifwithdstaddr ifa_ifwithnet ifaof_ifpforaddr ifa_ifwithroute ifa_ifwithroute_fib rt_getifa rt_getifa_fib IFP_TO_IA ip_rtaddr in6_ifawithifp in6ifa_ifpforlinklocal in6ifa_ifpwithaddr in6_ifadd carp_iamatch6 ip6_getdstifaddr Remove unused macro which didn't have required referencing: IFP_TO_IA6 This closes many small races in which changes to interface or address lists while an ifaddr was in use could lead to use of freed memory (etc). In a few cases, add missing if_addr_list locking required to safely acquire references. Because of a lack of deep copying support, we accept a race in which an in6_ifaddr pointed to by mbuf tags and extracted with ip6_getdstifaddr() doesn't hold a reference while in transmit. Once we have mbuf tag deep copy support, this can be fixed. Reviewed by: bz Obtained from: Apple, Inc. (portions) MFC after: 6 weeks (portions)
* add missing calls to ieee80211_dfs_attach/detachsam2009-06-091-0/+2
|
* iv_flags_ext is full, make room by moving HT-related flags to a newsam2009-06-071-5/+46
| | | | iv_flags_ht word
* partially fix mode setting; this no longer returns an error but stillsam2009-06-021-1/+1
| | | | | | needs to handle the case where the vap is up+running Noticed by: "Paul B. Mahol" <onemda@gmail.com>
* move if_detach to the top of ieee80211_ifdetach to close various racessam2009-06-021-2/+3
| | | | Reviewed by: jhb
* Remove hack used to deal with ifnet teardown now that if_detach and thesam2009-06-021-22/+4
| | | | | | | | | | | | | bridge do a better job. o move ether_ifdetach to the top of ieee80211_detach o do not clear if_softc at the top of ieee80211_detach; we no longer need this because we are safeguarded against calls coming back through if_ioctl o simplify the bpf tracker now that we don't null if_softc This also fixes an issue where having a bpf consumer active when a vap is destroyed would cause a crash because bpf referenced free'd memory. Reviewed by: imp
* Fix monitor mode vaps to work as intended:sam2009-06-021-4/+0
| | | | | | | o track # bpf taps on monitor mode vaps instead of # monitor mode vaps o spam monitor mode taps on tx/rx o fix ieee80211_radiotap_rx_all to dispatch frames only if the vap is up o while here print radiotap (and superg) state in show com
* Overhaul monitor mode handling:sam2009-05-201-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Create a taskqueue for each wireless interface which provides a serialisedthompsa2009-05-021-3/+20
| | | | | | | | | | | | | | | | | | | | | | | 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
* Change if_output to take a struct route as its fourth argument in orderkmacy2009-04-161-1/+1
| | | | | | to allow passing a cached struct llentry * down to L2 Reviewed by: rwatson
* o add ic_rt to track the rate table for the current channel; this enablessam2009-03-291-0/+1
| | | | | calculation of packet transmit times to do things like check txop limits o remove equivalent driver code and convert to use net80211 state
* Eliminate ic_myaddr so changing the mac address of a device works correctly:sam2009-03-291-2/+3
| | | | | | | | | | | o remove ic_myaddr from ieee80211com o change ieee80211_ifattach to take the mac address of the physical device and use that to setup the lladdr. o replace all references to ic_myaddr in drivers by IF_LLADDR o related cleanups (e.g. kill dead code) PR: kern/133178 Reviewed by: thompsa, rpaulo
* split Atheros SuperG support out into it's own file that's included onlysam2009-03-241-4/+19
| | | | with a new IEEE80211_SUPPORT_SUPERG option
* Add modes for 1/2 and 1/4-width channels so we have separate roamingsam2009-02-191-6/+19
| | | | | | | | | | | | | | | | | | 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.
* check ptr against NULLsam2009-02-191-1/+1
|
* instead of special casing lookups for the 11na/g legacy rate set, justsam2009-02-191-6/+3
| | | | install the rates once when creating the com structure
* remove ic_stats; it was intended to accumulate stats from vaps as theysam2009-02-131-1/+0
| | | | were reaped but was never used and is inaccessible
* Add a ieee80211_waitfor_parent() function that will wait for all deferredthompsa2009-02-121-1/+1
| | | | | | | | 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
* When crafting a media setting w/ an auto (non-fixed) rate mask out thesam2009-02-031-12/+14
| | | | | | | | | | 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.
* setup default rate set for static turbo modesam2009-01-291-0/+1
|
* fill in ieee channel #'s and max tx power for drivers that work exclusivelysam2009-01-271-0/+15
| | | | with frequencies; this mimics how ieee80211_setregdomain works
* TDMA support for long distance point-to-point links using ath devices:sam2009-01-081-1/+16
| | | | | | | | | | | | | | | 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
* Fix definition of IEEE80211_CHAN_MAX; it was defined as 255 butsam2008-12-151-3/+1
| | | | | | | 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
* honor IEEE80211_CLONE_NOBEACONS for type of vap, not just a sta mode vapsam2008-10-251-5/+3
|
* o add support for ifconfig wlanX mode foosam2008-10-251-62/+8
| | | | | | 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
* Replace a line matching /^ $/ with one matching /^$/.brooks2008-09-031-1/+1
| | | | Obtained from: //depot/projects/vimage-commit2/...
* free ifp allocated at ieee80211_vap_setup.weongyo2008-09-021-0/+2
| | | | Reviewed by: sam, thompsa
* Revise lock name handling:sam2008-05-281-1/+1
| | | | | | | | 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
* Minor cleanup of vap create work:sam2008-05-121-18/+12
| | | | | | | | | | | | | 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
* use c99-style initialization for ieee80211_phymode_namesam2008-05-111-11/+11
|
* add DFS capability bit and use it to auto-enable DFS supportsam2008-05-111-2/+3
|
* re-enable WME by default; after a full day of testing on iwi I see nosam2008-05-011-3/+0
| | | | issues and the only way we'll identify them is for people to use it
* disable default enabling of WME until we resolve driver regressionssam2008-04-301-0/+3
|
* hookup the parent device's if_input and if_output to stub routinessam2008-04-251-0/+19
| | | | | | | 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
* Multi-bss (aka vap) support for 802.11 devices.sam2008-04-201-361/+641
| | | | | | | | | | | 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)
* Add padding for anticipated functionalitykmacy2007-12-071-2/+2
| | | | | | | | | | | | - vimage - TOE - multiq - host rtentry caching Rename spare used by 80211 to if_llsoftc Reviewed by: rwatson, gnn MFC after: 1 day
* add ieee80211_find_channel_byieee to lookup a channel by ieee channel #sam2007-11-231-0/+26
| | | | | Reviewed by: thompsa MFC after: 1 week
* invalidate ic_prevchan when constructing a new channel listsam2007-09-181-0/+1
| | | | Approved by: re (blanket wireless)
* skip IEEE80211_MODE_AUTO in announcing supported rates in ieee80211_announce;sam2007-09-181-1/+2
| | | | | | there won't be any Approved by: re (blanket wireless)
* o add IEEE80211_RATE_MCS to use instead of naked constant (for marking MCS)sam2007-09-181-2/+4
| | | | | | | o correct ieee80211_rate2media handling of MCS o correct rate HT announcements for 11n devices Approved by: re (blanket wireless)
* remove IFM_IEEE80211_HT40PLUS and IFM_IEEE80211_HT40MINUS; theysam2007-09-181-4/+0
| | | | | | never got used so nuke 'em before we branch Approved by: re (blanket wireless)
* Update 802.11 wireless support:sam2007-06-111-388/+457
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
OpenPOWER on IntegriCloud