summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_node.c
Commit message (Collapse)AuthorAgeFilesLines
* Change the calling convention for ic_node_alloc to deal withsam2008-06-071-4/+5
| | | | | | | | | | | | some longstanding issues: o pass the vap since it's now the "coin of the realm" and required to do things like set initial tx parameters in private node state for use prior to association o pass the mac address as cards that maintain outboard station tables require this to create an entry (e.g. in ibss mode) o remove the node table reference, we only have one node table and it's unlikely this will change so this is not needed to find the com structure
* Split ieee80211_notify_erp into locked and unlocked variantssam2008-06-071-4/+12
| | | | | | | and use the locked version to handle the hostap input path case where the com lock is not already held. Noticed by: Jared Go
* Fix node cleanup issues when the last reference is held bysam2008-06-071-16/+27
| | | | | the driver (e.g. in the tx q); ni_vap may not be valid, we must carefully check before using it.
* correct code returned in AsssocResp; the previous code is spec'd for usesam2008-06-071-2/+1
| | | | | | | only in deauth+disassoc frames Submitted by: Chris Zimmermann MFC after: 1 month
* Don't override the txpower cap installed by ieee80211_alloc_node;sam2008-05-281-3/+0
| | | | we use ic_txpowlimit (for now) to initialize all new sta entries.
* special-case broadcast probe request in ieee80211_find_rxnode; we needsam2008-05-221-16/+30
| | | | | | | | to spam all vaps and this won't happen if the frame comes from a station that is associated to an ap vap (and so has an entry in the table) Noticed by: Jared Go Reviewed by: thompsa
* fix build w/ IEEE80211_DEBUG_REFCNT enabledsam2008-05-011-1/+1
|
* Multi-bss (aka vap) support for 802.11 devices.sam2008-04-201-605/+1000
| | | | | | | | | | | 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)
* o correct re-association indicator dispatched in node join eventsam2007-11-231-3/+3
| | | | | | o remove misleading "reassociation" msg on sta join MFC after: 3 days
* parse htcap ie early so ampdu density and max rx size are availablesam2007-11-231-1/+3
| | | | | | for constructing the AssocReq frame MFC after: 3 days
* sync 11n support with vap code base; many changes based on interopsam2007-11-021-14/+40
| | | | | | testing with all major vendors MFC after: 1 week
* Close longstanding race dropping inactive stations; grab a referencesam2007-09-181-0/+2
| | | | | | | | to the node before starting the work, otherwise the node may go away before a reference is made in ieee80211_send_mgmt. Approved by: re (blanket wireless) Obtained from: Atheros
* Safeguard count of stations in power save; don't touch it unless we'resam2007-09-181-1/+2
| | | | | | | operating in a mode where it should be maintained. Approved by: re (blanket wireless) MFC after: 2 weeks
* Update beacon handling to sync w/ vap code base:sam2007-09-171-42/+87
| | | | | | | | | | | | | | | | | | | 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)
* oops, add missing bit from last changesam2007-09-061-0/+2
| | | | Approved by: re (blanket wireless)
* Fixup sta inactivity handling:sam2007-09-061-6/+13
| | | | | | | | | | | | o reset ni_inact when ni_inact_reload is changed so we're assured a valid setting o never let ni_inact go negative o add a knob to disable hostap sta idle handling (e.g. so it can be done by a user application) o remove bogus reload on associate Reviewed by: avatar Approved by: re (blanket wireless)
* Update 802.11 wireless support:sam2007-06-111-771/+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-2/+3
| | | | | | ni_rates; this lets us re-use the code to check 11n HT rates MFC after: 2 weeks
* keep tx/rx seq #'s for non-QoS traffic separate from QoS; stationssam2007-03-111-3/+3
| | | | | | | aren't supposed mix traffic but if they did frames might be mis-handled Obtained from: Atheros MFC after: 2 weeks
* when starting up an ibss master use a random address forsam2007-03-071-2/+5
| | | | | | | the bssid; this is required for wifi alliance compliance Obtained from: Atheros MFC after: 2 weeks
* Add initial support for 900MHz cards like the Ubiquiti SR9:sam2007-01-151-13/+8
| | | | | | | | | | | | | | | | 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
* Correct several issues with rate set negotiation:sam2007-01-081-7/+12
| | | | | | | | | | | | | | | | | | | | 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-3/+2
| | | | | | | | | | | | | | | | | | | | 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
* Move conditional preprocessing out from the IEEE80211_DPRINTF macrodds2006-06-011-14/+8
| | | | | invocation. Per C99 6.10.3 paragraph 11 preprocessing directives appearing as macro arguments yield undefined behavior.
* Ensure outbound data packets in hostap mode are delivered only tosam2006-04-281-1/+12
| | | | | | | | | | | stations that are associated by making ieee80211_find_txnode return NULL when a unicast frame is to be delivered to an unassociated station. This will be handled differently in the future but for now putting the check here allows all drivers to immediately do the right thing. Reviewed by: avatar MFC after: 1 week
* when scanning channels marked passive defer probe request untilsam2006-03-061-0/+27
| | | | | | | 802.11 traffic is seen; fixes problems with ap's hiding their ssid Obtained from: atheros MFC after: 1 week
* bump the scan generation number before iterating so we're guaranteedsam2006-01-181-2/+2
| | | | | | | | | to have a value that's not been used before; this fixes the problem where the first traversal of the scan list did nothing because the entries were initialized with the current generation number (a separate issue) MFC after: 1 week
* update erp information element in the beacon frame to reflectsam2006-01-021-0/+3
| | | | | | | | changes in the bss Reviewed by: avatar Obtained from: atheros MFC after: 2 weeks
* When creating neighbor entries for an ahdemo bss apply the localsam2005-12-141-0/+9
| | | | | settings. In particular this allows us to use QoS frames in a bss and in turn enables disabling ack's.
* when creating an ahdemo bss use any requested bssid; otherwise use zerosam2005-12-141-0/+5
| | | | Obtained from: madwifi
* propagate current bss state on sta join so, in particular, authmodesam2005-12-121-2/+4
| | | | | | is set properly in the new bss node MFC after: 2 weeks
* Bandaid ieee80211_set_chan to handle a channel parameter of "any";sam2005-12-121-1/+3
| | | | | | | | | this can happen under certain conditions when scanning. This logic will eventually go away with the new scanning code. While here de-inline the routine. MFC after: 1 week
* Adhoc mode fixups:sam2005-12-041-19/+33
| | | | | | | | | | | | | | o plug memory leak in adhoc mode: on rx the sender may be the current master so simply checking against ic_bss is not enough to identify if the packet comes from an unknown sender; must also check the mac address o split neighbor node creation into two routines and fillin state of nodes faked up on xmit when a beacon or probe response frame is later received; this ensures important state like the rate set and advertised capabilities are correct Obtained from: netbsd MFC after: 1 week
* revert 1.64: we cannot use the channel characteristics to decide when tosam2005-08-131-4/+3
| | | | | | | do 11g erp sta accounting because b/g channels show up as false positives when operating in 11b. Noticed by: Michal Mertl
* Don't use ic_curmode to decide when to do 11g station accounting,sam2005-08-101-5/+4
| | | | | | | | | | use the station channel properties. Fixes assert failure/bogus operation when an ap is operating in 11a and has associated stations then switches to 11g. Noticed by: Michal Mertl Reviewed by: avatar MFC after: 2 weeks
* Clarify/fix handling of the current channel:sam2005-08-101-9/+184
| | | | | | | | | | | | | | | | | | | 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
* Split crypto tx+rx key indices and add a key index -> node mapping table:sam2005-08-081-48/+222
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Crypto changes: o change driver/net80211 key_alloc api to return tx+rx key indices; a driver can leave the rx key index set to IEEE80211_KEYIX_NONE or set it to be the same as the tx key index (the former disables use of the key index in building the keyix->node mapping table and is the default setup for naive drivers by null_key_alloc) o add cs_max_keyid to crypto state to specify the max h/w key index a driver will return; this is used to allocate the key index mapping table and to bounds check table loookups o while here introduce ieee80211_keyix (finally) for the type of a h/w key index o change crypto notifiers for rx failures to pass the rx key index up as appropriate (michael failure, replay, etc.) Node table changes: o optionally allocate a h/w key index to node mapping table for the station table using the max key index setting supplied by drivers (note the scan table does not get a map) o defer node table allocation to lateattach so the driver has a chance to set the max key id to size the key index map o while here also defer the aid bitmap allocation o add new ieee80211_find_rxnode_withkey api to find a sta/node entry on frame receive with an optional h/w key index to use in checking mapping table; also updates the map if it does a hash lookup and the found node has a rx key index set in the unicast key; note this work is separated from the old ieee80211_find_rxnode call so drivers do not need to be aware of the new mechanism o move some node table manipulation under the node table lock to close a race on node delete o add ieee80211_node_delucastkey to do the dirty work of deleting unicast key state for a node (deletes any key and handles key map references) Ath driver: o nuke private sc_keyixmap mechansim in favor of net80211 support o update key alloc api These changes close several race conditions for the ath driver operating in ap mode. Other drivers should see no change. Station mode operation for ath no longer uses the key index map but performance tests show no noticeable change and this will be fixed when the scan table is eliminated with the new scanning support. Tested by: Michal Mertl, avatar, others Reviewed by: avatar, others MFC after: 2 weeks
* Cleanup beacon/listen interval handling:sam2005-08-081-2/+2
| | | | | | | | | | | | | | | | | 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
* Fix handling of frames sent prior to a station being authorizedsam2005-08-061-0/+36
| | | | | | | | | | | | when operating in ap mode. Previously we allocated a node from the station table, sent the frame (using the node), then released the reference that "held the frame in the table". But while the frame was in flight the node might be reclaimed which could lead to problems. The solution is to add an ieee80211_tmp_node routine that crafts a node that does exist in a table and so isn't ever reclaimed; it exists only so long as the associated frame is in flight. MFC after: 5 days
* close a race between reclaiming a node when a station is inactivesam2005-07-311-0/+8
| | | | | | and sending the null data frame used to probe inactive stations MFC after: 5 days
* bandaid ni_fails handling so ap's with association failures aresam2005-07-271-18/+24
| | | | | | | | reconsidered after a bit; a proper fix involves more changes to the scanning infrastructure Reviewed by: avatar, David Young MFC after: 5 days
* the AREF flag is only meaningful in ap mode; adhoc neighbors nowsam2005-07-231-1/+2
| | | | are timed out of the sta/neighbor table
* o move inactivity-related debug msgs under IEEE80211_MSG_INACTsam2005-07-221-8/+12
| | | | | | | o probe inactive neighbors in adhoc mode (they don't have an association id so previously were being timed out) MFC after: 3 days
* split xmit of probe request frame out into a separate routine thatsam2005-07-221-15/+0
| | | | | | | takes explicit parameters; this will be needed when scanning is decoupled from the state machine to do bg scanning MFC after: 3 days
* simplify ic_newassoc callbacksam2005-07-221-2/+2
| | | | MFC after: 3 days
* simplify ieee80211_ibss_merge apisam2005-07-221-1/+2
| | | | MFC after: 3 days
* simplify tim callback apisam2005-07-221-5/+5
| | | | MFC after: 3 days
* simplify ieee80211_node_authorize and ieee80211_node_unauthorize api'ssam2005-07-221-3/+5
| | | | MFC after: 3 days
* simplifiy ieee80211_send_nulldata apisam2005-07-221-1/+1
| | | | MFC after: 3 days
OpenPOWER on IntegriCloud