summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_node.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* simplify rate set api's by removing ic parameter (implicit in node reference)sam2005-07-221-3/+2
| | | | MFC after: 3 days
* Fix race condition in handling node reference counts for authenticatingsam2005-07-061-0/+15
| | | | | | | | | stations in ap mode. Track when a node's first auth frame is received and use this to decide whether or not to bump the refcnt. This insures we only ever bump the refcnt once. Reviewed by: avatar Approved by: re (scottl)
* move AID implementation defines from the protocol definitions tosam2005-06-101-0/+10
| | | | where they are used
* Change the MLME ASSOCIATE ioctl to accept either a ssid, a bssid,sam2005-06-071-14/+29
| | | | | | | or a bssid+ssid. This is needed for later versions of wpa_supplicant and for forthcoming addons to wpa_supplicant. Note this is an api change and applications must be rebuilt.
* avoid potential array index by -1sam2005-03-161-1/+2
| | | | Noticed by: Coverity Prevent analysis tool
* honor any desired bssid when creating an ibsssam2005-03-081-1/+4
| | | | | Prodded by: David Young Obtained from: netbsd
* propagate state kept in the bss node when re-creating the nodesam2005-02-101-1/+16
| | | | | | | on state transitions; this is a stopgap measure, need to rethink how we do management of this state Identified by: Divy Le Ray
* update node reference count debug msgs to include the node addresssam2005-01-241-16/+23
| | | | since the mac address may not be sufficient to uniquely identify a node
* statically allocate the station/neighbor node table; the deferredsam2005-01-241-111/+44
| | | | | allocation scheme introduced a race condition during device state transitions
* when a station is timed out for inactivity, remove it from the tablesam2005-01-201-2/+13
| | | | so it isn't considered again
* explicitly avoid timing out ourself due to inactivity; itsam2005-01-201-0/+6
| | | | can easily happen if the bss is quiet
* fix refcnt leak in adhoc mode: entries in the neighbor tablesam2005-01-201-3/+9
| | | | created due to rx'd frames had an extra reference
* remove debug msg from ieee80211_iterate_nodes; it makes logs very noisysam2005-01-181-3/+0
| | | | as onoe rate control invokes this once a second
* avoid possible null pointer deref when refcnt debugging is enabled; thesam2005-01-181-1/+1
| | | | | | node may be orphaned Submitted by: Tai-hwa Liang
* Explicitly ignore ibss merge requests when the node is ic_bss. This cansam2005-01-181-1/+2
| | | | | | | | happen on the first management frame received from a neighbor; we assume any merge candidate will send more frames and those should be processed with a suitable table entry. Stepped on by: Tai-hwa Liang
* Simplify the logic for checking the scan candidates at the end of a scan.sam2005-01-181-20/+17
| | | | | | | | Hold a lock on the table instead of futzing with reference counts which was potentially dangerous except drivers were quiescent while we did this so the table contents never changed. Disable the hack logic for removing scan candidates with multiple association failures; it's never done the right thing and will be fixed correctly with background scanning goes in.
* when scanning is interrupted reset state so table entries go in the stationsam2005-01-181-5/+16
| | | | | | table and not the scan table Noticed by: Tai-hwa Liang
* do fixed rate check when considering if a scan candidate is suitable so whensam2005-01-181-9/+5
| | | | it's time to join the bss we can't get an error
OpenPOWER on IntegriCloud